/* Scouting · Real Unión — hoja única.
   Sistema: tokens de la familia Simplifik (TKV Transporte): rejilla de 4, escala 12-24, contrastes medidos,
   foco de 2 px separado, capas de estado (8 % / 12 %), movimiento ≤ 200 ms y modo noche. Letra: Geist (OFL, Vercel),
   alojada aquí mismo: sin peticiones a terceros. Identidad: monograma RU y, como único acento semántico, los colores
   de valoración de los informes. CSP: sin estilos en línea; las proporciones se dibujan con SVG. */

@font-face { font-family: "Geist"; src: url("fuentes/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fuentes/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --letra: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --letra-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --t-12: 12px; --l-12: 16px; --t-13: 13px; --l-13: 18px; --t-14: 14px; --l-14: 20px;
  --t-16: 16px; --l-16: 24px; --t-20: 20px; --l-20: 28px; --t-24: 24px; --l-24: 32px;
  --p-normal: 400; --p-medio: 500; --p-semi: 600; --p-fuerte: 700;
  --r-4: 4px; --r-6: 6px; --r-8: 8px; --r-12: 12px; --r-16: 16px; --r-pildora: 9999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-12: 48px;
  --toque: 48px; --control: 36px; --barra-alto: 56px; --ancho: 1320px; --alto-herramientas: 0px;
  --d-pulsar: 70ms; --d-cambio: 150ms; --d-cajon: 200ms; --curva: cubic-bezier(.2, 0, 0, 1);

  --fondo: #f3f4f6; --superficie: #ffffff; --superficie-2: #f7f8fa; --elevada: #ffffff;
  --barra: #2b3036; --sobre-barra: #ffffff; --sobre-barra-2: #c3c8ce; --marcador: #2b3036;
  --pildora: #1d2125; --sobre-pildora: #ffffff; --sobre-pildora-2: #aab0b6;
  --texto: #16191d; --texto-2: #50575e; --texto-3: #6b7279;
  --linea: #e4e7eb; --linea-2: #eef0f3; --borde: #c9ced4; --borde-fuerte: #7b838b;
  --accion: #0056b3; --accion-hover: #004a99; --accion-pulsado: #003d80; --sobre-accion: #ffffff;
  --accion-texto: #0056b3; --accion-suave: #e3edfb; --sobre-accion-suave: #003d80; --foco: #003d80;
  --aviso-fondo: #fff3cd; --aviso-texto: #7a5a00; --aviso-punto: #c26a00;
  --error-fondo: #fdecea; --error-texto: #b3261e; --error-punto: #d93025;
  --ok-fondo: #e6f4ea; --ok-texto: #1e6b34; --ok-punto: #2e8540; --neutro-punto: #9aa1a8;
  --capa-hover: rgba(22, 25, 29, .05); --capa-pulsado: rgba(22, 25, 29, .09);
  --velo: rgba(10, 12, 14, .32); --marca-busca: #ffe58f;
  --e1: 0 1px 2px rgba(16, 24, 40, .05);
  --e2: 0 1px 3px rgba(16, 24, 40, .08), 0 6px 16px rgba(16, 24, 40, .08);
  --e3: 0 12px 32px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06);
  --v-fichar: #00a651; --v-interesante: #0070c0; --v-seguimiento: #f2b200; --v-descartar: #e00000; --v-sin: #9aa1a8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #17191c; --superficie: #1e2125; --superficie-2: #24282c; --elevada: #2a2e33; --marcador: #0e1012;
    --barra: #111315; --pildora: #24282c;
    --texto: #e8eaed; --texto-2: #b0b6bc; --texto-3: #8f969d; --linea: #30353b; --linea-2: #2a2e33; --borde: #4a5158; --borde-fuerte: #8d959d;
    --accion: #90c2ff; --accion-hover: #a8cfff; --accion-pulsado: #bfdcff; --sobre-accion: #062a52;
    --accion-texto: #90c2ff; --accion-suave: #233a5a; --sobre-accion-suave: #d6e6ff; --foco: #ffffff;
    --aviso-fondo: #3a3014; --aviso-texto: #f5cf66; --aviso-punto: #f0a33a;
    --error-fondo: #45201e; --error-texto: #ff9d91; --error-punto: #ff7a6b;
    --ok-fondo: #1c3524; --ok-texto: #8fd9a0; --ok-punto: #5cc275; --neutro-punto: #7d858c;
    --capa-hover: rgba(232, 234, 237, .06); --capa-pulsado: rgba(232, 234, 237, .10); --velo: rgba(0, 0, 0, .55);
    --marca-busca: #5f5116;
    --e1: none; --e2: 0 1px 3px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .35); --e3: 0 12px 32px rgba(0, 0, 0, .6);
    --v-fichar: #3ccf7a; --v-interesante: #4da3ff; --v-seguimiento: #ffcc33; --v-descartar: #ff6b6b; --v-sin: #7d858c;
  }
}
@media (prefers-reduced-motion: reduce) { :root { --d-pulsar: 0ms; --d-cambio: 0ms; --d-cajon: 0ms; } }

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
body { margin: 0; min-height: 100vh; background: var(--fondo); color: var(--texto);
  font: var(--p-normal) var(--t-14)/var(--l-14) var(--letra); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accion-texto); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; width: 1.25em; height: 1.25em; }  /* tamaño por defecto: cada componente pone el suyo */
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-radius: 2px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.oculto:focus-visible + .boton { outline: 2px solid var(--foco); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--letra-mono); font-size: .92em; letter-spacing: -0.01em; }
.no-partir { white-space: nowrap; }
.tenue { color: var(--texto-3); }

