/* Rediseno Fase 1 (04-11-2026) -- paleta negro/zinc + rojo, Inter autoalojada, nav nueva.
   SOLO estilos: se carga DESPUES del <style> de cada pagina y pisa sus variables de tema
   (familia A: --surface/--ink/--accent...; familia B: --card/--ink/--accent...; trazabilidad: --panel/--txt).
   Para revertir una pagina basta quitar el <link> a este archivo y el <script src="./vendor/nav.js">. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('./inter-latin.woff2') format('woff2'); }

/* ---------- tokens: OSCURO (por defecto) ---------- */
html:root[data-theme="dark"] {
  /* familia A */
  --bg:#000; --surface:#18181b; --surface-alt:#27272a; --border:#3f3f46;
  --ink:#f4f4f5; --ink-muted:#a1a1aa; --ink-faint:#8f8f98;
  --accent:#ef4444; --accent-ink:#fff; --accent-soft:rgba(239,68,68,.16);
  --rojo:#f87171; --rojo-soft:rgba(248,113,113,.16); --amarillo:#fbbf24; --amarillo-soft:rgba(251,191,36,.15);
  --verde:#4ade80; --verde-soft:rgba(74,222,128,.14); --azul:#60a5fa; --azul-soft:rgba(96,165,250,.16);
  --shadow:0 10px 30px rgba(0,0,0,.5);
  /* familia B (control diario, reporte operativo) */
  --card:#18181b; --muted:#a1a1aa; --line:#27272a; --ok:#4ade80; --warn:#fbbf24; --bad:#f87171;
  --prev:#27272a; --dirty:#2a2411; --ok-bg:rgba(74,222,128,.14); --warn-bg:rgba(251,191,36,.15); --bad-bg:rgba(248,113,113,.16);
  /* trazabilidad */
  --panel:#18181b; --txt:#f4f4f5; --mut:#a1a1aa; --pin:#fbbf24;
  --rd-glass:rgba(0,0,0,.82);
}
/* ---------- tokens: CLARO (a pleno sol) ---------- */
html:root[data-theme="light"] {
  --bg:#f4f4f5; --surface:#ffffff; --surface-alt:#ececee; --border:#d4d4d8;
  --ink:#18181b; --ink-muted:#52525b; --ink-faint:#71717a;
  --accent:#dc2626; --accent-ink:#fff; --accent-soft:rgba(220,38,38,.09);
  --rojo:#b91c1c; --rojo-soft:rgba(185,28,28,.09); --amarillo:#a16207; --amarillo-soft:rgba(161,98,7,.11);
  --verde:#15803d; --verde-soft:rgba(21,128,61,.10); --azul:#1d4ed8; --azul-soft:rgba(29,78,216,.09);
  --shadow:0 1px 2px rgba(0,0,0,.06),0 6px 18px rgba(0,0,0,.07);
  --card:#fff; --muted:#52525b; --line:#e4e4e7; --ok:#15803d; --warn:#a16207; --bad:#b91c1c;
  --prev:#f1f1f3; --dirty:#fff8e1; --ok-bg:rgba(21,128,61,.10); --warn-bg:rgba(161,98,7,.11); --bad-bg:rgba(185,28,28,.09);
  --panel:#fff; --txt:#18181b; --mut:#52525b; --pin:#a16207;
  --rd-glass:rgba(244,244,245,.86);
}

/* ---------- base ---------- */
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
::selection { background: #dc2626; color: #fff; }
input, select, textarea, button { font-family: inherit; }
.panel, .kpi, .card, .table-scroll, .tarjeta { border-radius: 14px; }
.panel, .kpi, .alert-grid > * { min-width: 0; }   /* Inter es algo mas ancha que la fuente anterior: evita desborde horizontal en movil */
@media (max-width: 900px) { input, select, button { min-height: 40px; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- navegacion (rd-*) ---------- */
.rd-side, .rd-side *, .rd-top, .rd-top *, .rd-tab, .rd-tab *, .rd-sheet, .rd-sheet *, .rd-pal, .rd-pal * { box-sizing: border-box; }
:root { --rd-w: 236px; --rd-top: 52px; }
.rd-skip { position: absolute; left: -9999px; }
.rd-skip:focus { left: 8px; top: 8px; z-index: 200; background: var(--surface, var(--card, var(--panel))); color: var(--ink, var(--txt)); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border, var(--line)); }
.rd-side { position: fixed; inset: 0 auto 0 0; width: var(--rd-w); z-index: 90; display: flex; flex-direction: column;
  background: var(--surface, var(--card, var(--panel))); border-right: 1px solid var(--border, var(--line)); font-family: 'Inter', system-ui, sans-serif; }
.rd-brand { display: flex; gap: 10px; align-items: center; padding: 16px 16px 12px; color: var(--ink, var(--txt)); font-weight: 800; letter-spacing: -.01em; text-decoration: none; font-size: 15px; }
.rd-brand i { width: 30px; height: 30px; border-radius: 9px; background: #dc2626; display: grid; place-items: center; font-style: normal; color: #fff; font-weight: 900; }
.rd-scroll { flex: 1; overflow: auto; padding: 4px 10px 16px; }
.rd-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint, var(--muted, var(--mut))); padding: 14px 10px 6px; font-weight: 700; }
.rd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-muted, var(--muted, var(--mut))); font-weight: 500; font-size: 14px; min-height: 38px; text-decoration: none; }
.rd-item:hover { background: var(--surface-alt, var(--prev, var(--line))); color: var(--ink, var(--txt)); }
.rd-item.active { background: var(--accent-soft, rgba(239,68,68,.16)); color: var(--ink, var(--txt)); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.rd-item .ic { width: 18px; text-align: center; }
.rd-foot { padding: 10px; border-top: 1px solid var(--border, var(--line)); }
.rd-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border, var(--line)); background: transparent;
  color: var(--ink, var(--txt)); font: 600 13px 'Inter', system-ui, sans-serif; cursor: pointer; }
