/* Tablero — hoja única, sin frameworks.
   Los colores de datos salen de una paleta validada para daltonismo; las
   variables se redefinen para modo oscuro en los dos ámbitos (preferencia del
   sistema y elección explícita). */
:root {
  color-scheme: light;
  --fondo:        #f4f4f2;
  --superficie:   #fcfcfb;
  --borde:        #e3e2dd;
  --tinta:        #0b0b0b;
  --tinta-2:      #52514e;
  --tinta-3:      #86857f;
  --marca:        #1c2f48;
  --serie-1:      #2a78d6;
  --serie-2:      #eb6834;
  --serie-3:      #1baf7a;
  --bien:         #0ca30c;
  --critico:      #d03b3b;
  --radio:        12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fondo:      #121211;
    --superficie: #1a1a19;
    --borde:      #343431;
    --tinta:      #ffffff;
    --tinta-2:    #c3c2b7;
    --tinta-3:    #8f8e86;
    --marca:      #e8e8e3;
    --serie-1:    #3987e5;
    --serie-2:    #d95926;
    --serie-3:    #199e70;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fondo:      #121211;
  --superficie: #1a1a19;
  --borde:      #343431;
  --tinta:      #ffffff;
  --tinta-2:    #c3c2b7;
  --tinta-3:    #8f8e86;
  --marca:      #e8e8e3;
  --serie-1:    #3987e5;
  --serie-2:    #d95926;
  --serie-3:    #199e70;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }

.barra {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: .75rem 1.25rem; background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.marca { font-weight: 800; letter-spacing: .02em; text-decoration: none; color: var(--marca); }
.barra nav { display: flex; gap: .35rem; flex: 1; flex-wrap: wrap; }
.barra nav a {
  padding: .4rem .8rem; border-radius: 999px; text-decoration: none;
  font-size: .88rem; font-weight: 600; color: var(--tinta-2);
}
.barra nav a.on { background: var(--marca); color: var(--superficie); }
.barra-fin { display: flex; align-items: center; gap: .75rem; font-size: .82rem; color: var(--tinta-3); }
.salir { color: var(--tinta-2); }

.contenido { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.aviso { padding: .8rem 1rem; border-radius: var(--radio); margin-bottom: 1.25rem; font-size: .9rem; }
.aviso-ok    { background: #ecfdf3; border: 1px solid #b7ebc6; color: #075e2b; }
.aviso-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .aviso-ok    { background: #0d2b18; border-color: #1b5e34; color: #86efac; }
  :root:not([data-theme="light"]) .aviso-error { background: #2b1212; border-color: #7f1d1d; color: #fca5a5; }
}

h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.sub { color: var(--tinta-3); font-size: .88rem; margin: 0 0 1.5rem; }

.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 1.25rem; margin-bottom: 1.25rem;
}

/* Número protagonista: una sola cifra grande, sin gráfico alrededor. */
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.cifra { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem 1.25rem; }
.cifra-valor { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.cifra-rotulo { font-size: .78rem; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .08em; margin-top: .3rem; font-weight: 700; }

label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: .3rem; color: var(--tinta-2); }
select, input[type=text], input[type=email], input[type=password], input[type=file] {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--borde);
  border-radius: 8px; background: var(--superficie); color: var(--tinta); font: inherit;
}
.filtros { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; margin-bottom: 1.25rem; }
.filtros > div { flex: 1; min-width: 160px; }
.boton {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 8px; border: none;
  background: var(--marca); color: var(--superficie); font: inherit; font-weight: 700; cursor: pointer;
}
.boton-suave { background: transparent; border: 1px solid var(--borde); color: var(--tinta); }
.boton-peligro { background: transparent; border: none; color: var(--critico); cursor: pointer; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* Barras: marca delgada, extremo redondeado anclado a la línea base, 2px de
   separación entre barras, y el valor siempre escrito al lado. */
.barras { display: flex; flex-direction: column; gap: 2px; }
.barra-fila { display: grid; grid-template-columns: minmax(90px, 26%) 1fr auto; gap: .75rem; align-items: center; padding: .2rem 0; }
.barra-nombre { font-size: .84rem; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-pista { background: color-mix(in srgb, var(--borde) 55%, transparent); border-radius: 0 4px 4px 0; height: 20px; }
.barra-dato { height: 100%; background: var(--serie-1); border-radius: 0 4px 4px 0; }
.barra-valor { font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 5.5rem; text-align: right; }
.barra-fila:hover .barra-dato { filter: brightness(1.08); }

.linea { width: 100%; height: 260px; display: block; }
.rejilla { stroke: var(--borde); stroke-width: 1; }
.linea-trazo { fill: none; stroke: var(--serie-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.linea-punto { fill: var(--serie-1); stroke: var(--superficie); stroke-width: 2; }
.linea-etiqueta { fill: var(--tinta); font-size: 13px; font-weight: 700; font-family: inherit; }
.linea-ejes { display: flex; justify-content: space-between; font-size: .75rem; color: var(--tinta-3); margin-top: .25rem; gap: .5rem; }
.linea-ejes span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--borde); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla-scroll { overflow-x: auto; }

.vacio { color: var(--tinta-3); font-size: .88rem; padding: 1rem 0; }
.pista { font-size: .78rem; color: var(--tinta-3); margin-top: .4rem; line-height: 1.45; }

.entrada { max-width: 380px; margin: 12vh auto; }
.entrada .tarjeta { padding: 1.75rem; }
.entrada h1 { text-align: center; margin-bottom: 1.5rem; }
.entrada .campo { margin-bottom: 1rem; }
.entrada .boton { width: 100%; }

@media (max-width: 640px) {
  .barra-fila { grid-template-columns: 1fr auto; }
  .barra-pista { grid-column: 1 / -1; }
}