/* ── barra de arriba ── */
.barra { position: sticky; top: 0; z-index: 50; height: var(--barra-alto); background: var(--barra); color: var(--sobre-barra); }
.barra__dentro { max-width: var(--ancho); height: 100%; margin: 0 auto; padding: 0 var(--s-8); display: flex; align-items: center; gap: var(--s-6); }
.marca { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
.monograma { width: 28px; height: 28px; border-radius: 7px; background: #ffffff; color: #111111; display: grid; place-items: center;
  font: 800 12px/1 var(--letra); letter-spacing: -0.04em; box-shadow: inset 0 0 0 2px #111111; }
.marca__nombre { font-size: 14px; font-weight: var(--p-semi); letter-spacing: -0.01em; }
.marca__nombre span { color: var(--sobre-barra-2); font-weight: var(--p-medio); }
.nav { display: flex; align-self: stretch; gap: 2px; }
.nav a { display: flex; align-items: center; padding: 0 10px; color: var(--sobre-barra-2); text-decoration: none; font-size: var(--t-13);
  font-weight: var(--p-medio); box-shadow: inset 0 -2px 0 transparent; transition: color var(--d-cambio) var(--curva); }
.nav a:hover { color: var(--sobre-barra); }
.nav a[aria-current="page"] { color: var(--sobre-barra); box-shadow: inset 0 -2px 0 var(--sobre-barra); }
.busca { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); width: min(360px, 30vw); height: 34px; padding: 0 6px 0 10px;
  border-radius: var(--r-8); background: var(--pildora); color: var(--sobre-pildora-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.busca:focus-within { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.busca svg { width: 15px; height: 15px; }
.busca input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--sobre-pildora); font: inherit; font-size: var(--t-13); }
.busca input::placeholder { color: var(--sobre-pildora-2); opacity: 1; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-4);
  border: 1px solid currentColor; font: var(--p-medio) 11px/1 var(--letra-mono); opacity: .7; }

/* cuenta: un solo sitio para el estado del servicio, el modo y salir */
.cuenta { position: relative; margin-left: auto; }
.busca + .cuenta { margin-left: 0; }
.cuenta > summary { list-style: none; display: flex; align-items: center; gap: var(--s-2); height: 36px; padding: 0 6px 0 4px; border-radius: var(--r-8);
  cursor: pointer; color: var(--sobre-barra-2); font-size: var(--t-13); }
.cuenta > summary::-webkit-details-marker { display: none; }
.cuenta > summary:hover, .cuenta[open] > summary { background: rgba(255, 255, 255, .08); color: var(--sobre-barra); }
.cuenta > summary:focus-visible { outline-color: var(--sobre-barra); }
.avatar { position: relative; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accion-suave);
  color: var(--sobre-accion-suave); font-size: 12px; font-weight: var(--p-semi); text-transform: uppercase; }
.avatar[data-servicio="parado"]::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--error-punto); box-shadow: 0 0 0 2px var(--barra); }
.cuenta__menu { position: absolute; right: 0; top: calc(100% + 6px); width: 260px; padding: 6px; background: var(--elevada); color: var(--texto);
  border: 1px solid var(--linea); border-radius: var(--r-12); box-shadow: var(--e3); display: grid; gap: 2px; z-index: 60; }
.cuenta__dato { display: flex; align-items: center; gap: var(--s-2); padding: 8px 10px; font-size: var(--t-13); color: var(--texto-2); }
.cuenta__dato strong { color: var(--texto); font-weight: var(--p-medio); }
.cuenta__menu hr { border: 0; border-top: 1px solid var(--linea); margin: 4px 0; }
.cuenta__menu button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: 8px 10px;
  border-radius: var(--r-6); font-size: var(--t-13); cursor: pointer; }
