/* Portal de indicadores de poda · sistema de diseno 0.5.0: tipografia, color (claro y oscuro) y base.
   Reglas (detalle en docs/sistema-de-diseno.md):
   - Un solo color de datos (--dato); referencias y umbrales van en tinta y con etiqueta.
   - El rojo es solo para fallas del sistema. Las senales usan --atencion y siempre llevan icono y texto.
   - El oro de la marca es decorativo (indicador del menu, bloque de marca): nunca texto ni dato.
   - Todo par de color se valida: herramientas/validar_contraste.py (tokens) y el arnes con ?auditar=1 (render).
   - Sin estilos en linea (CSP style-src 'self'): el JS solo cambia clases, atributos data-* y variables por CSSOM.
   Las fuentes son los archivos oficiales de IBM sin modificar (Latin1): su licencia reserva el nombre "Plex". */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/ibm-plex-sans-1.1.0/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fuentes/ibm-plex-sans-1.1.0/IBMPlexSans-Medium-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fuentes/ibm-plex-sans-1.1.0/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fuentes/ibm-plex-mono-2.5.0/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fuentes/ibm-plex-mono-2.5.0/IBMPlexMono-Medium-Latin1.woff2") format("woff2");
}
/* Respaldo con las metricas de Plex (medidas con fontTools): mientras carga la fuente, el texto no salta. */
@font-face {
  font-family: "Plex respaldo";
  src: local("Segoe UI");
  size-adjust: 102.73%;
  ascent-override: 99.78%;
  descent-override: 26.77%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Plex respaldo Arial";
  src: local("Arial");
  size-adjust: 101.11%;
  ascent-override: 101.37%;
  descent-override: 27.2%;
  line-gap-override: 0%;
}

/* ---------------------------------------------------------------- color: claro (tambien el valor por omision) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --pagina: #f3f5f8;
  --superficie: #ffffff;
  --superficie-2: #f7f8fa;
  --superficie-3: #eceff4;
  --borde: #dde2ea;
  --borde-fuerte: #c8cfd9;
  --borde-control: #858fa1;
  --reja: #e7eaf0;
  --eje: #a3acba;

  --tinta: #0f172a;
  --tinta-2: #475569;
  --tinta-3: #5b6779;

  --acento: #2e3192;
  --acento-fuerte: #22256f;
  --acento-fondo: #2e3192;
  --acento-fondo-hover: #25287a;
  --sobre-acento: #ffffff;
  --acento-lavado: #eef0fb;
  --acento-borde: #c5c8ef;
  --foco: #2e3192;

  --dato: #4a50c2;
  --dato-suave: #c3c6f1;
  --dato-lavado: rgba(74, 80, 194, 0.1);
  /* Temporadas anteriores cuando se ven mas de dos (tablero de poda, T13): --dato mezclado con la superficie al 80,
     65, 52, 42, 34 y 28 %. Cada barra lleva escrita su temporada: el color solo no tiene que distinguirlas. */
  --serie-1: #6e73ce;
  --serie-2: #898dd7;
  --serie-3: #a1a4df;
  --serie-4: #b3b6e5;
  --serie-5: #c1c4ea;
  --serie-6: #ccceee;
  --ref: #0f172a;
  --umbral: #5b6779;
  --trama: #cdd3dd;

  --lateral-fondo: #232678;
  --lateral-fondo-2: #1d2067;
  --lateral-borde: rgba(255, 255, 255, 0.12);
  --lateral-tinta: #ffffff;
  --lateral-tinta-2: #c9cbef;
  --lateral-hover: rgba(255, 255, 255, 0.08);
  --lateral-activo: rgba(255, 255, 255, 0.14);
  --lateral-insignia: rgba(255, 255, 255, 0.18);
  --marca-oro: #ffcb04;

  --atencion: #c2410c;
  --atencion-texto: #9a3412;
  --atencion-fondo: #fff4ec;
  --atencion-borde: #f5c4a5;

  --bien: #0ca30c;
  --bien-texto: #006300;
  --bien-fondo: #ebf6eb;
  --aviso: #fab219;
  --aviso-texto: #7a4a00;
  --aviso-fondo: #fff6e0;
  --critico: #d03b3b;
  --critico-texto: #b42f2f;
  --critico-fondo: #fdeeee;
  --critico-borde: #f0c2c2;
  --info-texto: #334155;
  --info-fondo: #eef2f7;

  --sombra-1: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sombra-2: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.08);
  --velo: rgba(15, 23, 42, 0.36);
  --esqueleto: #e9ecf1;
  --esqueleto-brillo: #f6f7f9;
}

