:root {
  --fondo: #f4f6f9; --papel: #fff; --tinta: #1b2433; --suave: #5f6b7d; --linea: #dde2ea;
  --azul: #1f3a6e; --azul-claro: #e8edf7; --oro: #d9a400; --aviso: #fff6d6; --error: #fde8e8;
  --resalte: #ffe08a; --barra: #1f3a6e; --input: #fff; --sel: #fffbea; --nogris: #fafbfc;
  --ok-bg: #e3f4e6; --ok-tx: #1b5e2b; --no-bg: #fde8e8; --no-tx: #8a1c1c; --aus-bg: #fff6d6; --aus-tx: #6b5300;
  --s0: #0072b2; --s1: #d55e00; --s2: #009e73;
}
:root[data-tema="dark"] {
  color-scheme: dark;
  --fondo: #0f141c; --papel: #18202c; --tinta: #e6ebf3; --suave: #9aa7ba; --linea: #2b3646;
  --azul: #8fb0ff; --azul-claro: #223150; --oro: #e0b000; --aviso: #3a3216; --error: #3d1f1f;
  --resalte: #5b4a0c; --barra: #16233f; --input: #111823; --sel: #2e2a14; --nogris: #131a24;
  --ok-bg: #1d3a27; --ok-tx: #9be5b0; --no-bg: #4a2020; --no-tx: #ffb4b4; --aus-bg: #4a3d12; --aus-tx: #ffd866;
  --s0: #56b4e9; --s1: #f0a04b; --s2: #4fd1a1;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 16px/1.5 "Segoe UI", system-ui, sans-serif; }
.barra { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 2rem; background: var(--barra); color: #fff; }
.barra h1 { margin: 0; font-size: 1.4rem; letter-spacing: .02em; }
main { max-width: 1050px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
button { font: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.secundario { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 6px; padding: .35rem .8rem; }
main .secundario { color: var(--azul); }
.migas { color: var(--suave); min-height: 1.5rem; margin-bottom: .75rem; }
.migas strong { color: var(--tinta); }
.volver { margin-bottom: 1rem; }
h2 { margin: 0 0 1rem; font-size: 1.6rem; }
.cuadricula { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.opcion { background: var(--papel); border: 1px solid var(--linea); border-left: 6px solid var(--azul); border-radius: 8px; padding: 1.6rem 1.2rem; text-align: left; font-size: 1.25rem; font-weight: 600; color: var(--tinta); }
.opcion small { display: block; font-weight: 400; font-size: .9rem; color: var(--suave); }
.opcion:hover { background: var(--azul-claro); }
.opcion.activa { border-left-color: var(--oro); background: var(--azul-claro); }
.lista { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lista .opcion { font-size: 1rem; padding: .9rem 1rem; font-weight: 500; }
.info { display: grid; gap: .9rem 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; padding: .9rem 1.1rem; margin: 1rem 0; }
.info dt { color: var(--suave); font-size: .85rem; }
.info .dato { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.aviso, .error, .vacio { border-radius: 8px; padding: .8rem 1rem; margin: .75rem 0; }
.aviso { background: var(--aviso); border-left: 5px solid var(--oro); }
.error { background: var(--error); border-left: 5px solid #c0392b; }
.vacio { background: var(--papel); border: 1px dashed var(--linea); color: var(--suave); }
.controles { display: flex; flex-wrap: wrap; gap: 1rem; margin: .75rem 0; }
.controles label { display: grid; font-size: .85rem; color: var(--suave); }
select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--linea); border-radius: 6px; background: var(--input); color: var(--tinta); }
.numeros { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 1rem 0 1.5rem; }
.numero { background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; padding: .9rem 1rem; }
.numero span { display: block; color: var(--suave); font-size: .85rem; }
.numero b { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.numero b.nd { font-size: 1rem; color: var(--suave); font-weight: 500; }
.numero small { color: var(--suave); }
.tabla-caja { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .8rem; text-align: left; border-bottom: 1px solid var(--linea); white-space: nowrap; }
th { background: var(--azul-claro); font-weight: 600; font-size: .9rem; }
td.n, th.n { text-align: right; }
tr.sel td { background: var(--sel); }
.pie { display: flex; gap: .75rem; margin-top: .75rem; align-items: center; color: var(--suave); }
.cargando { display: flex; align-items: center; gap: .8rem; color: var(--suave); padding: 2rem 0; }
/* Pantalla de carga */
.carga { max-width: 34rem; margin: 2.5rem auto; padding: 1.6rem 1.4rem; text-align: center; background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; box-shadow: 0 2px 10px rgba(15, 25, 45, .06); animation: aparece .25s ease both; }
.carga-marca { display: inline-flex; align-items: center; justify-content: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--azul-claro); color: var(--azul); animation: latido 1.6s ease-in-out infinite; }
.carga-marca .icono { width: 1.7rem; height: 1.7rem; }
.carga-titulo { margin: .9rem 0 .2rem; font-size: 1.1rem; font-weight: 600; color: var(--tinta); }
.carga-detalle { margin: 0 0 1rem; min-height: 1.3em; color: var(--suave); font-size: .92rem; }
.carga-barra { height: 8px; border-radius: 999px; background: var(--linea); overflow: hidden; }
.carga-barra > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--azul), var(--oro)); transition: width .5s ease; }
.carga-barra.indeterminada > i { width: 38%; animation: desliza 1.3s ease-in-out infinite; }
.esqueleto { display: grid; gap: .55rem; margin-top: 1.4rem; }
.esqueleto span { height: .8rem; border-radius: 6px; background: linear-gradient(90deg, var(--linea) 25%, var(--azul-claro) 50%, var(--linea) 75%); background-size: 200% 100%; animation: brillo 1.4s linear infinite; }
.esqueleto span:nth-child(1) { width: 100%; } .esqueleto span:nth-child(2) { width: 82%; } .esqueleto span:nth-child(3) { width: 64%; }
.carga-nota { margin: 1.1rem 0 0; padding: .55rem .8rem; background: var(--aviso); border-radius: 8px; color: var(--tinta); font-size: .9rem; }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes desliza { 0% { transform: translateX(-100%); } 100% { transform: translateX(270%); } }
@keyframes brillo { to { background-position: -200% 0; } }
.giro { width: 22px; height: 22px; border: 3px solid var(--linea); border-top-color: var(--azul); border-radius: 50%; animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation-duration: 3s; } }
@media (max-width: 600px) { .barra { padding: .8rem 1rem; } .barra h1 { font-size: 1.1rem; } }

.fichas { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.ficha { background: var(--papel); border: 1px solid var(--linea); border-bottom: 4px solid var(--linea); border-radius: 8px; padding: .5rem .9rem; text-align: left; color: var(--tinta); font-weight: 600; }
.ficha small { display: block; font-weight: 400; color: var(--suave); font-size: .8rem; }
.ficha:hover { background: var(--azul-claro); }
.ficha.activa { border-bottom-color: var(--oro); background: var(--azul-claro); }
.marca { display: flex; gap: .5rem; align-items: center; margin: .25rem 0 .75rem; cursor: pointer; }
.marca input { width: 1.1rem; height: 1.1rem; accent-color: var(--azul); }
tr.no-ing td { color: var(--suave); background: var(--nogris); }
.procesos { margin: 1rem 0; background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; padding: .6rem 1rem; }
.procesos summary { cursor: pointer; font-weight: 600; }
.procesos ul { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--suave); }

.acciones { display: flex; gap: .5rem; flex-wrap: wrap; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.buscador-caja { margin-bottom: 1rem; }
#buscador { width: 100%; font: inherit; font-size: 1.05rem; padding: .7rem 1rem; border: 1px solid var(--linea); border-radius: 8px; background: var(--input); color: var(--tinta); }
#buscador:disabled { opacity: .6; }
.resumen-busqueda { color: var(--suave); margin: .25rem 0 .75rem; }
.insignia { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--azul-claro); color: var(--tinta); }
.insignia.ingreso { background: var(--ok-bg); color: var(--ok-tx); }
.insignia.noingreso { background: var(--no-bg); color: var(--no-tx); }
.insignia.ausente { background: var(--aus-bg); color: var(--aus-tx); }

tr.clic { cursor: pointer; }
tr.clic:hover td { background: var(--azul-claro); }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--azul); text-decoration: underline; text-align: left; }
tr.resaltado td { background: var(--resalte); color: var(--tinta); font-weight: 700; }
tr.resaltado td:first-child { box-shadow: inset 5px 0 0 var(--oro); }