.cuenta__menu button:hover { background: var(--capa-hover); }
.cuenta__menu button:focus-visible { outline: 2px solid var(--foco); }
.cuenta__menu svg { width: 16px; height: 16px; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-punto); flex: none; }
.punto--parado { background: var(--error-punto); }
.punto--prueba { background: var(--aviso-punto); }

/* franja de modo prueba (solo en Informes) */
.franja { background: var(--aviso-fondo); color: var(--aviso-texto); font-size: var(--t-13); }
.franja div { max-width: var(--ancho); margin: 0 auto; padding: 7px var(--s-8); display: flex; align-items: center; gap: var(--s-2); }
.franja strong { font-weight: var(--p-semi); }

/* ── página ── */
main { max-width: var(--ancho); margin: 0 auto; padding: var(--s-6) var(--s-8) var(--s-12); }
.migas { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s-3); font-size: var(--t-13); color: var(--texto-3); }
.migas a { color: var(--texto-2); text-decoration: none; }
.migas a:hover { color: var(--texto); }
.migas svg { width: 14px; height: 14px; }
.cabecera-pagina { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); flex-wrap: wrap; margin-bottom: var(--s-5); }
.titulo { font-size: var(--t-24); line-height: var(--l-24); font-weight: var(--p-semi); letter-spacing: -0.025em; }
.subtitulo { margin-top: 2px; color: var(--texto-2); font-size: var(--t-13); }
.acciones { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* ── botones ── */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control); padding: 0 14px;
  border-radius: var(--r-8); border: 1px solid transparent; font: inherit; font-size: var(--t-13); font-weight: var(--p-medio); white-space: nowrap;
  cursor: pointer; text-decoration: none; transition: background-color var(--d-cambio) var(--curva), box-shadow var(--d-cambio) var(--curva); }
.boton svg { width: 16px; height: 16px; }
.boton--primario { background-color: var(--accion); color: var(--sobre-accion); box-shadow: var(--e1); }
.boton--primario:hover { background-color: var(--accion-hover); }
.boton--primario:active { background-color: var(--accion-pulsado); }
.boton--secundario { background-color: var(--superficie); color: var(--texto); border-color: var(--borde); box-shadow: var(--e1); }
.boton--borde { background-color: transparent; color: var(--accion-texto); border-color: color-mix(in srgb, var(--accion-texto) 45%, transparent); }
.boton--texto { background-color: transparent; color: var(--accion-texto); padding: 0 10px; }
.boton--fantasma { background-color: transparent; color: var(--texto-2); padding: 0 10px; }
.boton--secundario:hover, .boton--borde:hover, .boton--texto:hover, .boton--fantasma:hover { background-image: linear-gradient(var(--capa-hover), var(--capa-hover)); }
.boton--secundario:active, .boton--borde:active, .boton--texto:active, .boton--fantasma:active { background-image: linear-gradient(var(--capa-pulsado), var(--capa-pulsado)); }
.boton--s { height: 30px; padding: 0 10px; }
.boton--ancho { width: 100%; }
.boton[disabled] { opacity: .5; cursor: not-allowed; }

/* ── chips y estados ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-pildora); font-size: var(--t-12);
  font-weight: var(--p-medio); white-space: nowrap; text-decoration: none; }
.chip--aviso { background: var(--aviso-fondo); color: var(--aviso-texto); }
.chip--error { background: var(--error-fondo); color: var(--error-texto); }
.chip--ok { background: var(--ok-fondo); color: var(--ok-texto); }
.chip--accion { background: var(--accion-suave); color: var(--sobre-accion-suave); }
.chip--neutro { background: var(--superficie-2); color: var(--texto-2); box-shadow: inset 0 0 0 1px var(--linea); }
.estado-texto { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: var(--t-13); }
.estado-texto::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--neutro-punto)); flex: none; }
.g-aviso { --c: var(--aviso-punto); } .g-accion { --c: var(--accion); } .g-ok { --c: var(--ok-punto); }
.g-error { --c: var(--error-punto); } .g-neutro { --c: var(--neutro-punto); }
.resumen-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* valoración del informe: cuadradito con el color del PDF + texto */
.valor { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-13); white-space: nowrap; }
.valor::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c, var(--v-sin)); }
.v-fichar { --c: var(--v-fichar); } .v-interesante { --c: var(--v-interesante); }
.v-seguimiento { --c: var(--v-seguimiento); } .v-descartar { --c: var(--v-descartar); } .v-sinvalorar { --c: var(--v-sin); }

/* ── tablas ── */
.tabla-caja { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-12); box-shadow: var(--e1); overflow: clip; }
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabla th { text-align: left; font-size: var(--t-12); line-height: var(--l-12); font-weight: var(--p-medio); color: var(--texto-3);
  padding: 9px var(--s-4); border-bottom: 1px solid var(--linea); white-space: nowrap; background: var(--superficie); }
