/* CONTROL SISTEMAS — identidad RAAR.
   Los colores salen de la hoja de los ERP de RAAR (src/react-app/index.css): fondo gris muy
   claro, barra lateral azul pizarra, verde azulado de marca. Cada color tiene una función:
     - marca (verde azulado): navegación activa, botón principal, foco;
     - magnitud (azul): medidores y barras de avance;
     - estado (verde, ámbar, naranja, rojo): siempre con icono y texto, nunca solos. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fuentes/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --page: hsl(210 20% 98%); --surface: #ffffff; --ink: hsl(215 25% 15%); --ink-2: hsl(215 15% 45%);
  --grid: hsl(210 16% 93%); --axis: hsl(214 15% 72%); --border: hsl(214 20% 88%); --wash: hsl(210 20% 96%);
  --marca: hsl(168 76% 36%); --boton: hsl(168 76% 29%); --boton-h: hsl(168 76% 25%);
  --tinte: hsl(168 55% 94%); --tinte-ink: hsl(168 80% 22%);
  --good: #1b9d4a; --warning: #fab505; --serious: #ef7d3c; --critical: #dc2828; --neutral: hsl(214 15% 78%);
  --fill: hsl(199 89% 42%); --track: hsl(199 80% 91%);
  --lat: hsl(215 28% 17%); --lat-ink: hsl(210 20% 95%); --lat-ink-2: hsl(215 15% 68%);
  --lat-activo: hsl(215 25% 23%); --lat-borde: hsl(215 25% 25%); --lat-marca: hsl(168 76% 42%);
  --sombra-1: 0 1px 2px hsl(215 25% 15% / 0.05);
  --sombra: 0 16px 48px hsl(215 30% 12% / 0.20);
  --radio: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: hsl(215 28% 10%); --surface: hsl(215 25% 14%); --ink: hsl(210 20% 95%); --ink-2: hsl(215 15% 62%);
    --grid: hsl(215 25% 19%); --axis: hsl(215 20% 34%); --border: hsl(215 25% 22%); --wash: hsl(215 25% 18%);
    --marca: hsl(168 72% 42%); --boton: hsl(168 76% 29%); --boton-h: hsl(168 76% 33%);
    --tinte: hsl(168 45% 16%); --tinte-ink: hsl(168 70% 62%);
    --good: #21c45d; --warning: #fbbd23; --serious: #f38b4f; --critical: #ec5151; --neutral: hsl(215 20% 36%);
    --fill: hsl(199 89% 55%); --track: hsl(199 55% 20%);
    --lat: hsl(215 30% 12%); --lat-activo: hsl(215 25% 18%); --lat-borde: hsl(215 25% 20%);
    --sombra-1: none;
    --sombra: 0 16px 48px hsl(0 0% 0% / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: hsl(215 28% 10%); --surface: hsl(215 25% 14%); --ink: hsl(210 20% 95%); --ink-2: hsl(215 15% 62%);
  --grid: hsl(215 25% 19%); --axis: hsl(215 20% 34%); --border: hsl(215 25% 22%); --wash: hsl(215 25% 18%);
  --marca: hsl(168 72% 42%); --boton: hsl(168 76% 29%); --boton-h: hsl(168 76% 33%);
  --tinte: hsl(168 45% 16%); --tinte-ink: hsl(168 70% 62%);
  --good: #21c45d; --warning: #fbbd23; --serious: #f38b4f; --critical: #ec5151; --neutral: hsl(215 20% 36%);
  --fill: hsl(199 89% 55%); --track: hsl(199 55% 20%);
  --lat: hsl(215 30% 12%); --lat-activo: hsl(215 25% 18%); --lat-borde: hsl(215 25% 20%);
  --sombra-1: none;
  --sombra: 0 16px 48px hsl(0 0% 0% / 0.6);
}

* { box-sizing: border-box; }
html { font-family: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.sec { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mayus { text-transform: uppercase; }
.mayus::placeholder { text-transform: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--marca); outline-offset: 2px; }

/* ------------------------------------------------------------------------------------------
   Estructura: barra lateral + cuerpo */

