/* ══════════════════════════════════════════════════════════════
   ÓLA · Gestión Académica Integral — capa de estilos (antes iO; los nombres io-* se mantienen)
   Se carga DESPUÉS de main.css y lo sobreescribe. Para volver al
   aspecto anterior basta con quitar la línea de io.css del index.
   Valores sacados del design system de iO (tokens versión 9).
══════════════════════════════════════════════════════════════ */

/* ── TOKENS iO ───────────────────────────────────────── */
:root {
  --io-blue-50:#E7F6F4; --io-blue-100:#CFEEEA; --io-blue-300:#9FD2D6; --io-blue-500:#12BAAA; --io-blue-700:#1D4E63; --io-blue-800:#163D4E; --io-blue-900:#0E2F3A;
  --io-yellow-100:#E3F6F4; --io-yellow-300:#12BAAA; --io-yellow-400:#3CC7B9; --io-yellow-500:#5ED1C5;
  --io-bg-page:#F4FAF9; --io-bg-subtle:#E8F3F1; --io-surface:#FFFFFF; --io-surface-hover:#CFEEEA; --io-surface-selected:#E7F6F4; --io-surface-disabled:#DCE8E6;
  --io-text:#0E2F3A; --io-text-2:#4A5F63; --io-link:#1D4E63;
  --io-border-subtle:#C3D7D4; --io-border-control:#5B7774; --io-border-action:#1D4E63; --io-focus:#1D4E63;
  --io-ok:#1A6F36; --io-ok-bg:#E3F2E7; --io-warn:#8A5A00; --io-warn-bg:#FCF0D2; --io-err:#B3261E; --io-err-bg:#FBE9E8; --io-info:#1D4E63; --io-info-bg:#E7F6F4; --io-holiday-bg:#E3F6F4;
  --io-primary:#12BAAA; --io-primary-hover:#3CC7B9; --io-primary-pressed:#5ED1C5; --io-primary-text:#0E2F3A; --io-primary-border:#1D4E63;
  --io-inverse:#0E2F3A; --io-on-inverse:#FFFFFF; --io-on-inverse-action:#12BAAA;
  --io-logo-text:#12BAAA; --io-header:#FFFFFF; --io-header-border:#C3D7D4;
  --io-act-clase:#33609A; --io-act-recuperacion:#00727A; --io-act-tutoria:#7048A8; --io-act-sesion:#B84A00; --io-act-simulacro:#26223B; --io-act-reunion:#A8327A; --io-act-grabacion:#625E52;
  --io-font:"Baloo 2", ui-rounded, system-ui, sans-serif;
  --io-shadow-sm:0 1px 2px rgba(14,47,58,.10); --io-shadow-md:0 4px 12px rgba(14,47,58,.14); --io-shadow-lg:0 12px 32px rgba(14,47,58,.22);

  /* Variables antiguas de main.css apuntadas a iO: todo lo que las usa cambia solo */
  --azul:#1D4E63; --azul2:#163D4E; --azul-btn:#1D4E63; --azul-sidebar:#0E2F3A;
  --teal:#1D4E63; --teal2:#163D4E;
  --gris:#F4FAF9; --gris2:#DCE8E6; --gris3:#4A5F63;
  --texto:#0E2F3A; --texto2:#4A5F63; --blanco:#FFFFFF;
  --verde:#1A6F36; --verde2:#E3F2E7; --rojo:#B3261E; --rojo2:#FBE9E8; --naranja:#8A5A00; --naranja2:#FCF0D2;
  --morado:#7048A8; --morado2:#EFE9F8; --rosa:#A8327A; --rosa2:#F8E6F0;
  --sombra:var(--io-shadow-sm); --sombra-card:var(--io-shadow-sm); --sombra-btn:none; --sombra-btn-hover:none;
  --radio:16px; --radio-sm:12px; --sidebar-w:256px;
}
[data-theme="dark"] {
  --io-bg-page:#1D4E63; --io-bg-subtle:#14374A; --io-surface:#14374A; --io-surface-hover:#1F4A5E; --io-surface-selected:#1F4A5E; --io-surface-disabled:#1F4A5E;
  --io-text:#F0F7F7; --io-text-2:#CFE3E5; --io-link:#9FD2D6;
  --io-border-subtle:#2E6077; --io-border-control:#7FA6B3; --io-border-action:#9FD2D6; --io-focus:#12BAAA;
  --io-ok:#8FD4A4; --io-ok-bg:#1D3A28; --io-warn:#F0C46A; --io-warn-bg:#3D3016; --io-err:#F7B8B3; --io-err-bg:#42201E; --io-info:#9FD2D6; --io-info-bg:#163D4E; --io-holiday-bg:#24505A;
  --io-primary-border:#12BAAA;
  --io-inverse:#F0F7F7; --io-on-inverse:#1D4E63; --io-on-inverse-action:#1D4E63;
  --io-logo-text:#F0F7F7; --io-header:#14374A; --io-header-border:#7FA6B3;
  --io-act-clase:#80B0E8; --io-act-recuperacion:#5CC6C9; --io-act-tutoria:#C29CF5; --io-act-sesion:#F5A15C; --io-act-simulacro:#D9D4F0; --io-act-reunion:#EE97C6; --io-act-grabacion:#ADA899;
  --io-shadow-sm:0 1px 2px rgba(0,0,0,.4); --io-shadow-md:0 4px 12px rgba(0,0,0,.5); --io-shadow-lg:0 12px 32px rgba(0,0,0,.6);

  --azul:#9FD2D6; --azul2:#163D4E; --azul-btn:#1D4E63; --azul-sidebar:#1D4E63;
  --teal:#9FD2D6; --teal2:#163D4E;
  --gris:#1D4E63; --gris2:#2E6077; --gris3:#CFE3E5;
  --texto:#F0F7F7; --texto2:#CFE3E5; --blanco:#14374A;
  --verde:#8FD4A4; --verde2:#1D3A28; --rojo:#F7B8B3; --rojo2:#42201E; --naranja:#F0C46A; --naranja2:#3D3016;
  --morado:#C29CF5; --morado2:#2E2640; --rosa:#EE97C6; --rosa2:#3A2430;
}