.tabla td { padding: 10px var(--s-4); border-bottom: 1px solid var(--linea-2); vertical-align: middle; }
.tabla tbody:last-child tr:last-child td { border-bottom: 0; }
.tabla .grupo td { background: var(--superficie-2); padding: 7px var(--s-4); font-size: var(--t-12); font-weight: var(--p-medio); color: var(--texto-2);
  border-bottom: 1px solid var(--linea-2); }
.grupo__n { color: var(--texto-3); font-weight: var(--p-normal); margin-left: 6px; }
.grupo .estado-texto { font-size: var(--t-12); color: var(--texto); }
.fila td:first-child { box-shadow: inset 3px 0 0 var(--c, transparent); }
.fila { transition: background-color var(--d-pulsar) linear; }
.fila:hover td, .fila.seleccionada td { background-color: var(--capa-hover); }
.fila.seleccionada td { background-color: color-mix(in srgb, var(--accion) 8%, transparent); }
.fila[data-href], .fila[data-enlace] { cursor: pointer; }
.col-num { width: 52px; color: var(--texto-3); font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.col-accion { width: 1%; text-align: right; white-space: nowrap; }
.principal { font-weight: var(--p-medio); color: var(--texto); text-decoration: none; }
a.principal:hover { text-decoration: underline; }
.secundario { display: block; margin-top: 1px; color: var(--texto-3); font-size: var(--t-12); line-height: var(--l-12); }
.trozo { display: block; margin-top: 3px; font-size: var(--t-12); line-height: 17px; color: var(--texto-2); max-width: 64ch; }
mark { background: var(--marca-busca); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ── barra de herramientas fija (buscar + filtros), patrón Linear/Stripe ── */
.herramientas { position: sticky; top: var(--barra-alto); z-index: 30; margin: 0 calc(-1 * var(--s-8)) var(--s-4); padding: var(--s-3) var(--s-8) 10px;
  background: color-mix(in srgb, var(--fondo) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  transition: box-shadow var(--d-cambio) var(--curva); }
.herramientas.pegada { box-shadow: 0 1px 0 var(--linea), 0 6px 14px -10px rgba(16, 24, 40, .25); }
.herramientas__fila { display: flex; align-items: center; gap: var(--s-3); }
.buscador { flex: 1; display: flex; align-items: center; gap: var(--s-2); height: 40px; padding: 0 12px; border: 1px solid var(--borde);
  border-radius: var(--r-8); background: var(--superficie); color: var(--texto-3); box-shadow: var(--e1);
  transition: border-color var(--d-cambio) var(--curva), box-shadow var(--d-cambio) var(--curva); }
.buscador:focus-within { border-color: var(--accion); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accion) 18%, transparent); }
.buscador svg { width: 17px; height: 17px; }
.buscador input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--texto); font: inherit; font-size: var(--t-14); }
.buscador input::placeholder { color: var(--texto-3); }
.buscador input::-webkit-search-cancel-button { display: none; }
.buscador kbd { color: var(--texto-3); }
.contador { font-size: var(--t-13); color: var(--texto-2); white-space: nowrap; }
.contador strong { color: var(--texto); font-weight: var(--p-semi); font-variant-numeric: tabular-nums; }
.facetas { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.facetas__limpiar { font-size: var(--t-12); color: var(--texto-2); text-decoration: none; padding: 0 6px; }
.facetas__limpiar:hover { color: var(--texto); text-decoration: underline; }
.carga { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; opacity: 0; transition: opacity var(--d-cambio); }
.carga::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--accion); animation: progreso 1s var(--curva) infinite; }
.cargando .carga { opacity: 1; }
.cargando #resultados { opacity: .55; transition: opacity var(--d-cambio) .1s; }

.faceta { position: relative; }
.faceta > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-pildora);
  border: 1px dashed var(--borde); background: var(--superficie); color: var(--texto-2); font-size: var(--t-13); font-weight: var(--p-medio);
  cursor: pointer; user-select: none; white-space: nowrap; transition: background-color var(--d-pulsar) linear, border-color var(--d-cambio); }
.faceta > summary::-webkit-details-marker { display: none; }
.faceta > summary:hover { border-color: var(--borde-fuerte); color: var(--texto); }
.faceta > summary svg { width: 14px; height: 14px; }
.faceta[data-faceta="orden"] > summary { border-style: solid; }
.faceta.activa > summary { border-style: solid; border-color: color-mix(in srgb, var(--accion) 35%, transparent); background: var(--accion-suave);
  color: var(--sobre-accion-suave); }