.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.lat { background: var(--lat); color: var(--lat-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--lat-borde); z-index: 40; }
.lat-marca { padding: 16px 16px 14px; border-bottom: 1px solid var(--lat-borde); }
.lat-marca img { display: block; width: 100%; height: auto; border-radius: 10px; }
.lat-marca .nom { font-weight: 700; letter-spacing: 0.08em; font-size: 13px; margin-top: 12px; }
.lat-marca .de { font-size: 12px; color: var(--lat-ink-2); margin-top: 2px; }
.lat nav { flex: 1; overflow-y: auto; padding: 10px; }
.lat .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lat-ink-2); padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin: 1px 0; border: 0; border-radius: var(--radio); background: none; color: var(--lat-ink-2); cursor: pointer; text-align: left; font-weight: 500; }
.nav:hover { background: var(--lat-activo); color: var(--lat-ink); }
.nav[aria-current="page"] { background: var(--lat-activo); color: #ffffff; box-shadow: inset 3px 0 0 var(--lat-marca); }
.nav[aria-current="page"] .ni { color: var(--lat-marca); }
.nav .n { margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; background: hsl(215 25% 30%); color: var(--lat-ink); border-radius: 10px; padding: 1px 7px; }
.nav .n.vivo { background: var(--lat-marca); color: hsl(215 30% 10%); }
.lat :focus-visible { outline-color: var(--lat-marca); }
.lat-pie { border-top: 1px solid var(--lat-borde); padding: 10px; }
.quien { display: flex; gap: 10px; align-items: center; padding: 8px 10px 4px; min-width: 0; }
.quien .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lat-marca); color: hsl(215 30% 10%); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.quien .n1 { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quien .n2 { font-size: 12px; color: var(--lat-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enlinea { padding: 8px 10px; font-size: 12px; color: var(--lat-ink-2); }
.enlinea b { color: var(--lat-ink); font-weight: 600; }
.enlinea .punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: hsl(215 15% 50%); }
.enlinea .punto.ok { background: #21c45d; }
.enlinea .punto.mal { background: #f38b4f; }
.enlinea a { color: var(--lat-ink); overflow-wrap: anywhere; }
.velo-menu { display: none; }

.ni { width: 18px; height: 18px; flex: none; }
.cuerpo { min-width: 0; display: flex; flex-direction: column; }
.cab { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 12px 24px; min-height: 68px; }
.cab-titulo { flex: 1 1 0; min-width: 0; }
.cab h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.cab .sub { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab .acc { flex: none; display: flex; gap: 8px; align-items: center; }
main { padding: 24px 24px 64px; width: 100%; max-width: 1480px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); padding: 7px 13px; cursor: pointer; white-space: nowrap; font-weight: 500; box-shadow: var(--sombra-1); }
.btn:hover { background: var(--wash); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.pri { background: var(--boton); border-color: var(--boton); color: #ffffff; }
.btn.pri:hover { background: var(--boton-h); border-color: var(--boton-h); }
.btn.mini { padding: 4px 9px; font-size: 12px; box-shadow: none; }
.btn.icono { padding: 7px; }
.btn .ni { width: 16px; height: 16px; }
.btn.solo-movil { display: none; }
.frescura { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; background: var(--surface); white-space: nowrap; }
.frescura i { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.frescura.ok i { background: var(--good); }
.frescura.vieja i { background: var(--serious); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--sombra-1); }
.card > h2, .cajon h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.card > h2 .sec { font-weight: 400; }
.rej { display: grid; gap: 16px; margin-bottom: 16px; }
.rej.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Cuatro, dos o una: nunca tres, que deja una ficha suelta en la fila de abajo. */
@media (max-width: 1300px) { .rej.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rej.t4 { grid-template-columns: minmax(0, 1fr); } }
.rej.t2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); align-items: start; }
.vacio { color: var(--ink-2); padding: 8px 0; }
.esp { margin-top: 10px; }
.card > h2.esp2 { margin-top: 22px; }
#vista > .card { margin-bottom: 16px; }
.card > p:last-child:not(.vacio) { margin-top: 10px; }

/* Fichas de cifra */
.ficha { position: relative; }
.ficha .et { font-size: 12px; color: var(--ink-2); padding-right: 44px; font-weight: 500; }
.ficha .val { font-size: 32px; font-weight: 650; line-height: 1.15; margin: 6px 0 2px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ficha .val small { font-size: 14px; font-weight: 400; color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.ficha .nota { font-size: 12px; color: var(--ink-2); min-height: 18px; }
.ficha .et + .nota { margin-top: 8px; padding-right: 44px; font-size: 13px; line-height: 1.5; }
.ficha .seg, .ficha .meter { margin: 12px 0 10px; }
.ficha .insignia { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 10px; background: var(--tinte); color: var(--tinte-ink); display: flex; align-items: center; justify-content: center; }
.ficha .insignia .ni { width: 20px; height: 20px; }

/* Barra segmentada y medidor */
.seg { display: flex; gap: 2px; height: 8px; }
.seg i { display: block; border-radius: 4px; min-width: 4px; flex: 1 1 0; }
.meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--fill); }
.meter.fino { height: 6px; }
.bg-good { background: var(--good); } .bg-warning { background: var(--warning); }
.bg-serious { background: var(--serious); } .bg-critical { background: var(--critical); }
.bg-neutral { background: var(--neutral); } .bg-pend { background: var(--grid); }

.ley { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.ley li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.ley li b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Icono + texto de estado */
.ic { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.g-good .ic, .ic.g-good { color: var(--good); } .g-warning .ic, .ic.g-warning { color: var(--warning); }
.g-serious .ic, .ic.g-serious { color: var(--serious); } .g-critical .ic, .ic.g-critical { color: var(--critical); }
.g-neutral .ic, .ic.g-neutral, .g-pend .ic { color: var(--axis); } .g-run .ic { color: var(--fill); }
.giro { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--fill); display: inline-block; animation: giro 0.9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation-duration: 4s; } }

/* Tablas */
.desliza { overflow-x: auto; }
.card.tabla { padding: 0; overflow: hidden; }
.card.tabla.desliza { overflow-x: auto; }
@media (max-width: 900px) { .card.tabla.desliza .t { min-width: 680px; } }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
.t th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--wash); }
.t th[data-a] { cursor: pointer; user-select: none; }
.t th[data-a]:hover { color: var(--ink); }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.fila { cursor: pointer; }
.t tr.fila:hover td { background: var(--wash); }
.t .nom { font-weight: 600; }
.t .chico { font-size: 12px; color: var(--ink-2); }
.t .corta { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .ult { max-width: 180px; }
.t .ruta { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t .der { text-align: right; white-space: nowrap; }
.t .larga { overflow-wrap: anywhere; min-width: 160px; }
.t .marcas { display: flex; gap: 4px; flex-wrap: wrap; }
.est { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.est .meter { flex: 1; min-width: 60px; }
.est span { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.barra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.barra input[type="search"], .barra select, .campo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radio); padding: 7px 10px; }
.barra input[type="search"]:focus, .barra select:focus, .campo:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 3px hsl(168 76% 36% / 0.18); }
.barra input[type="search"] { width: 240px; max-width: 100%; }
.barra .fin { margin-left: auto; color: var(--ink-2); font-size: 12px; }
input[type="checkbox"] { accent-color: var(--boton); }
.conmuta { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radio); overflow: hidden; background: var(--surface); }
.conmuta button { background: none; border: 0; padding: 7px 13px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.conmuta button[aria-pressed="true"] { background: var(--tinte); color: var(--tinte-ink); font-weight: 600; }

/* Filas con barra (ranking) */
.rank { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 13px; }
.rank .eti { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .eti b { font-weight: 600; margin-right: 6px; }
.rank .v { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12px; white-space: nowrap; text-align: right; }

/* Listas */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.lista li:last-child { border-bottom: 0; }
.lista .cuerpo { flex: 1; min-width: 0; display: block; }
.lista .t1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .t1 .enlace { display: inline-block; max-width: calc(100% - 26px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; text-align: left; }
.lista .t2 { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista .cuando { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.enlace { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 2px; font-weight: inherit; }
.enlace:hover { text-decoration-color: var(--marca); }
.dia { font-size: 12px; color: var(--ink-2); padding: 12px 0 2px; font-weight: 600; }
.marca { font-size: 11px; border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; color: var(--ink-2); white-space: nowrap; }
.marca.fuerte { background: var(--tinte); border-color: transparent; color: var(--tinte-ink); font-weight: 600; }

/* Matriz de auditoría */
.matriz { border-collapse: collapse; font-size: 12px; }
.matriz th, .matriz td { padding: 3px; text-align: center; }
.matriz thead th { font-weight: 500; color: var(--ink-2); line-height: 1.15; vertical-align: bottom; padding-bottom: 8px; padding-top: 12px; cursor: help; }
.matriz thead th.grupo { border-left: 1px solid var(--grid); }
.matriz td.grupo { border-left: 1px solid var(--grid); }
.matriz tbody th { text-align: left; font-weight: 600; white-space: nowrap; padding: 3px 14px 3px 16px; position: sticky; left: 0; background: var(--surface); }
.matriz tbody tr { cursor: pointer; }
.matriz tbody tr:hover th, .matriz tbody tr:hover td { background: var(--wash); }
.matriz tbody tr:last-child th, .matriz tbody tr:last-child td { padding-bottom: 12px; }
.matriz td.tot { text-align: right; padding: 3px 16px 3px 10px; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.m { display: inline-flex; width: 20px; height: 20px; border-radius: 4px; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; line-height: 1; }
.m-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.m-falta { background: var(--critical); color: #ffffff; }
.m-revisar { background: var(--warning); color: #1d2530; }
.m-na { color: var(--axis); }
.leyenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.leyenda span { display: inline-flex; gap: 6px; align-items: center; }
.cuadro { width: 14px; height: 8px; border-radius: 4px; display: inline-block; }

details > summary { cursor: pointer; }
details.punto { border-bottom: 1px solid var(--grid); }
details.punto:last-child { border-bottom: 0; }
details.punto > summary { list-style: none; display: grid; grid-template-columns: 56px minmax(0, 1.5fr) minmax(120px, 1fr) 150px; gap: 12px; align-items: center; padding: 10px 18px; }
details.punto > summary::-webkit-details-marker { display: none; }
details.punto > summary:hover { background: var(--wash); }
details.punto .dentro { padding: 4px 18px 14px 86px; font-size: 13px; }
details.punto .dentro li { padding: 2px 0; }

/* Cambios */
.cambio { margin-bottom: 16px; }
.cambio .tit { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cambio .tit h2 { font-size: 15px; font-weight: 600; }
.cambio .tit .acc { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.cambio .seg { margin: 14px 0 10px; }
.cambio .ley { display: flex; gap: 18px; flex-wrap: wrap; }
.cambio .ley li b { margin-left: 2px; }
.cambio details { margin-top: 12px; }
.pasos { counter-reset: p; list-style: none; padding: 0; margin: 8px 0 0; }
.pasos li { counter-increment: p; padding: 3px 0 3px 28px; position: relative; }
.pasos li::before { content: counter(p); position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--tinte); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; color: var(--tinte-ink); }
code, .cod { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--wash); border-radius: 4px; padding: 1px 5px; }
pre.cod { padding: 10px 12px; overflow-x: auto; margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }

/* Procesos */
.dosp { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.plista { padding: 6px; }
.pitem { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radio); padding: 9px 10px; cursor: pointer; }
.pitem:hover { background: var(--wash); }
.pitem[aria-current="true"] { background: var(--tinte); box-shadow: inset 3px 0 0 var(--marca); }
.pitem .t1 { display: flex; gap: 8px; align-items: center; }
.pitem .t1 span.tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pitem .t2 { font-size: 12px; color: var(--ink-2); margin-top: 2px; padding-left: 22px; }
.pitem .meter { margin: 6px 0 0 22px; }
.pcab h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.pcab .datos { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); align-items: center; }
.pcab .prog { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.pcab .prog .meter { flex: 1; }
.log { margin-top: 14px; border-top: 1px solid var(--grid); max-height: 62vh; overflow-y: auto; padding-top: 6px; }
.ll { display: grid; grid-template-columns: 62px 16px minmax(0, 1fr); gap: 8px; padding: 3px 0; font-size: 13px; align-items: baseline; }
.ll .h { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ll .s { font-weight: 600; }
.ll.n-paso { color: var(--ink-2); }
.ll.n-paso .s { font-weight: 400; }
.ll pre { margin: 2px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.punto-paso { width: 6px; height: 6px; border-radius: 50%; background: var(--fill); display: inline-block; margin: 0 4px; }

/* Aviso de proceso en marcha */
.marcha { background: var(--tinte); border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; padding: 8px 24px; font-size: 13px; }
.marcha .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marcha .meter { width: 160px; flex: none; }
.alerta { border: 1px solid var(--border); border-left: 3px solid var(--serious); background: var(--surface); border-radius: var(--radio); padding: 10px 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: baseline; }
.alerta.roja { border-left-color: var(--critical); }
.alerta.info { border-left-color: var(--fill); }

/* Cajón de detalle */
.velo { position: fixed; inset: 0; background: hsl(215 30% 10% / 0.45); z-index: 50; }
.cajon { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--sombra); z-index: 51; overflow-y: auto; padding: 22px 24px 40px; }
.cajon .cierra { position: absolute; top: 16px; right: 16px; }
.cajon h2 { font-size: 19px; font-weight: 650; padding-right: 90px; letter-spacing: -0.01em; }
.cajon section { margin-top: 22px; }
.cajon h3 { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.cajon .urls { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 13px; }
.cajon .urls a { color: var(--tinte-ink); }
.cajon ul.plano { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.cajon ul.plano li { padding: 6px 0; border-bottom: 1px solid var(--grid); display: flex; gap: 8px; align-items: baseline; }
.cajon ul.plano li:last-child { border-bottom: 0; }
.cajon ul.plano .cd { font-weight: 600; white-space: nowrap; min-width: 40px; }
.cajon ul.plano .dt { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.archivos { max-height: 180px; overflow-y: auto; margin-top: 6px; }
.archivos div { padding: 1px 0; overflow-wrap: anywhere; }

/* Diálogos y formularios */
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 24px; width: min(540px, 92vw); box-shadow: var(--sombra); }
dialog::backdrop { background: hsl(215 30% 10% / 0.5); }
dialog h2 { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
dialog p { margin-bottom: 10px; }
dialog label { display: block; margin: 14px 0 5px; font-weight: 500; }
dialog label.caja { font-weight: 400; margin: 8px 0; display: flex; gap: 8px; align-items: baseline; }
dialog .campo { width: 100%; }
dialog fieldset { border: 1px solid var(--border); border-radius: var(--radio); margin: 16px 0 0; padding: 6px 14px 8px; }
dialog legend { font-weight: 500; padding: 0 6px; }
dialog .pie { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
dialog .ayuda { font-size: 12px; color: var(--ink-2); margin: 5px 0 0; }
.peligro { border: 1px solid var(--border); border-left: 3px solid var(--critical); border-radius: var(--radio); padding: 10px 12px; margin-top: 14px; }
.dlg-error { border: 1px solid var(--border); border-left: 3px solid var(--critical); border-radius: var(--radio); padding: 9px 12px; margin-top: 14px; }

.tostadas { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tostada { background: hsl(215 28% 17%); color: hsl(210 20% 95%); border-radius: 10px; padding: 10px 16px; box-shadow: var(--sombra); max-width: 80vw; }

/* ------------------------------------------------------------------------------------------
   Entrada (tablero en línea): la misma pantalla que los sistemas RAAR */

.acceso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; color: #ffffff; color-scheme: dark;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #134e4a 100%); }
.acceso::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: radial-gradient(circle at 1px 1px, #ffffff 1px, transparent 0); background-size: 30px 30px; }
.acceso-caja { position: relative; width: 100%; max-width: 448px; text-align: center; }
.acceso-logo { display: block; height: 96px; width: auto; margin: 0 auto 24px; border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.35); }
.acceso h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: #ffffff; }
.acceso-sub { color: #94a3b8; margin-top: 8px; font-size: 15px; }
.acceso-tarjeta { margin-top: 32px; text-align: left; background: rgb(30 41 59 / 0.8); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: 1px solid rgb(51 65 85 / 0.5); border-radius: 16px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5); padding: 32px; }
.acceso-tarjeta h2 { font-size: 20px; font-weight: 600; text-align: center; margin-bottom: 20px; color: #ffffff; }
.acceso-tarjeta label { display: block; font-size: 14px; font-weight: 500; color: #cbd5e1; margin: 18px 0 8px; }
.acceso-nota { color: #94a3b8; font-size: 14px; text-align: center; margin-bottom: 16px; }
.acceso-nota + .acceso-error { margin-bottom: 4px; }
.con-icono { position: relative; }
.con-icono .ni { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; width: 20px; height: 20px; pointer-events: none; }
.con-icono input { width: 100%; height: 44px; padding: 0 12px 0 42px; border-radius: 8px; background: rgb(15 23 42 / 0.5); border: 1px solid #475569; color: #ffffff; font-size: 15px; }
.con-icono input::placeholder { color: #64748b; }
.con-icono input:focus { outline: none; border-color: #14b8a6; box-shadow: 0 0 0 3px rgb(20 184 166 / 0.25); }
.acceso-boton { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; margin-top: 26px; border: 0; border-radius: 12px; color: #ffffff; font-weight: 600; font-size: 16px; cursor: pointer;
  background: linear-gradient(90deg, #14b8a6, #0d9488); box-shadow: 0 10px 15px -3px rgb(20 184 166 / 0.25); }
.acceso-boton:hover { background: linear-gradient(90deg, #2dd4bf, #14b8a6); }
.acceso-boton:disabled { opacity: 0.65; cursor: not-allowed; }
.acceso-boton:focus-visible, .acceso-enlace:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
.acceso-boton .giro { border-color: rgb(255 255 255 / 0.35); border-top-color: #ffffff; width: 16px; height: 16px; }
.acceso-enlace { display: block; margin: 14px auto 0; background: none; border: 0; color: #94a3b8; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.acceso-error { background: rgb(239 68 68 / 0.1); border: 1px solid rgb(239 68 68 / 0.3); color: #f87171; border-radius: 8px; padding: 12px; font-size: 14px; }
.acceso-aviso { background: rgb(20 184 166 / 0.1); border: 1px solid rgb(20 184 166 / 0.3); color: #5eead4; border-radius: 8px; padding: 12px; font-size: 14px; margin-bottom: 10px; }
.acceso-pie { margin-top: 24px; color: #64748b; font-size: 14px; }

/* ------------------------------------------------------------------------------------------
   Pantallas estrechas */

@media (max-width: 1000px) {
  .dosp { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lat { position: fixed; top: 0; bottom: 0; left: 0; width: 272px; height: auto; transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: var(--sombra); }
  .menu-abierto .lat { transform: none; }
  .menu-abierto .velo-menu { display: block; position: fixed; inset: 0; background: hsl(215 30% 10% / 0.5); z-index: 39; }
  .btn.solo-movil { display: inline-flex; }
  .cab { padding: 10px 16px; gap: 12px; }
  .cab h1 { font-size: 17px; }
  main { padding: 16px 16px 56px; }
  .marcha { padding: 8px 16px; flex-wrap: wrap; }
  .cab .acc .btn span, .frescura .largo { display: none; }
  .cab .acc .btn { padding: 7px; }
  details.punto > summary { grid-template-columns: 48px minmax(0, 1fr); }
  details.punto .dentro { padding-left: 18px; }
  .cajon { padding: 18px 16px 32px; }
  .acceso-tarjeta { padding: 24px 20px; }
  .acceso h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .lat { transition: none; } }