.herramientas { margin: 2rem 0 .75rem; font-size: 1.1rem; }
.campo { font: inherit; padding: .35rem .6rem; border: 1px solid var(--linea); border-radius: 6px; background: var(--input); color: var(--tinta); width: 9rem; }
.controles { align-items: end; }
.calcular { align-self: end; padding: .45rem 1.2rem; font-weight: 600; }
.graficos { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin: 1.5rem 0; align-items: start; }
.graficos > :only-child { grid-column: 1 / -1; }
@media (max-width: 860px) { .graficos { grid-template-columns: minmax(0, 1fr); } }
.grafico { margin: 1rem 0; min-width: 0; }
.graficos .grafico { margin: 0; }
.grafico h3 { margin: 0 0 .5rem; }
.lienzo { position: relative; }
.grafico .lienzo > svg { display: block; width: 100%; height: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; }
.grafico .lienzo > svg:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.g-rejilla { stroke: var(--linea); stroke-width: 1; }
.g-txt { fill: var(--suave); font-size: 12px; }
.g-valor { fill: var(--tinta); font-size: 12px; font-weight: 600; }
.g-linea { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-min { stroke: var(--azul); stroke-width: 3.5; }
.g-prom { stroke: var(--suave); stroke-dasharray: 6 4; }
.g-max { stroke: var(--oro); }
.g-banda { fill: var(--azul); opacity: .12; }
.g-punto { stroke: var(--papel); stroke-width: 1.5; }
.g-sel { stroke: var(--oro); stroke-width: 2; stroke-dasharray: 3 4; opacity: .8; }
.g-cursor { stroke: var(--suave); stroke-width: 1; }
.g-min-p { fill: var(--azul); background: var(--azul); }
.g-prom-p { fill: var(--suave); background: var(--suave); }
.g-max-p { fill: var(--oro); background: var(--oro); }
.g-no-p { background: var(--suave); opacity: .5; }
.g-corte-p { background: var(--oro); border-radius: 2px !important; }
.g-barra { fill: var(--azul); cursor: pointer; }
.g-barra-sel { fill: var(--oro); }
.g-barra-no { fill: var(--suave); opacity: .45; }
.g-zona { fill: transparent; }
.g-zona:hover { fill: var(--azul); opacity: .12; }
.g-corte { stroke: var(--oro); stroke-width: 2.5; stroke-dasharray: 6 4; }
.tooltip { position: absolute; top: 8px; z-index: 2; pointer-events: none; min-width: 200px; background: var(--papel); border: 1px solid var(--linea); border-radius: 8px; padding: .5rem .75rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); font-size: .85rem; }
.tip-fecha { display: block; color: var(--suave); margin-bottom: .3rem; }
.tip-fila { display: flex; justify-content: space-between; gap: 1rem; }
.tip-fila span { color: var(--suave); }
.leyenda { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .5rem; color: var(--suave); font-size: .9rem; }
.leyenda .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .4rem; }
.ley { background: none; border: 1px solid var(--linea); border-radius: 999px; padding: .15rem .7rem; color: var(--tinta); }
.ley.apagada { opacity: .45; text-decoration: line-through; }
.ley:hover { background: var(--azul-claro); }
.tendencia { color: var(--suave); font-size: .9rem; margin: .5rem 0 0; }