.faceta__valor { font-weight: var(--p-semi); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.faceta__quitar { display: grid; place-items: center; width: 18px; height: 18px; margin-right: -4px; border-radius: 50%; border: 0; padding: 0;
  background: none; color: inherit; cursor: pointer; }
.faceta__quitar:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.faceta__quitar svg { width: 12px; height: 12px; }
.menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; max-height: min(380px, 60vh); overflow-y: auto; padding: 6px;
  background: var(--elevada); border: 1px solid var(--linea); border-radius: var(--r-12); box-shadow: var(--e3); animation: menu-entra 120ms var(--curva); }
.menu--derecha { left: auto; right: 0; }
@keyframes menu-entra { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.opcion-menu { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 8px; border-radius: var(--r-6); cursor: pointer; font-size: var(--t-13); }
.opcion-menu:hover { background: var(--capa-hover); }
.opcion-menu input { width: 15px; height: 15px; margin: 0; accent-color: var(--accion); flex: none; }
.opcion-menu span:first-of-type { flex: 1; }
.opcion-menu .n { color: var(--texto-3); font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.opcion-menu.vacia { opacity: .45; }
.menu__titulo { padding: 6px 8px 4px; font-size: var(--t-12); color: var(--texto-3); }
.menu__campos { display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px; color: var(--texto-3); }
.menu__campos input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--borde); border-radius: var(--r-6); background: var(--superficie);
  color: var(--texto); font: inherit; font-size: var(--t-13); }
.menu__atajos { display: flex; gap: 6px; padding: 0 8px 6px; flex-wrap: wrap; }
.menu__atajos button { height: 26px; padding: 0 9px; border-radius: var(--r-pildora); border: 1px solid var(--borde); background: var(--superficie);
  color: var(--texto-2); font: inherit; font-size: var(--t-12); cursor: pointer; }
.menu__atajos button:hover { color: var(--texto); border-color: var(--borde-fuerte); }

.tabla--fija th { position: sticky; top: calc(var(--barra-alto) + var(--alto-herramientas)); z-index: 5; }
.mas { display: flex; justify-content: center; padding: var(--s-4) 0 0; }

/* ── panel lateral del jugador (patrón «side peek»: la lista sigue a la vista) ── */
.vistazo { position: fixed; top: var(--barra-alto); right: 0; bottom: 0; z-index: 45; width: min(580px, 100vw); display: flex; flex-direction: column;
  background: var(--elevada); border-left: 1px solid var(--linea); box-shadow: var(--e3); transform: translateX(104%);
  transition: transform var(--d-cajon) var(--curva); visibility: hidden; }
.vistazo.abierto { transform: none; visibility: visible; }
.vistazo__barra { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--linea); }
.vistazo__barra .espacio { flex: 1; }
.vistazo__cuerpo { flex: 1; overflow-y: auto; padding: var(--s-5) var(--s-6) var(--s-8); }
.icono-boton { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--r-6); background: none; color: var(--texto-2);
  cursor: pointer; text-decoration: none; }
.icono-boton:hover { background: var(--capa-hover); color: var(--texto); }
.icono-boton svg { width: 17px; height: 17px; }

/* ── ficha del jugador (página y panel) ── */
.ficha-cabecera h1, .ficha-cabecera h2 { font-size: var(--t-24); line-height: var(--l-24); font-weight: var(--p-semi); letter-spacing: -0.025em; }
.ficha-cabecera p { margin-top: 2px; color: var(--texto-2); font-size: var(--t-13); }
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.columnas { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--s-6); align-items: start; margin-top: var(--s-6); }
.vistazo .columnas { grid-template-columns: 1fr; gap: var(--s-6); margin-top: var(--s-5); }
.seccion-titulo { font-size: var(--t-13); font-weight: var(--p-semi); margin: 0 0 var(--s-3); color: var(--texto); }
.seccion-titulo .n { color: var(--texto-3); font-weight: var(--p-normal); }
.historial { display: grid; gap: 0; position: relative; }
.informe-item { position: relative; display: grid; gap: 6px; padding: 0 0 var(--s-5) var(--s-5); }
.informe-item::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--neutro-punto));
  box-shadow: 0 0 0 3px var(--superficie); z-index: 1; }
