/* SIMSA — sistema de diseño. Tema claro/oscuro con variables CSS (data-theme en <html>).

   Dirección: tablero de ingeniería ambiental y señalética vial. Fondos neutros (papel y asfalto),
   un verde de ingeniería para la marca y las acciones, y un ÁMBAR DE SEÑAL que se usa solo para
   alertas y lo urgente. La jerarquía la dan la tipografía (Archivo semiexpandida para cifras y títulos,
   con numerales tabulares), los filetes finos y la densidad; no las sombras, ni las pastillas, ni los
   bordes de color a un costado. Guía completa: docs/marca/README.md. */

@font-face { font-family: "Archivo"; src: url("../vendor/fuentes/archivo-latin.de2f1fe81758.woff2") format("woff2"); font-weight: 500 800; font-stretch: 100% 125%; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../vendor/fuentes/instrument-sans-latin.d4be1b605ba7.woff2") format("woff2"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../vendor/fuentes/ibm-plex-mono-500.b1c8a895f5fd.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  /* Superficies: papel, nunca blanco puro ni verde */
  --fondo: #f3f2ee;
  --fondo-elev: #fbfaf7;
  --fondo-sutil: #e9e7e1;
  --borde: #d9d6ce;
  --borde-fuerte: #aaa69b;
  --texto: #14181a;
  --texto-suave: #575d5b;

  /* Marca y acciones */
  --acento: #0b7a52;
  --acento-fuerte: #075c3e;
  --acento-suave: #dcebe3;
  --sobre-acento: #ffffff;
  --enlace: #075c3e;

  /* Señal: ámbar de señalética, SOLO para alertas y urgente */
  --senal: #f2b200;
  --senal-suave: #fbefc6;
  --senal-tinta: #6b4b00;   /* texto ámbar legible sobre papel (AA) */
  --sobre-senal: #14181a;

  --sube: #08683f;  /* un poco más oscuro que el acento: contraste AA sobre las fichas */
  --baja: #b3402a;
  --peligro: #b3402a;
  --info: #23628f;

  /* Series de gráficos: verde, petróleo, cartón, óxido, ciruela, salvia (sin el ámbar de señal) */
  --serie-1: #0b7a52;
  --serie-2: #23628f;
  --serie-3: #8f6a3a;
  --serie-4: #b3402a;
  --serie-5: #6d5687;
  --serie-6: #7d9a86;

  /* El encabezado es una franja de asfalto en los dos temas */
  --franja: #14181a;
  --franja-texto: #f1efe9;
  --franja-suave: #a6aba7;
  --franja-borde: #2b3134;

  --fuente-titulo: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --fuente: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fuente-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radio: 10px;
  --radio-chico: 7px;
  --sombra: 0 1px 0 rgb(0 0 0 / .04), 0 8px 24px -12px rgb(20 24 26 / .25);
  /* Sombra mínima de las fichas y textura de mosaico del fondo (casi imperceptibles) */
  --sombra-ficha: 0 1px 1px rgb(20 24 26 / .04), 0 3px 10px -4px rgb(20 24 26 / .10);
  --sombra-titulo: 0 1px 0 rgb(255 255 255 / .7), 0 2px 3px rgb(20 24 26 / .10), 0 6px 18px rgb(20 24 26 / .14);
  --mosaico-tinta: rgb(20 24 26 / .022);
  --curva: cubic-bezier(.2, .8, .2, 1);
  --t: 220ms var(--curva);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fondo: #0e1113;
  --fondo-elev: #151a1c;
  --fondo-sutil: #1d2326;
  --borde: #2a3134;
  --borde-fuerte: #4a5357;
  --texto: #ebe9e3;
  --texto-suave: #a0a6a3;
  --acento: #3fcf8e;
  --acento-fuerte: #74e0b0;
  --acento-suave: #133325;
  --sobre-acento: #04140c;
  --enlace: #3fcf8e;
  --senal: #ffc21a;
  --senal-suave: #3a2f0c;
  --senal-tinta: #ffd25c;
  --sobre-senal: #14181a;
  --sube: #3fcf8e;
  --baja: #f07a5c;
  --peligro: #f07a5c;
  --info: #7ab4e0;
  --serie-1: #3fcf8e;
  --serie-2: #6aaedb;
  --serie-3: #c9a26e;
  --serie-4: #f07a5c;
  --serie-5: #ad94cf;
  --serie-6: #a3c4ad;
  --franja: #080a0b;
  --franja-borde: #22282b;
  --sombra: 0 10px 30px -12px rgb(0 0 0 / .7);
  --sombra-ficha: 0 1px 1px rgb(0 0 0 / .25), 0 4px 14px -6px rgb(0 0 0 / .55);
  --sombra-titulo: 0 2px 4px rgb(0 0 0 / .45), 0 8px 22px rgb(0 0 0 / .5);
  --mosaico-tinta: rgb(255 255 255 / .018);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background-color: var(--fondo);
  /* Mosaico: baldosas alternadas, muy tenues, que le dan textura al papel sin distraer */
  background-image: repeating-conic-gradient(var(--mosaico-tinta) 0 25%, transparent 0 50%);
  background-size: 22px 22px;
  color: var(--texto);
  font: 15px/1.5 var(--fuente);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { font-family: var(--fuente-titulo); font-weight: 700; font-stretch: 108%; letter-spacing: -.012em; line-height: 1.1; text-shadow: var(--sombra-titulo); }
h1 { font-size: clamp(28px, 3.2vw, 38px); }
a { color: var(--enlace); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
::selection { background: var(--acento); color: var(--sobre-acento); }

/* Pictogramas del sprite (includes/icono.html) */
.icono { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

/* Etiqueta de sección: mayúsculas chicas y espaciadas, como en un plano */
.rotulo, .campo label, .kpi-titulo {
  font: 600 11.5px/1.2 var(--fuente); letter-spacing: .09em; text-transform: uppercase; color: var(--texto-suave);
}

/* ---------- Encabezado: franja de asfalto ---------- */

.encabezado {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 4vw, 32px); min-height: 60px;
  /* Dentro de la franja, los tokens pasan a los de la franja: botones y menú se adaptan solos */
  --texto: var(--franja-texto); --texto-suave: var(--franja-suave); --borde: var(--franja-borde);
  --fondo: var(--franja); --fondo-elev: #1b2023; --fondo-sutil: #232a2d;
  --acento: #3fcf8e; --acento-fuerte: #74e0b0; --acento-suave: #173a2a; --sobre-acento: #04140c;
  background: var(--franja); color: var(--texto);
  border-bottom: 1px solid var(--franja-borde);
}

.marca { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--texto); }
.marca-logo { width: 34px; height: 34px; flex: none; }
.marca-placa { fill: #0b7a52; }
.marca-ruta { fill: none; stroke: #fff; stroke-width: 4.4; stroke-dasharray: 100; }
.marca-base { fill: #0b7a52; stroke: #fff; stroke-width: 2.6; }
.marca-parada { fill: #fff; transform-box: fill-box; transform-origin: center; }
.marca-nombre { font: 700 24px/1 var(--fuente-titulo); letter-spacing: .06em; text-transform: uppercase; }
.marca-sub { color: var(--texto-suave); font-size: 12.5px; display: block; line-height: 1.3; margin-top: 3px; white-space: nowrap; }

.encabezado-acciones { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- Botones ---------- */

.boton {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 8px 14px; border-radius: var(--radio-chico);
  border: 1px solid var(--borde-fuerte); background: transparent;
  cursor: pointer; text-decoration: none; color: var(--texto);
  font: 600 14.5px/1.2 var(--fuente);
  transition: background-color var(--t), border-color var(--t), color var(--t), transform 120ms ease;
}
.encabezado .boton { border-color: var(--franja-borde); }
.encabezado-acciones form { display: contents; }
.boton:hover { background: var(--fondo-sutil); border-color: var(--texto-suave); }
.boton:active { transform: translateY(1px); }
.boton-primario { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); font-weight: 700; }
.boton-primario:hover { background: var(--acento-fuerte); border-color: var(--acento-fuerte); }
a.boton-primario { color: var(--sobre-acento); }
.boton-icono { padding: 8px; width: 38px; height: 38px; justify-content: center; }
.boton-icono svg { width: 19px; height: 19px; transition: transform 500ms var(--curva); }
.boton-icono:hover svg { transform: rotate(-25deg); }

.tema-sol { display: none; }
:root[data-theme="dark"] .tema-sol { display: block; }
:root[data-theme="dark"] .tema-luna { display: none; }

.usuario-nombre { color: var(--texto-suave); font-size: 14px; }

.contenido { padding: 26px clamp(16px, 4vw, 32px) 64px; max-width: 1400px; margin: 0 auto; }

/* Pie con la firma del producto */
.pie-simsa {
  max-width: 1400px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 32px) 28px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: 12.5px;
}
.pie-simsa b { font-family: var(--fuente-titulo); font-size: 14px; letter-spacing: .08em; color: var(--texto); }

/* ---------- Filtros: una banda entre filetes, no una tarjeta ---------- */

.filtros {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px;
  padding: 4px 0 18px; margin-bottom: 22px;
  border-bottom: 1px solid var(--borde);
}
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.campo input, .campo select {
  min-height: 38px; padding: 7px 10px; border-radius: var(--radio-chico);
  border: 1px solid var(--borde-fuerte); background: var(--fondo-elev);
  transition: border-color var(--t), box-shadow var(--t);
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }

/* Atajos de período: pestañas con una regla que se desliza bajo la elegida (ver tablero.js) */
.atajos {
  position: relative; display: flex; flex-wrap: wrap; gap: 0; width: 100%;
  border-bottom: 1px solid var(--borde); margin-bottom: 4px;
}
.chip {
  position: relative; z-index: 1;
  padding: 9px 14px 10px; border-radius: 0; font: 600 14px/1.2 var(--fuente);
  border: 0; background: transparent; color: var(--texto-suave); cursor: pointer;
  transition: color var(--t);
}
.chip:hover { color: var(--texto); }
.chip[aria-pressed="true"] { color: var(--texto); }
/* Sin la regla animada (páginas sin tablero.js), la pestaña activa lleva su propia regla */
.atajos:not(:has(.indicador)) .chip[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--acento); }
.indicador {
  position: absolute; z-index: 0; left: 0; top: 0;
  background: transparent; box-shadow: inset 0 -3px 0 var(--acento); opacity: 0; pointer-events: none;
  transition: transform 420ms var(--curva), width 420ms var(--curva), height 420ms var(--curva), opacity 200ms ease;
}

.filtros .boton-limpiar { margin-left: auto; }

/* ---------- Resumen (KPIs): ficha técnica con regla superior gruesa ---------- */

.kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0;
  margin-bottom: 26px; background: var(--fondo-elev);
  border: 1px solid var(--borde); border-top: 3px solid var(--texto); border-radius: var(--radio);
  box-shadow: var(--sombra-ficha); overflow: hidden;
}
.kpi {
  padding: 14px 18px 16px; min-width: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--borde);
}
.kpi:first-child { border-left: 0; }
.kpi-valor {
  font: 700 42px/1 var(--fuente-titulo); font-stretch: 108%; letter-spacing: -.02em; text-shadow: var(--sombra-titulo);
  margin-top: 10px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-valor small { font: 600 15px/1 var(--fuente); letter-spacing: 0; color: var(--texto-suave); margin-left: 4px; }
.kpi-detalle { font-size: 13px; color: var(--texto-suave); margin-top: auto; padding-top: 8px; min-height: 1.5em; }
.kpi-detalle .variacion {
  display: inline-block; font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums;
  animation: variacion 500ms 600ms var(--curva) both;
}
.kpi-detalle .sube { color: var(--sube); }
.kpi-detalle .baja { color: var(--baja); }
@keyframes variacion { from { opacity: 0; transform: translateY(4px); } }

/* Mini gráficos dentro del resumen */
.chispa { display: block; width: 100%; height: 30px; margin-top: 10px; overflow: visible; }
.chispa path.linea { fill: none; stroke: var(--serie-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chispa path.relleno { fill: color-mix(in srgb, var(--serie-1) 14%, transparent); stroke: none; }
.chispa circle { fill: var(--serie-1); }
/* Barra de proporción: regla con marcas cada 10 % */
.cobertura {
  height: 8px; margin-top: 14px; background: var(--fondo-sutil); overflow: hidden;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--borde) calc(10% - 1px) 10%);
}
.cobertura span {
  display: block; height: 100%; width: 0; background: var(--serie-2);
  transition: width 900ms var(--curva);
}
.cobertura-reciclable span { background: var(--serie-1); }

/* ---------- Gráficos ---------- */

.grilla { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.tarjeta {
  grid-column: span 12; min-width: 0;
  background: var(--fondo-elev); border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: var(--sombra-ficha);
  padding: 18px 20px 10px;
  transition: opacity 300ms ease, filter 300ms ease;
}
.tarjeta.media { grid-column: span 6; }
@media (max-width: 900px) { .tarjeta.media { grid-column: span 12; } }
/* Tablero: los dos gráficos principales comparten fila; el resto se elige en «Más gráficos» (#58) */
.tarjeta.principal { grid-column: span 8; }
.tarjeta.secundaria { grid-column: span 4; }
@media (max-width: 1100px) { .tarjeta.principal, .tarjeta.secundaria { grid-column: span 12; } }
.mas-graficos { padding-bottom: 18px; }
.mas-graficos .tarjeta-encabezado { justify-content: space-between; }
.mas-graficos .ayuda { display: block; margin-top: 2px; }
.mas-graficos-opciones { display: flex; flex-wrap: wrap; gap: 0; margin-top: 10px; border-top: 1px solid var(--borde); }
/* Opciones de «Más gráficos»: casillas en una lista, no pastillas */
.opcion-grafico {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px 11px 0; margin-right: 18px; border-radius: 0; font: 600 14px/1.2 var(--fuente); cursor: pointer;
  border: 0; background: transparent; color: var(--texto-suave);
  transition: color var(--t);
}
.opcion-grafico::before {
  content: ""; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--borde-fuerte); border-radius: 6px;
  background: var(--fondo-elev) center / 12px no-repeat; transition: background-color var(--t), border-color var(--t);
}
.opcion-grafico:hover { color: var(--texto); }
.opcion-grafico[aria-pressed="true"] { color: var(--texto); }
.opcion-grafico[aria-pressed="true"]::before {
  background-color: var(--acento); border-color: var(--acento);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4.5 12.5 4.5 4.5 10-10' fill='none' stroke='%23fff' stroke-width='3.2'/%3E%3C/svg%3E");
}
/* Calendario chico en el indicador «Días con retiro» (#58) */
.kpi.kpi-dias { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.kpi.kpi-dias > div:first-child { min-width: 0; }
.mini-calendario { flex-shrink: 0; display: grid; gap: 4px; justify-items: center; max-width: 100%; min-width: 0; }
.almanaque { display: grid; grid-template-columns: repeat(7, minmax(0, 20px)); max-width: 100%; gap: 2px; font-variant-numeric: tabular-nums; }
.almanaque b { font-size: 10px; font-weight: 700; color: var(--texto-suave); text-align: center; }
.almanaque span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 1px; font-size: 10px; color: var(--texto-suave); }
.almanaque span.con { background: color-mix(in srgb, var(--acento) calc(var(--nivel, .5) * 100%), var(--fondo)); color: var(--texto); }
.almanaque span.con.fuerte { background: var(--acento); color: var(--sobre-acento); font-weight: 700; } /* fondo lleno: el número se lee */
.almanaque span.sin { background: var(--fondo-sutil); box-shadow: inset 0 0 0 1px var(--borde); }
.almanaque span.fuera { opacity: .35; }
.almanaque-leyenda { margin: 0; font-size: 11px; color: var(--texto-suave); display: flex; align-items: center; gap: 4px; }
.almanaque-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 1px; }
.almanaque-leyenda i.con { background: var(--acento); }
@media (max-width: 700px) {
  .kpi.kpi-dias { flex-direction: column; align-items: flex-start; }
  .mini-calendario { justify-items: start; }
  .almanaque { grid-template-columns: repeat(7, minmax(0, 16px)); gap: 2px; }
  .almanaque span { font-size: 9px; }
}
.almanaque-leyenda i.sin { background: var(--fondo-sutil); box-shadow: inset 0 0 0 1px var(--borde); margin-left: 6px; }

.tarjeta-encabezado { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.tarjeta h2 { font: 700 21px/1.15 var(--fuente-titulo); margin: 0; letter-spacing: 0; text-wrap: balance; }
.tarjeta .ayuda { font-size: 13px; color: var(--texto-suave); }
.tarjeta-controles { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Control segmentado: celdas cuadradas unidas, la elegida en tinta */
.segmentado { position: relative; display: inline-flex; padding: 0; border-radius: var(--radio-chico); border: 1px solid var(--borde-fuerte); overflow: hidden; }
.segmentado button {
  position: relative; z-index: 1;
  border: 0; background: transparent; padding: 6px 13px; border-radius: 0;
  font: 600 13px/1.2 var(--fuente); cursor: pointer; color: var(--texto-suave); transition: color var(--t);
}
.segmentado button + button { box-shadow: inset 1px 0 0 var(--borde); }
.segmentado button[aria-pressed="true"] { color: var(--fondo-elev); }
.segmentado .indicador { background: var(--texto); box-shadow: none; border-radius: 0; }

.interruptor { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--texto-suave); cursor: pointer; }
.interruptor input { accent-color: var(--acento); width: 16px; height: 16px; }

.grafico { width: 100%; height: 320px; }
.grafico.alto { height: 380px; }

.vacio { display: none; padding: 48px 16px; text-align: center; color: var(--texto-suave); }
.sin-datos .vacio { display: block; }
.sin-datos .grilla, .sin-datos .kpis { display: none; }

/* Mientras llegan datos nuevos los paneles se atenúan; al llegar, los gráficos se redibujan */
.actualizando .tarjeta, .actualizando .kpi { opacity: .5; filter: saturate(.5); }

/* ---------- Movimiento ---------- */

/* Entrada escalonada: todo es visible en reposo; la animación parte de ahí */
@keyframes aparecer { from { opacity: 0; transform: translateY(12px); } }
.aparece { animation: aparecer 600ms var(--curva) both; animation-delay: calc(var(--orden, 0) * 70ms); }
/* Las celdas de una ficha entran una detrás de otra */
.kpis.aparece > .kpi, .centro-indicadores > *, .cifras > * { animation: aparecer 520ms var(--curva) both; }
.kpis.aparece > .kpi:nth-child(2), .centro-indicadores > :nth-child(2), .cifras > :nth-child(2) { animation-delay: 60ms; }
.kpis.aparece > .kpi:nth-child(3), .centro-indicadores > :nth-child(3), .cifras > :nth-child(3) { animation-delay: 120ms; }
.kpis.aparece > .kpi:nth-child(4), .centro-indicadores > :nth-child(4), .cifras > :nth-child(4) { animation-delay: 180ms; }
.kpis.aparece > .kpi:nth-child(5), .centro-indicadores > :nth-child(5), .cifras > :nth-child(5) { animation-delay: 240ms; }
.kpis.aparece > .kpi:nth-child(6), .centro-indicadores > :nth-child(6), .cifras > :nth-child(6) { animation-delay: 300ms; }
.centro-indicadores > :nth-child(n+7) { animation-delay: 360ms; }

/* Logo: la ruta dibuja la S y aparece la parada */
@keyframes marca-trazar { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes marca-parada { from { transform: scale(0); } 70% { transform: scale(1.25); } to { transform: scale(1); } }
.marca-ruta { animation: marca-trazar 900ms 100ms var(--curva) both; }
.marca-parada { animation: marca-parada 420ms 900ms var(--curva) both; }

/* Línea del mini gráfico: se dibuja */
@keyframes trazar { from { stroke-dashoffset: var(--largo, 0); } }
.chispa path.linea { stroke-dasharray: var(--largo, 0); animation: trazar 1100ms 250ms var(--curva) both; }
@keyframes rellenar { from { opacity: 0; } }
.chispa path.relleno { animation: rellenar 800ms 700ms ease both; }

.barra-carga {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 50;
  background: var(--acento);
  transition: width 400ms ease, opacity 300ms ease; opacity: 0;
}
.cargando .barra-carga { width: 70%; opacity: 1; }

/* Cambio de tema: revelado circular desde el botón (View Transitions, ver tema.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: revelar 650ms var(--curva); }
@keyframes revelar {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 0)); }
}

/* Aviso de error: borde completo y tinte; nada de barra lateral */
.aviso {
  padding: 11px 14px; border-radius: var(--radio); margin-bottom: 16px;
  background: color-mix(in srgb, var(--peligro) 9%, var(--fondo-elev)); color: var(--texto);
  border: 1px solid color-mix(in srgb, var(--peligro) 45%, var(--borde));
}
.aviso[hidden] { display: none; }

/* ---------- Login ---------- */

.pagina-login { background: var(--fondo); }
.login-pagina { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
.login-lado {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 4vw, 56px); background: var(--franja); color: #f1efe9;
}
.login-lado .marca { color: #f1efe9; }
.login-lado .marca-logo { width: 44px; height: 44px; }
.login-lado .marca-nombre { font-size: 30px; }
.login-plano { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.login-plano .grilla-plano { stroke: #f1efe9; stroke-opacity: .05; }
.login-plano .linea-ruta { fill: none; stroke: #3fcf8e; stroke-width: 5; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: login-ruta 2.4s 300ms var(--curva) forwards; }
.login-plano .parada-ruta { fill: var(--franja); stroke: #3fcf8e; stroke-width: 3.5; opacity: 0; animation: login-parada 400ms var(--curva) forwards; }
.login-plano .parada-ruta.final { fill: #3fcf8e; }
@keyframes login-ruta { to { stroke-dashoffset: 0; } }
@keyframes login-parada { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.login-plano .parada-ruta { transform-box: fill-box; transform-origin: center; }
.login-lema { position: relative; max-width: 560px; }
.login-lema strong { display: block; font: 700 clamp(34px, 4.2vw, 54px)/1.02 var(--fuente-titulo); letter-spacing: -.005em; }
.login-lema strong em { font-style: normal; color: #3fcf8e; }
.login-lema p { margin: 16px 0 0; color: #a6aba7; font-size: 15px; max-width: 42ch; }
.login-firma { position: relative; font: 500 12px/1 var(--fuente-mono); letter-spacing: .08em; text-transform: uppercase; color: #a6aba7; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-caja { width: 100%; max-width: 360px; }
.login-caja .marca { display: none; margin-bottom: 26px; }
.login-caja h1 { font-size: 40px; margin: 0 0 6px; }
.login-caja p { margin: 0 0 26px; color: var(--texto-suave); font-size: 15px; }
.login-caja .campo { margin-bottom: 16px; }
.login-caja .campo input { min-height: 46px; font-size: 16px; }
.login-caja .boton-primario { width: 100%; justify-content: center; min-height: 48px; margin-top: 8px; font-size: 16px; }
.login-tema { position: fixed; top: 16px; right: 16px; z-index: 5; }
@media (max-width: 820px) {
  .login-pagina { grid-template-columns: 1fr; }
  .login-lado { display: none; }
  .login-caja .marca { display: flex; }
}

/* ---------- Pantallas chicas ---------- */

@media (max-width: 1300px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(3n + 1) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--borde); }
}
@media (max-width: 600px) {
  .usuario-nombre, .marca-sub { display: none; }
  .campo { min-width: calc(50% - 9px); flex: 1; }
  .filtros .boton-limpiar { margin-left: 0; }
  .atajos { overflow-x: auto; flex-wrap: nowrap; }
  .chip { white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi, .kpi:nth-child(3n + 1) { padding: 12px 12px 14px; border-left: 1px solid var(--borde); }
  .kpi:nth-child(2n + 1) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--borde); }
  .kpi-valor { font-size: 30px; font-stretch: 104%; }
  .kpi-valor small { font-size: 13px; }
  .kpi-detalle { font-size: 12px; }
  .kpi-titulo { font-size: 10.5px; letter-spacing: .07em; }
  /* Encabezado en una sola fila: marca a la izquierda, tema y usuario (solo el avatar) a la derecha */
  .encabezado { gap: 10px; min-height: 56px; }
  .marca { gap: 9px; }
  .marca-logo { width: 30px; height: 30px; }
  .marca-nombre { font-size: 20px; }
  .encabezado-acciones { gap: 6px; }
  .encabezado-acciones .boton { min-height: 40px; padding: 6px 10px; }
  .menu-saludo { display: none; }
  h1 { font-size: 26px; }
  .tarjeta { padding: 14px 14px 8px; }
}

/* «Día pico»: qué pasó ese día (#74) */
.dia-pico { display: grid; gap: 4px; margin-top: 6px; }
.dia-pico p { margin: 0; }
.dia-pico ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.dia-pico li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 2px 0; border-top: 1px solid var(--borde); }
.dia-pico li b { font-variant-numeric: tabular-nums; }
.dia-pico a { color: var(--enlace); font-weight: 700; text-decoration: none; font-size: 12.5px; }
.dia-pico a:hover { text-decoration: underline; }

/* Aviso a la oficina: un chofer espera autorización para no recolectar (#89).
   Es urgente: cartel de señal ámbar con texto en tinta, como en la ruta. */
.aviso-pedidos {
  position: fixed; z-index: 1300; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); display: grid; gap: 6px; padding: 14px 16px 14px 56px; border-radius: var(--radio);
  background: var(--senal) no-repeat 16px 15px / 26px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 22 20.5H2z' fill='none' stroke='%2314181a' stroke-width='2'/%3E%3Cpath d='M12 9.5v5' stroke='%2314181a' stroke-width='2'/%3E%3Ccircle cx='12' cy='17.6' r='1.3' fill='%2314181a'/%3E%3C/svg%3E");
  color: var(--sobre-senal); border: 1px solid color-mix(in srgb, var(--sobre-senal) 30%, var(--senal));
  box-shadow: 0 14px 34px -10px rgb(0 0 0 / .4); animation: aviso-pedidos-entra 320ms var(--curva, ease);
}
.aviso-pedidos[hidden] { display: none; }
.aviso-pedidos strong { font: 700 19px/1.15 var(--fuente-titulo); }
.aviso-pedidos span { color: var(--sobre-senal); font-size: 14px; }
.aviso-pedidos .boton { justify-self: start; }
.aviso-pedidos .boton-primario { background: var(--sobre-senal); border-color: var(--sobre-senal); color: var(--senal); }
.aviso-pedidos-activar { justify-self: start; border: 0; background: none; padding: 0; color: var(--sobre-senal); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
@keyframes aviso-pedidos-entra { from { opacity: 0; transform: translateY(14px); } }

/* Contador: las cifras grandes de las páginas cuentan hasta su valor (ver js/simsa.js) */
[data-contando] { font-variant-numeric: tabular-nums; }

/* Pantalla sin movimiento: nada de animaciones ni transiciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-new(root) { animation: none !important; transition: none !important; }
  .marca-ruta, .login-plano .linea-ruta { stroke-dashoffset: 0; }
  .login-plano .parada-ruta { opacity: 1; }
}

/* ---------- Terminación: fichas con sombra mínima y cifras con relieve ---------- */
.marca-nombre, .login-lema strong, .tarjeta h2 { text-shadow: var(--sombra-titulo); }
.marca-nombre { font-stretch: 112%; }
.tarjeta h2 { font-stretch: 106%; }
.boton { box-shadow: 0 1px 1px rgb(20 24 26 / .06); }
.boton-primario { box-shadow: 0 1px 1px rgb(20 24 26 / .08), 0 4px 12px -6px color-mix(in srgb, var(--acento) 70%, transparent); }
