/* Pedidos Sudoeste — estilo propio sobre Bootstrap 5 (paleta Sistematizar: azul #0052cc, naranja #ff6b35). */
:root {
    --marca: #0052cc;
    --marca-oscuro: #003d99;
    --acento: #ff6b35;
    --fondo: #f4f6fa;
    --lateral: #0f1f3d;
    --lateral-texto: #c9d3e6;
    --ancho-lateral: 236px;
    --bs-primary: #0052cc;
    --bs-primary-rgb: 0, 82, 204;
    --bs-link-color: #0052cc;
    --bs-link-color-rgb: 0, 82, 204;
}

body { background: var(--fondo); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.btn-primary { --bs-btn-bg: var(--marca); --bs-btn-border-color: var(--marca); --bs-btn-hover-bg: var(--marca-oscuro); --bs-btn-hover-border-color: var(--marca-oscuro); --bs-btn-active-bg: var(--marca-oscuro); }
.btn-acento { --bs-btn-color: #fff; --bs-btn-bg: var(--acento); --bs-btn-border-color: var(--acento); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #e85a26; --bs-btn-hover-border-color: #e85a26; }

/* ---------- estructura: menú lateral + contenido ---------- */
.app { display: flex; min-height: 100vh; }
.lateral {
    width: var(--ancho-lateral); background: var(--lateral); color: var(--lateral-texto);
    flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040;
    transition: transform .2s ease;
}
.lateral .marca { display: flex; align-items: center; gap: .55rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.lateral .marca .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--acento); display: grid; place-items: center; color: #fff; }
.lateral .empresa { padding: .6rem 1.1rem; font-size: .8rem; color: #8fa3c7; }
.lateral .seccion { padding: .9rem 1.1rem .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #6f84ab; }
.lateral a.item { display: flex; align-items: center; gap: .65rem; padding: .5rem 1.1rem; color: var(--lateral-texto); text-decoration: none; border-left: 3px solid transparent; font-size: .93rem; }
.lateral a.item:hover { background: rgba(255,255,255,.05); color: #fff; }
.lateral a.item.activo { background: rgba(0,82,204,.35); color: #fff; border-left-color: var(--acento); }
.lateral a.item i { font-size: 1.05rem; width: 1.2rem; text-align: center; }

.contenido { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { background: #fff; border-bottom: 1px solid #e3e8f0; padding: .55rem 1rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1030; }
.barra .titulo-barra { font-weight: 600; color: #344563; }
.pie { margin-top: auto; padding: .75rem 1rem; font-size: .78rem; color: #7a869a; display: flex; gap: .6rem; align-items: center; }
.velo { display: none; }

@media (max-width: 991.98px) {
    .lateral { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
    .lateral.abierto { transform: none; }
    .velo.visible { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
}

/* ---------- tarjetas, tablas, listados ---------- */
.card { border: 1px solid #e3e8f0; border-radius: .7rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; }
.tarjeta-numero { display: block; padding: 1rem; text-decoration: none; color: inherit; }
.tarjeta-numero .valor { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.tarjeta-numero .rotulo { font-size: .85rem; color: #5e6c84; }
.tarjeta-numero:hover { background: #f8faff; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #5e6c84; background: #f8f9fc; white-space: nowrap; }
.table td { vertical-align: middle; }
.col-copiar { width: 34px; padding-left: .5rem !important; padding-right: 0 !important; }
.btn-copiar { border: 0; background: transparent; color: #97a0af; padding: 0 .2rem; }
.btn-copiar:hover { color: var(--marca); }
th.ordenable { cursor: pointer; user-select: none; }
th.ordenable:hover { color: var(--marca); }
th.ordenable::after { content: "\2195"; opacity: .25; margin-left: .3rem; font-size: .8em; }
th[aria-sort="ascending"]::after { content: "\2191"; opacity: .9; }
th[aria-sort="descending"]::after { content: "\2193"; opacity: .9; }
.paginador { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .6rem .9rem; border-bottom: 1px solid #eef1f6; font-size: .85rem; color: #5e6c84; }
.paginador select { width: auto; display: inline-block; }
.solapas .nav-link { color: #42526e; }
.solapas .nav-link.active { font-weight: 600; color: var(--marca); }
.solapas .badge { font-weight: 500; }
.totales { font-size: .88rem; color: #42526e; }
.totales strong { color: #172b4d; }
.form-check-input.toggle-activo { width: 1.25rem; height: 1.25rem; cursor: pointer; }
.cargando { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* ---------- detalle de nota ---------- */
.estado-chip { font-size: .8rem; }
.item-modificado { font-size: .78rem; color: #8a6d00; }
.item-reprogramado { font-size: .78rem; color: #8a6d00; }
.decision { display: none; }
.decision.visible { display: block; }
.fila-cancelada td { color: #97a0af; }
.fila-cancelada td.producto { text-decoration: line-through; }
.w-cant { width: 6.5rem; }
.w-fecha { width: 9.5rem; }
.w-camion { min-width: 9rem; }

/* ---------- armado de hoja ---------- */
.lista-recorrido .list-group-item { display: flex; align-items: center; gap: .6rem; }
.lista-recorrido .orden { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--marca); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.candidata { cursor: default; }
.candidata.elegida { opacity: .45; }
.cantidad-parcial { display: none; }
.cantidad-parcial.visible { display: inline-block; }

/* ---------- login ---------- */
.login-fondo { min-height: 100vh; background: linear-gradient(135deg, #0f1f3d 0%, #0052cc 100%); display: flex; align-items: center; justify-content: safe center; padding: 1.5rem; }
.login-caja { width: 100%; max-width: 430px; }
.login-caja .card { border: 0; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-marca { color: #fff; text-align: center; margin-bottom: 1.25rem; }
.login-marca .logo { width: 52px; height: 52px; border-radius: 14px; background: var(--acento); display: inline-grid; place-items: center; font-size: 1.6rem; color: #fff; }
.acceso-rapido { max-width: 760px; width: 100%; }
.paso { display: none; }
.paso.visible { display: block; }
.oculto { display: none !important; }

/* ---------- aviso flotante (toast) ---------- */
.toast-fijo {
    position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(150%);
    background: #172b4d; color: #fff; padding: .65rem 1.1rem; border-radius: .5rem; z-index: 2000;
    box-shadow: 0 8px 24px rgba(0,0,0,.25); transition: transform .25s ease; max-width: 90vw; font-size: .93rem;
}
.toast-fijo.visible { transform: translateX(-50%) translateY(0); }
.toast-fijo.error { background: #c9372c; }
.toast-fijo.ok { background: #1f845a; }