.vistazo .informe-item::before { box-shadow: 0 0 0 3px var(--elevada); }
.informe-item::after { content: ""; position: absolute; left: 7px; top: 10px; bottom: 0; width: 1px; background: var(--linea); }
.informe-item:last-child::after { display: none; }
.informe-item__cabecera { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.informe-item__fecha { font-family: var(--letra-mono); font-size: var(--t-12); color: var(--texto-3); }
.informe-item__partido { font-weight: var(--p-medio); }
.informe-item__meta { color: var(--texto-3); font-size: var(--t-12); }
.informe-item__texto { white-space: pre-line; line-height: 21px; }
.informe-item__extra { font-size: var(--t-13); color: var(--texto-2); white-space: pre-line; }
.informe-item__extra strong { color: var(--texto); font-weight: var(--p-medio); }
.lateral { position: sticky; top: calc(var(--barra-alto) + var(--s-4)); display: grid; gap: var(--s-4); padding: var(--s-4);
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-12); }
.vistazo .lateral { position: static; background: var(--superficie-2); border-color: var(--linea-2); }
.lateral .seccion-titulo { margin: 0; }
.dato { display: grid; grid-template-columns: 104px 1fr; gap: 7px var(--s-3); margin: 0; font-size: var(--t-13); }
.dato dt { color: var(--texto-3); }
.dato dd { margin: 0; }
.texto-ficha { white-space: pre-line; font-size: var(--t-13); line-height: var(--l-13); }
.nota { padding: 10px 12px; border-radius: var(--r-8); background: var(--superficie-2); color: var(--texto-2); font-size: var(--t-13); }
.bloque { display: grid; gap: 6px; }
.bloque__titulo { font-size: var(--t-12); line-height: var(--l-12); font-weight: var(--p-medio); color: var(--texto-3); }

/* ── informe: marcador, reparto y cabecera fija con la acción ── */
.cabecera-informe { position: sticky; top: var(--barra-alto); z-index: 30; margin: 0 calc(-1 * var(--s-8)) var(--s-4); padding: var(--s-3) var(--s-8);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-6); flex-wrap: wrap;
  background: color-mix(in srgb, var(--fondo) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  transition: box-shadow var(--d-cambio) var(--curva); }
.cabecera-informe.pegada { box-shadow: 0 1px 0 var(--linea), 0 6px 14px -10px rgba(16, 24, 40, .25); }
.marcador { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.marcador__equipo { font-size: var(--t-20); line-height: var(--l-20); font-weight: var(--p-semi); letter-spacing: -0.02em; }
.marcador__resultado { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-8);
  background: var(--marcador); color: #ffffff; font: 600 var(--t-20)/1 var(--letra-mono); font-variant-numeric: tabular-nums; }
.marcador__resultado span { opacity: .5; font-weight: 400; }
.datos-partido { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; color: var(--texto-3); font-size: var(--t-12); }
.reparto { display: grid; gap: 10px; margin-bottom: var(--s-4); }
.reparto__barra { width: 100%; height: 6px; display: block; border-radius: var(--r-pildora); overflow: hidden; }
.reparto__barra rect { fill: var(--c); }
.reparto__leyenda { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-12); color: var(--texto-2); }
.reparto__leyenda strong { color: var(--texto); font-variant-numeric: tabular-nums; margin-right: 3px; font-weight: var(--p-semi); }

/* ── panel de decisión (diálogo) ── */
.panel { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); height: 100dvh; max-height: none; max-width: none; margin: 0; padding: 0;
  border: 0; border-left: 1px solid var(--linea); background: var(--elevada); color: var(--texto); box-shadow: var(--e3); }
.panel[open] { display: flex; flex-direction: column; animation: panel-entra var(--d-cajon) var(--curva); }
.panel::backdrop { background: var(--velo); }
@keyframes panel-entra { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel__cabecera { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-6) var(--s-4); border-bottom: 1px solid var(--linea); }
.panel__titulo { flex: 1; min-width: 0; }
.panel__titulo h2 { font-size: var(--t-20); line-height: var(--l-20); font-weight: var(--p-semi); letter-spacing: -0.02em; }
.panel__titulo p { margin-top: 4px; color: var(--texto-3); font-size: var(--t-12); display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.panel__cuerpo { flex: 1; overflow-y: auto; padding: var(--s-5) var(--s-6); display: grid; gap: var(--s-5); align-content: start; }
.panel__pie { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-6); border-top: 1px solid var(--linea); }
.cerrar { width: 32px; height: 32px; margin: -4px -8px 0 0; display: grid; place-items: center; border: 0; border-radius: var(--r-6);
  background: none; color: var(--texto-2); cursor: pointer; }
.cerrar:hover { background: var(--capa-hover); color: var(--texto); }
.cerrar svg { width: 18px; height: 18px; }
.motivo { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-8); background: var(--aviso-fondo); color: var(--aviso-texto);
  font-size: var(--t-13); font-weight: var(--p-medio); }