.rd-btn:hover { background: var(--surface-alt, var(--prev, var(--line))); }
.rd-top { position: fixed; top: 0; left: var(--rd-w); right: 0; height: var(--rd-top); z-index: 80; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: var(--rd-glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border, var(--line)); font-family: 'Inter', system-ui, sans-serif; }
.rd-crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-faint, var(--muted, var(--mut))); min-width: 0; white-space: nowrap; overflow: hidden; }
.rd-crumbs a { color: inherit; text-decoration: none; } .rd-crumbs a:hover { text-decoration: underline; }
.rd-crumbs b { color: var(--ink, var(--txt)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rd-sp { flex: 1; }
body.rd { padding-left: calc(var(--rd-w) + var(--rd-pad, 0px)) !important; padding-top: calc(var(--rd-top) + 14px) !important; }
.rd-tab { display: none; }
.rd-sheet { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.6); display: none; align-items: flex-end; }
.rd-sheet.open { display: flex; }
.rd-sheet .in { background: var(--surface, var(--card, var(--panel))); border: 1px solid var(--border, var(--line)); border-radius: 20px 20px 0 0; width: 100%; max-height: 82vh; overflow: auto; padding: 8px 14px 26px; }
.rd-pal { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: none; justify-content: center; padding-top: 12vh; }
.rd-pal.open { display: flex; }
.rd-pal .in { background: var(--surface, var(--card, var(--panel))); border: 1px solid var(--border, var(--line)); border-radius: 16px; width: min(560px, 92vw); max-height: 60vh; overflow: auto; align-self: flex-start; box-shadow: 0 20px 60px rgba(0,0,0,.5); font-family: 'Inter', system-ui, sans-serif; }
.rd-pal input { width: 100%; border: 0; border-bottom: 1px solid var(--border, var(--line)); border-radius: 0; background: transparent; color: var(--ink, var(--txt)); font: 500 16px 'Inter', system-ui, sans-serif; padding: 16px; min-height: 54px; outline: 0; }
.rd-pal a { display: flex; gap: 10px; padding: 11px 16px; color: var(--ink, var(--txt)); text-decoration: none; align-items: center; }
.rd-pal a.sel, .rd-pal a:hover { background: var(--accent-soft, rgba(239,68,68,.16)); }
.rd-pal .tag { margin-left: auto; font-size: 11px; color: var(--ink-faint, var(--muted, var(--mut))); }
.rd-kbd { font: 600 11px 'Inter', sans-serif; border: 1px solid var(--border, var(--line)); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
/* el boton viejo de hamburguesa/scrim ya no existe; por si queda alguna pagina sin migrar */
@media (max-width: 900px) {
  .rd-side { display: none; }
  .rd-top { left: 0; padding: 0 12px; }
  .rd-crumbs a, .rd-crumbs > span { display: none; } .rd-crumbs b:not(:last-child) { display: none; }
  body.rd { padding-left: var(--rd-pad, 0px) !important; padding-bottom: 84px !important; }
  .rd-tab { display: flex; position: fixed; inset: auto 0 0 0; z-index: 100; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface, var(--card, var(--panel))); border-top: 1px solid var(--border, var(--line)); font-family: 'Inter', system-ui, sans-serif; }
  .rd-tab a, .rd-tab button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 11px 'Inter', sans-serif; color: var(--ink-muted, var(--muted, var(--mut)));
    background: none; border: 0; padding: 6px 2px; min-height: 44px; border-radius: 10px; text-decoration: none; text-align: center; }
  .rd-tab .ic { font-size: 19px; line-height: 1; } .rd-tab .active { color: var(--ink, var(--txt)); background: var(--accent-soft, rgba(239,68,68,.16)); }
}

/* controles nativos (select, time, scrollbars) acordes al tema */
html:root[data-theme="dark"] { color-scheme: dark; }
html:root[data-theme="light"] { color-scheme: light; }