/* ---------------------------------------------------------------- color: oscuro */
[data-theme="dark"] {
  color-scheme: dark;
  --pagina: #0b0f14;
  --superficie: #121821;
  --superficie-2: #161e29;
  --superficie-3: #1e2835;
  --borde: #243041;
  --borde-fuerte: #334155;
  --borde-control: #64748b;
  --reja: #1c2531;
  --eje: #4b5a6e;

  --tinta: #e8edf4;
  --tinta-2: #aeb9c9;
  --tinta-3: #8f9bae;

  --acento: #a8aefa;
  --acento-fuerte: #c7cbfc;
  --acento-fondo: #5257cf;
  --acento-fondo-hover: #6166dd;
  --sobre-acento: #ffffff;
  --acento-lavado: #1c2242;
  --acento-borde: #3b418f;
  --foco: #a8aefa;

  --dato: #8990f0;
  --dato-suave: #353b86;
  --dato-lavado: rgba(137, 144, 240, 0.14);
  --serie-1: #7178c7;
  --serie-2: #5f66a8;
  --serie-3: #50568d;
  --serie-4: #444a78;
  --serie-5: #3a4167;
  --serie-6: #333a5b;
  --ref: #e8edf4;
  --umbral: #8f9bae;
  --trama: #334155;

  --lateral-fondo: #10142e;
  --lateral-fondo-2: #0c1026;
  --lateral-borde: rgba(255, 255, 255, 0.08);
  --lateral-tinta: #e8edf4;
  --lateral-tinta-2: #a9acd6;
  --lateral-hover: rgba(255, 255, 255, 0.06);
  --lateral-activo: rgba(255, 255, 255, 0.1);
  --lateral-insignia: rgba(255, 255, 255, 0.14);

  --atencion: #fb8a55;
  --atencion-texto: #fdba8c;
  --atencion-fondo: #2a1a11;
  --atencion-borde: #6a3a22;

  --bien: #22c55e;
  --bien-texto: #4ade80;
  --bien-fondo: #0f2418;
  --aviso: #fbbf24;
  --aviso-texto: #fcd34d;
  --aviso-fondo: #2a2210;
  --critico: #f16464;
  --critico-texto: #fca5a5;
  --critico-fondo: #2c1414;
  --critico-borde: #6b2a2a;
  --info-texto: #cbd5e1;
  --info-fondo: #18212c;

  --sombra-1: none;
  --sombra-2: 0 12px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --velo: rgba(0, 0, 0, 0.55);
  --esqueleto: #1b2430;
  --esqueleto-brillo: #232e3c;
}

/* ---------------------------------------------------------------- tipografia, espacio, capas y movimiento */
:root {
  --fuente: "IBM Plex Sans", "Plex respaldo", "Plex respaldo Arial", system-ui, sans-serif;
  --fuente-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radio-1: 4px;
  --radio-2: 6px;
  --radio-3: 8px;
  --ancho-lateral: 232px;
  --ancho-riel: 64px;
  --alto-contexto: 56px;
  --ancho-max: 1600px;
  --fila: 40px;
  --celda-py: 10px;
  --celda-px: 12px;
  --z-lateral: 30;
  --z-contexto: 40;
  --z-popover: 60;
  --z-panel: 70;
  --z-tooltip: 80;
  --z-toast: 90;
  --mov-rapido: 120ms;
  --mov-normal: 200ms;
  --curva: cubic-bezier(0.2, 0.6, 0.2, 1);
}
[data-densidad="compacta"] {
  --fila: 32px;
  --celda-py: 6px;
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --mov-rapido: 0ms;
    --mov-normal: 0ms;
  }
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--borde-fuerte) transparent;
}
html,
body {
  margin: 0;
}
body {
  min-height: 100vh;
  background: var(--pagina);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 14px;
  line-height: 20px;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
a {
  color: var(--acento);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--acento-fuerte);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
code,
kbd,
.codigo {
  font-family: var(--fuente-mono);
  font-size: 0.92em;
}
::selection {
  background: var(--acento-borde);
  color: var(--tinta);
}
:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.num,
.cifra {
  font-variant-numeric: tabular-nums;
}