.motivo svg { width: 18px; height: 18px; }
.cita { margin: 0; padding: 12px 14px; border-radius: var(--r-8); background: var(--superficie-2); box-shadow: inset 3px 0 0 var(--c, var(--v-sin)); }
.cita__posicion { font-size: var(--t-12); font-weight: var(--p-medio); color: var(--texto-2); }
.cita__texto { margin-top: 4px; font-size: var(--t-14); line-height: 22px; }
.cita__wyscout { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linea); font-size: var(--t-12); line-height: var(--l-12);
  color: var(--texto-3); font-variant-numeric: tabular-nums; }
.opciones { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.opciones legend { padding: 0; margin-bottom: 6px; }
.opcion { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--linea);
  border-radius: var(--r-8); background: var(--superficie); cursor: pointer; transition: border-color var(--d-cambio); }
.opcion:hover { border-color: var(--borde); }
.opcion:has(input:checked) { border-color: var(--accion); box-shadow: inset 0 0 0 1px var(--accion); background-color: color-mix(in srgb, var(--accion) 6%, var(--superficie)); }
.opcion input { width: 16px; height: 16px; margin: 0; accent-color: var(--accion); }
.opcion:has(input:focus-visible) { outline: 2px solid var(--foco); outline-offset: 2px; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.campo { display: grid; gap: 6px; align-content: start; }
.campo > span { font-size: var(--t-12); font-weight: var(--p-medio); color: var(--texto-3); }
.campo select { height: var(--control); padding: 0 10px; border: 1px solid var(--borde); border-radius: var(--r-8); background: var(--superficie);
  color: var(--texto); font: inherit; font-size: var(--t-13); }
.pista { font-size: var(--t-12); line-height: var(--l-12); color: var(--aviso-texto); }

/* ── avisos flotantes ── */
.tostadas { position: fixed; bottom: var(--s-6); left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: var(--s-2);
  width: min(440px, calc(100vw - 32px)); }
.tostada { display: flex; align-items: center; gap: var(--s-3); padding: 10px 10px 10px 14px; background: var(--texto); color: var(--fondo);
  border-radius: var(--r-12); box-shadow: var(--e3); font-size: var(--t-13); animation: tostada-entra var(--d-cajon) var(--curva); }
.tostada::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.tostada p { flex: 1; }
.tostada .cerrar { margin: 0; color: inherit; opacity: .7; }
.tostada .cerrar:hover { opacity: 1; background: rgba(127, 127, 127, .2); }
.tostada--ok { --c: #5cc275; } .tostada--aviso { --c: #f0a33a; } .tostada--error { --c: #ff7a6b; }
@keyframes tostada-entra { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── vacíos, proceso, errores ── */
.vacio { display: grid; justify-items: center; gap: 10px; padding: 56px var(--s-6); text-align: center; background: var(--superficie);
  border: 1px dashed var(--borde); border-radius: var(--r-16); }
.vacio__icono { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-12); background: var(--superficie-2);
  color: var(--texto-2); box-shadow: inset 0 0 0 1px var(--linea); }
.vacio__icono svg { width: 22px; height: 22px; }
.vacio h2 { font-size: var(--t-14); font-weight: var(--p-semi); }
.vacio p { color: var(--texto-2); font-size: var(--t-13); max-width: 44ch; }
.procesando { display: grid; gap: 10px; padding: var(--s-5); background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--r-12); }
.procesando h2 { font-size: var(--t-14); font-weight: var(--p-semi); }
.procesando p { color: var(--texto-2); font-size: var(--t-13); }
.progreso { position: relative; height: 3px; border-radius: var(--r-pildora); background: var(--accion-suave); overflow: hidden; }
.progreso::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: inherit; background: var(--accion);
  animation: progreso 1.4s var(--curva) infinite; }
@keyframes progreso { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .progreso::after, .carga::after { animation: none; width: 100%; opacity: .5; } }
.error-caja { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-12); background: var(--error-fondo); color: var(--error-texto); font-size: var(--t-13); }
.error-caja svg { width: 18px; height: 18px; }

