:root{
  --bg:#F4F1E9;          /* crema (page) */
  --bg2:#FBFAF6;         /* crema clara (insets) */
  --panel:#FFFFFF;       /* tarjetas */
  --panel2:#F3EFE6;      /* chip / inset calido */
  --line:#E8E2D5;        /* hairline calida */
  --line2:#DAD3C3;
  --txt:#1C2536;         /* tinta azul oscuro */
  --muted:#6B7385;
  --dim:#9AA1AE;
  --brand:#1B3A6B;       /* azul oscuro (primario) */
  --brand-ink:#13294B;
  --cream:#FBF7EC;
  --gold:#C49A3A;        /* dorado */
  --gold-soft:#EFE0B8;
  --verde:#1E8E5A; --amarillo:#D98A2B; --rojo:#D14343; --gris:#8A93A6;
  --gold-grad:linear-gradient(95deg,#E7CD86 0%,#C49A3A 50%,#9A7A2E 100%);
  --brand-grad:linear-gradient(180deg,#21406F 0%,#16304F 100%);
  --font-brand:"Saira Condensed","Arial Narrow",sans-serif;
  --font-ui:"Roboto","Segoe UI",system-ui,-apple-system,Helvetica,Arial,sans-serif;
  --radius:14px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(28,37,54,.05), 0 2px 8px rgba(28,37,54,.06);
  --shadow-lg:0 6px 20px rgba(28,37,54,.10);
}

/* ---------- centro maestro de viajes ---------- */
.journey-center-head{margin-bottom:14px}
.journey-pipeline{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  margin-bottom:12px;
  box-shadow:var(--shadow);
}
.journey-pipeline-card{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:92px;
  padding:14px 16px;
  color:var(--txt);
  border-right:1px solid var(--line);
  position:relative;
}
.journey-pipeline-card:last-child{border-right:0}
.journey-pipeline-card:hover,.journey-pipeline-card.active{background:#F6F9FE;text-decoration:none}
.journey-pipeline-card.active::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:#F2A20C}
.pipeline-step{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:#EAF0FA;color:#173A70;font-weight:900;flex:0 0 auto}
.pipeline-step.done{background:#DDF4E7;color:#087A48}
.journey-pipeline-card > span:last-child{display:grid;grid-template-columns:1fr auto;align-items:center;gap:1px 8px;min-width:0;width:100%}
.journey-pipeline-card small{grid-column:1;color:#536786;font-size:.73rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.journey-pipeline-card b{grid-column:2;grid-row:1/3;font-size:1.65rem;color:#06265A}
.journey-pipeline-card em{grid-column:1;color:var(--muted);font-size:.78rem;font-style:normal}

.journey-views{display:flex;gap:7px;overflow-x:auto;padding:2px 1px 10px;margin-bottom:2px;scrollbar-width:thin}
.journey-view{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#52617A;font-size:.82rem;font-weight:750}
.journey-view b{min-width:22px;height:20px;display:grid;place-items:center;border-radius:10px;background:#E9EEF7;color:#173A70;font-size:.7rem}
.journey-view:hover{border-color:#99AFD0;color:#06265A;text-decoration:none}
.journey-view.active{background:#06265A;color:#fff;border-color:#06265A}
.journey-view.active b{background:#F7B739;color:#06265A}

.journey-filters{display:grid;grid-template-columns:minmax(270px,2fr) minmax(190px,1fr) 145px 145px auto;align-items:end;gap:10px;padding:13px 14px;margin-bottom:12px}
.journey-filters label{display:flex;flex-direction:column;gap:5px;color:#536786;font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.journey-filters select,.journey-filters input[type="date"]{height:42px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--txt);padding:0 11px;font:inherit;font-size:.84rem;text-transform:none;letter-spacing:normal;outline:none}
.journey-filters select:focus,.journey-filters input:focus{border-color:#4F79B9;box-shadow:0 0 0 3px rgba(37,93,171,.1)}
.journey-filters .search{height:42px;min-height:42px;box-shadow:none;border-radius:9px;padding:0 11px;min-width:0;width:100%;flex:0 0 42px}
.journey-filter-actions{display:flex;gap:7px;align-items:center;min-height:42px}

.journey-register{padding:0;overflow:hidden}
.journey-register-head{padding:16px 18px 12px;margin:0;border-bottom:1px solid var(--line)}
.journey-register-head h2{margin-bottom:2px}
.journey-register-head p{margin:0}
.journey-table{min-width:1370px}
.journey-table th{background:#F4F7FB;padding:11px 12px;color:#496080}
.journey-table td{padding:13px 12px;vertical-align:top}
.journey-row{box-shadow:inset 3px 0 0 #C8D3E3}
.journey-row.stage-operacion{box-shadow:inset 3px 0 0 #1B69E8}
.journey-row.stage-por_cerrar{box-shadow:inset 3px 0 0 #E79B0B}
.journey-row.stage-por_liquidar,.journey-row.stage-revision{box-shadow:inset 3px 0 0 #B77913}
.journey-row.stage-observado{box-shadow:inset 3px 0 0 #C13B3B}
.journey-row.stage-liquidado{box-shadow:inset 3px 0 0 #188656}
.journey-id-cell{min-width:190px}
.journey-id-cell .unit{font-size:1rem;font-weight:900}
.journey-id-cell small,.journey-table td > small{display:block;margin-top:4px;color:var(--muted);font-size:.7rem}
.journey-doc{display:block;margin-top:6px;color:#355377;font-size:.75rem;max-width:220px;white-space:normal;line-height:1.35}
.journey-doc.missing,.journey-warning{color:#A9620A!important;font-weight:750}
.journey-subline{display:block;margin-top:5px;color:#536786;font-size:.79rem}
.journey-stage,.liq-state{display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border-radius:7px;font-size:.72rem;font-weight:850;white-space:nowrap}
.journey-stage.stage-operacion{background:#E7F0FF;color:#1255B2}
.journey-stage.stage-por_cerrar,.journey-stage.stage-por_liquidar,.journey-stage.stage-revision{background:#FFF0D7;color:#9A5E09}
.journey-stage.stage-observado{background:#FCE3E3;color:#A33232}
.journey-stage.stage-liquidado{background:#DFF4E8;color:#0C7749}
.sem-rojo-txt{color:#B93434!important;font-weight:700}.sem-amarillo-txt{color:#9A6418!important;font-weight:700}.sem-verde-txt{color:#16734A!important;font-weight:700}
.journey-checks{display:grid;grid-template-columns:repeat(2,max-content);gap:5px 10px;min-width:210px}
.journey-checks span{display:inline-flex;align-items:center;gap:4px;font-size:.7rem;font-weight:750;color:#637087}
.journey-checks span.ok{color:#087A48}.journey-checks span.missing{color:#B23D3D}.journey-checks span.neutral{color:#64748B}
.journey-checks .ic{width:13px;height:13px}
.liq-no_iniciada{background:#EEF1F5;color:#64748B}.liq-pendiente{background:#FFF0D7;color:#955A06}.liq-en_revision{background:#E7F0FF;color:#1255B2}.liq-observada{background:#FCE3E3;color:#A33232}.liq-cerrada{background:#DFF4E8;color:#0C7749}
.journey-next-cell{min-width:180px}
.journey-next{width:100%;justify-content:center}
.journey-pending{margin-top:7px;font-size:.7rem;color:#66738A}
.journey-pending summary{cursor:pointer;font-weight:750;color:#586981}
.journey-pending ul{margin:5px 0 0;padding-left:17px;line-height:1.55}
.journey-ready{display:flex!important;align-items:center;gap:4px;color:#087A48!important;font-weight:750}
.journey-empty{display:flex;align-items:center;justify-content:center;gap:14px;min-height:180px;padding:28px;color:#60708A}
.journey-empty > .ic{width:34px;height:34px;color:#8CA0BE}
.journey-empty div{display:flex;flex-direction:column;gap:4px}.journey-empty b{color:#183A69}.journey-empty span{font-size:.82rem}

.dashboard-process-queues{display:grid;grid-template-columns:minmax(225px,1.6fr) repeat(5,minmax(100px,1fr));align-items:stretch;background:#fff;border:1px solid var(--line);border-radius:11px;overflow:hidden;margin:0 0 14px;box-shadow:var(--shadow)}
.dashboard-queue-title{display:flex;align-items:center;gap:10px;padding:11px 14px;background:#F5F8FC;border-right:1px solid var(--line)}
.dashboard-queue-title > span{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:#06265A;color:#fff}
.dashboard-queue-title div{display:flex;flex-direction:column}.dashboard-queue-title b{font-size:.82rem;color:#06265A}.dashboard-queue-title small{font-size:.67rem;color:#66738A}
.dashboard-process-queues > a{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:11px 12px;border-right:1px solid var(--line);color:#52617A;font-size:.72rem;font-weight:750}
.dashboard-process-queues > a:last-child{border-right:0}.dashboard-process-queues > a:hover{background:#F8FAFD;text-decoration:none;color:#06265A}
.dashboard-process-queues > a b{font-size:1.15rem;color:#173A70}.dashboard-process-queues > a.needs b{color:#B76D06}.dashboard-process-queues > a.alert b{color:#B93434}

/* Bandeja diaria: solo viajes que siguen operativamente abiertos. */
.active-ops-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:0 0 12px}
.active-ops-summary > a{display:flex;align-items:center;gap:11px;min-height:86px;padding:13px 14px;background:#fff;border:1px solid var(--line);border-radius:11px;color:var(--txt);box-shadow:var(--shadow);position:relative}
.active-ops-summary > a:hover,.active-ops-summary > a.active{border-color:#9CB2D2;text-decoration:none;background:#F8FAFE}
.active-ops-summary > a.active::after{content:"";position:absolute;left:12px;right:12px;bottom:-1px;height:3px;background:#F2A20C;border-radius:3px 3px 0 0}
.active-ops-summary > a.tracking-summary-alert.has-alert{border-color:#E19A9A;background:linear-gradient(135deg,#FFF 0%,#FFF4F4 100%);box-shadow:0 0 0 1px rgba(209,67,67,.08),0 7px 20px rgba(185,52,52,.16);animation:tracking-alert-pulse 2.2s ease-in-out infinite}
.active-ops-summary > a.tracking-summary-alert.has-alert b,.active-ops-summary > a.tracking-summary-alert.has-alert small{color:#A82E2E}
.active-ops-summary > a.tracking-summary-alert.has-alert::after{background:#D14343}
.active-summary-icon{width:36px;height:36px;border-radius:9px;display:grid;place-items:center;flex:0 0 auto}.active-summary-icon .ic{width:19px;height:19px}
.active-summary-icon.blue{background:#E6F0FF;color:#1558B4}.active-summary-icon.red{background:#FCE5E5;color:#B93434}.active-summary-icon.amber{background:#FFF0D7;color:#A66608}.active-summary-icon.green{background:#DFF4E8;color:#0C7749}
.active-ops-summary > a > span:last-child{display:grid;grid-template-columns:1fr auto;width:100%;align-items:center;gap:1px 8px}.active-ops-summary small{grid-column:1;color:#4E6381;font-size:.71rem;font-weight:850;text-transform:uppercase;letter-spacing:.04em}.active-ops-summary b{grid-column:2;grid-row:1/3;font-size:1.55rem;color:#06265A}.active-ops-summary em{grid-column:1;color:#778398;font-style:normal;font-size:.72rem}
.active-ops-toolbar{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-bottom:12px}.active-ops-toolbar .journey-views{margin:0;padding-bottom:3px}.active-ops-toolbar form{display:flex;align-items:center;align-self:flex-end;gap:7px;width:min(100%,600px)}.active-ops-toolbar form .search{height:40px;min-height:40px;flex:1 1 auto;box-shadow:none}.active-ops-toolbar form .btn{height:40px}
.active-trip-worklist{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);overflow:hidden}
.active-worklist-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 18px;border-bottom:1px solid var(--line);background:#FAFBFD}.active-worklist-head h2{margin:0;color:#06265A;font-size:1rem}.active-worklist-head p{margin:3px 0 0;color:#6A778C;font-size:.75rem}
.active-trip-list{display:flex;flex-direction:column}
.active-trip-row{display:grid;grid-template-columns:minmax(155px,1fr) minmax(210px,1.35fr) minmax(205px,1.15fr) minmax(175px,1fr) 155px;gap:16px;align-items:center;padding:16px 17px;border-bottom:1px solid var(--line);position:relative;transition:background .18s ease,box-shadow .18s ease}.active-trip-row:last-child{border-bottom:0}.active-trip-row::before{content:"";position:absolute;left:0;top:0;bottom:0;width:5px;background:#AAB6C8}.active-trip-row.sem-verde{background:linear-gradient(90deg,rgba(30,142,90,.07),#fff 24%)}.active-trip-row.sem-amarillo{background:linear-gradient(90deg,rgba(217,138,43,.12),#fff 28%)}.active-trip-row.sem-rojo{background:linear-gradient(90deg,rgba(209,67,67,.14),#fff 30%)}.active-trip-row.sem-verde::before{background:#1E8E5A}.active-trip-row.sem-amarillo::before{background:#D98A2B}.active-trip-row.sem-rojo::before{background:#D14343;box-shadow:2px 0 12px rgba(209,67,67,.55)}
.active-trip-row.tracking-alert{box-shadow:inset 0 0 0 1px rgba(209,67,67,.13);animation:tracking-row-pulse 2.2s ease-in-out infinite}
.active-trip-row.sem-rojo .active-trip-tracking b{color:#A82E2E}.active-trip-row.sem-amarillo .active-trip-tracking b{color:#98600C}.active-trip-row.sem-verde .active-trip-tracking b{color:#0C7749}
@keyframes tracking-alert-pulse{0%,100%{box-shadow:0 0 0 1px rgba(209,67,67,.08),0 7px 20px rgba(185,52,52,.13)}50%{box-shadow:0 0 0 4px rgba(209,67,67,.12),0 9px 25px rgba(185,52,52,.24)}}
@keyframes tracking-row-pulse{0%,100%{box-shadow:inset 0 0 0 1px rgba(209,67,67,.12)}50%{box-shadow:inset 0 0 0 1px rgba(209,67,67,.3),0 0 18px rgba(209,67,67,.13)}}
@media (prefers-reduced-motion:reduce){.active-ops-summary > a.tracking-summary-alert.has-alert,.active-trip-row.tracking-alert{animation:none}}
.active-trip-row.final-stage::before{background:#D49A2E}.active-trip-row.ready-to-close::before{background:#1E8E5A}
.active-trip-row.sem-rojo::before{background:#D14343;box-shadow:2px 0 12px rgba(209,67,67,.55)}.active-trip-row.sem-amarillo:not(.sem-rojo)::before{background:#D98A2B}.active-trip-row.sem-verde::before{background:#1E8E5A}
.active-trip-identity,.active-trip-service,.active-trip-close,.active-trip-actions{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0}.active-trip-identity .unit{font-size:1rem;font-weight:900}.active-trip-identity small,.active-trip-service small,.active-trip-close > small,.active-trip-tracking small{color:#718096;font-size:.67rem;text-transform:uppercase;font-weight:800;letter-spacing:.04em}.active-trip-identity > span:last-child,.active-trip-service > span{color:#53647D;font-size:.76rem}
.active-trip-status{display:inline-flex;padding:3px 7px;border-radius:6px;font-size:.65rem;font-weight:850;text-transform:uppercase}.active-trip-status.sem-verde{background:#DFF4E8;color:#0C7749}.active-trip-status.sem-amarillo{background:#FFF0D7;color:#9A5E09}.active-trip-status.sem-rojo{background:#FCE3E3;color:#A33232}
.active-trip-status.open{background:#E7EEF8;color:#3E5D86}.active-trip-status.closing{background:#FFF0D7;color:#945B09}
.active-trip-service b{font-size:.82rem;line-height:1.35;color:#102F5D}.active-trip-service em{display:flex;align-items:center;gap:4px;color:#456080;font-size:.7rem;font-style:normal;line-height:1.35}.active-trip-service em.missing{color:#A85F05;font-weight:750}
.active-trip-tracking{display:flex;align-items:center;gap:10px;min-width:0}.active-trip-tracking .ring{width:58px;height:58px;flex:0 0 58px}.active-trip-tracking .ring-top{font-size:.64rem}.active-trip-tracking .ring-bot{font-size:.45rem}.active-trip-tracking > div:last-child{display:flex;flex-direction:column;gap:3px;min-width:0}.active-trip-tracking b{font-size:.8rem;color:#173A70;text-transform:capitalize}.active-trip-tracking span{font-size:.68rem;color:#67758B}
.active-trip-progress{display:flex;align-items:center;gap:10px;min-width:0}.active-progress-icon{width:38px;height:38px;border-radius:9px;display:grid;place-items:center;background:#EAF0F8;color:#4C678C;flex:0 0 auto}.active-progress-icon .ic{width:19px;height:19px}.active-trip-progress > div{display:flex;flex-direction:column;gap:3px;min-width:0}.active-trip-progress small{color:#718096;font-size:.67rem;text-transform:uppercase;font-weight:800;letter-spacing:.04em}.active-trip-progress b{font-size:.8rem;color:#173A70;text-transform:capitalize}.active-trip-progress span{font-size:.68rem;color:#67758B}
.active-close-checks{display:flex;flex-wrap:wrap;gap:5px}.active-close-checks a{display:inline-flex;align-items:center;gap:3px;padding:4px 6px;border-radius:6px;font-size:.65rem;font-weight:800}.active-close-checks a:hover{text-decoration:none}.active-close-checks a.done{background:#E3F4EA;color:#0B784A}.active-close-checks a.pending{background:#FBE7E7;color:#A93636}.active-close-ready,.active-close-note{display:flex;align-items:center;gap:4px;font-size:.67rem;color:#A56408}.active-close-note{color:#6C788B}
.active-trip-actions{align-items:stretch}.active-trip-actions .btn{justify-content:center;width:100%;white-space:nowrap}

@media (max-width:1400px){
  .active-ops-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
  .active-trip-row{grid-template-columns:1fr 1.35fr 1fr}.active-trip-close{grid-column:1/3}.active-trip-actions{grid-column:3;grid-row:1/3}
}

@media (max-width:1180px){
  .journey-filters{grid-template-columns:2fr 1fr 140px 140px}.journey-filter-actions{grid-column:1/-1;justify-content:flex-end}
  .dashboard-process-queues{grid-template-columns:repeat(5,1fr)}
  .dashboard-queue-title{grid-column:1/-1;border-right:0;border-bottom:1px solid var(--line)}
  .active-ops-summary{grid-template-columns:repeat(2,1fr)}
  .active-ops-toolbar form{width:100%}
  .active-trip-row{grid-template-columns:1fr 1.35fr 1fr}.active-trip-close{grid-column:1/3}.active-trip-actions{grid-column:3;grid-row:1/3}
}
@media (max-width:760px){
  .journey-pipeline{grid-template-columns:repeat(2,1fr)}
  .journey-pipeline-card{min-height:80px;border-bottom:1px solid var(--line)}
  .journey-pipeline-card:nth-child(2){border-right:0}.journey-pipeline-card:nth-child(3),.journey-pipeline-card:nth-child(4){border-bottom:0}
  .journey-filters{grid-template-columns:1fr 1fr}.journey-search,.journey-filters label:nth-of-type(2){grid-column:1/-1}
  .journey-filter-actions{justify-content:stretch}.journey-filter-actions .btn{flex:1;justify-content:center}
  .journey-empty{flex-direction:column;text-align:center}
  .dashboard-process-queues{grid-template-columns:repeat(2,1fr)}
  .dashboard-queue-title{grid-column:1/-1}.dashboard-process-queues > a{min-height:48px}
  .active-trip-row{grid-template-columns:1fr}.active-trip-close,.active-trip-actions{grid-column:auto;grid-row:auto}.active-trip-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .active-worklist-head{align-items:flex-start}.active-ops-toolbar form{flex-wrap:wrap}.active-ops-toolbar form .search{flex:1 0 100%}
}
@media (max-width:480px){
  .journey-pipeline{grid-template-columns:1fr}.journey-pipeline-card{border-right:0!important;border-bottom:1px solid var(--line)!important}.journey-pipeline-card:last-child{border-bottom:0!important}
  .journey-filters{grid-template-columns:1fr}.journey-filters label,.journey-filter-actions{grid-column:1!important}
  .active-ops-summary{grid-template-columns:1fr}.active-ops-summary > a{min-height:72px}.active-trip-actions{grid-template-columns:1fr}
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; min-height:100vh; color:var(--txt);
  background:
    radial-gradient(120% 60% at 50% -10%, #FBF8F1 0%, var(--bg) 55%),
    var(--bg);
  font:15px/1.55 var(--font-ui);
  -webkit-font-smoothing:antialiased;
}
a{color:var(--brand); text-decoration:none}
a:hover{text-decoration:underline}
h1{font-family:var(--font-brand); font-size:1.85rem; margin:.1rem 0; letter-spacing:.01em; font-weight:700; text-transform:uppercase}
h2{font-size:.95rem; margin:.1rem 0 .85rem; color:var(--txt); font-weight:700;
   font-family:var(--font-brand); text-transform:uppercase; letter-spacing:.04em;
   display:flex; align-items:center; gap:.55rem}
h2::before{content:""; width:4px; height:1.05em; border-radius:3px; background:var(--gold-grad); flex:0 0 auto}
.panel-head h2::before, .center h2::before, .group-head::before{display:none}
.center h2{justify-content:center}
.muted{color:var(--muted)} .small{font-size:.84rem} .nowrap{white-space:nowrap}
.sub{color:var(--muted); margin:.15rem 0 0; font-size:.92rem}
.back{color:var(--muted); font-size:.85rem}
.ic{width:18px; height:18px; vertical-align:-3px; flex:0 0 auto}
.ic.dim{color:var(--dim)} .ic.tiny{width:14px;height:14px;vertical-align:-2px}

/* ---------- topbar ---------- */
.topbar{
  display:flex; align-items:center; gap:1rem; padding:.6rem 1.3rem;
  background:var(--panel); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:20; box-shadow:0 1px 0 rgba(28,37,54,.03);
}
.logo{display:inline-flex; align-items:center; text-decoration:none}
.logo:hover{text-decoration:none}
.logo img{height:80px; width:auto; display:block}
.topbar nav{display:flex; gap:.2rem; margin-left:.8rem; flex-wrap:wrap}
.nav-link{display:flex; align-items:center; gap:.45rem; padding:.5rem .85rem; border-radius:9px; color:var(--muted); font-weight:500; font-size:.9rem}
.nav-link:hover{background:var(--panel2); color:var(--txt); text-decoration:none}
.nav-link.active{background:var(--panel2); color:var(--brand)}
.nav-link.active .ic{color:var(--gold)}
.topclock{margin-left:auto; display:flex; align-items:center; gap:.45rem; color:var(--muted);
  font-variant-numeric:tabular-nums; font-size:.88rem; background:var(--bg2); padding:.42rem .75rem; border-radius:9px; border:1px solid var(--line)}

.container{max-width:1140px; margin:0 auto; padding:1.4rem 1.3rem 2.5rem}
.foot{color:var(--muted); text-align:center; padding:1.6rem 1rem; font-size:.8rem}
.dot{display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--gris)}
.dot.off{background:var(--gold)}

/* flash */
.flash{display:flex; align-items:center; gap:.5rem; padding:.7rem .9rem; border-radius:var(--radius-sm); margin-bottom:1rem; box-shadow:var(--shadow); border:1px solid var(--line)}
.flash-ok{background:#EAF6EF; color:#1B6E47; border-color:#C7E6D4}
.flash-error{background:#FBECEC; color:#A33232; border-color:#F0CFCF}

/* ---------- page head ---------- */
.page-head{display:flex; justify-content:space-between; align-items:flex-end; gap:1rem; flex-wrap:wrap; margin-bottom:1.3rem}
.head-cumpl{display:flex; align-items:center; gap:.75rem; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:.6rem .95rem; box-shadow:var(--shadow)}
.head-cumpl-txt{display:flex; flex-direction:column}

/* ---------- stats ---------- */
.stats{display:grid; grid-template-columns:repeat(5,1fr); gap:.7rem; margin-bottom:1.2rem}
.stat{display:flex; align-items:center; gap:.7rem; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:.85rem .95rem; box-shadow:var(--shadow)}
.stat.clickable{cursor:pointer; transition:box-shadow .14s, transform .14s, border-color .14s}
.stat.clickable:hover{box-shadow:var(--shadow-lg); transform:translateY(-2px); border-color:var(--line2)}
.stat-ic{display:grid; place-items:center; width:40px; height:40px; border-radius:11px; flex:0 0 auto}
.stat-ic .ic{width:20px;height:20px}
.stat-ic.blue{background:#E9EEF7; color:var(--brand)}
.stat-ic.rojo{background:#FBEAEA; color:#C13B3B}
.stat-ic.amarillo{background:#FBF0DD; color:#B5731C}
.stat-ic.verde{background:#E7F4EC; color:#1B7A4C}
.stat-ic.gris{background:#EFEDE6; color:#6E7585}
.stat-num{display:block; font-size:1.55rem; font-weight:700; line-height:1; color:var(--txt)}
.stat-lbl{display:block; color:var(--muted); font-size:.8rem; margin-top:.2rem}

/* ---------- toolbar ---------- */
.toolbar{display:flex; gap:.8rem; align-items:center; flex-wrap:wrap; margin-bottom:1.3rem}
.search{display:flex; align-items:center; gap:.5rem; background:var(--panel); border:1px solid var(--line); border-radius:11px; padding:.55rem .85rem; flex:1 1 280px; min-width:220px; box-shadow:var(--shadow)}
.search .ic{color:var(--dim)}
.search input{border:none; background:transparent; color:var(--txt); width:100%; height:auto; outline:none; font:inherit; box-shadow:none}
.search input:focus{border:none; box-shadow:none}
.search input::placeholder{color:var(--dim)}
.chips{display:flex; gap:.4rem; flex-wrap:wrap}
.chip{padding:.48rem .85rem; border-radius:22px; border:1px solid var(--line2); background:var(--panel); color:var(--muted); cursor:pointer; font-size:.85rem; font-weight:500; transition:.12s}
.chip:hover{color:var(--txt); border-color:var(--brand)}
.chip.active{background:var(--brand); color:var(--cream); border-color:var(--brand)}

/* ---------- groups ---------- */
.group{margin-bottom:1.5rem}
.group-head{display:flex; align-items:center; gap:.5rem; font-size:.78rem; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin:0 0 .8rem; font-weight:600}
.group-head .count{margin-left:.15rem; background:var(--panel2); border-radius:20px; padding:.05rem .5rem; font-size:.76rem; color:var(--muted)}
.group-head.sem-rojo{color:#C13B3B} .group-head.sem-amarillo{color:#B5731C}
.group-head.sem-verde{color:#1B7A4C} .group-head.sem-gris{color:#6E7585}

/* ---------- cards ---------- */
.cards{display:grid; grid-template-columns:repeat(auto-fill,minmax(315px,1fr)); gap:.9rem}
.card{display:flex; flex-direction:column; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:.95rem 1rem; box-shadow:var(--shadow); position:relative; overflow:hidden; transition:box-shadow .14s, transform .14s}
.card::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--gris)}
.card.sem-rojo::before{background:var(--rojo)} .card.sem-amarillo::before{background:var(--amarillo)}
.card.sem-verde::before{background:var(--verde)} .card.sem-gris::before{background:var(--line2)}
.card:hover{box-shadow:var(--shadow-lg); transform:translateY(-2px)}
.card-top{display:flex; align-items:center; gap:.75rem; margin-bottom:.7rem}
.card-id{min-width:0; flex:1}
.card-id-top{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap}
.unit{font-weight:700; font-size:1.1rem; color:var(--txt)}
.unit:hover{color:var(--brand)}
.estado-ic{display:grid; place-items:center; width:46px; height:46px; border-radius:50%; flex:0 0 auto; background:var(--panel2); color:var(--muted)}
.card-meta{display:flex; flex-direction:column; gap:.42rem; flex:1}
.meta-row{display:flex; align-items:center; gap:.45rem; flex-wrap:wrap; font-size:.9rem}
.meta-row.split{justify-content:space-between}
.meta-row .ic{color:var(--dim)}
.kv{display:flex; align-items:center; gap:.35rem; color:var(--muted)}
.card-actions{display:flex; gap:.5rem; margin-top:.95rem}
.card-actions .btn{flex:1; justify-content:center}

/* ---------- ring ---------- */
.ring{position:relative; width:50px; height:50px; flex:0 0 auto}
.ring svg{width:50px; height:50px; transform:rotate(-90deg)}
.ring circle{fill:none; stroke-width:4; stroke-linecap:round}
.ring .ring-bg{stroke:#ECE6D9}
.ring .ring-fg{transition:stroke-dashoffset .5s ease}
.ring-rojo .ring-fg{stroke:var(--rojo)} .ring-amarillo .ring-fg{stroke:var(--amarillo)}
.ring-verde .ring-fg{stroke:var(--verde)} .ring-gris .ring-fg{stroke:var(--gris)}
.ring-label{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1}
.ring-top{font-size:.95rem; font-weight:700; color:var(--txt)}
.ring-bot{font-size:.55rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em}
.center .ring{width:120px; height:120px; margin:.4rem auto .6rem}
.center .ring svg{width:120px; height:120px}
.center .ring circle{stroke-width:5}
.center .ring-top{font-size:1.5rem}
.center .ring-bot{font-size:.7rem}

/* ---------- badges & pills ---------- */
.badge{display:inline-flex; align-items:center; gap:.25rem; padding:.16rem .55rem; border-radius:20px; font-size:.74rem; font-weight:600; border:1px solid transparent; white-space:nowrap}
.badge.lg{font-size:.85rem; padding:.3rem .7rem}
.badge.sem-rojo{background:#FBEAEA; color:#A33232; border-color:#F0CFCF}
.badge.sem-amarillo{background:#FBF0DD; color:#9A6418; border-color:#EFD9AE}
.badge.sem-verde{background:#E7F4EC; color:#1B6E47; border-color:#BFE3CD}
.badge.sem-gris{background:#EFEDE6; color:#5C6473; border-color:#E0DACC}
.badge.estatus{background:#E9EEF7; color:#244D86; border-color:#CFDCF0}
.badge.carga{background:var(--panel2); color:var(--muted); border-color:var(--line)}
.badge[class*="estado-"]{background:var(--panel2); color:#414B5E; border-color:var(--line)}
.badge.estado-taller{background:#FBF0DD; color:#9A6418; border-color:#EFD9AE}
.badge.estado-sin_operador{background:#FBEAEA; color:#A33232; border-color:#F0CFCF}
.badge.estado-disponible{background:#E7F4EC; color:#1B6E47; border-color:#BFE3CD}
.badge[class*="ev-"]{background:#FBEAEA; color:#A33232; border-color:#F0CFCF}
.badge.tipo-inicio{background:#E7F4EC; color:#1B6E47; border-color:#BFE3CD}
.badge.tipo-cierre{background:#FBEAEA; color:#A33232; border-color:#F0CFCF}
.badge.tipo-seguimiento{background:var(--panel2); color:var(--muted); border-color:var(--line)}
.pill{display:inline-flex; align-items:center; gap:.25rem; padding:.1rem .5rem; border-radius:20px; font-size:.72rem; font-weight:600}
.pill.ok{background:#E7F4EC; color:#1B6E47}
.pill.no{background:#FBEAEA; color:#A33232}
.pill.warn{background:#FFF2D6; color:#9A6418}
.pill.auto{background:#EFEDE6; color:#5C6473; font-size:.66rem}
.sev{font-size:.78rem; font-weight:600}
.sev-critico{color:var(--rojo)} .sev-advertencia{color:#B5731C} .sev-info{color:var(--brand)}

/* ---------- panels & detail ---------- */
.panel{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:1.15rem; margin-bottom:1rem; box-shadow:var(--shadow)}
.panel.center{text-align:center}
.panel-head{display:flex; justify-content:space-between; align-items:center; gap:.6rem; margin-bottom:.6rem}
.panel-head h2{margin:0}
.empty-panel{display:flex; align-items:center; gap:.5rem; color:var(--muted)}
.empty{display:flex; align-items:center; gap:.5rem; justify-content:center; color:var(--muted); padding:2rem}
.detail-grid{display:grid; grid-template-columns:1fr 320px; gap:1rem; align-items:start}
.detail-grid.form-clean{grid-template-columns:minmax(0,900px)}
.detail-side{position:sticky; top:78px}
dl.grid{display:grid; grid-template-columns:auto 1fr; gap:.55rem .9rem; margin:0}
dl.grid.tight{gap:.42rem .7rem; font-size:.9rem}
dl.grid dt{color:var(--muted); display:flex; align-items:center; gap:.4rem}
dl.grid dd{margin:0; color:var(--txt)}

/* route banner */
.route-banner{display:flex; align-items:center; gap:.6rem; background:var(--bg2); border:1px solid var(--line); border-radius:var(--radius-sm); padding:.85rem; margin:.4rem 0 1.1rem}
.rb-pt{display:flex; align-items:center; gap:.5rem; flex:1; min-width:0}
.rb-pt small{display:block; color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.05em}
.rb-pt b{color:var(--txt)}
.rb-dot{width:11px; height:11px; border-radius:50%; flex:0 0 auto}
.rb-dot.start{background:var(--brand)} .rb-dot.end{background:var(--gold)}
.rb-line{flex:0 0 auto; color:var(--dim); border-top:2px dashed var(--line2); position:relative; width:48px; text-align:center}
.rb-line .ic{background:var(--panel); padding:0 2px}

/* timeline */
.timeline{list-style:none; margin:0; padding:0; position:relative}
.timeline::before{content:""; position:absolute; left:13px; top:6px; bottom:6px; width:2px; background:var(--line)}
.tl-item{position:relative; padding:0 0 1.1rem 2.3rem}
.tl-dot{position:absolute; left:0; top:0; width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--panel); border:2px solid var(--line); z-index:1}
.tl-item.ok .tl-dot{color:var(--verde); border-color:#BFE3CD}
.tl-item.late .tl-dot{color:var(--rojo); border-color:#F0CFCF}
.tl-top{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap}
.tl-comment{margin:.4rem 0 .3rem; color:var(--txt)}
.tl-gps{display:flex; align-items:center; gap:.35rem}
.tl-gps-on{
  flex-wrap:wrap;
  gap:.45rem .65rem;
  margin-top:.45rem;
  color:#0b2a5b;
}
.tl-gps-on b{
  color:#06265a;
  font-weight:800;
}
.tl-gps-on span{
  color:var(--muted);
}

/* kpi / bar */
.kpi{display:flex; align-items:baseline; gap:.5rem; margin-bottom:.3rem}
.kpi-num{font-size:1.5rem; font-weight:700; color:var(--txt)}
.sem-verde-txt{color:var(--verde)}
.bar{height:8px; background:var(--panel2); border-radius:20px; overflow:hidden; margin:.5rem 0 .2rem}
.bar-fill{display:block; height:100%; background:var(--verde)}

/* trip list */
.trip-list{display:flex; flex-direction:column; gap:.8rem}
.trip-card{display:flex; align-items:center; gap:1rem; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:.95rem 1rem; box-shadow:var(--shadow); position:relative; overflow:hidden}
.trip-card::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px}
.trip-card.sem-rojo::before{background:var(--rojo)} .trip-card.sem-amarillo::before{background:var(--amarillo)}
.trip-card.sem-verde::before{background:var(--verde)} .trip-card.sem-gris::before{background:var(--line2)}
.trip-main{flex:1; min-width:0}
.trip-head{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; margin-bottom:.4rem}
.trip-route{display:flex; align-items:center; gap:.4rem; margin:.2rem 0; font-size:.92rem; flex-wrap:wrap}
.trip-route b{color:var(--txt)}
.route-line{flex:1; min-width:24px; height:2px; border-top:2px dashed var(--line2)}
.trip-meta{display:flex; gap:1rem; flex-wrap:wrap; color:var(--muted); font-size:.86rem; margin-top:.3rem}
.trip-actions{display:flex; flex-direction:column; gap:.5rem; flex:0 0 auto}
.trip-inline{display:flex; align-items:center; gap:.6rem; flex-wrap:wrap}

/* ---------- tables ---------- */
.table-wrap{overflow-x:auto; border-radius:var(--radius-sm)}
table{width:100%; border-collapse:collapse; font-size:.9rem}
th,td{text-align:left; padding:.6rem .7rem; border-bottom:1px solid var(--line); vertical-align:middle}
th{color:var(--muted); font-weight:600; white-space:nowrap; font-size:.78rem; text-transform:uppercase; letter-spacing:.04em}
tbody tr{transition:background .1s}
tbody tr:hover{background:var(--bg2)}

/* tabs */
.tabs{display:flex; gap:.4rem; margin-bottom:1rem}
.tab{display:flex; align-items:center; gap:.4rem; padding:.55rem 1rem; border-radius:11px; border:1px solid var(--line2); background:var(--panel); color:var(--muted); cursor:pointer; font-weight:600; font-size:.9rem}
.tab:hover{color:var(--txt)}
.tab.active{background:var(--brand); color:var(--cream); border-color:var(--brand)}
.tab.active .count{background:rgba(255,255,255,.2); color:var(--cream)}
.tab .count{background:var(--panel2); border-radius:20px; padding:.02rem .5rem; font-size:.75rem}

/* ---------- buttons & forms ---------- */
.btn{display:inline-flex; align-items:center; gap:.4rem; padding:.5rem .85rem; border-radius:10px; font-size:.86rem; background:var(--panel); color:var(--txt); border:1px solid var(--line2); cursor:pointer; font-weight:600; transition:.12s}
.btn:hover{text-decoration:none; border-color:var(--brand); background:var(--bg2)}
.btn .ic{width:16px;height:16px}
.btn-primary{background:var(--brand-grad); color:var(--cream); border-color:var(--brand-ink); box-shadow:0 2px 6px rgba(22,48,79,.25)}
.btn-primary:hover{background:var(--brand-ink); border-color:var(--brand-ink)}
.btn-primary .ic{color:var(--cream)}
.btn.lg{padding:.65rem 1.1rem; font-size:.95rem}
.field{display:block; margin-bottom:.85rem; color:#45566F; font-size:.74rem; font-weight:700}
.field-label{display:flex; align-items:center; gap:.4rem; color:#45566F; font-size:.74rem; font-weight:700; margin-bottom:.35rem}
select,textarea,input:not([type]),
input[type=text],input[type=password],input[type=email],input[type=number],
input[type=date],input[type=time],input[type=datetime-local],input[type=month],
input[type=search],input[type=tel],input[type=url]{
  width:100%; height:38px; margin-top:.3rem; padding:0 .65rem;
  border-radius:5px; background:#fff; color:var(--txt);
  border:1px solid #C3CDDA; font:500 .84rem/1.35 var(--font-ui); outline:none;
  transition:border-color .12s, box-shadow .12s;
}
textarea{height:auto; min-height:84px; padding:.5rem .65rem; resize:vertical}
select{
  appearance:none; -webkit-appearance:none; padding-right:1.9rem; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2351627E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right .6rem center; background-size:12px 12px;
}
select[multiple]{height:auto; padding:.4rem .65rem; background-image:none}
input[type=date],input[type=time],input[type=datetime-local],input[type=month]{font-variant-numeric:tabular-nums}
input::-webkit-calendar-picker-indicator{opacity:.55; cursor:pointer}
input::-webkit-calendar-picker-indicator:hover{opacity:.9}
input[type=file]{width:100%; margin-top:.3rem; color:var(--muted); font:500 .8rem var(--font-ui)}
input[type=file]::file-selector-button{
  height:30px; margin-right:.6rem; padding:0 .85rem;
  border:1px solid #C3CDDA; border-radius:4px;
  background:#F4F6FA; color:#24344F; font:700 .76rem var(--font-ui); cursor:pointer;
}
input[type=file]::file-selector-button:hover{background:#E9EEF5}
input[type=checkbox],input[type=radio]{accent-color:#123765; width:15px; height:15px}
select:focus,textarea:focus,input:focus{border-color:#2F6BBF; box-shadow:0 0 0 3px rgba(29,99,196,.14)}
select:disabled,textarea:disabled,input:disabled{background:#F1F4F8; color:#8794A8; border-color:#DDE3EC; cursor:not-allowed; opacity:1}
.field.has-error input,.field.has-error select,.field.has-error textarea,.input-error{
  border-color:#C43838 !important; box-shadow:0 0 0 3px rgba(196,56,56,.12) !important;
}
.seg{display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:1rem}
.seg-opt input{position:absolute; opacity:0; pointer-events:none}
.seg-opt span{display:inline-block; padding:.45rem .8rem; border-radius:20px; border:1px solid var(--line2); background:var(--panel); color:var(--muted); cursor:pointer; font-size:.85rem; font-weight:600; transition:.12s; text-transform:capitalize}
.seg-opt:hover span{color:var(--txt); border-color:var(--brand)}
.seg-opt input:checked + span{background:var(--brand); color:var(--cream); border-color:var(--brand)}
.gps-panel .gps-badge{display:inline-flex; align-items:center; gap:.35rem; padding:.35rem .7rem; border-radius:20px; font-size:.8rem; font-weight:600; background:#FBF0DD; color:#9A6418; margin-top:.5rem}

/* ---------- responsive ---------- */
@media(max-width:900px){
  .detail-grid{grid-template-columns:1fr}
  .detail-side{position:static}
  .stats{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:620px){
  .topbar{flex-wrap:wrap; gap:.5rem; padding:.6rem .9rem}
  .topclock{order:3; margin-left:0}
  .nav-link span{display:none}
  .stats{grid-template-columns:repeat(2,1fr)}
  .head-cumpl{width:100%; justify-content:center}
  .trip-card{flex-wrap:wrap}
  .trip-actions{flex-direction:row; width:100%}
  .trip-actions .btn{flex:1; justify-content:center}
  .page-head{align-items:flex-start}
  .container{padding:1.1rem .9rem 2rem}
}

/* =====================================================================
   CAPA RSR — navbar oscuro, shell con rail, stats pastel, renglones, dona
   ===================================================================== */
.container{max-width:1340px}

/* ---- navbar oscuro ---- */
.topbar{
  background:linear-gradient(100deg,#0E1B33 0%,#15294B 55%,#0C1A30 100%);
  border-bottom:none; box-shadow:0 2px 14px rgba(8,16,32,.35); padding:.55rem 1.5rem;
}
.topbar nav{margin-left:1.3rem; gap:.3rem}
.nav-link{color:#AEB9CE; border:1px solid transparent}
.nav-link:hover{background:rgba(255,255,255,.06); color:#fff}
.nav-link.active{background:rgba(255,255,255,.05); color:#fff; border-color:rgba(201,162,76,.45); box-shadow:inset 0 -2px 0 var(--gold)}
.nav-link.active .ic{color:var(--gold)}
.topbar-right{display:flex; align-items:center; gap:.7rem; margin-left:auto}
.topclock{margin-left:0; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#D2DBEA}
.btn-gold{background:linear-gradient(180deg,#F2AC41,#E2882A); color:#fff; border:none; font-weight:700; box-shadow:0 3px 10px rgba(226,136,42,.45)}
.btn-gold:hover{filter:brightness(1.06); background:linear-gradient(180deg,#F2AC41,#E2882A)}
.btn-gold .ic{color:#fff}

/* ---- shell con rail ---- */
.app-shell{display:grid; grid-template-columns:minmax(0,1fr) 348px; gap:1.4rem; align-items:start}
.main-col{min-width:0}
.rail{display:flex; flex-direction:column; gap:1rem; position:sticky; top:88px}
.rail .panel{padding:1.1rem 1.15rem}

/* ---- stats pastel ---- */
.stats{gap:.8rem}
.stat{border:1px solid transparent}
.stat[data-filter="all"]{background:#E9F0FB; border-color:#D6E3F6}
.stat.rojo{background:#FCEDED; border-color:#F5D6D6}
.stat.amarillo{background:#FDF4E4; border-color:#F2E1BD}
.stat.verde{background:#E9F6EE; border-color:#CDE8D7}
.stat.gris{background:#F1EFE8; border-color:#E3DDCE}
.stat-ic{background:#FFFFFF; box-shadow:0 1px 2px rgba(28,37,54,.08)}

/* ---- renglones de unidad ---- */
.cards{display:grid; gap:.8rem}
.cards.cols-1{grid-template-columns:1fr}
.cards.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cards.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ucard{
  display:flex; align-items:center; gap:1.1rem; flex-wrap:wrap; position:relative;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:.9rem 1.15rem; box-shadow:var(--shadow); overflow:hidden; transition:box-shadow .14s, transform .14s;
}
.ucard::before{content:""; position:absolute; left:0; top:0; bottom:0; width:5px}
.ucard:hover{box-shadow:var(--shadow-lg); transform:translateY(-1px)}
.ucard.sem-rojo{background:#FCEFEF; border-color:#F3D7D7} .ucard.sem-rojo::before{background:var(--rojo)}
.ucard.sem-amarillo{background:#FDF6E9; border-color:#F1E2BF} .ucard.sem-amarillo::before{background:var(--amarillo)}
.ucard.sem-verde{background:#EEF8F1; border-color:#CFE9D9} .ucard.sem-verde::before{background:var(--verde)}
.ucard.sem-gris{background:#F7F5EF; border-color:#E7E1D3} .ucard.sem-gris::before{background:var(--line2)}
.uc-id{min-width:150px; flex:1.1; display:flex; flex-direction:column; gap:.25rem}
.uc-id-top{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap}
.uc-badges{display:flex; gap:.35rem; flex-wrap:wrap; margin-top:.1rem}
.uc-info{min-width:150px; flex:1.2; display:flex; flex-direction:column; gap:.35rem; font-size:.9rem}
.uc-info .kv{color:var(--txt)}
.uc-trip{min-width:175px; flex:1.5; display:flex; flex-direction:column; gap:.3rem; font-size:.86rem; color:var(--muted)}
.uc-trip .ic{color:var(--dim)}
.uc-actions{display:flex; gap:.5rem; flex:0 0 auto}
.uc-menu{position:absolute; top:.55rem; right:.6rem; background:transparent; border:none; color:var(--dim); cursor:pointer; padding:.2rem; border-radius:6px; line-height:0}
.uc-menu:hover{background:rgba(0,0,0,.05); color:var(--muted)}
.uc-actions .btn-checkin{background:var(--verde); color:#fff; border-color:var(--verde)}
.uc-actions .btn-checkin:hover{filter:brightness(1.05); background:var(--verde)}
.uc-actions .btn-checkin .ic{color:#fff}
.ucard.sem-rojo .btn-checkin, .ucard.sem-amarillo .btn-checkin{background:var(--brand-grad); border-color:var(--brand-ink)}
.uc-compact{justify-content:flex-start}
.uc-compact .uc-actions{margin-left:auto}

/* ---- dona de cumplimiento ---- */
.donut{position:relative; width:118px; height:118px; flex:0 0 auto}
.donut svg{width:118px; height:118px; transform:rotate(-90deg)}
.donut circle{fill:none; stroke-width:13; stroke-linecap:butt}
.donut .dn-track{stroke:#EEE8DA}
.donut .dn-v{stroke:var(--verde)} .donut .dn-a{stroke:var(--amarillo)} .donut .dn-r{stroke:var(--rojo)}
.donut-label{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1}
.donut-pct{font-size:1.5rem; font-weight:800; color:var(--txt)}
.donut-sub{font-size:.62rem; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-top:2px}
.cumpl-top{display:flex; align-items:center; gap:1rem}
.cumpl-side{display:flex; flex-direction:column; gap:.1rem}
.cumpl-side b{font-size:1.5rem; font-weight:800}
.link-gold{color:var(--brand); font-weight:600; font-size:.85rem; display:inline-flex; align-items:center; gap:.3rem; margin-top:.3rem}
.stack{display:flex; height:22px; border-radius:7px; overflow:hidden; margin:.9rem 0 .7rem}
.stack span{display:grid; place-items:center; color:#fff; font-size:.72rem; font-weight:700; min-width:0}
.stack .s-r{background:var(--rojo)} .stack .s-a{background:var(--amarillo)} .stack .s-v{background:var(--verde)}
.mini3{display:flex; justify-content:space-around; text-align:center}
.mini3 .m-num{font-size:1.15rem; font-weight:800; display:block}
.mini3 .m-lbl{font-size:.72rem; color:var(--muted)}
.mini3 .m-r{color:var(--rojo)} .mini3 .m-a{color:#B5731C} .mini3 .m-v{color:var(--verde)}

/* ---- resumen general ---- */
.rs-row{display:flex; align-items:center; gap:.65rem; padding:.42rem 0; border-bottom:1px solid var(--line)}
.rs-row:last-child{border-bottom:none}
.rs-row .ic{color:var(--dim)}
.rs-num{font-weight:800; min-width:1.4rem; color:var(--txt)}
.rs-row.r-rojo .rs-num{color:var(--rojo)} .rs-row.r-amarillo .rs-num{color:#B5731C} .rs-row.r-verde .rs-num{color:var(--verde)}
.rs-label{color:var(--muted); font-size:.9rem}

/* ---- ultimos check-ins ---- */
.ck-row{display:flex; align-items:center; gap:.6rem; padding:.5rem 0; border-bottom:1px solid var(--line)}
.ck-row:last-child{border-bottom:none}
.ck-dot{width:26px; height:26px; border-radius:50%; display:grid; place-items:center; flex:0 0 auto}
.ck-dot.ok{background:#E7F4EC; color:var(--verde)} .ck-dot.no{background:#FBEAEA; color:var(--rojo)}
.ck-dot .ic{width:15px;height:15px}
.ck-main{flex:1; min-width:0; display:flex; flex-direction:column; gap:.1rem}
.ck-unit{display:flex; align-items:center; gap:.4rem; font-weight:600}
.ck-sub{font-size:.8rem; color:var(--muted)}
.ck-time{font-size:.78rem; color:var(--muted); white-space:nowrap}
.rail-btn{display:flex; align-items:center; justify-content:center; gap:.45rem; width:100%; margin-top:.6rem}

/* ---- detalle: head actions, resumen grid, gps honesto ---- */
.head-actions{display:flex; gap:.5rem; align-items:center}
.title-row{display:flex; align-items:center; gap:.7rem; flex-wrap:wrap}
.badge.curso{background:#FDF4E4; color:#9A6418; border-color:#F0DCA8}
.metrics{display:grid; grid-template-columns:repeat(2,1fr); gap:.8rem 1.2rem}
.metric .m-k{color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.03em}
.metric .m-v{font-size:1.15rem; font-weight:700; margin-top:.15rem}
.metric .m-v.verde{color:var(--verde)} .metric .m-v.amber{color:#B5731C}
.gps-honest{display:flex; align-items:center; gap:.7rem; background:#EEF8F1; border:1px solid #CFE9D9; border-radius:var(--radius-sm); padding:.8rem 1rem; color:#1B6E47}
.gps-honest .ic{width:22px;height:22px}
.two-up{display:grid; grid-template-columns:1fr 1fr; gap:1rem}

@media(max-width:1040px){
  .app-shell{grid-template-columns:1fr}
  .rail{position:static; flex-direction:row; flex-wrap:wrap}
  .rail .panel{flex:1 1 280px}
  .cards.cols-2,.cards.cols-3{grid-template-columns:1fr}
  .two-up{grid-template-columns:1fr}
}

/* ===== CAPA RSR — modelo limpio (atencion, situacion, form) ===== */
.stats{grid-template-columns:repeat(auto-fit,minmax(148px,1fr))}
.stat.atencion{background:#FBEDE7; border-color:#F4D5C6}
.stat-ic.atencion{background:#fff; color:#C4552A}
.badge.accion{background:#ECEAF9; color:#46399B; border-color:#D7D0F1}
.ucard.has-atencion{box-shadow:0 0 0 1px rgba(209,67,67,.25), var(--shadow)}
.panel-title-icon{display:inline-flex; align-items:center; color:var(--gold); margin-right:.1rem}
.panel-title-icon .ic{width:17px;height:17px}
/* checkin form */
.two-col{display:grid; grid-template-columns:1fr 1fr; gap:0 1rem}
.check-toggle{display:flex; align-items:center; gap:.55rem; cursor:pointer; font-size:.92rem; margin:.2rem 0 .4rem}
.check-toggle input{width:18px; height:18px; margin:0; accent-color:var(--brand)}
.excepcion-fields{margin-top:.6rem; padding-top:.6rem; border-top:1px dashed var(--line2)}
.deuda{color:#9A6418; font-size:.82rem}
@media(max-width:620px){ .two-col{grid-template-columns:1fr} }
@media(max-width:680px){
  .topbar-right .btn-gold span,.btn-gold{font-size:.82rem}
  .ucard{gap:.7rem}
  .uc-actions{width:100%}
  .uc-actions .btn{flex:1; justify-content:center}
  .metrics{grid-template-columns:1fr 1fr}
}

/* =====================================================================
   RSR PREMIUM — look operativo menos generico, inspirado en la maqueta
   ===================================================================== */
:root{
  --bg:#F7F9FD;
  --bg2:#FFFFFF;
  --panel:#FFFFFF;
  --panel2:#F3F7FC;
  --line:#DDE6F2;
  --line2:#C9D5E5;
  --txt:#061840;
  --muted:#536784;
  --dim:#91A0B6;
  --brand:#061B45;
  --brand-ink:#071431;
  --gold:#F59E0B;
  --gold-soft:#FFF2D6;
  --verde:#09A85B;
  --amarillo:#F59E0B;
  --rojo:#F01717;
  --gris:#59708F;
  --brand-grad:linear-gradient(180deg,#0B2A62 0%,#031638 100%);
  --gold-grad:linear-gradient(180deg,#FDBA35 0%,#ED8707 100%);
  --font-brand:"Montserrat","Segoe UI",system-ui,sans-serif;
  --font-ui:"Montserrat","Segoe UI",system-ui,sans-serif;
  --radius:12px;
  --radius-sm:9px;
  --shadow:0 8px 24px rgba(10,26,58,.08),0 1px 2px rgba(10,26,58,.08);
  --shadow-lg:0 14px 34px rgba(10,26,58,.15),0 2px 4px rgba(10,26,58,.08);
}

body{
  background:
    radial-gradient(900px 280px at 24% -160px, rgba(0,73,164,.10), transparent 68%),
    linear-gradient(180deg,#FFFFFF 0%,#F7F9FD 34%,#F4F7FB 100%);
  color:var(--txt);
  font-size:14px;
}
a{color:#005CFF}
h1{
  font:800 2.08rem/1.05 var(--font-brand);
  letter-spacing:0;
  color:#07183F;
}
.title-row h1{font-size:2.65rem; letter-spacing:0}
.sub{color:#486080; font-weight:500}
.small{font-size:.82rem}

/* barra superior */
.topbar{
  min-height:96px;
  padding:0 42px;
  gap:0;
  overflow:hidden;
  background:
    radial-gradient(520px 160px at 78% -20%, rgba(49,76,116,.45), transparent 70%),
    linear-gradient(108deg,#041635 0%,#072354 50%,#031231 100%);
  box-shadow:0 10px 28px rgba(4,15,35,.28);
}
.topbar::after{
  content:"";
  position:absolute;
  inset:0 280px 0 auto;
  width:560px;
  background:linear-gradient(130deg,transparent 0 48%,rgba(255,255,255,.08) 49%,rgba(255,255,255,.02) 76%,transparent 77%);
  pointer-events:none;
}
.logo,.topbar nav,.topbar-right{position:relative; z-index:1}
.topbar nav{
  align-self:stretch;
  align-items:center;
  gap:16px;
  margin-left:42px;
  padding-left:28px;
  border-left:1px solid rgba(255,255,255,.12);
}
.nav-link{
  height:64px;
  min-width:132px;
  justify-content:center;
  gap:.68rem;
  padding:0 25px;
  border-radius:9px;
  color:#E8EEF9;
  font-weight:800;
  font-size:1rem;
  border:1px solid transparent;
  position:relative;
}
.nav-link .ic{width:27px;height:27px}
.nav-link:hover{
  background:rgba(255,255,255,.055);
  color:#fff;
  text-decoration:none;
}
.nav-link.active{
  color:#fff;
  background:rgba(2,17,45,.58);
  border-color:rgba(245,158,11,.58);
  box-shadow:inset 0 -2px 0 #FFA70B,0 0 0 1px rgba(255,255,255,.03);
}
.nav-link.active::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-1px;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-bottom:7px solid #FFA70B;
}
.nav-link.active .ic{color:#FFA70B}
.topbar-right{gap:1rem}
.topclock{
  min-width:142px;
  height:56px;
  justify-content:center;
  border-radius:10px;
  color:#F5F8FF;
  font-weight:600;
  border:1px solid rgba(245,158,11,.38);
  background:rgba(255,255,255,.045);
}
.topclock .ic{width:23px;height:23px}
.btn-gold{
  min-height:56px;
  padding:0 28px;
  border-radius:10px;
  font-size:1rem;
  background:linear-gradient(180deg,#FDB133 0%,#F18A06 100%);
  box-shadow:0 12px 24px rgba(237,135,7,.32), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-gold .ic{width:26px;height:26px}

/* superficie general */
.container{
  max-width:1800px;
  width:100%;
  padding:30px 52px 2.4rem;
}
.page-head{margin-bottom:1.55rem}
.app-shell{
  grid-template-columns:minmax(0,1fr) 398px;
  gap:2.05rem;
}
.rail{top:116px; gap:1.15rem}
.panel{
  border-color:var(--line);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:1.35rem 1.45rem;
}
.rail .panel{
  padding:1.45rem 1.55rem;
  background:linear-gradient(180deg,#FFFFFF,#FBFDFF);
}
h2{
  font:800 .98rem/1.2 var(--font-brand);
  letter-spacing:.02em;
  color:#07183F;
}
h2::before{
  width:4px;
  height:1.15rem;
  background:linear-gradient(180deg,#F5B32B,#D78A11);
}

/* KPIs */
.stats{
  gap:1rem;
  margin-bottom:1.3rem;
}
.stat{
  min-height:86px;
  padding:1rem 1.2rem;
  border-radius:11px;
  box-shadow:0 10px 26px rgba(10,26,58,.07);
}
.stat[data-filter="all"]{background:linear-gradient(110deg,#EEF6FF,#FBFDFF); border-color:#CFE0FF}
.stat.rojo{background:linear-gradient(110deg,#FFF0F0,#FFFFFF); border-color:#FFD0D0}
.stat.amarillo{background:linear-gradient(110deg,#FFF6E8,#FFFFFF); border-color:#FFE1B3}
.stat.verde{background:linear-gradient(110deg,#ECFFF5,#FFFFFF); border-color:#BEEFD6}
.stat.gris{background:linear-gradient(110deg,#F5F8FC,#FFFFFF); border-color:#D8E1EE}
.stat-ic{
  width:54px;
  height:54px;
  border-radius:13px;
  background:#fff;
  box-shadow:0 8px 18px rgba(10,26,58,.09);
}
.stat-ic .ic{width:34px;height:34px}
.stat-num{
  font-size:1.75rem;
  font-weight:900;
  color:#061840;
}
.stat-lbl{font-size:.88rem; color:#061840; font-weight:600}

/* barra de busqueda/filtros */
.toolbar{
  gap:.9rem;
  margin-bottom:1.25rem;
}
.search{
  min-height:46px;
  border-radius:8px;
  border-color:#E0E8F3;
  box-shadow:0 7px 20px rgba(10,26,58,.06);
}
.search .ic{width:23px;height:23px;color:#315B98}
.chips{gap:1rem}
.chip{
  min-width:104px;
  min-height:46px;
  border-radius:8px;
  color:#07183F;
  background:#FFFFFF;
  border-color:#E1E7F1;
  box-shadow:0 6px 16px rgba(10,26,58,.06);
  font-weight:700;
}
.chip.active{
  background:linear-gradient(180deg,#08285D,#04183A);
  color:#fff;
  border-color:#092D66;
  box-shadow:0 10px 20px rgba(5,25,62,.22);
}

/* grupos y tarjetas del tablero */
.group{margin-bottom:1.12rem}
.group-head{
  margin-bottom:.55rem;
  font:800 .92rem/1.2 var(--font-brand);
  letter-spacing:.03em;
}
.group-head .ic{width:22px;height:22px}
.group-head .count{
  background:transparent;
  color:inherit;
  padding-left:.65rem;
  font-weight:800;
}
.cards{gap:.95rem}
.ucard{
  min-height:118px;
  border-radius:9px;
  padding:1rem 1.1rem 1rem 1.25rem;
  gap:1.25rem;
  box-shadow:0 9px 23px rgba(10,26,58,.08),0 1px 2px rgba(10,26,58,.08);
}
.ucard::before{width:4px}
.ucard.sem-rojo{
  background:linear-gradient(90deg,#FFE9EA 0%,#FFF7F7 62%,#FFFFFF 100%);
  border-color:#FFB8B8;
}
.ucard.sem-amarillo{
  background:linear-gradient(90deg,#FFF1DD 0%,#FFF9F1 62%,#FFFFFF 100%);
  border-color:#FFD79D;
}
.ucard.sem-verde{
  background:linear-gradient(90deg,#E9FBF2 0%,#F6FFFA 68%,#FFFFFF 100%);
  border-color:#B9E8CF;
}
.ucard.sem-gris{
  background:linear-gradient(90deg,#F5F8FC 0%,#FFFFFF 100%);
  border-color:#DDE6F2;
}
.uc-id{min-width:185px}
.uc-id-top .unit{
  color:#07183F;
  font-size:1.32rem;
  font-weight:900;
}
.uc-id .muted{color:#334A6D; font-weight:500}
.uc-info,.uc-trip{
  align-self:stretch;
  justify-content:center;
  border-left:1px solid rgba(124,146,178,.25);
  padding-left:1.55rem;
}
.uc-info{min-width:210px}
.uc-trip{min-width:260px}
.uc-info .kv,.uc-trip .kv{
  color:#061840;
  font-weight:600;
}
.uc-trip .kv{color:#27415F}
.uc-actions{
  margin-left:auto;
  align-items:center;
}
.uc-actions .btn{
  min-width:126px;
  height:45px;
  border-radius:7px;
  font-weight:800;
}
.uc-actions .btn-checkin{
  background:linear-gradient(180deg,#072B64,#04183A);
  border-color:#04183A;
  box-shadow:0 9px 18px rgba(4,24,58,.22);
}
.ucard.sem-verde .btn-checkin{
  background:linear-gradient(180deg,#08B968,#07924F);
  border-color:#07924F;
  box-shadow:0 9px 18px rgba(9,168,91,.25);
}
.uc-menu{color:#061840; top:.8rem; right:.75rem}
.badge{
  border-radius:999px;
  font-size:.75rem;
  font-weight:800;
  text-transform:none;
}
.badge.sem-rojo{background:#FFECEF;color:#E20E18;border-color:#FFC9CE}
.badge.sem-amarillo{background:#FFF3DC;color:#E07A00;border-color:#FFDDA4}
.badge.sem-verde{background:#E9FAF1;color:#078844;border-color:#BBE9CE}
.badge.estatus{background:#DCEBFF;color:#0750A7;border-color:#BDD7FF}
.badge.carga{background:#F9FAFC;color:#2B5F31;border-color:#CBEAD4}
.badge.accion{background:#FFF2D8;color:#AE6500;border-color:#FFD79D}
.badge.estado-taller{background:#FFF0DB;color:#E07A00;border-color:#FFD9A2}
.badge.estado-sin_operador{background:#FFECEC;color:#E20E18;border-color:#FFC9CE}
.badge.estado-disponible{background:#E9FAF1;color:#078844;border-color:#BBE9CE}
.badge.tipo-inicio{background:#E9FAF1;color:#078844;border-color:#BBE9CE}
.badge.tipo-cierre{background:#FFECEC;color:#E20E18;border-color:#FFC9CE}
.badge.tipo-seguimiento{background:#F9FAFC;color:#5C6473;border-color:#E0DACC}

/* anillos */
.ring{width:64px;height:64px}
.ring svg{width:64px;height:64px}
.ring circle{stroke-width:5}
.ring .ring-bg{stroke:#EAF0F7}
.ring-rojo .ring-bg{stroke:#FFD6D6}
.ring-amarillo .ring-bg{stroke:#FFE1AF}
.ring-verde .ring-bg{stroke:#BCEBD2}
.ring-top{font-size:1.08rem;font-weight:900;color:#07183F}
.ring-bot{font-size:.62rem;font-weight:700;color:#07183F}

/* rail */
.donut{width:142px;height:142px}
.donut svg{width:142px;height:142px}
.donut circle{stroke-width:15}
.donut-pct{font-size:1.85rem;font-weight:900}
.donut-sub{font-size:.75rem;font-weight:800;color:#07183F}
.cumpl-top{gap:1.35rem}
.cumpl-side b{font-size:1.85rem;color:#07183F}
.stack{height:24px;border-radius:5px;background:#EEF2F7}
.mini3{border-top:1px solid #E2E9F2;padding-top:.8rem}
.mini3 .m-num{font-size:1.35rem}
.rs-row{padding:.55rem 0}
.ck-row{padding:.7rem 0}
.ck-unit{font-weight:900;color:#07183F}
.rail-btn{
  min-height:44px;
  border-radius:7px;
  font-weight:800;
}

/* lista de viajes */
.trip-list{gap:1rem}
.trip-card{
  min-height:126px;
  border-radius:10px;
  padding:1.05rem 1.15rem;
  box-shadow:0 9px 23px rgba(10,26,58,.08);
}
.trip-card.sem-rojo{background:linear-gradient(90deg,#FFF0F1,#FFFFFF);border-color:#FFB8B8}
.trip-card.sem-amarillo{background:linear-gradient(90deg,#FFF4E5,#FFFFFF);border-color:#FFD79D}
.trip-card.sem-verde{background:linear-gradient(90deg,#EFFFF6,#FFFFFF);border-color:#B9E8CF}
.trip-head .unit{font-size:1.28rem;font-weight:900;color:#07183F}
.trip-route b{font-weight:900}
.route-line{border-top-color:#D0B995}
.trip-actions .btn{
  height:43px;
  min-width:118px;
  justify-content:center;
  border-radius:7px;
  font-weight:800;
}

/* detalle de viaje */
.head-actions .btn{min-height:48px;border-radius:8px;padding:0 1.15rem}
.detail-layout .app-shell,.app-shell.detail-shell{
  grid-template-columns:minmax(0,1fr) 420px;
}
.route-banner{
  display:grid;
  grid-template-columns:1.2fr 52px 1.2fr 1fr 1.05fr;
  gap:0;
  align-items:center;
  min-height:122px;
  padding:1.15rem 1.35rem;
  background:#fff;
  border:1px solid var(--line);
  border-radius:11px;
  box-shadow:var(--shadow);
}
.rb-pt{
  min-height:70px;
  padding:0 1.2rem;
  border-right:1px solid #DDE6F2;
}
.rb-pt:first-child{padding-left:0}
.rb-pt:last-child{border-right:none}
.rb-pt small{
  color:#0B2A62;
  font-weight:800;
  font-size:.73rem;
}
.rb-pt b{font-size:1.05rem;font-weight:900;color:#07183F}
.rb-pt .rb-sub{
  display:block;
  margin-top:.18rem;
  color:#486080;
  font-weight:500;
}
.rb-big{
  width:36px;
  height:36px;
  color:#005CFF;
}
.rb-line{
  width:52px;
  border:0;
  color:#07183F;
  font-size:1.6rem;
  font-weight:900;
}
.fact-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  border-top:1px solid #DDE6F2;
  margin-top:1rem;
}
.fact{
  padding:1rem 1.15rem;
  border-right:1px solid #DDE6F2;
  border-bottom:1px solid #DDE6F2;
}
.fact:nth-child(3n){border-right:none}
.fact:nth-last-child(-n+3){border-bottom:none}
.fact-k{
  color:#0B2A62;
  font-size:.72rem;
  text-transform:uppercase;
  font-weight:800;
}
.fact-v{
  margin-top:.4rem;
  color:#07183F;
  font-weight:700;
}
.fact-list{
  display:flex;
  flex-direction:column;
  gap:.65rem;
}
.fact-list .fact{
  padding:.75rem 0;
  border-right:0;
  border-bottom:1px solid #DDE6F2;
}
.fact-list .fact:last-child{border-bottom:0}
.panel-title-icon{
  display:inline-grid;
  place-items:center;
  width:38px;
  height:38px;
  margin-right:.65rem;
  border-radius:7px;
  background:linear-gradient(180deg,#0B2A62,#061840);
  color:#fff;
  vertical-align:middle;
}
.panel-title-icon .ic{width:21px;height:21px}
h2:has(.panel-title-icon)::before{display:none}
.gps-operativo{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 1.7fr;
  gap:0;
  align-items:center;
  background:linear-gradient(90deg,#EFFFF6,#FFFFFF);
  border:1px solid #CDEEDB;
  border-radius:11px;
  overflow:hidden;
}
.gps-cell{
  min-height:88px;
  padding:1rem 1.2rem;
  border-right:1px solid #D4ECDD;
}
.gps-cell:last-child{border-right:none}
.gps-k{
  color:#0B2A62;
  font-size:.72rem;
  text-transform:uppercase;
  font-weight:800;
}
.gps-v{
  margin-top:.45rem;
  color:#07183F;
  font-weight:700;
}
.gps-v.ok,.gps-v.fresco{color:#078844}
.gps-v.retrasado{color:#b26300}
.gps-v.sin_reporte{color:var(--muted)}
.gps-chip{
  border:1px solid #d7e0ee;
  border-radius:999px;
  padding:.1rem .45rem;
  background:#f7f9fc;
  font-weight:700;
}
.gps-chip.fresco{
  color:#078844;
  border-color:#bde8d0;
  background:#effaf4;
}
.gps-chip.retrasado{
  color:#b26300;
  border-color:#f4d59e;
  background:#fff7e8;
}
.gps-map-meta{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  margin-top:.7rem;
  color:var(--muted);
  font-size:.82rem;
}
.gps-map-meta span{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}
.viaje-map{
  width:100%;
  height:360px;
  margin-top:1rem;
  border:1px solid #cfdced;
  border-radius:10px;
  overflow:hidden;
  background:#eaf1fb;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.7);
}
.viaje-map .leaflet-control-attribution{
  font-size:10px;
}
.route-marker{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:999px;
  background:#0b2a5b;
  color:#fff;
  border:3px solid #f6a400;
  box-shadow:0 8px 18px rgba(6,38,90,.28);
  font-size:.72rem;
  font-weight:900;
}
.route-marker.latest{
  background:#f6a400;
  color:#061c3d;
  border-color:#061c3d;
}
.route-marker.inicio{background:#1B6E47;border-color:#0d3d28;}
.route-marker.cierre{background:#A33232;border-color:#5c1a1a;color:#fff;}
.map-empty{
  min-height:210px;
  margin-top:1rem;
  border:1px dashed #cfdced;
  border-radius:10px;
  background:
    linear-gradient(135deg, rgba(0,95,255,.12) 0 2px, transparent 2px 80px),
    linear-gradient(90deg, rgba(6,38,90,.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(6,38,90,.06) 1px, transparent 1px),
    #f4f8ff;
  background-size:auto, 36px 36px, 36px 36px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:.45rem;
  text-align:center;
  color:#0b2a5b;
}
.map-empty b{
  font-size:1rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.map-empty small{
  max-width:520px;
  color:var(--muted);
}
.map-mini{
  position:relative;
  min-height:88px;
  margin:.5rem;
  border-radius:8px;
  overflow:hidden;
  border:1px solid #DDE6F2;
  background:
    linear-gradient(34deg,transparent 45%,rgba(0,115,255,.35) 46% 49%,transparent 50%),
    linear-gradient(155deg,transparent 42%,rgba(0,115,255,.28) 43% 46%,transparent 47%),
    linear-gradient(0deg,rgba(8,32,70,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(8,32,70,.05) 1px,transparent 1px),
    #F5FAFF;
  background-size:auto,auto,34px 34px,34px 34px,auto;
}
.map-pin{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:50%;
  background:#07183F;
  color:#fff;
  box-shadow:0 8px 20px rgba(7,24,63,.28);
}
.map-pin .ic{width:24px;height:24px}
.info-strip{
  display:grid;
  grid-template-columns:1.5fr 1fr 1fr 1fr;
  gap:0;
  background:linear-gradient(90deg,#F8F3FF,#FFFFFF);
}
.info-strip .fact{border-bottom:none}
.panel.center .ring{width:144px;height:144px}
.panel.center .ring svg{width:144px;height:144px}
.panel.center .ring circle{stroke-width:5.5}
.panel.center .ring-label{gap:2px; padding:0 14px}
.panel.center .ring-top{font-size:1.4rem; font-weight:800; white-space:nowrap; letter-spacing:-.02em}
.panel.center .ring-bot{font-size:.62rem; letter-spacing:.1em}

/* check-in inteligente */
.checkin-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:1.4rem;
  align-items:start;
}
.checkin-main{display:flex; flex-direction:column; gap:1rem}
.checkin-side{position:sticky; top:116px; display:flex; flex-direction:column; gap:1rem}
.gps-lock{
  border:1px solid #DDE6F2;
  border-radius:11px;
  overflow:hidden;
  background:linear-gradient(90deg,#F4F8FF,#FFFFFF);
}
.gps-lock-head{
  display:flex;
  gap:.9rem;
  align-items:center;
  padding:1rem 1.15rem;
  border-bottom:1px solid #DDE6F2;
}
.gps-lock-head b{display:block; font-size:1.05rem}
.gps-lock-head span{display:block; color:var(--muted); font-size:.86rem}
.gps-lock-icon{
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border-radius:11px;
  background:#EEF3FA;
  color:#07183F;
}
.gps-lock-icon .ic{width:27px;height:27px}
.gps-lock-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.gps-lock-grid div{
  min-height:74px;
  padding:.85rem 1rem;
  border-right:1px solid #DDE6F2;
}
.gps-lock-grid div:last-child{border-right:none}
.gps-lock-grid small{
  display:block;
  color:#0B2A62;
  text-transform:uppercase;
  font-size:.68rem;
  font-weight:800;
}
.gps-lock-grid b{
  display:block;
  margin-top:.35rem;
  color:#07183F;
}
.seg-strong .seg-opt span{
  min-width:136px;
  text-align:center;
}
.action-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.55rem;
  margin-bottom:1rem;
}
.action-opt input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.action-opt span{
  min-height:64px;
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.75rem .8rem;
  border:1px solid #DDE6F2;
  border-radius:9px;
  background:#FFFFFF;
  color:#07183F;
  cursor:pointer;
  box-shadow:0 5px 14px rgba(10,26,58,.05);
  transition:.14s;
}
.action-opt span .ic{color:#315B98}
.action-opt:hover span{border-color:#9DB6D8; transform:translateY(-1px)}
.action-opt input:checked + span{
  background:linear-gradient(180deg,#08285D,#04183A);
  color:#FFFFFF;
  border-color:#04183A;
  box-shadow:0 10px 22px rgba(5,25,62,.22);
}
.action-opt input:checked + span .ic{color:#FFA70B}
.check-toggle{
  display:flex;
  align-items:center;
  gap:.7rem;
  margin:0 0 1rem;
  cursor:pointer;
}
.check-toggle input{width:18px;height:18px}
.check-toggle span{
  display:flex;
  align-items:center;
  gap:.45rem;
  padding:.65rem .85rem;
  border:1px solid #FFD0D0;
  border-radius:9px;
  background:#FFF4F4;
  color:#B30D14;
  font-weight:800;
}
.tl-operativo{
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
  margin:.45rem 0 .25rem;
}
.tl-location{
  display:flex;
  align-items:center;
  gap:.35rem;
  color:#07183F;
  font-weight:800;
  margin:.25rem 0;
}
.tl-next{
  display:flex;
  flex-direction:column;
  gap:.15rem;
  margin:.3rem 0;
}

/* ---------- user pill (topbar) ---------- */
.user-pill{
  display:flex; align-items:center; gap:.55rem;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16);
  border-radius:10px; padding:.4rem .9rem .4rem .75rem;
  color:#E8EEF9; font-size:.88rem; font-weight:600;
}
.user-pill .ic{width:20px;height:20px; color:rgba(255,255,255,.6)}
.rol-badge{
  padding:.18rem .55rem; border-radius:20px; font-size:.72rem;
  font-weight:800; text-transform:uppercase; letter-spacing:.05em;
}
.rol-badge.jefe{background:rgba(245,179,43,.22); color:#FFD97A; border:1px solid rgba(245,179,43,.35)}
.rol-badge.subjefe{background:rgba(36,149,255,.18); color:#A9D7FF; border:1px solid rgba(96,178,255,.32)}
.rol-badge.monitorista{background:rgba(255,255,255,.1); color:#C8D6EE; border:1px solid rgba(255,255,255,.18)}
.btn-logout{
  background:transparent; border:none; cursor:pointer; padding:.15rem;
  color:rgba(255,255,255,.5); line-height:1; border-radius:6px;
  transition:.12s;
}
.btn-logout:hover{color:#fff; background:rgba(255,255,255,.12)}
.btn-logout .ic{width:16px;height:16px;vertical-align:-2px}

/* ---------- login page ---------- */
body.login-page{
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(49,76,116,.55), transparent 65%),
    radial-gradient(700px 420px at 8% 108%, rgba(196,154,58,.14), transparent 60%),
    linear-gradient(128deg,#041635 0%,#072354 52%,#031231 100%);
}
.login-shell{
  min-height:100vh; min-height:100dvh;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:1.6rem; padding:2.5rem 1rem;
}
.login-brand img{height:76px; width:auto; display:block; filter:drop-shadow(0 6px 18px rgba(0,0,0,.35))}
.login-card{
  width:100%; max-width:420px; background:var(--panel);
  border:1px solid rgba(255,255,255,.08); border-radius:18px;
  box-shadow:0 24px 60px rgba(2,10,28,.45), 0 4px 14px rgba(2,10,28,.28);
  padding:2.5rem 2.6rem 2.1rem;
}
.login-card h1{font-size:1.7rem; margin:0 0 .2rem}
.login-card .sub{margin:0 0 1.7rem; font-size:.93rem}
.login-card .flash{margin-bottom:1.2rem}

.login-field{margin-bottom:1.15rem}
.login-field label{
  display:block; margin-bottom:.4rem;
  color:var(--txt); font-size:.85rem; font-weight:600; letter-spacing:.01em;
}
.login-field input{
  width:100%; height:48px; padding:0 .95rem;
  border:1px solid var(--line2); border-radius:11px;
  background:var(--bg2); color:var(--txt);
  font:inherit; font-size:.95rem; outline:none;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.login-field input::placeholder{color:var(--dim)}
.login-field input:hover{border-color:#B9B1A0}
.login-field input:focus{
  border-color:var(--brand); background:var(--panel);
  box-shadow:0 0 0 3.5px rgba(27,58,107,.14);
}
.login-field input:-webkit-autofill{
  -webkit-box-shadow:0 0 0 100px var(--bg2) inset;
  -webkit-text-fill-color:var(--txt);
}
.login-pass{position:relative}
.login-pass input{padding-right:3rem}
.pass-toggle{
  position:absolute; top:50%; right:.5rem; transform:translateY(-50%);
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border:none; border-radius:9px;
  background:transparent; color:var(--dim); cursor:pointer;
  transition:.12s;
}
.pass-toggle:hover{color:var(--brand); background:rgba(27,58,107,.07)}
.pass-toggle svg{width:19px; height:19px}
.pass-toggle .eye-off{display:none}
.pass-toggle.on .eye{display:none}
.pass-toggle.on .eye-off{display:block}

.login-submit{
  display:flex; align-items:center; justify-content:center; gap:.55rem;
  width:100%; height:50px; margin-top:1.5rem;
  border:none; border-radius:11px; cursor:pointer;
  background:var(--brand-grad); color:var(--cream);
  font:inherit; font-size:1rem; font-weight:700; letter-spacing:.01em;
  box-shadow:0 4px 14px rgba(22,48,79,.35);
  transition:transform .12s, box-shadow .12s, filter .12s;
}
.login-submit svg{width:18px; height:18px; transition:transform .15s}
.login-submit:hover{filter:brightness(1.12); box-shadow:0 6px 20px rgba(22,48,79,.45); transform:translateY(-1px)}
.login-submit:hover svg{transform:translateX(3px)}
.login-submit:active{transform:translateY(0); filter:brightness(.98)}
.login-submit:focus-visible{outline:3px solid rgba(196,154,58,.55); outline-offset:2px}

.login-help{
  margin-top:1.6rem; padding-top:1.3rem;
  border-top:1px solid var(--line);
  color:var(--muted); font-size:.83rem; text-align:center;
}
.login-foot{color:rgba(255,255,255,.45); font-size:.78rem; margin:0; text-align:center}

@media(max-width:480px){
  .login-card{padding:1.9rem 1.5rem 1.6rem; border-radius:15px}
  .login-brand img{height:60px}
}

/* ---------- admin table ---------- */
.admin-table-wrap{overflow-x:auto}
.admin-table{width:100%; border-collapse:collapse; font-size:.9rem}
.admin-table th{
  text-align:left; padding:.65rem .9rem; border-bottom:2px solid var(--line);
  color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; font-weight:700;
}
.admin-table td{padding:.7rem .9rem; border-bottom:1px solid var(--line); vertical-align:middle}
.admin-table tr:last-child td{border-bottom:none}
.admin-table tr:hover td{background:var(--bg2)}
.admin-table .actions{display:flex; gap:.4rem}
.admin-table .actions form{margin:0}
.badge.disponible{background:#E9FAF1;color:#078844;border:1px solid #BBE9CE}
.badge.en_viaje{background:#DCEBFF;color:#0750A7;border:1px solid #BDD7FF}
.badge.taller{background:#FFF6E8;color:#B5731C;border:1px solid #FFE1B3}
.badge.mantenimiento{background:#FFF6E8;color:#B5731C;border:1px solid #FFE1B3}
.badge.baja{background:#FBEAEA;color:#A33232;border:1px solid #F0CFCF}
.badge.sin_operador{background:#EFEDE6;color:#6E7585;border:1px solid #D8D5CB}
.bool-yes{color:var(--verde);font-weight:700}
.bool-no{color:var(--dim)}

/* ---------- terminar viaje btn ---------- */
.btn-danger{
  background:linear-gradient(180deg,#E53935,#C62828);
  color:#fff; border-color:#B71C1C;
  box-shadow:0 6px 16px rgba(197,40,40,.22);
}
.btn-danger:hover{background:linear-gradient(180deg,#EF5350,#D32F2F)}

@media(max-width:1180px){
  .topbar{padding:0 22px}
  .topbar nav{margin-left:24px;padding-left:18px;gap:8px}
  .nav-link{min-width:104px;padding:0 16px}
  .container{padding:26px 26px 2rem}
  .app-shell,.app-shell.detail-shell{grid-template-columns:1fr}
  .rail{position:static}
}
@media(max-width:820px){
  .topbar{min-height:auto;padding:14px 16px;gap:12px}
  .logo img{height:48px}
  .topbar nav{order:3;width:100%;margin:0;padding:10px 0 0;border-left:0;justify-content:space-between}
  .nav-link{height:46px;min-width:0;flex:1}
  .topbar-right{margin-left:auto}
  .topclock{display:none}
  .stats{grid-template-columns:repeat(2,1fr)}
  .chips{width:100%;gap:.5rem}
  .chip{flex:1;min-width:0}
  .route-banner,.gps-operativo,.info-strip,.fact-grid{grid-template-columns:1fr}
  .rb-pt,.gps-cell,.fact{border-right:none;border-bottom:1px solid #DDE6F2}
  .rb-line{display:none}
  .checkin-layout{grid-template-columns:1fr}
  .checkin-side{position:static}
  .gps-lock-grid,.action-grid{grid-template-columns:1fr}
  .gps-lock-grid div{border-right:none;border-bottom:1px solid #DDE6F2}
  .hub-grid{grid-template-columns:1fr}
}

/* =====================================================================
   Sprint 2 additions
   ===================================================================== */

/* --- admin hub cards --- */
.hub-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:1.1rem; margin-top:.5rem}
.hub-card{
  display:flex; align-items:flex-start; gap:1rem;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:1.4rem 1.4rem;
  min-height:88px;
  text-decoration:none; color:var(--txt);
  transition:box-shadow .18s, border-color .18s;
}
.hub-card:hover{box-shadow:var(--shadow-lg); border-color:var(--gold); text-decoration:none}
.hub-card.hub-card-disabled{opacity:.6; cursor:default}
.hub-card.hub-card-disabled:hover{box-shadow:none; border-color:var(--line)}
.hub-card.hub-card-disabled .hub-icon{background:var(--muted)}
.hub-section-title{margin:1.6rem 0 .3rem; font-size:1.02rem; display:flex; align-items:center; gap:.4rem}
.hub-section-title:first-of-type{margin-top:.4rem}
.hub-icon{width:2.6rem; height:2.6rem; border-radius:50%;
  background:var(--brand); color:#fff;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.hub-icon .ic{width:22px; height:22px; vertical-align:middle}
.hub-title{font-weight:700; font-size:.97rem; margin-bottom:.25rem}
.hub-desc{font-size:.84rem; color:var(--muted)}
.hub-body{min-width:0}
.catalog-directory-toolbar{
  display:flex; align-items:flex-end; justify-content:space-between; gap:1rem;
  margin:.85rem 0 1.1rem; padding:.8rem .9rem;
  border:1px solid var(--line); border-radius:6px; background:#fff;
}
.catalog-directory-toolbar label{display:flex; flex:1; max-width:620px; flex-direction:column; gap:.35rem; color:#51627A; font-size:.7rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase}
.catalog-search-control{display:flex; align-items:center; gap:.5rem; min-height:38px; padding:0 .65rem; border:1px solid #C3CDDA; border-radius:4px; background:#fff; color:#61738E}
.catalog-search-control:focus-within{border-color:#2D6CBB; box-shadow:0 0 0 2px rgba(45,108,187,.12)}
.catalog-search-control input{width:100%; min-width:0; height:34px; padding:0; border:0; outline:0; background:transparent; box-shadow:none; font-size:.82rem; text-transform:none}
.catalog-directory-count{display:flex; align-items:baseline; gap:.35rem; color:#697991; white-space:nowrap}
.catalog-directory-count strong{color:var(--navy); font-size:1.35rem}
.catalog-directory-count span{font-size:.72rem}
.catalog-group[hidden],.hub-card[hidden]{display:none!important}
.catalog-empty{margin-top:1rem}
@media(max-width:760px){
  .catalog-directory-toolbar{align-items:stretch; flex-direction:column}
  .catalog-directory-toolbar label{max-width:none}
  .catalog-directory-count{justify-content:flex-end}
}

/* --- worklist (expedientes por liquidar) — L1A --- */
.worklist{margin-top:.6rem}
.worklist-card{
  display:flex; flex-direction:column; gap:.5rem;
  background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:1rem 1.1rem;
}
.worklist-card .wl-head{display:flex; align-items:flex-start; justify-content:space-between; gap:.6rem}
.worklist-card .wl-id{font-size:1.02rem}
.worklist-card .wl-route{font-weight:600}
.worklist-card .wl-metrics{display:flex; flex-wrap:wrap; gap:.4rem 1.2rem; font-size:.86rem}
.worklist-card .wl-metrics .wl-k{display:block; color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.03em}
.worklist-card .wl-actions{display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.3rem}
.worklist-card .wl-actions form{margin:0}
.worklist-card .amber{color:#B5731C}

.worklist-card .wl-open{width:100%; justify-content:center; margin-top:.2rem}

/* --- chips de etapa (cola de liquidacion) --- */
.stage-chips{display:flex; flex-wrap:wrap; gap:.5rem; margin:0 0 1rem}
.stage-chip{display:inline-flex; align-items:center; gap:.35rem; padding:.35rem .7rem;
  border:1px solid var(--line); border-radius:999px; background:var(--panel);
  font-size:.82rem; color:var(--muted)}
.stage-chip b{color:var(--txt)}
.stage-chip.on{border-color:var(--gold); color:var(--txt)}

/* --- archivo de liquidadas (colapsable) --- */
.liq-archive{margin-top:1rem}
.liq-archive-head{cursor:pointer; list-style:none; display:flex; align-items:center; gap:.6rem}
.liq-archive-head::-webkit-details-marker{display:none}
.liq-archive-head h2{margin:0}

/* --- stepper de etapa de liquidacion --- */
.liq-steps{display:flex; align-items:center; flex-wrap:wrap; gap:.4rem;
  margin:.2rem 0 1rem; padding:.65rem .9rem;
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius)}
.liq-step{display:inline-flex; align-items:center; gap:.45rem; color:var(--muted); font-size:.88rem}
.liq-step .liq-dot{width:1.55rem; height:1.55rem; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  border:2px solid var(--line); font-size:.78rem; font-weight:700; flex:0 0 auto}
.liq-step.current{color:var(--txt); font-weight:700}
.liq-step.current .liq-dot{border-color:var(--gold); background:var(--gold); color:#1b2430}
.liq-step.done{color:var(--txt)}
.liq-step.done .liq-dot{border-color:var(--verde, #2E7D32); background:var(--verde, #2E7D32); color:#fff}
.liq-sep{flex:0 0 2.2rem; height:2px; background:var(--line); border-radius:2px}
.liq-sep.done{background:var(--verde, #2E7D32)}
.liq-steps .amber{color:#B5731C}

/* --- expediente integral de liquidación / rentabilidad operativa --- */
.liquidacion-route-summary{margin-bottom:12px}
.profit-grid{
  display:grid;
  grid-template-columns:minmax(145px,1fr) auto minmax(145px,1fr) auto minmax(145px,1fr) auto minmax(175px,1.15fr);
  align-items:stretch;
  gap:8px;
  margin-top:12px;
}
.profit-card{
  display:flex;
  min-width:0;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:15px;
  border:1px solid #D7E0EC;
  border-radius:8px;
  background:#F8FAFD;
}
.profit-card span{font-size:.7rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:#65758E}
.profit-card b{font-size:1.3rem;color:#061840;white-space:nowrap}
.profit-card small{font-size:.72rem;color:#718099;line-height:1.3}
.profit-card.income{border-top:3px solid #0B63E5;background:#F4F8FF}
.profit-card.cost{border-top:3px solid #8390A4}
.profit-card.result{border-top:3px solid #E69A00;background:#FFF9EA}
.profit-card.result.rentable{border-color:#16834F;background:#F0FBF5}
.profit-card.result.no_rentable{border-color:#C13B3B;background:#FFF5F5}
.profit-sign{display:flex;align-items:center;justify-content:center;font-size:1.25rem;font-weight:900;color:#8290A4}
.liq-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.liq-capture-card,.liq-readiness-card{padding:14px;border:1px solid var(--line);border-radius:8px;background:#fff}
.liq-capture-card h3,.liq-readiness-card h3{margin:0 0 10px;font-size:.9rem;color:#061840}
.income-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.income-form .field{flex:1;min-width:210px;margin:0}
.liq-checklist{list-style:none;margin:0;padding:0;display:grid;gap:8px;font-size:.82rem}
.liq-checklist li{display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:6px;background:#F5F7FA;color:#5E6D83}
.liq-checklist li.ok{background:#EDF9F2;color:#146C43}
.liq-checklist li.pending{background:#FFF8EA;color:#8A5A0A}
.operator-pay-box{margin-top:16px;padding:14px;border:1px solid var(--line);border-left:3px solid var(--gold);border-radius:8px;background:#FAFCFF}
.operator-pay-box h3{margin:0 0 4px}
.operator-pay-box [hidden]{display:none!important}
.operator-pay-config{
  margin:0 0 18px;
  padding:16px;
  border:1px solid #C9D8EC;
  border-left:4px solid #0B63E5;
  border-radius:9px;
  background:#F7FAFE;
}
.operator-pay-config.is-missing{border-color:#E8C675;border-left-color:#E69A00;background:#FFFBF1}
.operator-pay-config-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.operator-pay-config-head h3{margin:2px 0 4px;color:#061840;font-size:1rem}
.operator-pay-config-head p{margin:0;color:var(--muted);font-size:.78rem}
.operator-pay-kicker{color:#315B98;font-size:.66rem;font-weight:900;letter-spacing:.07em;text-transform:uppercase}
.operator-pay-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
.operator-pay-form-grid .field{margin:0}
.operator-pay-form-grid [hidden]{display:none!important}
.operator-pay-config-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:12px;border-top:1px solid #D8E2F1}
.liq-checklist li .btn{margin-left:auto}
.close-readiness li .btn{margin-left:6px;vertical-align:middle}
.erp-doc-tabs.liquidacion-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
.erp-doc-tabs.liquidacion-tabs button{flex:0 0 auto;padding-inline:7px;gap:4px;font-size:.72rem}
.operator-settlement-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:10px;align-items:stretch;margin:4px 0 16px}
.operator-settlement-summary>div{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--line);border-radius:7px;background:#F8FAFD}
.operator-settlement-summary span{font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:800}
.operator-settlement-summary small{color:var(--muted);font-size:.7rem;line-height:1.3}
.operator-settlement-summary>.btn{align-self:center}
.close-readiness{margin:12px 0;padding:12px 14px;border-radius:7px;border:1px solid var(--line)}
.close-readiness.is-ready{background:#EDF9F2;border-color:#A9DCC2;color:#146C43}
.close-readiness.is-blocked{background:#FFF8EA;border-color:#F0D49C;color:#7B520B}
.close-readiness ul{margin:7px 0 0;padding-left:20px;font-size:.8rem;line-height:1.55}
.profit-positive{color:#16834F}.profit-negative{color:#C13B3B}

@media (max-width:1100px){
  .profit-grid{grid-template-columns:1fr 1fr}
  .profit-sign{display:none}
  .operator-settlement-summary{grid-template-columns:1fr 1fr}
}
@media (max-width:700px){
  .profit-grid,.liq-summary-grid,.operator-settlement-summary{grid-template-columns:1fr}
  .profit-card b{font-size:1.16rem}
  .income-form{display:block}
  .income-form .btn{width:100%;justify-content:center;margin-top:8px}
  .operator-pay-form-grid{grid-template-columns:1fr}
  .operator-pay-config-head,.operator-pay-config-actions{align-items:stretch;flex-direction:column}
  .operator-pay-config-actions .btn{width:100%;justify-content:center}
}

/* --- hint de siguiente paso (flujo conectado) --- */
.next-hint{display:flex; align-items:center; gap:.55rem; flex-wrap:wrap;
  margin-top:.9rem; padding:.65rem .85rem; font-size:.88rem;
  border:1px solid var(--line); border-left:3px solid var(--gold);
  border-radius:var(--radius); background:rgba(0,0,0,.02)}
.next-hint .btn{margin-left:auto}

/* --- acciones dentro del encabezado de panel --- */
.panel-actions{display:flex; align-items:center; gap:.45rem; flex-wrap:wrap}
.panel-actions form{margin:0}

/* --- pop-up "¿Qué vas a registrar?" (3 tipos financieros) — L1B --- */
.gasto-modal{
  border:1px solid var(--line); border-radius:var(--radius);
  padding:0; width:min(460px, calc(100vw - 2rem));
  background:var(--panel); color:var(--txt);
  box-shadow:var(--shadow-lg);
}
.gasto-modal::backdrop{background:rgba(10,16,28,.55)}
.gasto-modal .gm-head{
  display:flex; align-items:center; justify-content:space-between; gap:.8rem;
  padding:.9rem 1.1rem; border-bottom:1px solid var(--line); font-size:1rem;
}
.gasto-modal .gm-close{
  background:none; border:1px solid var(--line); border-radius:8px;
  padding:.25rem .5rem; cursor:pointer; color:var(--muted);
}
.gasto-modal .gm-close:hover{border-color:var(--gold); color:var(--txt)}
.gasto-modal .gm-options{display:flex; flex-direction:column; gap:.55rem; padding:1rem 1.1rem 1.2rem}
.gasto-modal .gm-opt{
  display:flex; align-items:center; gap:.85rem;
  padding:.85rem .95rem; border:1px solid var(--line); border-radius:var(--radius);
  text-decoration:none; color:var(--txt);
  transition:border-color .15s, box-shadow .15s;
}
.gasto-modal .gm-opt:hover{border-color:var(--gold); box-shadow:var(--shadow-lg); text-decoration:none}
.gasto-modal .gm-ic{
  width:2.4rem; height:2.4rem; border-radius:50%; flex:0 0 auto;
  background:var(--brand); color:#fff;
  display:inline-flex; align-items:center; justify-content:center;
}
.gasto-modal .gm-txt{display:flex; flex-direction:column; gap:.1rem}
.gasto-modal .gm-txt small{color:var(--muted)}

/* --- casetas: tabla especializada + captura manual/importacion CSV --- */
.caseta-modal{
  width:min(760px,calc(100vw - 2rem));
  max-height:min(90vh,820px);
  overflow:auto;
}
.caseta-modal form{margin:0}
.caseta-modal .gm-head > div{display:flex; flex-direction:column; gap:.15rem}
.caseta-modal .gm-head small{color:var(--muted); font-size:.76rem; font-weight:600}
.caseta-form-body{padding:1rem 1.1rem .2rem}
.caseta-form-actions{
  display:flex;
  justify-content:flex-end;
  gap:.6rem;
  padding:.85rem 1.1rem 1rem;
  border-top:1px solid var(--line);
  background:#F8FAFD;
}
.caseta-file-field input[type="file"]{
  width:100%;
  margin-top:.4rem;
  padding:.75rem;
  border:1px dashed var(--line2);
  border-radius:8px;
  background:#F8FAFD;
}
.caseta-import-guide{
  margin:.2rem 0 1rem;
  padding:.85rem .95rem;
  border:1px solid #D8E2F1;
  border-radius:8px;
  background:#F7FAFE;
  color:var(--muted);
  font-size:.8rem;
}
.caseta-import-guide > b{display:block; margin-bottom:.45rem; color:var(--txt)}
.caseta-import-guide code{
  display:block;
  padding:.55rem .65rem;
  border-radius:6px;
  background:#EAF0F8;
  color:#243753;
  white-space:normal;
  overflow-wrap:anywhere;
}
.caseta-import-guide ul{margin:.7rem 0 0; padding-left:1.1rem}
.caseta-import-guide li + li{margin-top:.28rem}
.casetas-summary{
  display:grid;
  grid-template-columns:140px 190px minmax(260px,1fr);
  align-items:center;
  gap:0;
  margin:0 0 14px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#F8FAFD;
  overflow:hidden;
}
.casetas-summary > div{padding:.65rem .8rem; border-right:1px solid var(--line)}
.casetas-summary span{display:block; color:var(--muted); font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em}
.casetas-summary b{display:block; margin-top:.16rem; color:var(--erp-ink); font-size:.92rem}
.casetas-summary p{margin:0; padding:.65rem .85rem; color:var(--muted); font-size:.76rem}
.casetas-table{min-width:1460px}
.casetas-table .mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.78rem}
.casetas-empty{
  display:flex;
  align-items:center;
  gap:.8rem;
  min-height:92px;
  padding:1rem;
  border:1px dashed var(--line2);
  border-radius:8px;
  background:#FBFCFE;
}
.casetas-empty b{display:block; color:var(--erp-ink)}
.casetas-empty p{margin:.2rem 0 0; color:var(--muted); font-size:.82rem}
@media(max-width:720px){
  .casetas-summary{grid-template-columns:1fr 1fr}
  .casetas-summary p{grid-column:1 / -1; border-top:1px solid var(--line)}
}

/* --- subtitulo de bloque dentro de panel --- */
.sub-block-title{margin:1.2rem 0 .45rem; font-size:.95rem; display:flex; align-items:center; gap:.4rem; flex-wrap:wrap}

/* --- evidencias: archivos reales de respaldo por gasto/cargo — v3 L2 --- */
.evidence-group{
  margin:0 0 1rem; padding:.75rem .9rem; border:1px solid var(--line); border-radius:var(--radius);
}
.evidence-group-head{
  display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-bottom:.5rem;
}
.evid-file{
  display:flex; align-items:center; gap:.6rem; flex-wrap:wrap;
  padding:.4rem 0; border-bottom:1px solid var(--line);
}
.evid-file:last-child{border-bottom:none}
.evid-file.is-cancelled{opacity:.6}
.evidence-upload-form{display:flex; align-items:center; gap:.5rem; margin-top:.5rem; flex-wrap:wrap}

.trip-evidence-upload{
  margin:.9rem 0 1rem;
  padding:1rem;
  border:1px solid #D8E2F1;
  border-radius:10px;
  background:#F7FAFE;
}
.trip-evidence-upload-head{display:flex; align-items:center; gap:.7rem; margin-bottom:.85rem}
.trip-evidence-upload-head > div{display:flex; flex-direction:column; gap:.1rem}
.trip-evidence-upload-head small{color:var(--muted); font-size:.76rem}
.trip-evidence-form-grid{
  display:grid;
  grid-template-columns:minmax(145px,.7fr) minmax(240px,1.5fr) minmax(260px,1.3fr);
  align-items:end;
  gap:.7rem;
}
.trip-evidence-form-grid .field{margin:0}
.trip-evidence-file input[type="file"]{
  width:100%;
  padding:.54rem .62rem;
  border:1px dashed var(--line2);
  border-radius:7px;
  background:#fff;
}
.trip-evidence-submit{min-height:40px; white-space:nowrap}
.standard-save-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}
.page-save-actions{margin-top:.2rem}
.trip-evidence-submit{grid-column:1 / -1;align-self:end;justify-self:end}
.save-contract-note{
  display:flex;align-items:flex-start;gap:.55rem;
  margin:0 0 .85rem;padding:.62rem .75rem;
  border:1px solid #C9DCF6;border-radius:7px;background:#F2F7FE;
  color:#28507F;font-size:.77rem;line-height:1.4;
}
.save-contract-note>div{display:flex;flex-direction:column;gap:.08rem}
.save-contract-note b{color:#123A68}
.pill.saved{background:#E8F2FF;color:#1257A6;border-color:#BFD8F7}
.trip-evidence-help{margin:.55rem 0 0}
.trip-evidence-list{display:grid; gap:.65rem; margin-top:.8rem}
.trip-evidence-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:.8rem;
  padding:.8rem .9rem;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
}
.trip-evidence-card.is-cancelled{opacity:.62; background:#F7F7F7}
.trip-evidence-icon{
  width:2.25rem; height:2.25rem; border-radius:8px;
  display:inline-flex; align-items:center; justify-content:center;
  background:#E9F0FA; color:var(--brand);
}
.trip-evidence-main{min-width:0}
.trip-evidence-title{display:flex; align-items:center; gap:.45rem; flex-wrap:wrap}
.trip-evidence-title b{overflow-wrap:anywhere}
.trip-evidence-main p{margin:.28rem 0; color:var(--txt); font-size:.82rem}
.trip-evidence-main small{display:block; color:var(--muted)}
.trip-evidence-main > .pill{display:inline-flex; margin-top:.4rem}
.trip-evidence-actions{display:flex; align-items:center; justify-content:flex-end; gap:.4rem; flex-wrap:wrap}
.trip-evidence-actions form{margin:0}
@media(max-width:980px){
  .trip-evidence-form-grid{grid-template-columns:1fr 1fr}
  .trip-evidence-submit{justify-self:start}
}
@media(max-width:640px){
  .trip-evidence-form-grid{grid-template-columns:1fr}
  .standard-save-actions{width:100%}
  .standard-save-actions .btn{flex:1;justify-content:center}
  .trip-evidence-card{grid-template-columns:auto minmax(0,1fr)}
  .trip-evidence-actions{grid-column:1 / -1; justify-content:flex-start}
}

/* --- selector de permisos por modulo — L1A --- */
.perm-section-title{font-size:1rem; margin:1.3rem 0 .4rem}
.perm-table td{vertical-align:middle}
.perm-select{width:100%; min-width:110px; padding:.35rem .45rem; border:1px solid var(--line);
  border-radius:8px; background:var(--panel); color:var(--txt); font-size:.85rem}

/* --- finalizar operacion dentro de tracking — L1A --- */
.track-finalizar{display:flex; align-items:center; gap:.7rem; flex-wrap:wrap;
  margin:.4rem 0 1rem; padding:.7rem .9rem; border:1px solid var(--line);
  border-radius:var(--radius); background:rgba(0,0,0,.02)}
.track-finalizar[open]{display:block; border-color:#E5BD64; background:#FFFCF5}
.track-finalizar > summary{
  cursor:pointer; display:inline-flex; align-items:center; gap:.4rem; list-style:none;
  font-weight:800; color:var(--brand); user-select:none;
}
.track-finalizar > summary::-webkit-details-marker{display:none}
.track-finalizar[open] > summary{margin-bottom:.8rem}
.track-finalizar form{margin:0; width:100%}
.track-close-grid{display:grid; grid-template-columns:1.35fr .8fr 1.2fr; gap:.7rem; align-items:end}
.track-close-grid .field{margin:0}
.track-close-description{grid-column:1 / -1}
.track-close-confirmations{
  display:grid; gap:.55rem; margin-top:.85rem; padding:.75rem;
  border:1px solid #D7E2F0; border-radius:9px; background:#F7FAFE;
}
.track-close-confirmations-head{display:flex; align-items:baseline; gap:.5rem; flex-wrap:wrap}
.track-close-confirmations-head small{color:var(--muted)}
.track-close-confirmations .check-toggle{margin:0; background:#fff}
.track-close-actions{display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; margin-top:.8rem}
.track-close-actions .muted{flex:1; min-width:220px}
.btn:disabled{opacity:.48; cursor:not-allowed; filter:grayscale(.25); box-shadow:none}

.checkin-evidence-panel input[type="file"],
.track-close-grid input[type="file"],
.tracking-evidence-file-input input[type="file"]{
  width:100%; padding:.54rem .62rem; border:1px dashed var(--line2);
  border-radius:7px; background:#fff;
}

.tracking-evidence-list{display:grid; gap:.4rem; margin:.55rem 0}
.tracking-evidence-file{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.5rem;
  padding:.48rem .55rem; border:1px solid #D8E2F1; border-radius:7px; background:#F7FAFE;
}
.tracking-evidence-file.is-cancelled{opacity:.62}
.tracking-evidence-file b,.tracking-evidence-file small{display:block; overflow-wrap:anywhere}
.tracking-evidence-file small{color:var(--muted); margin-top:.08rem}
.tracking-evidence-add{margin:.55rem 0}
.tracking-evidence-add > summary{
  cursor:pointer; display:inline-flex; align-items:center; gap:.3rem; list-style:none;
  color:var(--brand); font-size:.8rem; font-weight:800;
}
.tracking-evidence-add > summary::-webkit-details-marker{display:none}
.tracking-evidence-add form{
  display:grid; gap:.5rem; margin-top:.55rem; padding:.65rem;
  border:1px solid var(--line); border-radius:8px; background:#FAFBFD;
}
.tracking-evidence-add .field{margin:0}

.liquidacion-double-check{
  display:flex; align-items:center; justify-content:space-between; gap:.75rem;
  margin:.7rem 0 .45rem; padding:.75rem .85rem; border:1px solid var(--line);
  border-radius:9px; background:#F8FAFC;
}
.liquidacion-double-check.is-ok{border-color:#BFE3CD; background:#F0FDF4}
.liquidacion-double-check.is-pending{border-color:#F1D2A1; background:#FFF8EB}
.liquidacion-double-check b,.liquidacion-double-check small{display:block}
.liquidacion-double-check small{margin-top:.2rem; color:var(--muted)}

@media(max-width:900px){.track-close-grid{grid-template-columns:1fr}}

/* --- prioridad badges --- */
.badge.prioridad-normal{background:#E8F5E9; color:#2E7D32}
.badge.prioridad-alta{background:#FFF3E0; color:#E65100}
.badge.prioridad-critica{background:#FFEBEE; color:#C62828}

/* --- pill resuelto (atención resuelta) --- */
.pill.resuelto{background:#D1FAE5; color:#065F46; border-color:#6EE7B7}

/* --- resolver form en timeline --- */
.resolver-form{margin-top:.5rem}
.resolver-form summary{
  cursor:pointer; display:inline-flex; align-items:center; gap:.3rem;
  font-size:.82rem; padding:.25rem .7rem;
  border:1px solid var(--line2); border-radius:6px;
  background:var(--bg2); color:var(--txt); list-style:none;
}
.resolver-form summary:hover{border-color:var(--brand); background:var(--cream)}
.resolver-form[open] summary{border-color:var(--brand)}
.resolver-form .field{margin-top:.4rem}
.tl-resolucion{margin-top:.35rem; padding:.35rem .55rem;
  border-left:3px solid var(--verde); background:#F0FDF4; border-radius:4px}

/* --- btn-sm --- */
.btn-sm{padding:.25rem .7rem; font-size:.82rem; border-radius:6px}
.alert-row-action{margin-top:.45rem}

/* --- centro de alertas --- */
.alert-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.9rem;
  margin:0 0 1rem;
}
.alert-stat-card{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:.15rem .8rem;
  align-items:center;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:1rem 1.15rem;
  box-shadow:var(--shadow);
}
.alert-stat-card::before{
  content:"";
  grid-row:1 / span 3;
  width:4px;
  height:100%;
  border-radius:4px;
  background:var(--line2);
}
.alert-stat-card.ok::before{background:var(--verde)}
.alert-stat-card.warn::before{background:var(--amarillo)}
.alert-stat-card.muted::before{background:#8A94A6}
.alert-stat-card .stat-label{
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:800;
}
.alert-stat-card strong{
  font-family:var(--display);
  font-size:2rem;
  line-height:1;
  color:var(--brand);
}
.alert-stat-card span:last-child{color:var(--muted); font-size:.86rem}
.alert-center-grid{grid-template-columns:minmax(0,1fr) 360px}
.alert-recipient-table th:nth-child(3){min-width:330px}
.alert-recipient-table th:nth-child(6){width:120px}
.alert-action{white-space:nowrap}
.delivery-list{display:flex; flex-direction:column; gap:.7rem; margin:.8rem 0 1rem}
.delivery-row{
  display:flex;
  justify-content:space-between;
  gap:.8rem;
  padding:.7rem 0;
  border-bottom:1px solid var(--line);
}
.delivery-row:last-child{border-bottom:none}
.delivery-row span{
  color:var(--muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:800;
}
.delivery-row b{text-align:right; color:var(--txt); font-size:.88rem}
.delivery-row small{color:var(--muted); font-weight:600}
.verified-list{list-style:none; padding-left:0}
.verified-list li{display:flex; align-items:center; gap:.45rem; font-weight:800; color:var(--txt)}
.verified-list .ic{color:var(--verde)}
.alert-event-list{
  list-style:none;
  padding:0;
  margin:.7rem 0 0;
  display:flex;
  flex-direction:column;
  gap:.7rem;
}
.alert-event-list li{
  display:grid;
  gap:.1rem;
  padding:.65rem .75rem;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}
.alert-event-list b{color:var(--brand)}
.alert-event-list span{font-size:.82rem; text-transform:capitalize; color:var(--txt)}
.alert-event-list small{color:var(--muted); font-size:.76rem}

/* --- form-actions row --- */
.form-actions{display:flex; gap:.75rem; margin-top:.5rem; flex-wrap:wrap}

/* --- required asterisk --- */
.req{color:var(--rojo); margin-left:.15rem}

/* --- field hint --- */
.hint{font-size:.8rem; color:var(--muted); margin-top:.2rem; display:block}

/* --- check-toggle disabled --- */
.check-toggle.disabled{opacity:.6; pointer-events:none}

/* =====================================================================
   Sprint 2.5 alertas
   ===================================================================== */
.table-input{
  width:100%;
  min-width:220px;
  border:1px solid var(--line);
  border-radius:7px;
  padding:.48rem .6rem;
  font:inherit;
  color:var(--txt);
  background:#fff;
}
.inline-check{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  font-weight:800;
  color:var(--brand);
  white-space:nowrap;
}
.inline-check input{width:17px;height:17px}
.alert-mail-list{
  margin:.4rem 0 1rem;
  padding-left:1.1rem;
  line-height:1.8;
  color:var(--txt);
  font-weight:700;
}

/* ---------- alerta parpadeante: unidades/viajes vencidos (solo rojo) ---------- */
/* Capa 1: borde + resplandor exterior de la tarjeta */
@keyframes vencido-glow{
  0%,100%{
    border-color:#F5A9A9;
    box-shadow:0 9px 23px rgba(10,26,58,.08);
  }
  45%,60%{
    border-color:#E01F1F;
    box-shadow:
      0 0 0 4px rgba(224,31,31,.22),
      0 0 30px 6px rgba(224,31,31,.40),
      0 9px 23px rgba(224,31,31,.20);
  }
}
/* Capa 2: lavado rojo que respira sobre el fondo de la tarjeta */
@keyframes vencido-wash{
  0%,100%{opacity:0}
  45%,60%{opacity:1}
}
/* Capa 3: barra lateral que se enciende como foco de alarma */
@keyframes vencido-bar{
  0%,100%{background:var(--rojo); box-shadow:none}
  45%,60%{background:#FF2424; box-shadow:0 0 16px 3px rgba(255,36,36,.85)}
}
/* Capa 4: badge "vencida" que destella a rojo sólido */
@keyframes vencido-badge{
  0%,100%{background:#FFECEF; color:#E20E18; border-color:#FFC9CE; box-shadow:none}
  45%,60%{background:#E20E18; color:#FFFFFF; border-color:#E20E18; box-shadow:0 0 14px rgba(226,14,24,.6)}
}

.ucard.sem-rojo,
.trip-card.sem-rojo,
.stat.rojo.alerta{
  position:relative;
  animation:vencido-glow 1.4s ease-in-out infinite;
}
.ucard.sem-rojo::after,
.trip-card.sem-rojo::after,
.stat.rojo.alerta::after{
  content:"";
  position:absolute; inset:0;
  border-radius:inherit;
  background:linear-gradient(100deg, rgba(224,31,31,.17) 0%, rgba(224,31,31,.05) 55%, rgba(224,31,31,.11) 100%);
  opacity:0;
  pointer-events:none;
  animation:vencido-wash 1.4s ease-in-out infinite;
}
.ucard.sem-rojo::before,
.trip-card.sem-rojo::before{
  animation:vencido-bar 1.4s ease-in-out infinite;
}
.ucard.sem-rojo .badge.sem-rojo,
.trip-card.sem-rojo .badge.sem-rojo{
  animation:vencido-badge 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce){
  .ucard.sem-rojo, .trip-card.sem-rojo, .stat.rojo.alerta,
  .ucard.sem-rojo::after, .trip-card.sem-rojo::after, .stat.rojo.alerta::after,
  .ucard.sem-rojo::before, .trip-card.sem-rojo::before,
  .ucard.sem-rojo .badge.sem-rojo, .trip-card.sem-rojo .badge.sem-rojo{animation:none}
}

/* =====================================================================
   REFINAMIENTO UI 2026 — topbar compacta, jerarquía del detalle,
   panel GPS en 3 bloques, mapa estable. Solo presentación.
   ===================================================================== */
:root{
  --shadow:0 3px 12px rgba(10,26,58,.06), 0 1px 2px rgba(10,26,58,.06);
  --shadow-lg:0 10px 26px rgba(10,26,58,.12), 0 2px 4px rgba(10,26,58,.07);
}

/* ---- topbar compacta y premium ---- */
/* overflow:visible: el dropdown de usuario se ancla al topbar y no debe recortarse */
.topbar{min-height:64px; padding:0 26px; gap:0; overflow:visible}
.topbar::after{content:none}
.logo img{height:42px}
.topbar nav{margin-left:26px; padding-left:22px; gap:4px; border-left:1px solid rgba(255,255,255,.10)}
.nav-link{
  height:38px; min-width:0; padding:0 15px; gap:.5rem;
  border-radius:8px; font-size:.9rem; font-weight:600; color:#B6C2D9;
}
.nav-link .ic{width:18px; height:18px}
.nav-link:hover{background:rgba(255,255,255,.06); color:#fff}
.nav-link.active{background:rgba(255,255,255,.07); border-color:transparent; box-shadow:none; color:#fff}
.nav-link.active::after{
  left:15px; right:15px; bottom:-7px; width:auto; height:3px;
  border:0; transform:none; border-radius:3px;
  background:linear-gradient(90deg,#F5B32B,#E2882A);
}
.nav-link.active .ic{color:#F7B739}
.topbar-right{gap:.6rem}
.topclock{
  min-width:0; height:36px; padding:0 12px; justify-content:center;
  border-radius:8px; font-size:.84rem; font-weight:600; color:#D9E2F2;
  border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.05);
}
.topclock .ic{width:16px; height:16px}
.btn-gold{
  min-height:36px; padding:0 15px; border-radius:8px; font-size:.87rem;
  box-shadow:0 3px 10px rgba(237,135,7,.32), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-gold .ic{width:17px; height:17px}

/* ---- menú de usuario (details/summary) ---- */
.user-menu{position:relative}
.user-menu > summary{list-style:none; cursor:pointer}
.user-menu > summary::-webkit-details-marker{display:none}
.user-menu > summary::marker{content:""}
.user-pill{
  height:36px;
  padding:0 .5rem 0 .3rem;
  gap:.45rem;
  border-radius:8px;
  transition:background-color .18s ease, border-color .18s ease;
}
.user-pill:hover{background:rgba(255,255,255,.12)}
.user-menu[open] .user-pill{background:rgba(255,255,255,.14)}
.user-avatar{
  display:grid; place-items:center; width:26px; height:26px; border-radius:7px;
  background:linear-gradient(160deg,#F2AC41,#D97B06); color:#3A2A05;
  font-size:.8rem; font-weight:800;
}
.user-name{max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.88rem}
.user-pill .rol-badge{font-size:.66rem; padding:.14rem .45rem}
.user-pill .chev{
  width:14px;
  height:14px;
  color:rgba(255,255,255,.5);
  transition:transform .2s cubic-bezier(.22,.8,.32,1), color .18s ease;
}
.user-menu[open] .chev{transform:rotate(180deg)}
.user-drop{
  position:absolute; right:0; top:calc(100% + 10px); min-width:220px; z-index:60;
  background:#fff; border:1px solid var(--line); border-radius:11px;
  box-shadow:0 18px 44px rgba(7,20,49,.22); padding:.45rem;
  overflow:hidden;
  transform-origin:top;
  will-change:height, opacity, transform;
}
.user-drop-head{padding:.55rem .7rem .6rem; border-bottom:1px solid var(--line); margin-bottom:.4rem}
.user-drop-head b{display:block; color:var(--txt); font-size:.92rem}
.user-drop-head span{display:block; color:var(--muted); font-size:.78rem; text-transform:capitalize; margin-top:.1rem}
.user-drop form{margin:0}
.user-drop-item{
  display:flex; align-items:center; gap:.55rem; width:100%; padding:.55rem .7rem;
  border:0; background:transparent; border-radius:8px; cursor:pointer; text-align:left;
  color:#B42318; font:inherit; font-size:.88rem; font-weight:700;
  transition:background-color .16s ease, transform .16s ease;
}
.user-drop-item:hover{background:#FEF2F2}
.user-drop-item:active{transform:translateY(1px)}
.user-drop-item .ic{width:16px; height:16px}

/* ---- jerarquía del detalle ---- */
.title-row h1{font-size:2.1rem}
.page-head{align-items:center; margin-bottom:1.4rem; row-gap:.8rem}
.head-actions{gap:.55rem}
.head-actions form{margin:0}
.head-actions .btn{min-height:42px; border-radius:9px; padding:0 1.05rem; font-weight:700}
.btn-danger{box-shadow:0 3px 10px rgba(197,40,40,.18)}
.detail-shell .main-col{display:flex; flex-direction:column; gap:1.15rem}
.detail-shell .main-col .panel, .detail-shell .main-col .two-up, .rail .panel{margin-bottom:0}
.two-up{gap:1.15rem}
.rail{top:84px; gap:1.15rem}
.checkin-side{top:84px}
.detail-side{top:84px}
.route-banner{margin:0; border:none; box-shadow:none; padding:.35rem .2rem; background:transparent}
.panel{box-shadow:var(--shadow)}

/* ---- panel Estado GPS: 3 bloques con estado fresco/retrasado/sin dato ---- */
.gps-panel.g-fresco{border-top:3px solid #12B76A}
.gps-panel.g-retrasado{border-top:3px solid #F59E0B}
.gps-panel.g-sin_reporte{border-top:3px solid #C6D2E2}
.gps-panel .panel-head{margin-bottom:.3rem}
.gps-note{margin:.1rem 0 1rem; color:var(--muted); font-size:.84rem}
.gps-estado-chip{
  display:inline-flex; align-items:center; gap:.4rem; padding:.42rem .85rem;
  border-radius:999px; font-size:.8rem; font-weight:800; border:1px solid; white-space:nowrap;
}
.gps-estado-chip .ic{width:15px; height:15px}
.gps-estado-chip.fresco{background:#EFFAF4; color:#067647; border-color:#B7E7CC}
.gps-estado-chip.retrasado{background:#FFF6E6; color:#B25E00; border-color:#F3D9A4}
.gps-estado-chip.sin_reporte{background:#F4F6FA; color:#5C6B84; border-color:#DCE4EF}
.gps-sec{border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff}
.gps-sec + .gps-sec{margin-top:.85rem}
.gps-sec-title{
  display:flex; align-items:center; gap:.5rem; padding:.55rem .95rem;
  background:#F6F9FD; border-bottom:1px solid var(--line);
  font:800 .72rem/1.2 var(--font-brand); text-transform:uppercase;
  letter-spacing:.07em; color:#33476B;
}
.gps-sec-title .ic{width:15px; height:15px; color:var(--gold)}
.gps-grid{display:grid; gap:1px; background:var(--line)}
.gps-grid.g-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.gps-grid.g-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.gps-grid.g-loc{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)}
.gps-item{background:#fff; padding:.75rem 1rem; min-height:64px}
.gps-item .gps-k{display:block; color:#5E6F8C; font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; font-weight:800}
.gps-item .gps-v{display:block; margin-top:.35rem; color:#0A1F44; font-weight:600; font-size:.92rem; line-height:1.35}
.gps-item .gps-v b{font-weight:800; font-size:1.02rem}
.gps-v.mono{font-variant-numeric:tabular-nums}
.gps-v .nd{color:#98A5BA; font-weight:500}
.gps-chip.on, .gps-chip.movil{color:#067647; border-color:#B7E7CC; background:#EFFAF4}
.gps-chip.ralenti{color:#B25E00; border-color:#F3D9A4; background:#FFF6E6}
.gps-chip.off, .gps-chip.quieto{color:#4A5A74; border-color:#D5DEEA; background:#F4F6FA}
.gps-chip.neutro{color:#8B99AF; border-color:#E1E8F1; background:#F8FAFD}

/* ---- mapa limpio y estable ---- */
.gps-sec .viaje-map{
  height:380px; margin:0; border:0; border-top:1px solid var(--line);
  border-radius:0; box-shadow:none; background:#F2F6FB;
  position:relative; z-index:1;
}
.gps-sec .gps-map-meta{margin:0; padding:.6rem .95rem; border-top:1px solid var(--line); background:#FBFDFF}
.tl-gps-dir{flex-basis:100%; color:var(--muted)}

/* ---- responsive del refinamiento ---- */
@media(max-width:1180px){
  .gps-grid.g-6{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:820px){
  .logo img{height:36px}
  .nav-link{height:42px}
  .nav-link.active::after{bottom:2px}
  .user-name{display:none}
  .title-row h1{font-size:1.7rem}
  .head-actions{width:100%; flex-wrap:wrap}
  .head-actions .btn{flex:1 1 auto; justify-content:center}
  .gps-grid.g-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .gps-grid.g-loc{grid-template-columns:1fr}
  .gps-sec .viaje-map{height:300px}
}
@media(max-width:560px){
  .gps-grid.g-4, .gps-grid.g-6{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* topbar: evitar que el nav/botón se partan en anchos intermedios */
.topbar .btn-gold, .topclock{white-space:nowrap}
@media(max-width:1080px){
  .user-name{display:none}
  .topbar nav{margin-left:14px; padding-left:12px; gap:2px}
  .nav-link{padding:0 11px; font-size:.86rem}
}
/* topbar móvil: restaurar respiro y nav apilado que las reglas base pisaban */
@media(max-width:820px){
  .topbar{min-height:auto; padding:10px 14px; gap:10px; flex-wrap:wrap}
  .topbar nav{margin-left:0; padding-left:0; border-left:0}
}

/* rol-badge legible sobre paneles claros (el estilo base es para topbar oscuro) */
.panel .rol-badge.jefe{background:#FFF3DC; color:#8A5A00; border:1px solid #F0DCA8}
.panel .rol-badge.subjefe{background:#E3F0FF; color:#0B5CAD; border:1px solid #BDDCFF}
.panel .rol-badge.monitorista{background:#EEF2F8; color:#44536D; border:1px solid #D8E1EE}

/* =====================================================================
   NAVEGACION LATERAL — estilo portal operativo, colapsable
   ===================================================================== */
:root{
  --side-w:272px;
  --side-mini:84px;
  --mobile-bar-h:64px;
}

.nav-toggle{
  position:fixed;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.mobile-topbar,
.sidebar-scrim{
  display:none;
}

.side-head{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:6px 4px 18px;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.side-toggle{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:11px;
  color:#fff;
  background:rgba(255,255,255,.08);
  cursor:pointer;
  flex:0 0 auto;
  transition:background .15s, border-color .15s, transform .15s;
}

.side-toggle:hover{
  background:rgba(255,255,255,.14);
  border-color:rgba(247,183,57,.55);
}

.side-toggle .ic{
  width:24px;
  height:24px;
}

body:not(.login-page) .topbar{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  z-index:80;
  width:var(--side-w);
  min-height:100vh;
  padding:16px 14px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  overflow:visible;
  background:
    radial-gradient(230px 190px at 18% 2%, rgba(247,183,57,.16), transparent 68%),
    radial-gradient(240px 220px at 100% 0%, rgba(49,76,116,.44), transparent 70%),
    linear-gradient(180deg,#061A3F 0%,#071E49 52%,#03122E 100%);
  border-right:1px solid rgba(255,255,255,.10);
  border-bottom:0;
  box-shadow:14px 0 32px rgba(4,15,35,.20);
  transition:width .18s ease, transform .2s ease;
}

body:not(.login-page) .topbar::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:3px;
  background:linear-gradient(90deg,#F7B739,#F18A06);
  pointer-events:none;
}

body:not(.login-page) .topbar::after{
  content:"";
  position:absolute;
  inset:0;
  width:auto;
  background:
    linear-gradient(150deg,transparent 0 44%,rgba(255,255,255,.055) 45%,rgba(255,255,255,.02) 68%,transparent 69%),
    repeating-linear-gradient(180deg,rgba(255,255,255,.025) 0 1px,transparent 1px 58px);
  pointer-events:none;
}

body:not(.login-page) .logo{
  min-width:0;
}

body:not(.login-page) .logo img{
  height:54px;
  max-width:178px;
  object-fit:contain;
  filter:drop-shadow(0 6px 16px rgba(0,0,0,.28));
}

body:not(.login-page) .topbar nav,
body:not(.login-page) .side-nav{
  position:relative;
  z-index:1;
  width:100%;
  display:block;
  margin:18px 0 0;
  padding:0;
  border-left:0;
}

body:not(.login-page) .side-nav > .nav-link,
body:not(.login-page) .side-nav > .nav-group{
  margin-bottom:7px;
}

body:not(.login-page) .nav-link{
  width:100%;
  height:48px;
  min-width:0;
  justify-content:flex-start;
  gap:12px;
  padding:0 14px;
  border-radius:12px;
  color:#C4D0E5;
  font-size:.94rem;
  font-weight:800;
  letter-spacing:0;
  border:1px solid transparent;
  box-shadow:none;
  position:relative;
}

body:not(.login-page) .nav-link .ic{
  width:21px;
  height:21px;
}

body:not(.login-page) .nav-link:hover{
  color:#fff;
  background:rgba(255,255,255,.08);
  text-decoration:none;
}

body:not(.login-page) .nav-link.active{
  color:#fff;
  background:rgba(255,255,255,.10);
  border-color:rgba(247,183,57,.30);
  box-shadow:inset 3px 0 0 #F7B739;
}

body:not(.login-page) .nav-link.active::after{
  content:none;
}

body:not(.login-page) .nav-link.active .ic{
  color:#F7B739;
}

body:not(.login-page) .topbar-right{
  position:relative;
  z-index:1;
  width:100%;
  margin:0;
  margin-top:auto;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
}

body:not(.login-page) .topclock,
body:not(.login-page) .topbar-right .btn-gold{
  width:100%;
  min-width:0;
  height:42px;
  justify-content:center;
  margin-left:0;
  border-radius:12px;
}

body:not(.login-page) .topclock{
  color:#EAF1FF;
  background:rgba(255,255,255,.065);
  border-color:rgba(255,255,255,.14);
}

body:not(.login-page) .user-menu{
  width:100%;
}

body:not(.login-page) .user-pill{
  width:100%;
  height:auto;
  min-height:46px;
  padding:7px 8px;
  border-radius:12px;
}

body:not(.login-page) .user-avatar{
  width:31px;
  height:31px;
  border-radius:9px;
}

body:not(.login-page) .user-name{
  display:block;
  max-width:118px;
}

body:not(.login-page) .user-pill .chev{
  margin-left:auto;
}

body:not(.login-page) .user-drop{
  position:static;
  min-width:0;
  margin-top:8px;
  background:rgba(255,255,255,.98);
  box-shadow:0 12px 30px rgba(2,10,28,.22);
}

body:not(.login-page) .container{
  margin-left:var(--side-w);
  max-width:none;
  width:auto;
  padding:30px 52px 2.4rem;
  transition:margin-left .18s ease;
}

body:not(.login-page) .foot{
  margin-left:var(--side-w);
  transition:margin-left .18s ease;
}

.nav-toggle:checked ~ .topbar{
  width:var(--side-mini);
}

.nav-toggle:checked ~ .container,
.nav-toggle:checked ~ .foot{
  margin-left:var(--side-mini);
}

.nav-toggle:checked ~ .topbar .side-head{
  justify-content:center;
  padding-left:0;
  padding-right:0;
}

.nav-toggle:checked ~ .topbar .logo,
.nav-toggle:checked ~ .topbar .nav-link span,
.nav-toggle:checked ~ .topbar .btn-gold span,
.nav-toggle:checked ~ .topbar .topclock span,
.nav-toggle:checked ~ .topbar .user-name,
.nav-toggle:checked ~ .topbar .user-pill .rol-badge,
.nav-toggle:checked ~ .topbar .user-pill .chev{
  display:none;
}

.nav-toggle:checked ~ .topbar .nav-link,
.nav-toggle:checked ~ .topbar .topbar-right .btn-gold,
.nav-toggle:checked ~ .topbar .topclock,
.nav-toggle:checked ~ .topbar .user-pill{
  justify-content:center;
  padding-left:0;
  padding-right:0;
}

.nav-toggle:checked ~ .topbar .user-pill{
  min-height:42px;
}

.nav-toggle:checked ~ .topbar .user-drop{
  display:none;
}

@media(max-width:1180px){
  :root{--side-w:244px}
  body:not(.login-page) .container{padding-left:32px; padding-right:32px}
  body:not(.login-page) .logo img{max-width:154px}
}

@media(max-width:900px){
  body:not(.login-page){
    padding-top:var(--mobile-bar-h);
  }

  .mobile-topbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:70;
    height:var(--mobile-bar-h);
    display:flex;
    align-items:center;
    gap:12px;
    padding:0 14px;
    background:linear-gradient(108deg,#041635 0%,#072354 55%,#031231 100%);
    box-shadow:0 8px 22px rgba(4,15,35,.22);
  }

  .mobile-logo{
    display:inline-flex;
    align-items:center;
    min-width:0;
  }

  .mobile-logo img{
    height:42px;
    width:auto;
    display:block;
  }

  .side-toggle.mobile{
    display:grid;
  }

  body:not(.login-page) .topbar{
    width:310px;
    max-width:86vw;
    transform:translateX(-104%);
    padding:16px 14px;
    min-height:100vh;
  }

  .nav-toggle:checked ~ .topbar{
    width:310px;
    transform:translateX(0);
  }

  .nav-toggle:checked ~ .sidebar-scrim{
    display:block;
    position:fixed;
    inset:0;
    z-index:75;
    background:rgba(4,15,35,.46);
    backdrop-filter:blur(2px);
  }

  .nav-toggle:checked ~ .topbar{
    z-index:90;
  }

  .nav-toggle:checked ~ .topbar .logo,
  .nav-toggle:checked ~ .topbar .nav-link span,
  .nav-toggle:checked ~ .topbar .btn-gold span,
  .nav-toggle:checked ~ .topbar .topclock span,
  .nav-toggle:checked ~ .topbar .user-name,
  .nav-toggle:checked ~ .topbar .user-pill .rol-badge,
  .nav-toggle:checked ~ .topbar .user-pill .chev{
    display:inline-flex;
  }

  .nav-toggle:checked ~ .topbar .logo{
    display:inline-flex;
  }

  .nav-toggle:checked ~ .topbar .nav-link,
  .nav-toggle:checked ~ .topbar .topbar-right .btn-gold,
  .nav-toggle:checked ~ .topbar .topclock,
  .nav-toggle:checked ~ .topbar .user-pill{
    justify-content:flex-start;
    padding-left:14px;
    padding-right:14px;
  }

  body:not(.login-page) .topbar .side-head{
    justify-content:flex-start;
  }

  body:not(.login-page) .topbar .logo img{
    max-width:170px;
    height:50px;
  }

  body:not(.login-page) .container,
  .nav-toggle:checked ~ .container{
    margin-left:0;
    padding:22px 18px 2.2rem;
  }

  body:not(.login-page) .foot,
  .nav-toggle:checked ~ .foot{
    margin-left:0;
  }

  body:not(.login-page) .user-name{
    display:block;
  }

  body:not(.login-page) .user-pill .chev{
    margin-left:auto;
  }
}

@media(max-width:560px){
  body:not(.login-page) .container,
  .nav-toggle:checked ~ .container{
    padding-left:14px;
    padding-right:14px;
  }

  .mobile-logo img{
    height:36px;
  }
}

/* ===== Capa ERP visual para detalle de viaje ===== */
.estado-erp{
  text-transform:none;
  letter-spacing:0;
}
.estado-erp.erp-verde{background:#E7F4EC;color:#126D43;border-color:#BFE3CD}
.estado-erp.erp-amarillo{background:#FFF1D8;color:#9A6418;border-color:#F0DCA8}
.estado-erp.erp-rojo{background:#FBEAEA;color:#A33232;border-color:#F0CFCF}
.estado-erp.erp-gris{background:#EEF2F7;color:#596A83;border-color:#DDE6F2}

.erp-flow-panel{
  padding-bottom:1rem;
}
.erp-flow{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:.55rem;
  position:relative;
}
.erp-step{
  min-width:0;
  display:flex;
  gap:.55rem;
  align-items:flex-start;
  padding:.72rem .68rem;
  border:1px solid var(--line);
  border-radius:12px;
  background:#F8FAFE;
}
.erp-step.done{background:#F1FBF5;border-color:#CAEBD9}
.erp-step.current{background:#FFF7E9;border-color:#F2D9A6;box-shadow:inset 0 0 0 1px rgba(245,158,11,.12)}
.erp-step.pending{color:#687891}
.erp-step-dot{
  width:26px;
  height:26px;
  border-radius:50%;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:#E9EFF8;
  color:#31527F;
  font-weight:800;
  font-size:.78rem;
}
.erp-step.done .erp-step-dot{background:#09A85B;color:white}
.erp-step.current .erp-step-dot{background:#F59E0B;color:white}
.erp-step b{
  display:block;
  font-size:.78rem;
  line-height:1.15;
  color:#07183F;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.erp-step small{
  display:block;
  margin-top:.18rem;
  color:var(--muted);
  font-size:.72rem;
  line-height:1.25;
}

.expediente-panel{
  background:
    radial-gradient(280px 120px at 100% 0%,rgba(196,154,58,.10),transparent 70%),
    linear-gradient(180deg,#FFFFFF,#F9FBFE);
}
.expediente-summary{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  justify-content:flex-end;
}
.exp-pill{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:.22rem .6rem;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-size:.74rem;
  font-weight:800;
}
.exp-pill.ok{background:#EAF7EF;color:#126D43;border-color:#CBEAD8}
.exp-pill.warn{background:#FFF7E6;color:#9A6418;border-color:#F2D9A6}
.exp-pill.danger{background:#FBEAEA;color:#A33232;border-color:#F0CFCF}
.exp-pill.source{background:#EDF3FC;color:#1B3A6B;border-color:#D7E4F6}
.expediente-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.75rem;
}
.exp-card{
  min-width:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 0 rgba(28,37,54,.03);
  overflow:hidden;
}
.exp-card-head{
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.72rem .78rem;
  border-bottom:1px solid var(--line);
  background:#F8FAFE;
}
.exp-card-head b{
  min-width:0;
  color:#07183F;
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.exp-icon{
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:8px;
  color:#16304F;
  background:#EAF0F9;
  flex:0 0 auto;
}
.exp-status{
  margin-left:auto;
  white-space:nowrap;
  font-size:.68rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#687891;
}
.exp-ok .exp-card-head{background:#F2FBF6}
.exp-ok .exp-icon{background:#09A85B;color:#fff}
.exp-ok .exp-status{color:#126D43}
.exp-warn .exp-card-head{background:#FFF8EB}
.exp-warn .exp-icon{background:#F59E0B;color:#fff}
.exp-warn .exp-status{color:#9A6418}
.exp-danger .exp-card-head{background:#FFF1F1}
.exp-danger .exp-icon{background:#D14343;color:#fff}
.exp-danger .exp-status{color:#A33232}
.exp-pending .exp-card-head{background:#F4F7FB}
.exp-facts{
  margin:0;
  padding:.2rem .78rem .72rem;
}
.exp-facts div{
  display:grid;
  grid-template-columns:minmax(86px,.72fr) minmax(0,1.28fr);
  gap:.7rem;
  padding:.48rem 0;
  border-bottom:1px solid rgba(218,211,195,.70);
}
.exp-facts div:last-child{border-bottom:0}
.exp-facts dt{
  color:#6B7385;
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.exp-facts dd{
  margin:0;
  color:#07183F;
  font-size:.82rem;
  font-weight:700;
  text-align:right;
  overflow-wrap:anywhere;
}
.exp-document-editor{margin-top:.8rem;border:1px solid #D4E0F0;border-radius:11px;background:#F8FAFE;padding:.7rem .78rem}
.exp-document-editor[open]{border-color:#E2BD65;background:#FFFCF5}
.exp-document-editor>summary{display:flex;align-items:center;gap:.55rem;cursor:pointer;list-style:none;color:#07183F}
.exp-document-editor>summary::-webkit-details-marker{display:none}
.exp-document-editor>summary>span:last-child{display:flex;min-width:0;flex-direction:column}
.exp-document-editor>summary b{font-size:.84rem}
.exp-document-editor>summary small{margin-top:.08rem;color:var(--muted);font-size:.72rem}
.exp-document-editor form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:.65rem;margin-top:.7rem;padding-top:.7rem;border-top:1px solid #E2D9C4}
.exp-document-editor .field{margin:0}
@media(max-width:700px){.exp-document-editor form{grid-template-columns:1fr}.exp-document-editor form>.btn{width:100%}}

/* --- Cartas Porte: catálogo independiente + vínculo explícito al viaje --- */
.cp-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:0 0 14px;
}
.cp-kpi{
  display:flex;
  min-height:92px;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  padding:14px 16px;
  border:1px solid var(--line);
  border-top:3px solid #7E8DA4;
  border-radius:9px;
  background:#fff;
  box-shadow:0 5px 14px rgba(7,24,63,.04);
}
.cp-kpi span{font-size:.7rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cp-kpi b{font-size:1.35rem;color:var(--erp-ink)}
.cp-kpi small{color:var(--muted)}
.cp-kpi.ok{border-top-color:#16834F}.cp-kpi.info{border-top-color:#0B63E5}.cp-kpi.money{border-top-color:var(--gold)}
.cp-master-panel{padding-bottom:0;overflow:hidden}
.cp-master-table{min-width:780px}
.cp-trip-link{display:flex;flex-direction:column;gap:1px;text-decoration:none}
.cp-trip-link small{color:var(--muted)}
.badge.cp-disponible{background:#E9FAF1;color:#078844;border:1px solid #BBE9CE}
.badge.cp-asignada{background:#E8F1FF;color:#0750A7;border:1px solid #BDD7FF}
.badge.cp-cancelada{background:#FBEAEA;color:#A33232;border:1px solid #F0CFCF}
.cp-return-hint{margin:0 0 14px}
.cp-create-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.cp-create-grid .field{margin:0}

.exp-document-editor.cp-document-row{
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.8rem;
}
.exp-document-editor.cp-document-row.is-linked{border-color:#A9DCC2;background:#F2FBF6}
.exp-document-editor.cp-document-row.is-missing{border-color:#E2BD65;background:#FFFCF5}
.cp-document-copy{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}
.cp-document-copy>b{font-size:.84rem;color:#07183F}
.cp-document-copy small{color:var(--muted);font-size:.74rem;line-height:1.4}
.cp-document-copy code{font-weight:900;color:#07183F}

.cp-selector-modal{
  width:min(960px,calc(100vw - 2rem));
  max-height:min(88vh,820px);
  overflow:hidden;
}
.cp-selector-modal .gm-head>div{display:flex;flex-direction:column;gap:2px}
.cp-selector-modal .gm-head small{color:var(--muted);font-size:.75rem}
.cp-selector-content{max-height:calc(88vh - 65px);overflow:auto}
.cp-selector-body{padding:16px}
.cp-selector-loading,.cp-selector-error,.cp-selector-empty{padding:28px!important;text-align:center;color:var(--muted)}
.cp-selector-error{color:#A33232}
.cp-separation-note{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid #D7E2F1;
  border-radius:9px;
  background:#F7FAFE;
}
.cp-separation-note>div:not(.cp-separation-arrow){display:flex;flex-direction:column;gap:2px}
.cp-separation-note span,.cp-linked-card span,.cp-liquidation-source span{font-size:.67rem;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.cp-separation-note b{font-size:1rem;color:#07183F}
.cp-separation-arrow{color:var(--gold);font-size:1.3rem;font-weight:900}
.cp-selector-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 9px}
.cp-selector-head>div{display:flex;flex-direction:column;gap:2px}
.cp-selector-head small{color:var(--muted)}
.cp-selector-table{min-width:700px}
.cp-selector-table form{margin:0}
.cp-linked-card{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr)) auto;
  align-items:center;
  gap:14px;
  margin-top:14px;
  padding:15px;
  border:1px solid #A9DCC2;
  border-left:4px solid #16834F;
  border-radius:9px;
  background:#F2FBF6;
}
.cp-linked-card>div{display:flex;min-width:0;flex-direction:column;gap:3px}
.cp-selector-section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:16px 0 4px}
.cp-selector-section-title>div{display:flex;flex-direction:column;gap:2px}
.cp-selector-section-title small{color:var(--muted)}
.cp-selector-section-title strong{white-space:nowrap;color:#087A47}
.cp-legacy-note{display:flex;flex-direction:column;gap:3px;margin-top:12px;padding:10px 12px;border-radius:8px;background:#FFF8EA;color:#7B520B;font-size:.78rem}
.cp-liquidation-source{display:grid;grid-template-columns:auto 1fr;gap:7px 12px;align-items:center}
.cp-liquidation-source small{grid-column:1/-1;color:var(--muted);line-height:1.4}

.audit-strip{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:.73rem}
.audit-strip b{color:var(--erp-ink)}
.audit-panel{margin-top:14px;padding:0;overflow:hidden}
.audit-panel-inline{margin-top:14px;border:1px solid var(--line);border-radius:9px;background:#FAFCFF}
.audit-panel summary{display:flex;align-items:center;gap:8px;padding:13px 16px;cursor:pointer;font-weight:900;color:var(--erp-ink);list-style:none}
.audit-panel summary::-webkit-details-marker{display:none}
.audit-panel summary span{margin-left:auto;min-width:25px;padding:2px 7px;border-radius:999px;background:#EAF1FB;text-align:center;font-size:.7rem}
.audit-timeline{display:flex;flex-direction:column;padding:0 16px 14px}
.audit-event{display:grid;grid-template-columns:12px 1fr;gap:10px;padding:10px 0;border-top:1px solid #E6EDF7}
.audit-event:first-child{border-top:0}
.audit-event>div{display:flex;flex-direction:column;gap:2px}
.audit-event b{font-size:.78rem;color:var(--erp-ink)}
.audit-event small{color:var(--muted);font-size:.7rem}
.audit-dot{width:8px;height:8px;margin-top:5px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 3px #FFF1CF}

@media(max-width:850px){
  .cp-kpi-grid{grid-template-columns:1fr 1fr}
  .cp-linked-card{grid-template-columns:1fr 1fr}
  .cp-linked-card form{grid-column:1/-1}
}
@media(max-width:620px){
  .cp-kpi-grid,.cp-create-grid{grid-template-columns:1fr}
  .exp-document-editor.cp-document-row{align-items:flex-start;flex-wrap:wrap}
  .exp-document-editor.cp-document-row>.btn{width:100%;justify-content:center}
  .cp-selector-head{align-items:stretch;flex-direction:column}
  .cp-separation-note{grid-template-columns:1fr;text-align:center}
  .cp-separation-arrow{transform:rotate(90deg)}
  .cp-linked-card{grid-template-columns:1fr}
  .cp-linked-card form{grid-column:auto}
}

.checklist-panel{
  background:linear-gradient(180deg,#FFFFFF,#F9FBFE);
}
.checklist-score{
  display:inline-flex;
  align-items:center;
  padding:.28rem .65rem;
  border-radius:999px;
  background:#EEF4FC;
  color:#31527F;
  font-size:.78rem;
  font-weight:800;
}
.checklist-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:.65rem;
}
.check-item{
  display:flex;
  gap:.55rem;
  align-items:flex-start;
  padding:.65rem .7rem;
  border-radius:11px;
  border:1px solid var(--line);
  background:#fff;
}
.check-item.ok{border-color:#CFEAD9;background:#F4FBF7}
.check-item.pendiente{border-color:#F1D6D6;background:#FFF8F8}
.check-ic{
  width:24px;
  height:24px;
  border-radius:50%;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  background:#EEF2F7;
  color:#6D7D95;
}
.check-item.ok .check-ic{background:#09A85B;color:white}
.check-item.pendiente .check-ic{background:#FBEAEA;color:#D14343}
.check-item b{
  display:block;
  font-size:.82rem;
  color:#07183F;
}
.check-item small{
  display:block;
  color:var(--muted);
  font-size:.74rem;
  margin-top:.08rem;
}

.next-action-panel{
  border-color:#C9D7EA;
  background:
    radial-gradient(180px 80px at 100% 0%,rgba(245,158,11,.12),transparent 70%),
    linear-gradient(180deg,#FFFFFF,#F8FAFE);
}
.next-action-body b{
  display:block;
  font-size:1.02rem;
  color:#07183F;
}
.next-action-body p{
  margin:.45rem 0 .9rem;
  color:var(--muted);
  font-size:.86rem;
}
.next-atencion,
.next-resolver,
.next-checkin{
  border-color:#F0DCA8;
}
.next-resolver{
  background:
    radial-gradient(180px 80px at 100% 0%,rgba(240,23,23,.10),transparent 70%),
    linear-gradient(180deg,#FFFFFF,#FFF9F7);
}

#bitacora-operativa .timeline::before{
  background:linear-gradient(180deg,#D9E4F2,#F0DCA8,#D9E4F2);
}
.tl-item.warn .tl-dot{
  color:#B5731C;
  border-color:#F0DCA8;
  background:#FFF7E9;
}
.tl-body > .tl-top:first-child b{
  color:#07183F;
  font-size:.9rem;
}
.tl-body > .tl-top:first-child time{
  margin-left:auto;
}

@media(max-width:1100px){
  .erp-flow{grid-template-columns:repeat(3,minmax(0,1fr))}
  .expediente-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .erp-flow{grid-template-columns:1fr}
  .expediente-grid{grid-template-columns:1fr}
  .expediente-summary{justify-content:flex-start}
  .exp-facts div{grid-template-columns:1fr}
  .exp-facts dd{text-align:left}
  .erp-step{align-items:center}
  .tl-body > .tl-top:first-child time{margin-left:0}
}

/* =====================================================================
   CAPA ERP SERIA — estructura densa, corporativa y operativa.
   Mantiene identidad RSR (azul/dorado), baja lo decorativo y prioriza lectura.
   ===================================================================== */
:root{
  --erp-bg:#F3F6FA;
  --erp-panel:#FFFFFF;
  --erp-line:#D8E1EE;
  --erp-line-strong:#B8C6D9;
  --erp-ink:#061840;
  --erp-muted:#66758C;
  --erp-navy:#061A3A;
  --erp-gold:#E4A11B;
}

body:not(.login-page){
  background:
    linear-gradient(180deg,#F8FAFD 0,#F3F6FA 220px),
    var(--erp-bg);
}

body:not(.login-page) .container{
  max-width:1540px;
  padding-top:26px;
}

body:not(.login-page) .topbar{
  width:248px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.04),transparent 26%),
    #071A39;
  border-right:1px solid rgba(255,255,255,.08);
  box-shadow:8px 0 26px rgba(8,24,51,.16);
}

body:not(.login-page) .topbar .logo img{
  max-width:176px;
  height:54px;
  object-fit:contain;
}

/* El sidebar completo comparte un solo scroll: logo, modulos, sesion y usuario. */
body:not(.login-page) .topbar{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  scrollbar-width:thin;
  scrollbar-color:rgba(196,208,229,.56) rgba(255,255,255,.05);
}

body:not(.login-page) .side-nav{
  display:flow-root;
  flex:0 0 auto;
  height:max-content;
  max-height:none;
  gap:4px;
  padding-top:18px;
  padding-right:6px;
  padding-bottom:12px;
  min-height:auto;
  overflow:visible;
}

body:not(.login-page) .side-head,
body:not(.login-page) .erp-side-meta,
body:not(.login-page) .topbar-right{
  flex:0 0 auto;
}

body:not(.login-page) .topbar-right{
  margin-top:0;
}
body:not(.login-page) .topbar::-webkit-scrollbar{
  width:8px;
}
body:not(.login-page) .topbar::-webkit-scrollbar-track{
  border-radius:999px;
  background:rgba(255,255,255,.05);
}
body:not(.login-page) .topbar::-webkit-scrollbar-thumb{
  border:2px solid transparent;
  border-radius:999px;
  background:rgba(196,208,229,.56);
  background-clip:padding-box;
}
body:not(.login-page) .topbar::-webkit-scrollbar-thumb:hover{
  background:#F7B739;
  background-clip:padding-box;
}

body:not(.login-page) .nav-link{
  min-height:42px;
  border-radius:6px;
  justify-content:flex-start;
  padding:0 12px 0 14px;
  color:#C7D3E5;
  border:1px solid transparent;
  box-shadow:none;
  font-size:.92rem;
  letter-spacing:.01em;
}

body:not(.login-page) .nav-link .ic{
  width:18px;
  height:18px;
}

body:not(.login-page) .nav-link.active{
  background:rgba(255,255,255,.075);
  border-color:rgba(255,255,255,.08);
  box-shadow:inset 3px 0 0 var(--erp-gold);
}

body:not(.login-page) .nav-link.active::after{
  content:none;
}

/* --- sidebar: grupos con subsecciones (acordeon nativo <details>) --- */
body:not(.login-page) .nav-group{
  margin:0 8px;
}
body:not(.login-page) .nav-group summary.nav-group-toggle{
  cursor:pointer;
  list-style:none;
  margin:0 -8px;
  width:calc(100% + 16px);
}
body:not(.login-page) .nav-group summary.nav-group-toggle::-webkit-details-marker{
  display:none;
}
body:not(.login-page) .nav-group .chev{
  width:15px;
  height:15px;
  margin-left:auto;
  color:#7183A6;
  transition:transform .15s ease;
  flex:0 0 auto;
}
body:not(.login-page) .nav-group[open] > summary .chev{
  transform:rotate(180deg);
}
body:not(.login-page) .nav-subitems{
  display:flex;
  flex-direction:column;
  gap:1px;
  padding:2px 0 8px 8px;
}
body:not(.login-page) .nav-sublink{
  display:flex;
  align-items:center;
  min-height:36px;
  padding:0 10px 0 34px;
  border-radius:6px;
  color:#AEBDD6;
  font-size:.82rem;
  font-weight:500;
  position:relative;
}
body:not(.login-page) .nav-sublink::before{
  content:"";
  position:absolute;
  left:20px;
  top:50%;
  width:4px;
  height:4px;
  border-radius:50%;
  background:#5E7096;
  transform:translateY(-50%);
}
body:not(.login-page) .nav-sublink:hover{
  background:rgba(255,255,255,.055);
  color:#fff;
}
body:not(.login-page) .nav-sublink.active{
  background:rgba(255,255,255,.065);
  color:#fff;
  font-weight:700;
  box-shadow:inset 2px 0 0 var(--erp-gold);
}
body:not(.login-page) .nav-sublink.active::before{
  background:var(--erp-gold);
}
body:not(.login-page) .nav-sublink-sm{
  padding-left:34px;
  font-size:.76rem;
  min-height:32px;
}
body:not(.login-page) .nav-subgroup-label{
  font-size:.66rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:rgba(199,211,229,.45);
  padding:8px 10px 3px 34px;
}
body:not(.login-page) .nav-subgroup-label:first-child{
  padding-top:2px;
}
body:not(.login-page) .nav-catalog-hint{
  font-size:.68rem;
  color:rgba(199,211,229,.4);
  line-height:1.4;
  padding:8px 10px 2px 34px;
}

body:not(.login-page) .topbar-right{
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:14px;
  gap:8px;
}

body:not(.login-page) .topclock,
body:not(.login-page) .topbar-right .btn-gold,
body:not(.login-page) .user-pill{
  min-height:38px;
  border-radius:6px;
  box-shadow:none;
}

body:not(.login-page) .topclock{
  font-size:.84rem;
  border-color:rgba(255,255,255,.12);
}

body:not(.login-page) .topbar-right .btn-gold{
  background:linear-gradient(180deg,#F0A527,#D98209);
  font-size:.9rem;
}

body:not(.login-page) .user-pill{
  background:rgba(255,255,255,.055);
  border-color:rgba(255,255,255,.12);
}

body:not(.login-page) .user-pill .rol-badge{
  display:none;
}

body:not(.login-page) .topclock,
body:not(.login-page) .live-clock,
body:not(.login-page) #live-clock{
  display:none !important;
  visibility:hidden !important;
  width:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
}

body:not(.login-page) .container,
body:not(.login-page) .foot{
  margin-left:248px;
}

.page-head{
  padding-bottom:14px;
  border-bottom:1px solid var(--erp-line);
  margin-bottom:18px;
}

h1{
  color:var(--erp-ink);
  font-size:1.72rem;
  letter-spacing:.015em;
}

.sub{
  color:var(--erp-muted);
  font-size:.88rem;
}

.hint-panel{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:0 0 1rem;
  padding:.7rem .9rem;
  border:1px dashed var(--erp-line-strong);
  border-radius:7px;
  background:#FBFDFF;
  font-size:.82rem;
  color:var(--erp-muted);
  line-height:1.5;
}
.hint-panel .ic{
  color:var(--erp-gold);
  margin-top:2px;
  flex:0 0 auto;
}

.panel{
  border:1px solid var(--erp-line);
  border-radius:7px;
  box-shadow:0 1px 2px rgba(8,25,55,.05);
  background:var(--erp-panel);
}

.panel:hover{
  box-shadow:0 2px 8px rgba(8,25,55,.07);
}

.panel-head{
  min-height:38px;
  padding-bottom:.75rem;
  margin-bottom:.85rem;
  border-bottom:1px solid var(--erp-line);
}

h2{
  color:var(--erp-ink);
  font-family:var(--font-ui);
  font-size:.84rem;
  font-weight:900;
  letter-spacing:.045em;
}

h2::before{
  width:3px;
  height:1rem;
  background:var(--erp-gold);
}

.panel-title-icon{
  color:var(--erp-navy);
}

.btn{
  border-radius:6px;
  box-shadow:none;
  font-weight:800;
  min-height:38px;
}

.btn-primary{
  background:#08285D;
  border-color:#08285D;
  box-shadow:none;
}

.btn-primary:hover{
  background:#061A3A;
}

.btn-danger{
  border-radius:6px;
  box-shadow:none;
}

.badge,
.pill,
.gps-chip{
  border-radius:4px;
  font-weight:800;
  letter-spacing:.01em;
}

.stats{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.7rem;
}

.stat{
  min-height:70px;
  padding:.8rem .9rem;
  border-radius:7px;
  background:#fff !important;
  border:1px solid var(--erp-line) !important;
  box-shadow:0 1px 2px rgba(8,25,55,.04);
}

.stat::before{
  content:"";
  width:3px;
  align-self:stretch;
  border-radius:999px;
  background:#8DA1BC;
}

.stat.rojo::before{background:var(--rojo)}
.stat.amarillo::before{background:var(--amarillo)}
.stat.verde::before{background:var(--verde)}
.stat.gris::before{background:#8390A4}
.stat.atencion::before{background:#9D174D}

.stat-ic{
  width:34px;
  height:34px;
  border-radius:6px;
  background:#F2F5FA;
  box-shadow:none;
}

.stat-ic .ic{
  width:19px;
  height:19px;
}

.stat-num{
  font-size:1.38rem;
  color:var(--erp-ink);
}

.stat-lbl{
  font-size:.76rem;
  color:var(--erp-muted);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.035em;
}

.toolbar{
  padding:10px;
  background:#fff;
  border:1px solid var(--erp-line);
  border-radius:7px;
  box-shadow:0 1px 2px rgba(8,25,55,.04);
}

.search{
  min-height:40px;
  border-radius:5px;
  box-shadow:none;
  background:#F8FAFD;
}

.chip{
  min-width:auto;
  min-height:38px;
  border-radius:5px;
  box-shadow:none;
  background:#fff;
}

.chip.active{
  background:#08285D;
  box-shadow:none;
}

.group-head{
  color:#31425C;
  border-bottom:1px solid var(--erp-line);
  padding-bottom:.35rem;
}

.ucard,
.trip-card{
  border-radius:7px;
  background:#fff !important;
  border:1px solid var(--erp-line);
  box-shadow:0 1px 2px rgba(8,25,55,.045);
  min-height:104px;
}

.ucard:hover,
.trip-card:hover{
  transform:none;
  border-color:var(--erp-line-strong);
  box-shadow:0 2px 8px rgba(8,25,55,.08);
}

.ucard::before,
.trip-card::before{
  width:5px;
}

.uc-id-top .unit,
.trip-head .unit{
  font-size:1.12rem;
  letter-spacing:.01em;
}

.uc-info,
.uc-trip{
  border-left:1px solid var(--erp-line);
  padding-left:1.15rem;
}

.uc-actions .btn,
.trip-actions .btn{
  border-radius:5px;
  box-shadow:none;
}

.ring{
  width:54px;
  height:54px;
}

.ring svg{
  width:54px;
  height:54px;
}

.ring circle{
  stroke-width:4.5;
}

.ring-top{
  font-size:.92rem;
}

.ring-bot{
  font-size:.55rem;
}

.rail{
  top:78px;
}

.rail .panel{
  border-radius:7px;
  background:#fff;
}

.donut{
  width:108px;
  height:108px;
}

.donut svg{
  width:108px;
  height:108px;
}

.donut circle{
  stroke-width:12;
}

.donut-pct{
  font-size:1.42rem;
}

.cumpl-side b{
  font-size:1.35rem;
}

.stack{
  height:16px;
  border-radius:4px;
}

.rs-row,
.ck-row{
  border-bottom:1px solid var(--erp-line);
}

.route-banner{
  border-radius:7px;
  min-height:96px;
  box-shadow:none;
}

.rb-pt{
  min-height:58px;
}

.rb-pt b{
  font-size:.98rem;
}

.erp-flow-panel{
  background:#fff;
}

.erp-flow{
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:0;
  border:1px solid var(--erp-line);
  border-radius:6px;
  overflow:hidden;
}

.erp-step{
  border:0;
  border-right:1px solid var(--erp-line);
  border-radius:0;
  background:#fff !important;
  padding:.65rem .7rem;
}

.erp-step:last-child{
  border-right:0;
}

.erp-step-dot{
  width:22px;
  height:22px;
  border-radius:5px;
  font-size:.7rem;
}

.erp-step.done .erp-step-dot{background:#0A7A44}
.erp-step.current .erp-step-dot{background:#B7791F}

.erp-step b{
  font-family:var(--font-ui);
  font-size:.72rem;
}

.erp-step small{
  font-size:.68rem;
}

.expediente-panel{
  background:#fff;
}

.expediente-summary{
  gap:.3rem;
}

.exp-pill{
  min-height:22px;
  border-radius:4px;
  font-size:.68rem;
}

.expediente-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.8rem;
}

.exp-card{
  border-radius:6px;
  box-shadow:none;
}

.exp-card-head{
  background:#F7F9FC !important;
  padding:.58rem .7rem;
}

.exp-icon{
  width:22px;
  height:22px;
  border-radius:5px;
}

.exp-facts div{
  padding:.42rem 0;
}

.exp-facts dd{
  font-weight:800;
}

.checklist-panel{
  background:#fff;
}

.checklist-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}

.check-item{
  border-radius:6px;
  background:#fff !important;
}

.next-action-panel{
  background:#fff;
}

.fact-grid{
  border:1px solid var(--erp-line);
  border-radius:6px;
  overflow:hidden;
}

.fact{
  border-right:1px solid var(--erp-line);
  border-bottom:1px solid var(--erp-line);
}

.fact:nth-child(3n){
  border-right:0;
}

.gps-panel{
  border-radius:7px;
}

.gps-sec{
  border-radius:6px;
}

.admin-table,
table{
  font-size:.84rem;
}

th{
  background:#F7F9FC;
  color:#40516B;
}

@media(max-width:1200px){
  .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .erp-flow{grid-template-columns:repeat(3,minmax(0,1fr))}
  .erp-step:nth-child(3){border-right:0}
}

@media(max-width:760px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .expediente-grid{grid-template-columns:1fr}
}

/* =====================================================================
   CAPA ERP — menu por modulos y acceso mas serio
   ===================================================================== */
body:not(.login-page) .erp-side-meta{
  position:relative;
  z-index:1;
  margin:12px 2px 4px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:7px;
  background:rgba(255,255,255,.045);
  color:#DDE7F7;
}

body:not(.login-page) .erp-side-meta span,
body:not(.login-page) .erp-session-label span{
  display:block;
  color:#8FA1BD;
  font-size:.66rem;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}

body:not(.login-page) .erp-side-meta strong,
body:not(.login-page) .erp-session-label strong{
  display:block;
  margin-top:3px;
  color:#fff;
  font-size:.79rem;
  font-weight:800;
}

body:not(.login-page) .nav-section-label{
  margin:14px 10px 4px;
  color:#7F91AF;
  font-size:.63rem;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
}

body:not(.login-page) .nav-main{
  display:flex;
  min-width:0;
  flex:1;
  flex-direction:column;
  justify-content:center;
  line-height:1.05;
}

body:not(.login-page) .nav-main b{
  display:block;
  color:inherit;
  font-size:.91rem;
  font-weight:900;
}

body:not(.login-page) .nav-main small{
  display:block;
  margin-top:4px;
  overflow:hidden;
  color:#8FA1BD;
  font-size:.67rem;
  font-weight:700;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}

body:not(.login-page) .nav-code{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:20px;
  padding:0 7px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:999px;
  color:#AAB8CF;
  background:rgba(255,255,255,.045);
  font-size:.58rem;
  font-weight:900;
  letter-spacing:.09em;
}

body:not(.login-page) .nav-link.active .nav-code{
  color:#071A39;
  border-color:#F7B739;
  background:#F7B739;
}

body:not(.login-page) .nav-link.active .nav-main small{
  color:#DDE7F7;
}

body:not(.login-page) .erp-session-label{
  padding:8px 10px 9px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:7px;
  background:rgba(255,255,255,.04);
}

@media(min-width:901px){
  body:not(.login-page) .topbar{
    width:286px;
  }

  body:not(.login-page) .container,
  body:not(.login-page) .foot{
    margin-left:286px;
  }

  body:not(.login-page) .nav-link{
    min-height:52px;
  }

  .nav-toggle:checked ~ .topbar{
    width:var(--side-mini);
  }

  .nav-toggle:checked ~ .container,
  .nav-toggle:checked ~ .foot{
    margin-left:var(--side-mini);
  }

  .nav-toggle:checked ~ .topbar .erp-side-meta,
  .nav-toggle:checked ~ .topbar .nav-section-label,
  .nav-toggle:checked ~ .topbar .nav-main,
  .nav-toggle:checked ~ .topbar .nav-code,
  .nav-toggle:checked ~ .topbar .erp-session-label{
    display:none;
  }

  .nav-toggle:checked ~ .topbar .nav-link{
    justify-content:center;
    min-height:46px;
    padding-left:0;
    padding-right:0;
  }
}

@media(max-width:900px){
  body:not(.login-page) .erp-side-meta{
    margin-top:10px;
  }

  body:not(.login-page) .nav-code{
    margin-left:auto;
  }
}

/* =====================================================================
   PANTALLAS ERP — expediente de viaje, worklists y modulos internos
   ===================================================================== */
.erp-module-head{
  align-items:flex-start;
  padding:0 0 16px;
  border-bottom:1px solid var(--erp-line);
}

.module-kicker{
  display:inline-flex;
  margin-bottom:5px;
  color:#51627B;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.erp-process-band{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  margin:0 0 16px;
  overflow:hidden;
  border:1px solid var(--erp-line);
  border-radius:7px;
  background:#fff;
}

.erp-process-band > div{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  column-gap:10px;
  row-gap:2px;
  padding:13px 15px;
  border-right:1px solid var(--erp-line);
}

.erp-process-band > div:last-child{
  border-right:0;
}

.erp-process-band .current{
  background:#F7FAFF;
  box-shadow:inset 0 -3px 0 var(--erp-gold);
}

.process-code{
  grid-row:1 / span 2;
  display:inline-grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:6px;
  color:#071A39;
  background:#F7B739;
  font-size:.68rem;
  font-weight:900;
}

.erp-process-band b{
  color:var(--erp-ink);
  font-size:.88rem;
  font-weight:900;
}

.erp-process-band small{
  color:#66758C;
  font-size:.72rem;
  font-weight:600;
}

.erp-kpi-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-bottom:16px;
  border:1px solid var(--erp-line);
  border-radius:7px;
  background:#fff;
}

.erp-kpi-strip > div{
  padding:13px 16px;
  border-right:1px solid var(--erp-line);
}

.erp-kpi-strip > div:last-child{
  border-right:0;
}

.erp-kpi-strip span{
  display:block;
  color:#66758C;
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
}

.erp-kpi-strip b{
  display:block;
  margin-top:4px;
  color:#061840;
  font-size:1.35rem;
  font-weight:900;
}

.erp-kpi-strip b.danger{color:#C13B3B}
.erp-kpi-strip b.warn{color:#B5731C}
.erp-kpi-strip b.ok{color:#1B7A4C}

.erp-worklist .panel-head{
  margin-bottom:0;
}

.erp-worklist-table{
  min-width:980px;
}

.erp-worklist-table th{
  font-size:.68rem;
  letter-spacing:.12em;
}

.erp-worklist-table td{
  vertical-align:middle;
}

.work-row.sem-rojo{
  background:#FFF7F7;
}

.work-row.sem-amarillo{
  background:#FFFBF2;
}

.work-priority{
  display:inline-block;
  width:8px;
  height:32px;
  margin-right:8px;
  border-radius:99px;
  vertical-align:middle;
  background:#8390A4;
}

.work-priority.sem-rojo{background:#C13B3B}
.work-priority.sem-amarillo{background:#B5731C}
.work-priority.sem-verde{background:#1B7A4C}

.erp-doc-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:-4px 0 16px;
  padding:8px;
  border:1px solid var(--erp-line);
  border-radius:7px;
  background:#fff;
}

.erp-doc-tabs a,
.erp-doc-tabs button{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:0 11px;
  border:1px solid transparent;
  border-radius:6px;
  color:#40516B;
  font-size:.78rem;
  font-weight:900;
  text-decoration:none;
  font-family:inherit;
  cursor:pointer;
}

.erp-doc-tabs a:hover,
.erp-doc-tabs button:hover{
  color:#061840;
  border-color:#C9D6E8;
  background:#F7FAFF;
}

.erp-doc-tabs button.is-active{
  color:#061840;
  border-color:#F2B333;
  background:#FFF8E8;
  box-shadow:inset 0 -2px 0 #E69A00;
}

.detail-route-summary{
  margin-bottom:12px;
}

[data-detail-panel][hidden]{
  display:none !important;
}

.detail-shell:not(.detail-tab-expediente){
  display:flex;
  flex-direction:column;
  gap:0;
}

.detail-shell:not(.detail-tab-expediente) > .main-col,
.detail-shell:not(.detail-tab-expediente) > .rail{
  display:contents;
}

.detail-shell:not(.detail-tab-expediente) [data-detail-panel]:not([hidden]){
  width:100%;
  min-width:0;
}

.detail-shell.detail-tab-tracking #tab-tracking{
  max-width:none;
}

@media (max-width:700px){
  body:not(.login-page) .container,
  body:not(.login-page) .foot,
  .nav-toggle:checked ~ .container,
  .nav-toggle:checked ~ .foot{
    margin-left:0;
  }

  .erp-doc-tabs{
    flex-wrap:nowrap;
    overflow-x:auto;
    scrollbar-width:thin;
  }

  .erp-doc-tabs button{
    flex:0 0 auto;
  }
}

.erp-submodule-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0 0 14px;
}

.erp-submodule{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  column-gap:10px;
  row-gap:2px;
  padding:12px;
  border:1px solid var(--erp-line);
  border-radius:6px;
  color:#061840;
  background:#F8FAFD;
  text-decoration:none;
}

.erp-submodule:hover{
  border-color:#B8C6D9;
  background:#fff;
  text-decoration:none;
}

.erp-submodule span{
  grid-row:1 / span 2;
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:6px;
  color:#071A39;
  background:#F7B739;
}

.erp-submodule b{
  font-size:.86rem;
  font-weight:900;
}

.erp-submodule small{
  color:#66758C;
  font-size:.72rem;
  font-weight:700;
}

.erp-finance-panel,
.erp-evidence-panel{
  border-left:3px solid #C9A24C;
}

.evidence-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.evidence-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--erp-line);
  border-radius:6px;
  background:#F8FAFD;
}

.evidence-row > span{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:6px;
  color:#071A39;
  background:#F7B739;
}

.evidence-row b,
.evidence-row small{
  display:block;
}

.evidence-row small{
  margin-top:2px;
  color:#66758C;
  font-size:.74rem;
}

@media(max-width:1000px){
  .erp-process-band,
  .erp-kpi-strip{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .erp-process-band > div:nth-child(2),
  .erp-kpi-strip > div:nth-child(2){
    border-right:0;
  }

  .erp-submodule-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:620px){
  .erp-process-band,
  .erp-kpi-strip{
    grid-template-columns:1fr;
  }

  .erp-process-band > div,
  .erp-kpi-strip > div{
    border-right:0;
    border-bottom:1px solid var(--erp-line);
  }

  .erp-process-band > div:last-child,
  .erp-kpi-strip > div:last-child{
    border-bottom:0;
  }

  .evidence-row{
    grid-template-columns:auto minmax(0,1fr);
  }

  .evidence-row .btn{
    grid-column:1 / -1;
    justify-content:center;
  }
}
.capture-confirm-bar{
  display:flex;align-items:center;gap:.8rem;margin:.75rem 0 .9rem;padding:.8rem .9rem;
  border:1px solid #cbd8e8;border-radius:10px;background:#f7f9fc
}
.capture-confirm-bar>div{display:flex;flex:1;min-width:0;flex-direction:column;gap:.15rem}
.capture-confirm-bar small{color:var(--muted)}
.capture-confirm-bar form{margin:0}
.capture-confirm-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#e7eef8;color:var(--navy)}
.capture-confirm-bar.is-confirmed{border-color:#9fd8b8;background:#f0faf4}
.capture-confirm-bar.is-confirmed .capture-confirm-icon{background:#12804a;color:#fff}
.check-toggle.is-complete{border-color:#9fd8b8;background:#f0faf4;color:#116a40}
@media(max-width:760px){
  .capture-confirm-bar{align-items:flex-start;flex-wrap:wrap}
  .capture-confirm-bar form,.capture-confirm-bar .btn{width:100%}
}

/* ===== Operación integral: actividad, incidencias, ruta y cobranza ===== */
.app-shell>.main-col>.erp-process-band{grid-template-columns:repeat(2,minmax(0,1fr))}
.app-shell>.main-col>.erp-process-band>div:nth-child(2){border-right:0}
.app-shell>.main-col>.erp-process-band>div:nth-child(-n+2){border-bottom:1px solid var(--erp-line)}
.app-shell>.main-col>.dashboard-process-queues{grid-template-columns:repeat(4,minmax(0,1fr))}
.app-shell>.main-col>.dashboard-process-queues .dashboard-queue-title{grid-column:1/-1;border-right:0;border-bottom:1px solid var(--line)}
.notification-menu{position:relative}
.notification-button{position:relative;display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.16);border-radius:12px;color:#fff;cursor:pointer;list-style:none;background:rgba(255,255,255,.06)}
.notification-button::-webkit-details-marker{display:none}
.notification-button .ic{width:21px;height:21px}
.notification-badge,.mobile-notification span{position:absolute;right:-5px;top:-6px;display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border:2px solid var(--navy);border-radius:999px;background:#ef3f3f;color:#fff;font:800 10px/1 Montserrat,sans-serif}
.notification-drop{position:absolute;z-index:80;left:calc(100% + 12px);bottom:0;width:min(390px,calc(100vw - 32px));border:1px solid #cfdaea;border-radius:15px;background:#fff;color:var(--navy);box-shadow:0 22px 55px rgba(6,29,68,.28);overflow:hidden}
.notification-drop-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:15px 16px;border-bottom:1px solid #e0e7f1}
.notification-drop-head>div{display:flex;flex-direction:column;gap:3px}.notification-drop-head small{color:var(--muted);font-size:.72rem}.notification-drop-head form{margin:0}.notification-drop-head button{border:0;background:none;color:#1263c7;font:700 .72rem Montserrat;cursor:pointer}
.notification-feed{max-height:410px;overflow:auto}.notification-item{display:grid;grid-template-columns:10px 1fr;gap:10px;padding:13px 16px;border-bottom:1px solid #edf1f6;color:inherit;text-decoration:none}.notification-item:hover{background:#f5f8fc}.notification-item.unread{background:#eef5ff}.notification-item>span:last-child{display:flex;min-width:0;flex-direction:column;gap:4px}.notification-item b{font-size:.78rem}.notification-item small{overflow:hidden;color:#53657f;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.notification-item time{color:#8190a5;font-size:.62rem}.notification-dot{width:8px;height:8px;margin-top:4px;border-radius:50%;background:#2e78d2}.severity-critico .notification-dot{background:#df3f3f}.severity-advertencia .notification-dot{background:#e59712}.severity-exito .notification-dot{background:#138453}.notification-all{display:block;padding:12px;text-align:center;color:#0d5ebc;text-decoration:none;font-size:.74rem;font-weight:800}.notification-empty{padding:28px 16px;text-align:center;color:var(--muted);font-size:.75rem}
.mobile-notification{display:none;position:relative;margin-left:auto;color:#fff}.mobile-notification .ic{width:23px;height:23px}

.activity-page{padding:0;overflow:hidden}.activity-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:12px;padding:15px 18px;border-bottom:1px solid #e4eaf2;color:inherit;text-decoration:none}.activity-row:hover{background:#f7f9fc}.activity-row.unread{background:#eef5ff}.activity-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#e7eef8;color:#0d5ebc}.activity-copy{display:flex;min-width:0;flex-direction:column;gap:4px}.activity-copy b{font-size:.9rem}.activity-copy small{color:#40536e}.activity-copy em{color:#7b899d;font-size:.7rem;font-style:normal}

.kpi-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px;border:1px solid #d6dfec;border-radius:14px;background:#fff;overflow:hidden}.kpi-strip>span{display:flex;min-height:96px;flex-direction:column;justify-content:center;gap:5px;padding:15px 18px;border-right:1px solid #dfe6f0}.kpi-strip>span:last-child{border-right:0}.kpi-strip small{color:#63738b;font-size:.68rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.kpi-strip b{font-size:1.5rem}.kpi-strip em{color:#6c7a8e;font-size:.7rem;font-style:normal}.kpi-strip .warn{background:#fff9ed}.kpi-strip .success{background:#eef9f3}.kpi-strip .danger{background:#fff0f0}.kpi-strip.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
.panel-title-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid #d9e2ef}.panel-title-row>div{display:flex;align-items:center;gap:10px}.panel-title-row h2{margin:0}.section-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:10px;background:var(--navy);color:#fff}.section-icon .ic{width:20px;height:20px}
.incident-list{display:flex;flex-direction:column;gap:10px}.incident-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);gap:18px;padding:15px;border:1px solid #dbe3ee;border-left:4px solid #e29a19;border-radius:11px;background:#fff}.incident-card.severity-critico{border-left-color:#db3939;background:#fffafa}.incident-main p{margin:8px 0;color:#40516a;font-size:.82rem}.incident-main small{color:#73829a}.incident-title{display:flex;align-items:center;gap:9px}.incident-actions{display:flex;flex-direction:column;gap:8px}.incident-actions form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:7px}.incident-actions input,.incident-actions select{min-width:0}.incident-resolved{display:flex;align-items:center;justify-content:flex-end;gap:7px;color:#15824f;font-weight:800}.incident-resolved small{color:#75849a;font-weight:500}
.erp-table td small{display:block;margin-top:4px;color:#76859a;font-size:.68rem}.empty-cell{text-align:center!important;color:var(--muted);padding:28px!important}.inline-action{position:relative}.inline-action>summary{list-style:none}.inline-action>summary::-webkit-details-marker{display:none}.inline-action form{display:flex;min-width:420px;gap:7px;margin-top:8px}.inline-action input{min-width:0}

.route-plan-form{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr)) auto;align-items:end;gap:8px 10px;padding:10px 12px;border:1px solid #DDE4EC;border-radius:4px;background:#F7F9FB}
.route-plan-form .field{margin:0}
.route-plan-form > .btn{height:38px}
.route-block-title{display:flex;align-items:baseline;gap:8px;margin:14px 0 6px;padding-top:10px;border-top:1px solid #E3E8EF;font:800 .66rem/1.2 var(--font-ui);letter-spacing:.1em;text-transform:uppercase;color:#3A4C68}
.route-block-title small{font-size:.68rem;font-weight:600;letter-spacing:0;text-transform:none;color:#7C8AA0}
.route-stops{position:relative;display:flex;flex-direction:column;gap:6px;margin:8px 0 4px}
.route-stops:before{content:"";position:absolute;left:14px;top:14px;bottom:14px;width:2px;background:#D8E2EE}
.route-stop{position:relative;display:grid;grid-template-columns:30px minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:7px 10px;border:1px solid #DCE4EF;border-radius:4px;background:#fff}
.route-stop-order{z-index:1;display:grid;place-items:center;width:26px;height:26px;border:2px solid #fff;border-radius:50%;background:#DFE8F4;color:#0A2A59;font-size:.72rem;font-weight:900}
.route-stop.state-en_sitio .route-stop-order{background:#F4AD1C}
.route-stop.state-completada .route-stop-order{background:#178450;color:#fff}
.route-stop-copy{display:flex;min-width:0;flex-direction:column;gap:2px}
.route-stop-copy>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.route-stop-copy small{color:#6A7A91;font-size:.7rem}
.route-stop form{display:flex;gap:6px;align-items:center}
.route-stop form select{height:30px;width:auto;min-width:120px;margin:0;font-size:.76rem}
.route-stop-add{margin-top:8px}
.route-stop-add>summary{width:max-content;list-style:none}
.route-stop-add>summary::-webkit-details-marker{display:none}
.route-stop-add form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;margin-top:8px;padding:10px 12px;border:1px solid #DDE4EC;border-radius:4px;background:#F7F9FB}
.route-stop-add form .field{margin:0}
.route-stop-add .route-notes{grid-column:span 2}
.route-stop-add form>.btn{align-self:end;height:38px}

.filter-bar{display:flex;align-items:end;gap:10px;margin-bottom:15px}.filter-bar label{display:flex;flex-direction:column;gap:5px;color:#52647e;font-size:.72rem;font-weight:700}.filter-bar input[type=search]{min-width:300px}.report-grid{align-items:start}.report-trip-list{display:flex;flex-direction:column}.report-trip-list a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 4px;border-bottom:1px solid #e2e8f0;color:inherit;text-decoration:none}.report-trip-list a:hover{background:#f7f9fc}.report-trip-list a>span{display:flex;flex-direction:column;gap:4px}.report-trip-list a>span:last-child{text-align:right}.report-trip-list small{color:#718198;font-size:.68rem}.text-ok{color:#168350}.text-danger{color:#cf3838}

@media(max-width:1100px){
  .route-plan-form{grid-template-columns:repeat(2,minmax(0,1fr))}.route-plan-form .btn{width:100%}
  .incident-card{grid-template-columns:1fr}.kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-strip>span:nth-child(2){border-right:0}.kpi-strip>span:nth-child(-n+2){border-bottom:1px solid #dfe6f0}
}
@media(max-width:760px){
  .mobile-notification{display:block}.notification-menu{display:none}.notification-drop{position:fixed;inset:64px 10px auto 10px;width:auto}
  .activity-row{grid-template-columns:40px minmax(0,1fr)}.activity-row>.pill{grid-column:2}
  .kpi-strip,.kpi-strip.compact{grid-template-columns:1fr}.kpi-strip>span{min-height:78px;border-right:0;border-bottom:1px solid #dfe6f0}.kpi-strip>span:last-child{border-bottom:0}
  .incident-actions form{grid-template-columns:1fr}.route-plan-form,.route-stop-add form{grid-template-columns:1fr}.route-stop-add .route-notes{grid-column:auto}.route-stop{grid-template-columns:38px minmax(0,1fr)}.route-stop>.pill,.route-stop>form{grid-column:2}.route-stop form{flex-wrap:wrap}.filter-bar{align-items:stretch;flex-direction:column}.filter-bar input[type=search]{min-width:0;width:100%}.inline-action form{min-width:0;flex-direction:column}.report-kpis{grid-template-columns:1fr}
}

/* =====================================================================
   SISTEMA ERP RSR — CAPA DE UNIFICACIÓN (2026-07)
   Consolida tokens, encabezados de módulo, barra de comandos, filtros,
   tablas, badges de estado y botoneras. No renombra clases usadas por JS.
   ===================================================================== */
:root{
  /* tokens que se referenciaban sin definición (fix) */
  --navy:#0A2B5E;
  --display:var(--font-brand);

  /* estados semánticos — única fuente de verdad de color de estado */
  --st-ok-bg:#E5F4EC;   --st-ok-tx:#0F6B40;   --st-ok-bd:#BFDFCE;   --st-ok:#128A52;
  --st-warn-bg:#FDF2DC; --st-warn-tx:#8A5A08; --st-warn-bd:#EDD8A8; --st-warn:#D98A0B;
  --st-danger-bg:#FBE9E9;--st-danger-tx:#A32C2C;--st-danger-bd:#EFC7C7;--st-danger:#C43838;
  --st-info-bg:#E8F0FC; --st-info-tx:#1252A8; --st-info-bd:#C6D9F2; --st-info:#1D63C4;
  --st-neutral-bg:#EEF1F5;--st-neutral-tx:#55647D;--st-neutral-bd:#D8DFEA;--st-neutral:#7C8AA0;

  /* controles */
  --ctl-h:36px; --ctl-h-sm:30px; --ctl-radius:4px;
}

/* ---------- 1. Jerarquía tipográfica compacta ---------- */
h1{font-size:1.5rem; line-height:1.15; letter-spacing:.005em}
.title-row h1{font-size:1.5rem}
.page-head .sub{margin-top:.3rem; font-size:.85rem; max-width:880px}
@media(max-width:820px){
  .title-row h1, h1{font-size:1.3rem}
}

/* ---------- 2. Encabezado de módulo + breadcrumb + barra de comandos ---------- */
.page-head{
  align-items:flex-end;
  margin-bottom:16px;
  padding-bottom:12px;
  border-bottom:1px solid var(--erp-line);
  row-gap:.6rem;
}
.crumbs{
  display:flex; align-items:center; flex-wrap:wrap; gap:7px;
  margin:0 0 7px; font-size:.7rem; font-weight:700; color:#66758C;
}
.crumb-code{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:36px; height:19px; padding:0 7px; border-radius:4px;
  background:var(--navy); color:#F7B739;
  font-size:.6rem; font-weight:900; letter-spacing:.09em;
}
.crumbs a{color:#51627B; text-decoration:none}
.crumbs a:hover{color:#08285D; text-decoration:underline}
.crumb-sep{color:#B4C0D2; font-weight:400}
.crumb-here{color:var(--navy); font-weight:800}
.page-head .back{display:inline-flex; align-items:center; gap:4px; margin-bottom:6px; font-size:.76rem; font-weight:700}

.head-actions{gap:.5rem}
.head-actions .btn{min-height:34px; border-radius:var(--ctl-radius); padding:0 .85rem; font-size:.82rem; font-weight:700}
.head-actions .btn .ic{width:15px; height:15px}

/* ---------- 3. Botones: familia única, compacta y sobria ---------- */
.btn{
  min-height:34px; padding:.3rem .85rem; border-radius:var(--ctl-radius);
  font-size:.84rem; font-weight:700; color:#22344F; border-color:#C7D2E2;
  box-shadow:none;
}
.btn:hover{border-color:#8DA1BC; background:#F5F8FC}
.btn .ic{width:15px; height:15px}
.btn.lg{min-height:40px; padding:.4rem 1.15rem; font-size:.9rem}
.btn-sm{min-height:28px; padding:.15rem .6rem; font-size:.78rem; border-radius:5px}
.btn-primary{background:#08285D; border-color:#08285D; color:#fff}
.btn-primary:hover{background:#061F49; border-color:#061F49}
.btn-danger{background:#B3261E; border-color:#9C1F18; color:#fff; box-shadow:none}
.btn-danger:hover{background:#9C1F18}
.btn-gold{background:linear-gradient(180deg,#EFA31F,#D8830B); border:1px solid #C67A08; color:#fff; box-shadow:none}
.btn-gold:hover{filter:brightness(1.04)}
.btn:disabled{opacity:.5}

/* ---------- 4. Barra de filtros administrativa (patrón canónico) ---------- */
.filter-bar{
  display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px;
  margin:0 0 14px; padding:10px 12px;
  background:#fff; border:1px solid var(--erp-line); border-radius:7px;
  box-shadow:0 1px 2px rgba(8,25,55,.04);
}
.filter-bar label{
  display:flex; flex-direction:column; gap:4px;
  color:#51627B; font-size:.66rem; font-weight:800;
  text-transform:uppercase; letter-spacing:.06em;
}
.filter-bar input, .filter-bar select{
  height:var(--ctl-h); width:auto; margin:0; padding:0 10px;
  border:1px solid #C9D5E5; border-radius:var(--ctl-radius);
  background:#fff; color:var(--erp-ink);
  font:500 .82rem var(--font-ui);
  text-transform:none; letter-spacing:normal;
}
.filter-bar input[type=search]{min-width:250px}
.filter-bar input:focus, .filter-bar select:focus{border-color:#4F79B9; box-shadow:0 0 0 3px rgba(37,93,171,.1)}
.filter-bar .btn{min-height:var(--ctl-h); height:var(--ctl-h)}
.filter-clear{
  display:inline-flex; align-items:center; height:var(--ctl-h);
  color:#66758C; font-size:.78rem; font-weight:700;
}
.filter-clear:hover{color:#08285D}

/* Alinear las variantes de filtro existentes al mismo lenguaje */
.journey-filters select, .journey-filters input[type="date"]{height:38px; border-radius:var(--ctl-radius)}
.journey-filters .search{height:38px; min-height:38px; flex-basis:38px; border-radius:var(--ctl-radius)}
.journey-filter-actions{min-height:38px}
.liquidation-filter input[type=search], .liquidation-filter input[type=date]{height:36px; border-radius:var(--ctl-radius)}
.liquidation-filter .btn{height:36px; min-height:36px}
.active-ops-toolbar form .search, .active-ops-toolbar form .btn{height:36px; min-height:36px}
.search{min-height:var(--ctl-h); border-radius:var(--ctl-radius)}
.search .ic{width:17px; height:17px}
.search input, .search input[type=search]{
  height:auto; margin:0; padding:0; border:0; background:transparent; box-shadow:none;
}
.search input:focus{border:0; box-shadow:none}

/* ---------- 5. Tabla ERP única: encabezado sólido, densidad administrativa ---------- */
.table-wrap, .admin-table-wrap{overflow-x:auto; border:1px solid #D4DCE7; border-radius:4px}
.panel > .table-wrap, .panel > .admin-table-wrap{border-left:0; border-right:0; border-radius:0}
table{font-size:.8rem}
th, .admin-table th{
  padding:7px 9px;
  background:#14335F; color:#C9D6EC;
  font-size:.63rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  border-bottom:1px solid #0C2445;
  border-right:1px solid rgba(255,255,255,.07);
  white-space:nowrap;
}
th:last-child, .admin-table th:last-child{border-right:0}
td, .admin-table td{
  padding:7px 9px;
  border-bottom:1px solid #E3E8EF;
  font-size:.8rem;
  line-height:1.35;
}
td small, .admin-table td small{font-size:.68rem; color:#76859A}
td.num, th.num{text-align:right; font-variant-numeric:tabular-nums}
td.ta-c, th.ta-c{text-align:center}
.admin-table tr:hover td, tbody tr:hover{background:#F0F5FB}
.admin-table .actions .btn, td .btn-sm{min-height:26px; padding:1px 8px; font-size:.72rem; border-radius:3px}
.journey-table td{padding:.7rem .65rem}

/* Estados vacíos unificados */
td.empty-row, td.empty-cell, .empty-row{
  text-align:center; padding:1.8rem 1rem !important;
  color:var(--erp-muted); font-size:.84rem;
}
.empty-state{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; padding:2rem 1.2rem; text-align:center; color:var(--erp-muted);
}
.empty-state b{color:#3C4F6E; font-size:.9rem}
.empty-state span, .empty-state small{font-size:.8rem}

/* ---------- 6. Badges y estados: geometría y paleta únicas ---------- */
.badge, .pill, .liq-state, .journey-stage, .estado-erp, .exp-pill{
  display:inline-flex; align-items:center; gap:4px;
  min-height:22px; padding:2px 8px; border-radius:4px;
  border:1px solid transparent; font-size:.72rem; font-weight:800;
  letter-spacing:.01em; white-space:nowrap; text-transform:none;
}
.badge.lg{font-size:.8rem; min-height:26px; padding:3px 10px}
.sev{display:inline-flex; align-items:center; min-height:22px; padding:2px 8px; border-radius:4px; border:1px solid transparent; font-size:.72rem; font-weight:800}

/* — familia OK / verde — */
.badge.sem-verde, .badge.estado-disponible, .badge.disponible, .badge.tipo-inicio,
.pill.ok, .pill.resuelto, .liq-cerrada, .journey-stage.stage-liquidado,
.estado-erp.erp-verde, .exp-pill.ok, .badge.cp-disponible, .badge.prioridad-normal,
.active-trip-status.sem-verde, .flash-ok{
  background:var(--st-ok-bg); color:var(--st-ok-tx); border-color:var(--st-ok-bd);
}
.gps-chip.fresco, .gps-chip.on, .gps-chip.movil, .gps-estado-chip.fresco{
  background:var(--st-ok-bg); color:var(--st-ok-tx); border-color:var(--st-ok-bd);
}
/* — familia WARN / ámbar — */
.badge.sem-amarillo, .badge.estado-taller, .badge.taller, .badge.mantenimiento,
.pill.warn, .liq-pendiente, .journey-stage.stage-por_cerrar,
.journey-stage.stage-por_liquidar, .journey-stage.stage-revision,
.estado-erp.erp-amarillo, .exp-pill.warn, .badge.prioridad-alta, .badge.curso,
.badge.accion, .active-trip-status.sem-amarillo, .active-trip-status.closing,
.sev-advertencia{
  background:var(--st-warn-bg); color:var(--st-warn-tx); border-color:var(--st-warn-bd);
}
.gps-chip.retrasado, .gps-chip.ralenti, .gps-estado-chip.retrasado{
  background:var(--st-warn-bg); color:var(--st-warn-tx); border-color:var(--st-warn-bd);
}
/* — familia DANGER / rojo — */
.badge.sem-rojo, .badge.estado-sin_operador, .badge.sin_operador, .badge.baja,
.badge.tipo-cierre, .pill.no, .liq-observada, .journey-stage.stage-observado,
.estado-erp.erp-rojo, .exp-pill.danger, .badge.cp-cancelada, .badge.prioridad-critica,
.active-trip-status.sem-rojo, .sev-critico, .badge[class*="ev-"], .flash-error{
  background:var(--st-danger-bg); color:var(--st-danger-tx); border-color:var(--st-danger-bd);
}
/* — familia INFO / azul — */
.badge.estatus, .badge.en_viaje, .liq-en_revision, .journey-stage.stage-operacion,
.pill.saved, .pill.info, .badge.cp-asignada, .active-trip-status.open,
.exp-pill.source, .sev-info{
  background:var(--st-info-bg); color:var(--st-info-tx); border-color:var(--st-info-bd);
}
/* — familia NEUTRAL / gris — */
.badge.sem-gris, .badge.carga, .pill.auto, .liq-no_iniciada, .estado-erp.erp-gris,
.badge.tipo-seguimiento{
  background:var(--st-neutral-bg); color:var(--st-neutral-tx); border-color:var(--st-neutral-bd);
}
.gps-chip.off, .gps-chip.quieto, .gps-chip.neutro, .gps-estado-chip.sin_reporte{
  background:var(--st-neutral-bg); color:var(--st-neutral-tx); border-color:var(--st-neutral-bd);
}
/* checks de expediente: mismos colores en ambas pantallas */
.journey-checks span.ok, .active-close-checks a.done{color:var(--st-ok-tx)}
.journey-checks span.missing, .active-close-checks a.pending{color:var(--st-danger-tx)}
.active-close-checks a.done{background:var(--st-ok-bg)}
.active-close-checks a.pending{background:var(--st-danger-bg)}
.text-ok{color:var(--st-ok-tx)} .text-danger{color:var(--st-danger-tx)}
.sem-verde-txt{color:var(--st-ok-tx)!important} .sem-amarillo-txt{color:var(--st-warn-tx)!important} .sem-rojo-txt{color:var(--st-danger-tx)!important}

/* ---------- 7. Pestañas y vistas: misma silueta ---------- */
.tab{border-radius:var(--ctl-radius); padding:.35rem .8rem; min-height:34px; font-size:.84rem}
.tab.active{background:#08285D; border-color:#08285D; color:#fff}
.journey-view{border-radius:var(--ctl-radius); min-height:34px; padding:6px 11px}
.stage-chip{border-radius:5px; min-height:30px}

/* ---------- 8. Botonera única de formularios ---------- */
.form-actions, .standard-save-actions, .caseta-form-actions{
  display:flex; align-items:center; justify-content:flex-end;
  gap:.6rem; flex-wrap:wrap; margin-top:.9rem;
}
.form-actions form, .standard-save-actions form{margin:0}

/* ---------- 9. Utilidades que sustituyen estilos inline repetidos ---------- */
.field-note{display:block; margin:-.25rem 0 .9rem; color:var(--erp-muted); font-size:.78rem}
.rail-notes{margin:0; padding-left:1.05rem; color:var(--muted); font-size:.8rem; line-height:1.75}
.ta-center{text-align:center !important}
.form-inline{display:inline; margin:0}
.flex-form{display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; margin:0}
.mt-sm{margin-top:.6rem !important}
.mt-md{margin-top:.9rem !important}
.push-right{margin-left:auto !important}
.table-actions, .actions{display:flex; gap:.4rem; flex-wrap:wrap}
.table-actions form, .actions form{margin:0}

/* ---------- 10. Paneles, hubs y tarjetas: radios y sombras sobrias ---------- */
.panel{border-radius:4px; padding:.85rem 1rem; box-shadow:none; border-color:#D4DCE7}
.panel:hover{box-shadow:none}
.panel-head{min-height:0; padding-bottom:.5rem; margin-bottom:.65rem}
h2{font-size:.78rem}
.panel-title-icon{width:24px; height:24px; border-radius:4px; margin-right:.45rem}
.panel-title-icon .ic{width:13px; height:13px}
.rail .panel{padding:.8rem .9rem; background:#fff}
.section-icon{width:28px; height:28px; border-radius:4px}
.section-icon .ic{width:15px; height:15px}
.empty-state{padding:1.4rem 1rem}
.hub-card{border-radius:4px; padding:.85rem .95rem; box-shadow:none}
.hub-card:hover{box-shadow:0 2px 8px rgba(8,25,55,.08); border-color:var(--erp-gold)}
.hub-icon{width:38px; height:38px; border-radius:7px; background:var(--navy)}
.hub-icon .ic{width:19px; height:19px}
.kpi-strip{border-radius:7px; box-shadow:0 1px 2px rgba(8,25,55,.04)}
.kpi-strip>span{min-height:80px}
.kpi-strip b{font-size:1.3rem}
.liquidation-queue, .liquidation-summary, .work-center-intro, .alert-stat-card,
.incident-card, .activity-page{border-radius:7px; box-shadow:0 1px 2px rgba(8,25,55,.04)}
.queue-icon{border-radius:6px}
.notification-drop{border-radius:9px}
.gasto-modal{border-radius:8px}
.route-plan-form, .route-stop, .route-stop-add form{border-radius:7px}
.journey-pipeline, .dashboard-process-queues{border-radius:7px}
.active-ops-summary>a{border-radius:7px}
.active-trip-worklist{border-radius:7px}
.cp-kpi{border-radius:7px}
.panel-title-row .section-icon{width:34px; height:34px; border-radius:6px}
.panel-title-row .section-icon .ic{width:17px; height:17px}

/* ---------- 11. Pie de página como franja de estado ---------- */
.foot{
  margin-top:1.2rem; padding:.8rem 52px; text-align:left;
  background:#fff; border-top:1px solid var(--erp-line);
  color:#66758C; font-size:.74rem;
}
@media(max-width:900px){ .foot{padding:.8rem 18px} }

/* ---------- 12. Responsive de los componentes nuevos ---------- */
/* Los hijos de grids de contenido deben poder encoger (tablas con scroll interno) */
.two-col > *, .report-grid > *, .detail-grid > *, .alert-center-grid > *{min-width:0}
@media(max-width:900px){
  .alert-center-grid{grid-template-columns:1fr}
  .alert-summary{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
  .alert-summary{grid-template-columns:1fr}
}
@media(max-width:820px){
  .filter-bar{align-items:stretch}
  .filter-bar label{flex:1 1 45%}
  .filter-bar input, .filter-bar select{width:100%}
  .filter-bar input[type=search]{min-width:0}
  .filter-bar .btn{flex:1 1 auto; justify-content:center}
  .head-actions{width:100%}
  .head-actions .btn{flex:1 1 auto; justify-content:center}
  .form-actions .btn, .standard-save-actions .btn{flex:1 1 auto; justify-content:center}
  .crumbs{font-size:.66rem}
}

/* ---------- 13. Estados HTTP y sesión ---------- */
.system-error-page{
  min-height:100vh; margin:0; display:grid; place-items:center; padding:24px;
  background:#eef2f7; color:#0b2b5f;
}
.system-error-card{
  width:min(520px,100%); padding:34px; background:#fff;
  border:1px solid #cdd7e5; border-top:4px solid #f3a000; border-radius:7px;
  box-shadow:0 8px 24px rgba(8,25,55,.08);
}
.system-error-code{font:800 2.6rem/1 var(--display); color:#0b2b5f}
.system-error-eyebrow{
  margin:.8rem 0 .45rem; color:#66758c; font-size:.69rem;
  font-weight:800; letter-spacing:.16em;
}
.system-error-card h1{margin:0 0 .65rem; font-size:1.45rem}
.system-error-card>p:not(.system-error-eyebrow){margin:0; color:#52627a; line-height:1.55}
.system-error-actions{margin-top:1.35rem}

.setup-readiness{margin-bottom:1rem}
.setup-checks{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px}
.setup-check{
  display:grid; gap:3px; padding:12px 14px; color:var(--navy);
  background:#f6f8fb; border:1px solid #d6deea; border-left:3px solid #17834f;
  border-radius:4px; text-decoration:none;
}
.setup-check:hover{background:#fff; border-color:#aebbd0}
.setup-check.is-pending{border-left-color:#bf2f2f; background:#fff6f5}
.setup-check.is-warning{border-left-color:#c17a08; background:#fff9ec}
.setup-check b{font-size:.78rem; text-transform:uppercase; letter-spacing:.04em}
.setup-check span{font-weight:800; font-size:1rem}
.setup-check small{color:#66758c; line-height:1.35}
@media(max-width:760px){.setup-checks{grid-template-columns:1fr}}

/* ---------- 14. Control operativo por hitos ---------- */
.callout{
  margin:.65rem 0; padding:.7rem .8rem; border:1px solid var(--st-info-bd);
  border-left-width:4px; border-radius:4px; background:var(--st-info-bg);
  color:var(--st-info-tx); font-size:.8rem; line-height:1.45;
}
.callout.info{background:var(--st-info-bg); border-color:var(--st-info-bd); color:var(--st-info-tx)}
.callout.warning{background:var(--st-warn-bg); border-color:var(--st-warn-bd); color:var(--st-warn-tx)}
.callout.danger{background:var(--st-danger-bg); border-color:var(--st-danger-bd); color:var(--st-danger-tx)}
.static-field{
  display:flex; align-items:center; min-height:38px; padding:0 11px;
  border:1px solid #c3cdda; border-radius:5px; background:#f4f6f9;
  color:#40516b; font-size:.84rem; font-weight:700;
}
.departure-checklist{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px;
  margin:.65rem 0 .9rem;
}
.departure-checklist .check-toggle{margin:0; min-height:40px}
.status-list{list-style:none; margin:0; padding:0; display:grid; gap:5px}
.status-list li{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:7px 8px; border:1px solid #d6deea; border-left-width:3px;
  border-radius:4px; background:#f8fafc; font-size:.72rem;
}
.status-list li span{color:#52627a}.status-list li b{text-align:right}
.status-list .status-ok{border-left-color:#17834f}
.status-list .status-warning{border-left-color:#c17a08; background:var(--st-warn-bg)}
.status-list .status-blocked{border-left-color:#bf2f2f; background:var(--st-danger-bg)}
.product-metrics{grid-template-columns:repeat(5,minmax(0,1fr))}
.product-custody-panel .metric{min-width:0}
.product-custody-panel .m-v{font-size:1rem; overflow-wrap:anywhere}
.checkin-workspace #control-producto{padding:.7rem; background:#f6f8fb; border:1px solid #d6deea; border-radius:4px}
.checkin-workspace .excepcion-fields{margin-top:.7rem; padding:.7rem; background:#fff8f0; border:1px solid #ead1a5; border-radius:4px}
@media(max-width:900px){
  .product-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .departure-checklist,.product-metrics{grid-template-columns:1fr}
  .form-actions .btn{width:100%}
}
/* Catálogos operativos v4 ------------------------------------------------ */
.page-command-bar{display:flex;justify-content:flex-end;gap:8px;margin:-4px 0 14px}
.erp-form{display:grid;gap:14px;max-width:1500px;margin:0 auto}.erp-form.form-narrow{max-width:900px}
.form-section-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;min-width:0}
.form-section-grid>*{min-width:0}.three-col{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.form-span-2{grid-column:span 2}.form-span-3{grid-column:1/-1}
.compact-checks{align-items:center;margin-top:8px;gap:8px}.compact-checks .check-toggle{margin:0;min-width:0}.compact-checks .check-toggle span{width:100%;min-height:38px;padding:8px 10px;border-color:#c3cdda;border-radius:5px;background:#f7f9fc;color:var(--navy);font-size:.78rem}.compact-checks .check-toggle:has(input:checked) span{border-color:#8fcaa9;background:#eef9f3;color:#116a40}.service-picker-panel{border-left:3px solid var(--amber,#f2a000)}
.route-request-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.route-request-grid .route-wide{grid-column:span 2}
.international-fields{border-top:1px solid var(--line,#d6deea);margin-top:14px;padding-top:14px}.international-fields[hidden]{display:none}
.sticky-actions{position:sticky;bottom:0;z-index:8;background:rgba(244,247,251,.96);border-top:1px solid var(--line,#d6deea);padding:12px 0;backdrop-filter:blur(5px)}
.erp-table td small{display:block;margin-top:3px;color:var(--muted,#65748b)}
.route-reference-strip{display:grid;grid-template-columns:2fr 1fr 1fr;gap:1px;background:var(--line,#d6deea);border:1px solid var(--line,#d6deea);margin:0 0 14px}.route-reference-strip>div{background:#f7f9fc;padding:9px 12px}.route-reference-strip span{display:block;color:var(--muted,#65748b);font-size:11px;text-transform:uppercase;font-weight:700;letter-spacing:.04em}.route-reference-strip b{font-size:13px}
.route-plan-form .route-plan-wide{grid-column:span 2}.route-deviations{display:grid;gap:7px;margin:8px 0 12px}.route-deviation{border:1px solid var(--line,#d6deea);border-left:3px solid #8ba0bb;border-radius:4px;padding:9px 11px;background:#fff}.route-deviation.deviation-operativa{border-left-color:#e49a13}.route-deviation.deviation-critica{border-left-color:#c93636}.route-deviation>div{display:flex;align-items:center;gap:9px}.route-deviation small{display:block;color:var(--muted,#65748b);margin-top:5px}.empty-inline{padding:10px 0;color:var(--muted,#65748b);font-size:13px}.deviation-form{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.deviation-form .deviation-wide{grid-column:span 2}
@media(max-width:900px){.form-section-grid{grid-template-columns:1fr}.three-col,.route-request-grid{grid-template-columns:1fr 1fr}.form-span-3,.route-request-grid .route-wide{grid-column:1/-1}.route-reference-strip{grid-template-columns:1fr}.deviation-form{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.three-col,.route-request-grid,.deviation-form{grid-template-columns:1fr}.form-span-2,.form-span-3,.route-request-grid .route-wide,.deviation-form .deviation-wide,.route-plan-form .route-plan-wide{grid-column:auto}.page-command-bar .btn{width:100%}.sticky-actions{position:static}.route-deviation>div{align-items:flex-start;flex-direction:column}}

.table-panel .table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
/* Centro de incidencias: controles administrativos compactos. */
.incident-actions-wide {
  min-width: min(100%, 620px);
}

.incident-classify-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 1fr));
  gap: 8px;
}

.incident-classify-form input,
.incident-classify-form select,
.incident-resolve-form input {
  min-width: 0;
}

.incident-resolve-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .incident-actions-wide { min-width: 0; width: 100%; }
  .incident-classify-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .incident-classify-form,
  .incident-resolve-form { grid-template-columns: 1fr; }
}

/* Vista previa de GPS en el formulario de check-in (2026-07-20) */
.gps-panel .gps-freshness{display:flex;align-items:center;gap:6px;font-weight:800;font-size:.82rem;margin:2px 0 8px;padding:6px 9px;border-radius:8px;border:1px solid transparent}
.gps-panel .gps-freshness.gps-fresco{color:#16734A;background:#EFFAF4;border-color:#B7E7CC}
.gps-panel .gps-freshness.gps-retrasado{color:#9A6418;background:#FFF6E6;border-color:#F3D9A4}
.gps-panel .gps-freshness.gps-sin_reporte{color:#B93434;background:#FCE9E9;border-color:#F0CFCF}
.gps-panel .gps-warn{color:#B93434;font-weight:700;margin:4px 0}
.gps-panel .gps-kv{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;margin:8px 0}
.gps-panel .gps-kv dt{color:#6E7585;font-size:.75rem;font-weight:700}
.gps-panel .gps-kv dd{margin:0;font-size:.82rem;font-weight:600;text-align:right}

/* Banner: sin conexion con la API de GPS (2026-07-20) */
.gps-conn-banner{display:flex;gap:12px;align-items:flex-start;margin:0 0 16px;padding:13px 16px;border-radius:10px;background:#FCE9E9;border:1px solid #F0B7B7;border-left:5px solid #B93434;color:#7A2020}
.gps-conn-banner .gps-conn-ic{flex:0 0 auto;color:#B93434;display:flex;align-items:center}
.gps-conn-banner b{color:#8F2626}
.gps-conn-banner small{display:block;margin-top:3px;color:#9A5252;font-size:.76rem}

/* Subtitulo de encabezado en la tabla de alertas por tipo (2026-07-20) */
.th-hint{font-weight:600;color:#8B99AF;font-size:.66rem;text-transform:none}

/* ============================================================
   FIX menu movil (2026-07-20): garantizar que al abrir el cajon en celular
   se vea el MENU COMPLETO (todos los modulos), no solo el encabezado y el
   usuario. Override final: el CSS tiene varias capas y una interaccion las
   colapsaba en pantallas <=900px. Alta especificidad + !important para
   ganarle a cualquier regla previa.
   ============================================================ */
@media (max-width:900px){
  /* CAUSA RAIZ: una capa vieja dejaba el cajon en fila (flex row), empujando
     el menu (.side-nav) al borde derecho (x=285), fuera del cajon de 310px.
     Se fuerza columna para que todo se apile de arriba a abajo dentro del cajon. */
  .nav-toggle:checked ~ .topbar{
    display:flex !important;
    flex-direction:column !important;
    flex-wrap:nowrap !important;
    align-items:stretch !important;
    overflow-y:auto !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav{
    display:block !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
    visibility:visible !important;
    opacity:1 !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav .nav-section-label{
    display:block !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav > .nav-link,
  .nav-toggle:checked ~ .topbar .side-nav .nav-group-toggle{
    display:flex !important;
    height:auto !important;
    min-height:44px !important;
    visibility:visible !important;
    opacity:1 !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav > .nav-group{
    display:block !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav .nav-main{
    display:flex !important;
    flex-direction:column !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav .nav-main b,
  .nav-toggle:checked ~ .topbar .side-nav .nav-main small,
  .nav-toggle:checked ~ .topbar .side-nav .nav-link span{
    display:block !important;
  }
  .nav-toggle:checked ~ .topbar .side-nav .nav-group[open] .nav-sublink{
    display:block !important;
  }
}

/* ---------- Paginacion del lado servidor ---------- */
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;
  gap:.75rem 1rem;padding:.85rem 1rem;border-top:1px solid var(--st-border,#e3e8ec)}
.pager-info{margin:0;font-size:.85rem;color:var(--st-muted,#5f6c79)}
.pager-info b{color:var(--st-ink,#1a1f24);font-variant-numeric:tabular-nums}
.pager-links{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.pager-current{font-size:.82rem;color:var(--st-muted,#5f6c79);
  padding:0 .5rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.pager .btn.is-disabled{opacity:.45;pointer-events:none}
@media (max-width:640px){
  .pager{flex-direction:column;align-items:stretch}
  .pager-links{justify-content:center}
}

/* ---------- Estado "guardando" del anti doble envío ---------- */
.is-enviando{position:relative;opacity:.65;pointer-events:none;cursor:progress}
.is-enviando::after{content:"";display:inline-block;width:.85em;height:.85em;
  margin-left:.5em;vertical-align:-.1em;border-radius:50%;
  border:2px solid currentColor;border-right-color:transparent;
  animation:rsr-guardando .7s linear infinite}
@media (prefers-reduced-motion: reduce){
  .is-enviando::after{animation:none;border-right-color:currentColor;opacity:.4}
}
@keyframes rsr-guardando{to{transform:rotate(360deg)}}

/* Cerrar sesion en el menu lateral (movil: el user-pill de la esquina no
   siempre abre; este boton garantiza una salida visible en toda pantalla). */
.nav-logout{margin:.6rem 0 0; padding-top:.6rem; border-top:1px solid rgba(255,255,255,.08)}
.nav-logout-btn{
  width:100%; background:none; border:0; cursor:pointer; text-align:left;
  font:inherit; color:#FCA5A5;
}
.nav-logout-btn:hover{color:#fff; background:rgba(248,113,113,.14)}
.nav-logout-btn .ic{color:currentColor}