/* ============ Iconos ============ */
:root { --aviso-ic: #8a6100; --error-ic: #c0392b; }
:root[data-tema="dark"] { --aviso-ic: #e0b000; --error-ic: #ff8a8a; }
.icono { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.barra h1 { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.barra h1 .logo { width: 1.5rem; height: 1.5rem; }
.barra h1 img.logo { width: 2rem; height: 2rem; object-fit: contain; flex: none; }
.acciones .secundario, .volver, .ley { display: inline-flex; align-items: center; gap: .45rem; }
.secundario { transition: background-color .15s, color .15s, border-color .15s, transform .15s; }
.secundario:hover { background: rgba(127, 140, 160, .16); }
.secundario:active { transform: scale(.97); }
#refrescar .icono { transition: transform .35s ease; }
#refrescar:hover .icono { transform: rotate(180deg); }
.volver .icono { transition: transform .15s; }
.volver:hover .icono { transform: translateX(-3px); }

/* Tarjetas con icono */
.opcion { transition: transform .15s ease, box-shadow .15s ease, background-color .15s, border-color .15s; }
.opcion:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 33, 61, .10); }
.opcion:active { transform: translateY(0) scale(.99); box-shadow: none; }
.opcion.con-icono { display: flex; align-items: center; gap: 1rem; }
.icono-caja { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 10px; background: var(--azul-claro); color: var(--azul); flex: none; transition: background-color .15s, color .15s; }
.icono-caja .icono { width: 1.5rem; height: 1.5rem; }
.opcion:hover .icono-caja { background: var(--azul); color: var(--papel); }
.opcion.fila { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.opcion.fila .icono { color: var(--suave); transition: transform .15s, color .15s; }
.opcion.fila:hover .icono { transform: translateX(3px); color: var(--azul); }

/* Avisos, errores y mensajes con icono */
.caja { display: flex; align-items: flex-start; gap: .7rem; }
.caja .icono { margin-top: .2rem; width: 1.2rem; height: 1.2rem; }
.caja-texto { flex: 1; min-width: 0; }
.caja.aviso .icono { color: var(--aviso-ic); }
.caja.error .icono { color: var(--error-ic); }
.caja.vacio .icono { color: var(--suave); }

/* Estadísticas */
.numero { position: relative; transition: transform .15s ease, box-shadow .15s ease; }
.numero:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 33, 61, .08); }
.numero > .icono { position: absolute; top: .85rem; right: .9rem; width: 1.3rem; height: 1.3rem; color: var(--azul); opacity: .7; }
.titulo-icono { display: flex; align-items: center; gap: .5rem; }
.titulo-icono .icono { color: var(--azul); }
.insignia .icono { width: .95em; height: .95em; margin-right: .25rem; vertical-align: -0.12em; stroke-width: 2.5; }

/* Buscador */
.buscador-caja { position: relative; }
.buscador-icono { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; display: flex; }
#buscador { padding-left: 2.8rem; }

/* ============ Animaciones ============ */
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes revelar { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes crecer { from { transform: scaleY(0); } to { transform: scaleY(1); } }

#app > *, #busqueda > * { animation: entra .3s ease both; }
#app > :nth-child(2) { animation-delay: .04s; }
#app > :nth-child(3) { animation-delay: .08s; }
#app > :nth-child(4) { animation-delay: .12s; }
#app > :nth-child(n+5) { animation-delay: .16s; }
.cuadricula > *, .lista > *, .numeros > *, .fichas > * { animation: entra .3s ease both; }
.cuadricula > :nth-child(2), .lista > :nth-child(2), .numeros > :nth-child(2), .fichas > :nth-child(2) { animation-delay: .04s; }
.cuadricula > :nth-child(3), .lista > :nth-child(3), .numeros > :nth-child(3), .fichas > :nth-child(3) { animation-delay: .08s; }
.cuadricula > :nth-child(4), .lista > :nth-child(4), .numeros > :nth-child(4), .fichas > :nth-child(4) { animation-delay: .12s; }
.cuadricula > :nth-child(5), .lista > :nth-child(5), .numeros > :nth-child(5), .fichas > :nth-child(5) { animation-delay: .16s; }
.cuadricula > :nth-child(n+6), .lista > :nth-child(n+6), .numeros > :nth-child(n+6), .fichas > :nth-child(n+6) { animation-delay: .20s; }
.tooltip { animation: aparece .12s ease both; }
tbody tr { animation: aparece .25s ease both; }

/* Gráficos: las líneas se dibujan de izquierda a derecha; las barras crecen desde la base */
.anim .g-revelar { animation: revelar .9s ease-out both; }
.anim .g-punto, .anim .g-valor { animation: aparece .4s ease-out .65s both; }
.anim .g-barra, .anim .g-barra-no { transform-box: fill-box; transform-origin: 50% 100%; animation: crecer .6s cubic-bezier(.2, .8, .2, 1) both; }
.anim .g-corte { animation: aparece .4s ease-out .7s both; }

/* Contador de días faltantes */
.contador { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; margin: 0 0 1.5rem; box-shadow: 0 2px 10px rgba(15, 25, 45, .08); }
.contador-banda { padding: 1.1rem 1.3rem 1.3rem; color: #fff; background: linear-gradient(135deg, #1f3a6e 0%, #2f5aa8 100%); }
:root[data-tema="dark"] .contador-banda { background: linear-gradient(135deg, #16233f 0%, #26427a 100%); }
.contador-cab { display: flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #cfdcf5; }
.contador-cab .icono { width: 1.1em; height: 1.1em; }
.contador-resumen { margin-left: auto; padding: .15rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .15); letter-spacing: .03em; text-transform: none; font-size: .8rem; color: #fff; }
.contador.cerca .contador-resumen { background: var(--oro); color: #1b2433; }
.contador-plegar { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; flex: none; }
.contador-plegar:hover { background: rgba(255, 255, 255, .25); }
.contador-plegar .icono { width: 1.1rem; height: 1.1rem; transform: rotate(90deg); transition: transform .2s; }
.contador.plegado .contador-plegar .icono { transform: rotate(0deg); }
.contador.plegado .contador-nombre, .contador.plegado .contador-fecha, .contador.plegado .contador-tipo, .contador.plegado .reloj-leyenda,
.contador.plegado .reloj, .contador.plegado .contador-progreso, .contador.plegado .contador-lista { display: none; }
.contador.plegado .contador-banda { padding-bottom: 1.1rem; }
.contador-nombre { margin: .6rem 0 0; font-size: 1.45rem; font-weight: 700; line-height: 1.25; }
.contador-fecha { margin: .15rem 0 1rem; color: #cfdcf5; font-size: .95rem; }
.reloj { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; max-width: 26rem; }
.reloj > div { display: grid; text-align: center; padding: .55rem .2rem .45rem; border-radius: 10px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); }
.reloj > div.dias { background: rgba(255, 255, 255, .22); border-bottom: 3px solid var(--oro); }
.reloj b { font-size: clamp(1.7rem, 6vw, 2.5rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.reloj small { color: #cfdcf5; font-size: .68rem; letter-spacing: .12em; }
.contador-lista { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem 1.3rem; border-top: 1px solid var(--linea); background: var(--nogris); }
.pastilla { display: grid; text-align: left; padding: .4rem .8rem; border: 1px solid var(--linea); border-radius: 999px; background: var(--papel); color: var(--tinta); font-weight: 600; font-size: .9rem; line-height: 1.25; cursor: pointer; }
.pastilla small { color: var(--suave); font-weight: 400; font-size: .75rem; }
.pastilla:hover { background: var(--azul-claro); }
.pastilla.activa { border-color: var(--azul); background: var(--azul-claro); box-shadow: 0 0 0 2px var(--oro); }

/* Favoritas y ranking */
.titulo-carrera { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.titulo-carrera h2 { margin: .5rem 0; }
.estrella { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 1px solid var(--linea); border-radius: 50%; background: var(--papel); color: var(--suave); cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.estrella .icono { width: 1.15rem; height: 1.15rem; }
.estrella:hover { color: var(--oro); transform: scale(1.1); }
.estrella.activa { color: var(--oro); background: var(--aviso); border-color: var(--oro); }
.estrella.activa .icono { fill: currentColor; }
td .estrella { width: 1.9rem; height: 1.9rem; }
td.sube { color: var(--no-tx); }
td.baja { color: var(--ok-tx); }

/* Paginación de la tabla de ingresantes */
/* Tres columnas: texto a la izquierda, páginas siempre al centro, acciones a la derecha. */
.pie-paginas { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem 1rem; align-items: center; }
.pie-paginas > :first-child { grid-column: 1; justify-self: start; }
.pie-paginas > .paginacion { grid-column: 2; justify-self: center; }
.pie-paginas > .pie-acciones { grid-column: 3; justify-self: end; }
@media (max-width: 720px) {
  .pie-paginas { grid-template-columns: 1fr; justify-items: center; }
  .pie-paginas > :first-child, .pie-paginas > .paginacion, .pie-paginas > .pie-acciones { grid-column: 1; justify-self: center; }
}
.paginacion { display: flex; align-items: center; justify-content: center; gap: .3rem; flex-wrap: wrap; }
.pag { min-width: 2.2rem; height: 2.2rem; padding: 0 .5rem; border: 1px solid var(--linea); border-radius: 8px; background: var(--papel); color: var(--tinta); font: inherit; font-weight: 600; cursor: pointer; }
.pag:hover:not(:disabled) { background: var(--azul-claro); }
.pag.activa { background: var(--azul-claro); border-color: var(--azul); color: var(--tinta); box-shadow: inset 0 -3px 0 var(--oro); }
.pag:disabled { opacity: .4; cursor: not-allowed; }
.pag-puntos { color: var(--suave); padding: 0 .15rem; }
.pie-acciones { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.pie-acciones label { display: flex; align-items: center; gap: .4rem; flex-direction: row; }
tr.ultimo-ing td { border-bottom: 2px solid var(--oro); }

/* Tendencia en tablas, selección y comparación */
.spark { display: block; width: 84px; height: 26px; }
.spark-linea { fill: none; stroke: var(--azul); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spark-punto { fill: var(--oro); stroke: var(--papel); stroke-width: 1; }
.sin-dato { color: var(--suave); }
td.centro, th.centro { text-align: center; }
td input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--azul); cursor: pointer; }
td input[type=checkbox]:disabled { cursor: not-allowed; opacity: .45; }
.cmp-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; margin: .5rem 0 .75rem; padding: .55rem .8rem; background: var(--papel); border: 1px dashed var(--linea); border-radius: 8px; color: var(--suave); }
.cmp-barra .cmp-texto { flex: 1 1 14rem; }
.cmp-barra button:disabled { opacity: .45; cursor: not-allowed; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1rem; }
.cmp-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .4rem .3rem .75rem; background: var(--papel); border: 1px solid var(--linea); border-radius: 999px; font-weight: 600; }
.cmp-chip button { display: inline-flex; padding: .2rem; border: 0; border-radius: 50%; background: transparent; color: var(--suave); cursor: pointer; }
.cmp-chip button:hover { background: var(--azul-claro); color: var(--tinta); }
.cmp-chip .icono { width: 1rem; height: 1rem; }
.sw-s { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .4rem; vertical-align: -1px; }
.cmp-chip .sw-s { margin-right: 0; }
.sw-s.s0 { background: var(--s0); } .sw-s.s1 { background: var(--s1); border-radius: 2px; } .sw-s.s2 { background: var(--s2); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.g-s0 { stroke: var(--s0); } .g-s1 { stroke: var(--s1); } .g-s2 { stroke: var(--s2); }
.g-marca { stroke: var(--papel); stroke-width: 1.5; }
.m-s0 { fill: var(--s0); } .m-s1 { fill: var(--s1); } .m-s2 { fill: var(--s2); }
.g-barra-c.b-s0 { fill: var(--s0); } .g-barra-c.b-s1 { fill: var(--s1); } .g-barra-c.b-s2 { fill: var(--s2); }
.ley-fija { display: inline-flex; align-items: center; }
.tabla-comparar th[scope=row] { color: var(--suave); font-weight: 600; background: var(--nogris); }
.tabla-comparar thead th { vertical-align: bottom; }
.cab-serie { display: inline-flex; align-items: center; }
.tabla-comparar td.mayor { font-weight: 700; }
.tabla-comparar td, .tabla-comparar thead th { white-space: normal; min-width: 9rem; }
@media (max-width: 600px) {
  .tabla-comparar th, .tabla-comparar td { padding: .45rem .4rem; font-size: .82rem; }
  .tabla-comparar td, .tabla-comparar thead th { min-width: 4rem; }
  .tabla-comparar th[scope=row] { min-width: 5.2rem; max-width: 5.4rem; white-space: normal; }
  .tabla-comparar .spark { width: 56px; }
  .tabla-comparar thead th { font-size: .76rem; }
  .tabla-comparar .sw-s { width: .6rem; height: .6rem; margin-right: .25rem; }
}

/* Buscador local de la lista de ingresantes */
.buscador-local-caja { margin: .5rem 0 .25rem; }
.buscador-local { width: 100%; max-width: 26rem; }
.aviso-local { margin: .4rem 0 0; padding: .45rem .75rem; background: var(--ok-bg); color: var(--ok-tx); border-radius: 8px; font-size: .9rem; }

/* Aviso legal y etiqueta "No oficial" */
.no-oficial { display: inline-block; margin-left: .6rem; padding: .1rem .55rem; border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.pie-legal { max-width: 1050px; margin: 0 auto 1.5rem; padding: 1rem 1.25rem 0; border-top: 1px solid var(--linea); color: var(--suave); font-size: .85rem; line-height: 1.5; }
.pie-legal p { margin: 0 0 .5rem; }
.pie-legal a { color: var(--azul); text-decoration: underline; text-underline-offset: 2px; }
.info dd a { color: var(--azul); }

/* Respeta "reducir movimiento" del sistema */
@media (prefers-reduced-motion: reduce) { .carga-marca, .esqueleto span { animation: none; } .carga-barra.indeterminada > i { animation: none; width: 38%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .opcion:hover, .numero:hover { transform: none; }
}

.enlace-boton { text-decoration: none; display: inline-block; font: inherit; }

/* Aviso al activar modo avanzado / dev */
.toast-modo { --tono: var(--ok-tx); position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.2rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok-tx); border: 1px solid currentColor; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: toast-entra .45s cubic-bezier(.2,1.2,.4,1) both; }
.toast-modo.dev { --tono: var(--azul); background: var(--azul-claro); color: var(--azul); }
.toast-modo.expirado { --tono: #b45309; background: #fef3c7; color: #92400e; }
:root[data-tema="dark"] .toast-modo.expirado { background: #3a2a0a; color: #fcd34d; --tono: #d97706; }
.toast-modo.saliendo { animation: toast-sale .5s ease-in both; }
.toast-icono { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .3rem; border-radius: 999px; background: var(--tono); color: var(--papel); font-size: .8rem; animation: toast-pulso 1s .4s ease-out; }
@keyframes toast-entra { from { opacity: 0; transform: translate(-50%, -140%) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes toast-sale { to { opacity: 0; transform: translate(-50%, -140%) scale(.9); } }
@keyframes toast-pulso { 0% { box-shadow: 0 0 0 0 var(--tono); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .toast-modo, .toast-modo.saliendo, .toast-icono { animation: none; } .toast-modo.saliendo { opacity: 0; } }