/* soltar el PDF en cualquier parte */
.soltar { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: var(--velo); padding: var(--s-6); }
.soltar.activo { display: grid; }
.soltar div { width: 100%; height: 100%; display: grid; place-items: center; border: 2px dashed #ffffff; border-radius: var(--r-16);
  color: #ffffff; font-size: var(--t-20); font-weight: var(--p-semi); }

/* ── acceso ── */
.acceso { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: var(--s-6); background: var(--fondo); }
.tarjeta-acceso { width: 100%; max-width: 360px; animation: entra .35s cubic-bezier(.2, .7, .2, 1) both; }
.tarjeta-acceso .monograma { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; margin-bottom: var(--s-6); }
.tarjeta-acceso h1 { font-size: var(--t-20); line-height: var(--l-20); font-weight: var(--p-semi); letter-spacing: -0.02em; }
.tarjeta-acceso .subtitulo { margin: 2px 0 var(--s-6); }
.tarjeta-acceso form { display: grid; gap: var(--s-4); }
.campo-acceso { display: grid; gap: 6px; }
.campo-acceso > label { font-size: var(--t-13); font-weight: var(--p-medio); color: var(--texto-2); }
.entrada { display: flex; align-items: center; height: 42px; border: 1px solid var(--borde); border-radius: var(--r-8); background: var(--superficie);
  box-shadow: var(--e1); transition: border-color var(--d-cambio), box-shadow var(--d-cambio); }
.entrada:focus-within { border-color: var(--accion); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accion) 18%, transparent); }
.entrada input { flex: 1; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; background: none; color: var(--texto); font: inherit; font-size: 15px; }
.ver-clave { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--texto-3); border-radius: var(--r-8); cursor: pointer; }
.ver-clave:hover { color: var(--texto); }
.ver-clave svg { width: 18px; height: 18px; }
.ver-clave:focus-visible { outline-offset: -2px; }
.error-acceso { display: flex; gap: var(--s-2); align-items: center; padding: 9px 12px; border-radius: var(--r-8); background: var(--error-fondo);
  color: var(--error-texto); font-size: var(--t-13); font-weight: var(--p-medio); }
.error-acceso svg { width: 16px; height: 16px; }
.tarjeta-acceso .boton { height: 42px; font-size: var(--t-14); margin-top: var(--s-1); }
.seguro { margin-top: var(--s-6); display: flex; align-items: center; gap: 6px; font-size: var(--t-12); color: var(--texto-3); }
.seguro svg { width: 13px; height: 13px; }

@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tarjeta-acceso, .panel[open], .tostada, .menu, .vistazo { animation: none; transition: none; } }

/* ── tableta ── */
@media (max-width: 1100px) {
  .barra__dentro { padding: 0 var(--s-4); gap: var(--s-4); }
  main { padding: var(--s-5) var(--s-4) var(--s-12); }
  .herramientas, .cabecera-informe { margin-left: calc(-1 * var(--s-4)); margin-right: calc(-1 * var(--s-4)); padding-left: var(--s-4); padding-right: var(--s-4); }
  .franja div { padding-left: var(--s-4); padding-right: var(--s-4); }
  .columnas { grid-template-columns: 1fr; }
  .lateral { position: static; }
  .cuenta__nombre { display: none; }
}
/* ── móvil ── */
@media (max-width: 760px) {
  .marca__nombre, .busca { display: none; }
  .barra__dentro { gap: var(--s-2); }
  .nav { margin-right: auto; }
  .titulo { font-size: var(--t-20); line-height: var(--l-20); }
  .cabecera-pagina .acciones, .cabecera-pagina .acciones .boton { width: 100%; }
  /* sin desenfoque: un backdrop-filter haría que los menús (position: fixed) se colocaran respecto a la barra */
  .herramientas, .cabecera-informe { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--fondo); }
  .herramientas__fila { flex-wrap: wrap; }
  .herramientas__fila .buscador { flex-basis: 100%; }
  .facetas { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(-1 * var(--s-4)); margin-right: calc(-1 * var(--s-4));
    padding: 0 var(--s-4) 2px; scrollbar-width: none; }
  .facetas::-webkit-scrollbar { display: none; }
  .menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 60vh; min-width: 0; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla .fila { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s-3); padding: 12px var(--s-4) 12px var(--s-5);
    border-bottom: 1px solid var(--linea-2); box-shadow: inset 3px 0 0 var(--c, transparent); }
  .tabla .fila td { padding: 0; border: 0; box-shadow: none; }
  .tabla .fila td.col-num, .tabla .fila td.solo-escritorio { display: none; }
  .tabla .fila td.col-accion { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: auto; }
  .tabla .fila td:not(.col-accion) { grid-column: 1; }
  .tabla .fila td.num:not(.col-num) { grid-column: 2; grid-row: 1; justify-self: end; color: var(--texto-3); font-size: var(--t-12); }
  .marcador__equipo { font-size: var(--t-16); line-height: var(--l-16); }
  .marcador__resultado { height: 28px; font-size: var(--t-16); }
  .cabecera-informe .acciones, .cabecera-informe .acciones .boton { width: 100%; }
  .panel__cabecera, .panel__cuerpo, .panel__pie { padding-left: var(--s-4); padding-right: var(--s-4); }
  .vistazo__cuerpo { padding: var(--s-4); }
  .campos { grid-template-columns: 1fr; }
  .dato { grid-template-columns: 1fr; gap: 2px; }
  .dato dd { margin-bottom: 6px; }
}