/* ── BASE: Baloo 2, texto normal de 18 px y nunca menos de 16 px ── */
html { font-size: 18px; }
body { font-family: var(--io-font); font-size: 18px; line-height: 1.5; background: var(--io-bg-page); color: var(--io-text); }
button, input, select, textarea { font-family: var(--io-font); }
a { color: var(--io-link); }
:focus-visible { outline: 2px solid var(--io-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ── MENÚ LATERAL: superficie clara, icono en el color del texto ──
   (main.css trae reglas con !important para el menú oscuro: aquí se igualan) */
#sidebar { background: var(--io-surface) !important; border-right: 1px solid var(--io-border-subtle) !important; box-shadow: none; }
.sb-logo { padding: 12px 16px; min-height: 64px; display: flex; align-items: center; border-bottom: 1px solid var(--io-header-border); }
.sb-logo .io-logo { height: 40px; width: auto; display: block; }
.io-logo .l-sq { fill: var(--io-blue-500); } .io-logo .l-w { fill: #FFFFFF; } .io-logo .l-y { fill: var(--io-yellow-300); }
.io-logo .l-tx { fill: var(--io-logo-text); }
.io-logo .l-ring { fill: none; stroke: var(--io-yellow-300); stroke-width: 18; }
.io-logo--acceso .l-tx { fill: #FFFFFF; }
#sidebar .sb-section { padding: 16px 16px 4px !important; font-size: 16px !important; font-weight: 800 !important; letter-spacing: .04em !important; color: var(--io-text-2) !important; }
#sidebar .sb-item { min-height: 44px; padding: 8px 16px; margin: 0 !important; width: 100%; border-radius: 0 !important; font-size: 18px; color: var(--io-text) !important; gap: 8px; position: relative; }
#sidebar .sb-item:hover { background: var(--io-surface-hover) !important; color: var(--io-text) !important; transform: none !important; }
#sidebar .sb-item.active { background: var(--io-surface-selected) !important; color: var(--io-link) !important; font-weight: 700 !important; box-shadow: none !important; }
#sidebar .sb-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--io-border-action); }
#sidebar .sb-icon { width: 24px !important; font-size: 18px; }
#sidebar .sb-icon svg { width: 20px; height: 20px; stroke: currentColor !important; }
#sidebar .sb-badge { background: var(--io-warn-bg); color: var(--io-warn); font-size: 18px; padding: 0 8px; }
#sb-fav-label { color: var(--io-text-2) !important; font-size: 18px !important; }
.sb-footer { border-top: 1px solid var(--io-border-subtle); }
#sidebar .sb-user { font-size: 18px; color: var(--io-text-2) !important; }
#sidebar .sb-user span { color: var(--io-text); }
.sb-rol { font-size: 18px; padding: 0 8px; }
.sb-rol-gestora { background: var(--morado2); color: var(--morado); }
.sb-rol-admin { background: var(--io-info-bg); color: var(--io-info); }
.sb-rol-secretaria { background: var(--io-ok-bg); color: var(--io-ok); }
.sb-rol-guest { background: var(--io-bg-subtle); color: var(--io-text-2); }
#sidebar .sb-copyright { font-size: 18px; color: var(--io-text-2) !important; }

/* ── CABECERA ───────────────────────────────────────── */
#topbar { height: 64px; background: var(--io-header); border-bottom: 1px solid var(--io-header-border); box-shadow: none; padding: 0 32px; }
.tb-title { font-size: 24px; font-weight: 800; color: var(--io-text); }
.tb-search { background: var(--io-bg-subtle); border: 1px solid var(--io-border-control); border-radius: 12px; padding: 4px 12px; min-height: 40px; }
.tb-search input { font-size: 18px; }
.tb-search-results { top: 60px; border-color: var(--io-border-subtle); box-shadow: var(--io-shadow-md); }
.tb-search-item { font-size: 18px; }
#content { padding: 24px 32px; min-width: 0; }
/* Sin esto, una tabla ancha (planning) estira toda la página hacia la derecha */
#main { min-width: 0; }

/* ── TARJETAS Y CIFRAS ─────────────────────────────── */
.card { border-radius: 16px; border-color: var(--io-border-subtle); box-shadow: var(--io-shadow-sm); padding: 24px; }
.card-title { font-size: 18px; font-weight: 800; letter-spacing: .04em; color: var(--io-text-2); }
.stat { border-color: var(--io-border-subtle); border-left: 4px solid var(--io-border-action); box-shadow: var(--io-shadow-sm); }
.stat:hover { transform: none; box-shadow: var(--io-shadow-sm); }
.stat-n { font-size: 32px; color: var(--io-text); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 18px; color: var(--io-text-2); }
.stat.verde { border-left-color: var(--io-ok); } .stat.naranja { border-left-color: var(--io-warn); } .stat.rojo { border-left-color: var(--io-err); } .stat.morado { border-left-color: var(--morado); }

/* ── TABLAS: cabecera clara, texto de 16 px ────────── */
.tabla-wrap { border-radius: 16px; border-color: var(--io-border-subtle); }
table { font-size: 18px; }
thead { background: var(--io-bg-subtle); }
thead th { color: var(--io-text); font-size: 18px; font-weight: 600; padding: 12px; border-bottom: 1px solid var(--io-border-subtle); }
thead th:hover { background: var(--io-surface-hover); }
tbody tr { border-bottom-color: var(--io-border-subtle); }
tbody tr:hover { background: var(--io-surface-hover); }
tbody td { padding: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── FORMULARIOS ───────────────────────────────────── */
label { font-size: 18px; font-weight: 600; color: var(--io-text); }
input, select, textarea { font-size: 18px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--io-border-control); border-radius: 12px; color: var(--io-text); background: var(--io-surface); }
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 20px; height: 20px; accent-color: var(--io-blue-700); }
input::placeholder, textarea::placeholder { color: var(--io-text-2); }
input:hover, select:hover, textarea:hover { border-color: var(--io-border-action); }
input:focus, select:focus, textarea:focus { border-color: var(--io-border-action); box-shadow: none; outline: 2px solid var(--io-focus); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { background: var(--io-surface-disabled); color: var(--io-text-2); border-color: transparent; }

/* ── BOTONES: principal amarillo con borde azul ────── */
.btn { font-size: 18px; font-weight: 600; min-height: 40px; padding: 6px 20px; border-radius: 12px; border: 2px solid transparent; box-shadow: none; gap: 8px; }
.btn:hover, .btn:active { transform: none !important; box-shadow: none !important; }
.btn-sm { font-size: 18px; min-height: 40px; padding: 4px 16px; }
.btn-primary { background: var(--io-primary); color: var(--io-primary-text); border-color: var(--io-primary-border); }
.btn-primary:hover { background: var(--io-primary-hover); color: var(--io-primary-text); }
.btn-primary:active { background: var(--io-primary-pressed); }
.btn-ghost { background: var(--io-surface); color: var(--io-link); border-color: var(--io-border-action); }
.btn-ghost:hover { background: var(--io-surface-selected); }
.btn-danger { background: var(--io-surface); color: var(--io-err); border-color: var(--io-err); }
.btn-danger:hover { background: var(--io-err-bg); }
.btn-morado { background: var(--io-surface); color: var(--morado); border-color: var(--morado); }
.btn-morado:hover { background: var(--morado2); }
.btn-verde { background: var(--io-surface); color: var(--io-ok); border-color: var(--io-ok); }
.btn-verde:hover { background: var(--io-ok-bg); }
.btn:disabled { background: var(--io-surface-disabled) !important; color: var(--io-text-2) !important; border-color: transparent !important; cursor: not-allowed; }

/* ── ETIQUETAS (chips) ─────────────────────────────── */
.chip { font-size: 18px; padding: 2px 12px; font-weight: 600; }
.chip-verde { background: var(--io-ok-bg); color: var(--io-ok); }
.chip-rojo { background: var(--io-err-bg); color: var(--io-err); }
.chip-naranja { background: var(--io-warn-bg); color: var(--io-warn); }
.chip-azul, .chip-teal { background: var(--io-info-bg); color: var(--io-info); }
.chip-gris { background: var(--io-bg-subtle); color: var(--io-text-2); }
.chip-rosa { background: var(--rosa2); color: var(--rosa); }
.chip-morado { background: var(--morado2); color: var(--morado); }

/* ── VENTANAS (modal) ──────────────────────────────── */
.overlay { background: rgba(14,47,58,.48); }
[data-theme="dark"] .overlay { background: rgba(0,0,0,.64); }
.modal { border-radius: 16px; box-shadow: var(--io-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--io-border-subtle); }
.modal-header { padding: 16px 24px; } .modal-body { padding: 24px; } .modal-footer { padding: 16px 24px; }
.modal-title { font-size: 24px; font-weight: 700; }
.btn-close { font-size: 20px; color: var(--io-link); min-width: 40px; min-height: 40px; border-radius: 12px; }

/* ── AVISOS ────────────────────────────────────────── */
.alerta { font-size: 18px; border-radius: 12px; padding: 16px; }
.alerta-error { background: var(--io-err-bg); color: var(--io-err); border-color: var(--io-err); }
.alerta-ok { background: var(--io-ok-bg); color: var(--io-ok); border-color: var(--io-ok); }
.alerta-warn { background: var(--io-warn-bg); color: var(--io-warn); border-color: var(--io-warn); }
.alerta-info { background: var(--io-info-bg); color: var(--io-info); border-color: var(--io-info); }

/* ── NOTIFICACIÓN BREVE (toast) Y TOOLTIP ──────────── */
.toast-item { font-size: 18px; border-radius: 12px; padding: 16px; box-shadow: var(--io-shadow-lg); max-width: 400px; }
.toast-ok { background: var(--io-inverse); color: var(--io-on-inverse); }
.toast-err { background: var(--io-err-bg); color: var(--io-err); border: 1px solid var(--io-err); }
.toast-warn { background: var(--io-warn-bg); color: var(--io-warn); border: 1px solid var(--io-warn); }
.tooltip-box { background: var(--io-inverse); color: var(--io-on-inverse); font-size: 18px; }
.detail-popup { font-size: 18px; border-color: var(--io-border-subtle); box-shadow: var(--io-shadow-md); }

/* ── VARIOS ────────────────────────────────────────── */
.empty { color: var(--io-text-2); } .empty-txt { font-size: 18px; }
.fecha-tag { background: var(--io-blue-800); font-size: 18px; }
.agenda-header, .asist-cal th { background: var(--io-bg-subtle); color: var(--io-text); font-size: 18px; }
.agenda-cell.hoy { background: var(--io-surface-selected); }
.asist-dia-num, .asist-doc, .agenda-hora, .agenda-evento, .calor-cell { font-size: 18px; }
.semaforo-verde { background: var(--io-ok); } .semaforo-rojo { background: var(--io-err); } .semaforo-gris { background: var(--io-text-2); }
.progreso-fill { background: var(--io-ok); }
.camara-card.libre { border-color: var(--io-ok); background: var(--io-ok-bg); }
.camara-card.ocupada { border-color: var(--io-err); background: var(--io-err-bg); }
.camara-card.anfitrion { border-color: var(--io-warn); background: var(--io-warn-bg); }
.camara-card { color: var(--io-text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--io-border-control); }

/* ── ACCESO ────────────────────────────────────────── */
#login-screen { background: var(--io-blue-500); flex-direction: column; gap: 32px; }
[data-theme="dark"] #login-screen { background: var(--io-blue-800); }
.io-login-logo { height: 80px; width: auto; max-width: calc(100vw - 32px); }
.login-box { background: var(--io-surface); border-radius: 16px; padding: 32px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--io-shadow-lg); }
.login-logo { display: none; }
.login-title { font-size: 32px; font-weight: 800; color: var(--io-text); text-align: left; }
.login-sub, .login-guest, .login-copy { font-size: 18px; color: var(--io-text-2); text-align: left; }
.login-guest a { color: var(--io-link); }
.login-box .btn-primary { min-height: 48px; }


/* ── TAMAÑOS ESCRITOS DENTRO DE LAS PANTALLAS ──────────
   Muchas vistas (vistas*.js) llevan el tamaño escrito a mano (10, 11, 12 px…).
   Aquí se suben todos a 16 px como mínimo. Se respeta la hoja imprimible
   de horarios (.hoja), que imita el papel y la foto para WhatsApp. */
[style*="font-size:6.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 6.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:8px"]:not(.hoja):not(.hoja *),
[style*="font-size: 8px"]:not(.hoja):not(.hoja *),
[style*="font-size:8.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 8.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:9px"]:not(.hoja):not(.hoja *),
[style*="font-size: 9px"]:not(.hoja):not(.hoja *),
[style*="font-size:9.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 9.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:10px"]:not(.hoja):not(.hoja *),
[style*="font-size: 10px"]:not(.hoja):not(.hoja *),
[style*="font-size:10.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 10.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:11px"]:not(.hoja):not(.hoja *),
[style*="font-size: 11px"]:not(.hoja):not(.hoja *),
[style*="font-size:11.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 11.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:12px"]:not(.hoja):not(.hoja *),
[style*="font-size: 12px"]:not(.hoja):not(.hoja *),
[style*="font-size:12.5px"]:not(.hoja):not(.hoja *),
[style*="font-size: 12.5px"]:not(.hoja):not(.hoja *),
[style*="font-size:13px"]:not(.hoja):not(.hoja *),
[style*="font-size: 13px"]:not(.hoja):not(.hoja *),
[style*="font-size:14px"]:not(.hoja):not(.hoja *),
[style*="font-size: 14px"]:not(.hoja):not(.hoja *),
[style*="font-size:15px"]:not(.hoja):not(.hoja *),
[style*="font-size: 15px"]:not(.hoja):not(.hoja *) { font-size: 16px !important; }


/* ── ICONOS (io.js cambia los emojis por iconos de línea) ── */
.io-ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; }
.io-ic--ok { color: var(--io-ok); } .io-ic--warn { color: var(--io-warn); } .io-ic--err { color: var(--io-err); }
.io-dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: .02em; margin-right: .2em; flex: none; }
.io-dot--ok { background: var(--io-ok); } .io-dot--err { background: var(--io-err); } .io-dot--info { background: var(--io-info); } .io-dot--warn { background: var(--io-warn); }
@media (forced-colors: active) { .io-dot { forced-color-adjust: none; border: 2px solid CanvasText; } }
#badge-usuario:empty { display: none; }
.io-wrapcell > .btn { margin: 2px 0; max-width: 100%; white-space: normal; }
.io-scroll { overflow-x: auto; max-width: 100%; border-radius: 12px; }
.io-scroll:focus-visible { outline: 2px solid var(--io-focus); outline-offset: 2px; }
/* Botón azul: pasa a secundario (en iO el único relleno es el amarillo principal) */
.btn-azul { background: var(--io-surface); color: var(--io-link); border-color: var(--io-border-action); }
.btn-azul:hover { background: var(--io-surface-selected); color: var(--io-link); }

/* ── MÓVIL ─────────────────────────────────────────── */
@media (max-width: 1023px) {
  #content { padding: 16px; }
  #topbar { padding: 0 16px; }
  .tb-search { min-width: 0; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { width: 256px; transform: translateX(-256px); box-shadow: var(--io-shadow-lg); }
  #sidebar.open { transform: translateX(0); }
}

/* ── Rejillas escritas en las vistas (25/10) ──
   Con la letra más grande, las columnas «fr» crecían con su contenido y se salían
   de la pantalla. Cada columna puede encoger; lo que no quepa se desplaza en su caja. */
#content [style*="grid-template-columns"] > * { min-width: 0; }
.card-title { flex-wrap: wrap; row-gap: 8px; }

/* Fichaje: la tercera columna (ausencias, solicitudes, historial) no cabía.
   Por debajo de 1800 px pasa debajo de las otras dos, a lo ancho. */
@media (max-width: 1800px) {
  #content [style*="grid-template-columns:1fr 1.3fr 0.85fr"] { grid-template-columns: 1fr 1.3fr !important; }
  #content [style*="grid-template-columns:1fr 1.3fr 0.85fr"] > :nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
  #content [style*="grid-template-columns:1fr 1.3fr 0.85fr"] > :nth-child(3) > .card { margin-bottom: 0 !important; }
  #content [style*="grid-template-columns:1fr 1.3fr 0.85fr"] > :nth-child(3) > .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  #content [style*="grid-template-columns:1fr 1.3fr 0.85fr"] { grid-template-columns: 1fr !important; }
}

/* ── Botones que eran morados (decisión de Marta, 25/10) ──
   Amarillo si crean o terminan algo (btn-primary); azul relleno el resto. */
.io-btn-azul { background: var(--io-blue-700) !important; color: #FFFFFF !important; border: 1px solid var(--io-blue-700) !important; }
.io-btn-azul:hover { background: var(--io-blue-800) !important; border-color: var(--io-blue-800) !important; }
.io-btn-azul:active { background: var(--io-blue-900) !important; }
[data-theme="dark"] .io-btn-azul { background: #9FD2D6 !important; color: #1D4E63 !important; border-color: #9FD2D6 !important; }
[data-theme="dark"] .io-btn-azul:hover { background: #BFE3E6 !important; border-color: #BFE3E6 !important; }
.io-btn-azul:disabled, .btn-primary[data-io-btn]:disabled { opacity: .55; }

/* Recuadros de cifras en amarillo en toda la app (decisión de Marta, 25/10).
   Si la cifra avisa de algo (rojo, ámbar, verde), el aviso se mantiene con el borde
   izquierdo y un punto de color delante de la palabra; la cifra va en azul oscuro.
   El amarillo es el mismo de día y de noche, así que los colores de aviso también. */
.stat { --io-stat-ok: #1A6F36; --io-stat-warn: #8A5A00; --io-stat-err: #B3261E;
  background: var(--io-primary) !important; border: 1px solid var(--io-primary-border) !important; border-left: 6px solid var(--io-primary-border) !important; }
.stat.stat .stat-n.stat-n.stat-n, .stat.stat .stat-l.stat-l.stat-l, .stat.stat .stat-n.stat-n * { color: var(--io-primary-text) !important; }
.stat.io-stat--warn { border-left-color: var(--io-stat-warn) !important; }
.stat.io-stat--err { border-left-color: var(--io-stat-err) !important; }
.stat:is(.io-stat--warn, .io-stat--err) .stat-l::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.stat.io-stat--warn .stat-l::before { background: var(--io-stat-warn); }
.stat.io-stat--err .stat-l::before { background: var(--io-stat-err); }

/* Dashboard · mapa de calor: escala de verdes de iO con texto que siempre se lee
   (oscuro en los verdes claros, blanco en los oscuros), igual de día y de noche. */
.calor-1 { background: #DCF2E3 !important; } .calor-2 { background: #A8DDB9 !important; } .calor-3 { background: #5DB47E !important; }
.calor-4 { background: #1A6F36 !important; } .calor-5 { background: #0E3F1E !important; }
.calor-cell.calor-1, .calor-cell.calor-1 *, .calor-cell.calor-2, .calor-cell.calor-2 *, .calor-cell.calor-3, .calor-cell.calor-3 * { color: #0E2F3A !important; opacity: 1 !important; }
.calor-cell.calor-4, .calor-cell.calor-4 *, .calor-cell.calor-5, .calor-cell.calor-5 * { color: #FFFFFF !important; opacity: 1 !important; }
.calor-cell.calor-0, .calor-cell.calor-0 * { color: var(--io-text) !important; opacity: 1 !important; }

/* Disponibilidad · calendario anual: letra mínima de 16 px y colores de iO en día y noche.
   El amarillo de bloqueo/festivo no cambia. Lo impreso tiene su propia hoja y no cambia. */
.disp-hoja { background: var(--io-surface) !important; border-color: var(--io-border-subtle) !important; }
.disp-cabecera-hoja { background: var(--io-blue-900) !important; }
.disp-nombre { font-size: 18px !important; } .disp-anio { font-size: 16px !important; opacity: 1 !important; }
.disp-mes { border-color: var(--io-border-subtle) !important; }
.disp-mes-titulo { background: var(--io-bg-subtle) !important; border-color: var(--io-border-subtle) !important; padding: 8px !important; flex-wrap: wrap; }
.disp-mes-nombre { font-size: 16px !important; color: var(--io-text) !important; }
.disp-centro-sel { font-size: 16px !important; max-width: 100% !important; min-height: 36px; padding: 2px 6px !important; background: var(--io-surface) !important; color: var(--io-text) !important; border-color: var(--io-border-control) !important; }
.disp-cabecera { font-size: 16px !important; background: var(--io-bg-subtle) !important; color: var(--io-text-2) !important; border-color: var(--io-border-subtle) !important; }
.disp-dia { border-color: var(--io-border-subtle) !important; }
.disp-dia-num { font-size: 16px !important; line-height: 1.1; color: var(--io-text) !important; background: var(--io-surface); border-radius: 4px; padding: 0 3px; top: 2px !important; left: 2px !important; pointer-events: none; }
.disp-vacio { background: var(--io-bg-subtle) !important; }
.disp-dom { background: var(--io-surface-selected) !important; opacity: 1 !important; }
@media (max-width: 1500px) { .disp-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 900px) { .disp-grid { grid-template-columns: 1fr !important; } }

/* Planificador: letra mínima de 16 px; los grupos sin horario habitual se leen
   (gris de texto secundario en vez de transparencia). */
.plani-paso-titulo, .plani-grupo-nombre, .plani-doc-nombre { font-size: 16px !important; }
.plani-grupo-dias, .plani-dia-chip span em, #view-planificador em { font-size: 16px !important; }
.plani-sin-hh { opacity: 1 !important; background: var(--io-bg-subtle) !important; }
.plani-sin-hh, .plani-sin-hh * { color: var(--io-text-2) !important; }

/* Celdas de acciones que no cabían: botones en varias líneas con separación */
td.io-acciones .btn, td.io-acciones button { margin: 2px 0; }

/* Modo noche: main.css forzaba letra oscura en chips y avisos azules, rosas y teal
   (pensados para fondo claro); con los fondos oscuros de iO no se leían. */
[data-theme="dark"] .chip.chip-azul, [data-theme="dark"] .chip.chip-teal, [data-theme="dark"] .alerta.alerta-info { color: var(--io-info); }
[data-theme="dark"] .chip.chip-verde, [data-theme="dark"] .alerta.alerta-ok { color: var(--io-ok); }
[data-theme="dark"] .chip.chip-rojo, [data-theme="dark"] .alerta.alerta-error { color: var(--io-err); }
[data-theme="dark"] .chip.chip-naranja, [data-theme="dark"] .alerta.alerta-warn { color: var(--io-warn); }
[data-theme="dark"] .chip.chip-rosa { background: var(--io-err-bg); color: var(--io-err); }
[data-theme="dark"] .chip.chip-morado { background: var(--io-info-bg); color: var(--io-info); }
/* Todo el texto de un recuadro de cifras en azul 900 (Fichaje tiene recuadros con más piezas) */
.stat.stat.stat *:not(svg):not(svg *) { color: var(--io-primary-text) !important; }

/* Texto solo para lector de pantalla */
.io-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Foco siempre visible con teclado (main.css lo dejaba a 0 px en el menú y otros botones) */
:focus-visible { outline: 3px solid var(--io-focus) !important; outline-offset: 2px !important; }
#sidebar .sb-item:focus-visible { outline-offset: -3px !important; }
/* «Saltar al contenido»: aparece al llegar con Tab */
.io-skip { position: fixed; left: 8px; top: -60px; z-index: 10000; background: var(--io-primary); color: var(--io-primary-text); border: 2px solid var(--io-primary-border); padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 18px; text-decoration: none; }
.io-skip:focus { top: 8px; }
/* El texto oculto no debe ensanchar la página: queda dentro de su celda o de su caja con desplazamiento */
th:has(> .io-sr), .io-scroll, .tabla-wrap { position: relative; }
.io-sr { top: 0; left: 0; }


/* ── Móvil (25/10) ── */
.io-menu-btn { display: none; }
.io-menu-fondo { display: none; }
@media (max-width: 768px) {
  .io-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; margin-right: 4px;
    background: var(--io-surface); color: var(--io-text); border: 1px solid var(--io-border-action); border-radius: 10px; cursor: pointer; }
  .io-menu-fondo.open { display: block; position: fixed; inset: 0; background: rgba(14,47,58,.48); z-index: 199; }
  #sidebar { z-index: 200; visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  #sidebar.open { visibility: visible; transition: transform .2s, visibility 0s; }
  /* Cabecera en dos filas: menú + título; buscador y botones debajo */
  #topbar { height: auto !important; min-height: 56px; flex-wrap: wrap; gap: 8px; padding: 8px 12px !important; }
  .tb-title { flex: 1; min-width: 0; font-size: 20px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-right { width: 100%; gap: 8px; flex-wrap: nowrap; }
  .tb-search { flex: 1; min-width: 0 !important; }
  .tb-search input { min-width: 0; }
  .tb-right .btn { flex: none; }
  /* Rejillas de columnas de las vistas: una sola columna (los calendarios no) */
  #content [style*="grid-template-columns"]:not([style*="repeat(7"]):not([style*="repeat(31"]):not([style*="repeat(6"]):not([style*="repeat(24"]) { grid-template-columns: 1fr !important; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (prefers-reduced-motion: reduce) { #sidebar { transition: none !important; } }
/* Punto de aviso pegado a su palabra aunque la palabra baje de línea */
.stat:is(.io-stat--warn, .io-stat--err) .stat-l { display: flex; align-items: baseline; gap: 8px; }
.stat:is(.io-stat--warn, .io-stat--err) .stat-l::before { margin-right: 0 !important; flex: none; }

/* Casillas pequeñas escritas en las vistas (14 px): mínimo 20 px para tocarlas bien */
#content input[type="checkbox"], #content input[type="radio"], .overlay input[type="checkbox"], .overlay input[type="radio"] { min-width: 20px !important; min-height: 20px !important; }

/* Logo más grande (petición de Marta, 25/10): acceso y menú lateral */
.io-login-logo { height: 140px !important; }
@media (max-width: 480px) { .io-login-logo { height: auto !important; width: 100% !important; } }
.sb-logo { padding: 8px 16px !important; }
.sb-logo .io-logo { height: 48px !important; max-width: 100%; }

/* Las clases verde/naranja/rojo de las cifras son de categoría (Altas, Bajas…), no avisos: sin punto ni borde de color (25/10) */
/* Palabras largas en los recuadros de cifras («Terminados/Repasados»): parten en vez de cortarse */
.stat .stat-l { overflow-wrap: anywhere; }

/* Ventanas largas: el botón de guardar siempre a la vista. Cabecera y pie fijos;
   solo se desplaza el contenido (25/10) */
.modal:has(> .modal-body) { display: flex; flex-direction: column; }
.modal > .modal-header, .modal > .modal-footer { flex: none; }
.modal > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* ══ ÓLA · 26/10/2026 ══════════════════════════════════════
   Marca nueva: turquesa #12BAAA, azul noche #0E2F3A, azul claro #9FD2D6 (cifras),
   azul petróleo #1D4E63 (pantalla de entrada y fondo de noche). */
:root { --io-stat-bg:#9FD2D6; --io-stat-border:#1D4E63; --io-login-bg:#1D4E63;
  --io-act-clase:#33609A; --io-act-recuperacion:#3F6B1F; --io-act-tutoria:#7048A8; --io-act-sesion:#B84A00; --io-act-simulacro:#26223B; --io-act-reunion:#A8327A; --io-act-grabacion:#4A5F63; }
[data-theme="dark"] { --io-stat-bg:#9FD2D6; --io-stat-border:#12BAAA; --io-primary-text:#0E2F3A;
  --io-act-clase:#A9C8F2; --io-act-recuperacion:#B5DE99; --io-act-tutoria:#C29CF5; --io-act-sesion:#F5A15C; --io-act-simulacro:#D9D4F0; --io-act-reunion:#EE97C6; --io-act-grabacion:#C3D2D4; }
.stat { background: var(--io-stat-bg) !important; border-color: var(--io-stat-border) !important; border-left-color: var(--io-stat-border) !important; }
.stat.io-stat--warn { border-left-color: var(--io-stat-warn) !important; }
.stat.io-stat--err { border-left-color: var(--io-stat-err) !important; }
#login-screen, [data-theme="dark"] #login-screen { background: var(--io-login-bg) !important; }
.ola-logo { display: block; height: auto; }
.io-login-logo.ola-logo { height: 160px !important; width: auto !important; max-width: calc(100vw - 32px); }
@media (max-width: 480px) { .io-login-logo.ola-logo { height: auto !important; width: 100% !important; } }
.sb-logo .ola-logo { height: 56px !important; width: auto !important; max-width: 100%; }
