/* ── VARIABLES ─────────────────────────────────────── */
:root {
  --azul:     #0693C4;   /* cian corporativo Infórmate (del logo, #00AEDD profundizado para leer) */
  --azul2:    #33BFE6;
  --azul-btn: #0693C4;
  --azul-sidebar: #26223B; /* la tinta azul oscura del texto del logo */
  --teal:     #00AEDD;   /* el cian puro del logo: acción, activo, acento */
  --teal2:    #0693C4;
  --gris:     #F4F7FB;
  --gris2:    #E1E7F0;
  --gris3:    #97A3B6;
  --texto:    #1E2A3A;
  --texto2:   #5D6B7E;
  --blanco:   #FFFFFF;
  --verde:    #5FA876;
  --verde2:   #DCF2E1;
  --rojo:     #D17575;
  --rojo2:    #FBE4E4;
  --naranja:  #CC9A5C;
  --naranja2: #FBEEDC;
  --morado:   #9B82C9;
  --morado2:  #ECE5F8;
  --rosa:     #E8A8C0;
  --rosa2:    #FBE5EE;
  /* Sombras "con relieve": offset duro + sombra de elevación suave, estilo tarjeta gruesa */
  --sombra:        0 1px 3px rgba(38,34,59,.06), 0 1px 2px rgba(38,34,59,.04);
  --sombra-card:   0 2px 6px rgba(38,34,59,.05), 0 10px 24px -10px rgba(38,34,59,.12);
  --sombra-btn:    0 2px 0 0 rgba(38,34,59,.16);
  --sombra-btn-hover: 0 5px 10px -2px rgba(38,34,59,.20), 0 2px 0 0 rgba(38,34,59,.16);
  --radio:    14px;
  --radio-sm: 10px;
  --sidebar-w: 230px;
}

/* ── MODO OSCURO ───────────────────────────────────── */
[data-theme="dark"] {
  --azul:     #4FC9EE;
  --azul2:    #1E5E77;
  --azul-btn: #0684B2;
  --azul-sidebar: #1B1830;
  --teal:     #0693C4;
  --gris:     #15171C;
  --gris2:    #262A33;
  --gris3:    #6B7280;
  --texto:    #E8E6E1;
  --texto2:   #A3A099;
  --blanco:   #1E2128;
  --verde2:   #1F3A2C;
  --rojo2:    #3A2424;
  --naranja2: #3A2E1C;
  --morado2:  #2E2640;
  --rosa2:    #3A2430;
  --sombra:        0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --sombra-card:   0 2px 6px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
  --sombra-btn:    0 2px 0 0 rgba(0,0,0,.4);
  --sombra-btn-hover: 0 4px 10px -2px rgba(0,0,0,.5), 0 2px 0 0 rgba(0,0,0,.4);
}

/* ── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--gris); color: var(--texto); min-height: 100vh; transition: background .2s, color .2s; }

/* ── LAYOUT ────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
#sidebar { width: var(--sidebar-w); background: var(--azul-sidebar); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; overflow-y: auto; box-shadow: 2px 0 12px rgba(0,0,0,.08); }
#main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
#topbar { background: var(--blanco); border-bottom: 1px solid var(--gris2); padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; box-shadow: var(--sombra); }
#content { flex: 1; padding: 22px; overflow-y: auto; }

/* ── SIDEBAR ───────────────────────────────────────── */
.sb-logo { padding: 20px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo img { height: 34px; }
.sb-section { padding: 16px 16px 5px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.32); }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: rgba(255,255,255,.72); font-size: 13px; cursor: pointer; border-radius: var(--radio-sm); margin: 2px 8px; transition: all .15s; border: none; background: none; width: calc(100% - 16px); text-align: left; }
.sb-item:hover { background: rgba(255,255,255,.07); color: var(--blanco); transform: translateX(2px); }
.sb-item.active { background: var(--teal); color: #FFFFFF; font-weight: 700; box-shadow: 0 2px 10px rgba(0,174,221,.45); }
.sb-item .sb-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sb-item .sb-badge { margin-left: auto; background: var(--rosa); color: #7A2E4D; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 700; }
.sb-footer { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sb-user { font-size: 11px; color: rgba(255,255,255,.4); padding: 4px 8px; margin-bottom: 6px; }
.sb-user span { color: rgba(255,255,255,.85); font-weight: 600; }
.sb-rol { font-size: 10px; padding: 2px 7px; border-radius: 10px; display: inline-block; margin-top: 3px; }
.sb-rol-gestora { background: var(--morado); color: #4A3B6B; }
.sb-rol-admin { background: var(--teal); color: #FFFFFF; }
.sb-rol-secretaria { background: var(--verde); color: #2E5440; }
.sb-rol-guest { background: rgba(255,255,255,.12); color: rgba(255,255,255,.5); }
.sb-copyright { font-size: 9px; color: rgba(255,255,255,.2); text-align: center; padding: 4px 8px; }

/* ── TOPBAR ────────────────────────────────────────── */
.tb-title { font-size: 15px; font-weight: 700; color: var(--texto); }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-search { display: flex; align-items: center; gap: 6px; background: var(--gris); border: 1px solid var(--gris2); border-radius: var(--radio-sm); padding: 5px 10px; min-width: 220px; }
.tb-search input { border: none; background: none; outline: none; font-size: 13px; color: var(--texto); width: 100%; }
.tb-search .tb-search-icon { color: var(--gris3); font-size: 14px; }
.tb-search-results { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); width: 400px; background: var(--blanco); border: 1px solid var(--gris2); border-radius: var(--radio); box-shadow: var(--sombra-card); z-index: 100; max-height: 300px; overflow-y: auto; }
.tb-search-item { padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--gris2); display: flex; align-items: center; gap: 10px; }
.tb-search-item:hover { background: var(--gris); }
.tb-search-item:last-child { border-bottom: none; }

/* ── CARDS ─────────────────────────────────────────── */
.card { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra-card); padding: 20px; margin-bottom: 14px; border: 1px solid var(--gris2); transition: box-shadow .2s, transform .2s; }
.card-title { font-size: 12px; font-weight: 700; color: var(--texto2); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }

/* ── STATS ─────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra-card); padding: 16px 18px; border: 1px solid var(--gris2); border-left: 5px solid var(--teal); transition: transform .15s ease, box-shadow .15s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(45,42,38,.08), 0 12px 24px -10px rgba(45,42,38,.12); }
.stat-n { font-size: 28px; font-weight: 800; color: var(--azul); line-height: 1; }
.stat-l { font-size: 11px; color: var(--texto2); margin-top: 4px; }
.stat.verde { border-left-color: var(--verde); }
.stat.naranja { border-left-color: var(--naranja); }
.stat.rojo { border-left-color: var(--rojo); }
.stat.morado { border-left-color: var(--morado); }

/* ── TABLA ─────────────────────────────────────────── */
.tabla-wrap { overflow-x: auto; border-radius: var(--radio); border: 1px solid var(--gris2); }
table { width: 100%; border-collapse: collapse; background: var(--blanco); font-size: 12px; }
thead { background: var(--azul); }
thead th { color: white; font-weight: 600; padding: 10px 12px; text-align: left; font-size: 11px; white-space: nowrap; cursor: pointer; user-select: none; }
thead th:hover { background: var(--azul2); }
thead th .sort-icon { margin-left: 4px; opacity: .5; }
thead th.sort-asc .sort-icon::after { content: ' ▲'; opacity: 1; }
thead th.sort-desc .sort-icon::after { content: ' ▼'; opacity: 1; }
tbody tr { border-bottom: 1px solid var(--gris2); transition: background .08s; }
tbody tr:hover { background: var(--gris); }
tbody td { padding: 9px 12px; vertical-align: middle; }

/* ── FORMULARIO ────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px,1fr)); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1/-1; }
label { font-size: 11px; font-weight: 600; color: var(--texto2); }
input, select, textarea { border: 1px solid var(--gris2); border-radius: 6px; padding: 7px 10px; font-size: 13px; color: var(--texto); background: var(--blanco); transition: border-color .12s; outline: none; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,174,221,.15); }
textarea { resize: vertical; min-height: 65px; }

/* ── BOTONES ───────────────────────────────────────── */
/* Botones con relieve: sombra "offset" sólida que da sensación de volumen;
   al pasar el ratón se elevan (más sombra), al pulsar se hunden (sombra menor + desplazamiento) */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: var(--radio-sm); font-size: 12px; font-weight: 600; border: none; cursor: pointer; transition: transform .1s ease, box-shadow .15s ease, background .15s ease; font-family: inherit; white-space: nowrap; position: relative; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #FFFFFF; box-shadow: var(--sombra-btn); }
.btn-primary:hover { background: var(--teal2); color: #FFFFFF; box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); }
.btn-primary:active { background: var(--teal2); box-shadow: 0 1px 0 0 rgba(38,34,59,.16); transform: translateY(1px); }
.btn-azul { background: var(--azul-btn); color: white; box-shadow: var(--sombra-btn); }
.btn-azul:hover { background: var(--azul-sidebar); box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); color: white; }
.btn-azul:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(45,42,38,.15); }
.btn-ghost { background: var(--blanco); color: var(--texto2); border: 1px solid var(--gris2); box-shadow: var(--sombra-btn); }
.btn-ghost:hover { background: var(--gris); box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); }
.btn-ghost:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(45,42,38,.1); }
.btn-danger { background: var(--rojo2); color: #A14545; border: 1px solid #F3CACA; box-shadow: var(--sombra-btn); }
.btn-danger:hover { background: #F6CFCF; box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); }
.btn-danger:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(45,42,38,.1); }
.btn-morado { background: var(--morado); color: #4A3B6B; box-shadow: var(--sombra-btn); }
.btn-morado:hover { background: #A88FE0; box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); }
.btn-morado:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(45,42,38,.15); }
.btn-verde { background: var(--verde); color: #2E5440; box-shadow: var(--sombra-btn); }
.btn-verde:hover { background: #6FB382; box-shadow: var(--sombra-btn-hover); transform: translateY(-1px); }
.btn-verde:active { transform: translateY(1px); box-shadow: 0 1px 0 0 rgba(45,42,38,.15); }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ── CHIPS ─────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.chip-verde   { background: var(--verde2); color: #065F46; }
.chip-rojo    { background: var(--rojo2); color: #991B1B; }
.chip-naranja { background: var(--naranja2); color: #92400E; }
.chip-azul    { background: #DBEAFE; color: #1E40AF; }
.chip-gris    { background: var(--gris2); color: var(--texto2); }
.chip-rosa    { background: #FCE7F3; color: #9D174D; }
.chip-morado  { background: var(--morado2); color: #4C1D95; }
.chip-teal    { background: #CFFAFE; color: #164E63; }

/* ── MODAL ─────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 500; display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.open { display: flex; }
.modal { background: var(--blanco); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.2); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; }
.modal-lg { max-width: 860px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--gris2); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 700; color: var(--texto); }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gris2); display: flex; justify-content: flex-end; gap: 8px; }
.btn-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--gris3); padding: 2px 6px; border-radius: 4px; }
.btn-close:hover { background: var(--gris); color: var(--texto); }

/* ── ALERTAS ───────────────────────────────────────── */
.alerta { padding: 11px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 8px; }
.alerta-error  { background: var(--rojo2); color: #A14545; border: 1px solid #F3CACA; }
.alerta-ok     { background: var(--verde2); color: #065F46; border: 1px solid #A7F3D0; }
.alerta-warn   { background: var(--naranja2); color: #92400E; border: 1px solid #FDE68A; }
.alerta-info   { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.alerta-icon   { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alerta ul     { margin: 5px 0 0 14px; }
.alerta li     { margin-bottom: 2px; }

/* ── CÁMARAS ───────────────────────────────────────── */
.camara-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(185px,1fr)); gap: 10px; }
.camara-card { border-radius: 8px; border: 1px solid var(--gris2); padding: 11px 13px; background: var(--blanco); }
.camara-card.libre { border-color: #A7F3D0; background: #F0FDF4; }
.camara-card.ocupada { border-color: #FECACA; background: #FFF5F5; }
.camara-card.anfitrion { border-color: #FDE68A; background: #FFFBEB; border-width: 2px; }

/* ── FILTROS ───────────────────────────────────────── */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filtros .form-group { margin: 0; min-width: 140px; }

/* ── EMPTY STATE ───────────────────────────────────── */
.empty { text-align: center; padding: 36px 16px; color: var(--gris3); }
.empty-icon { font-size: 36px; margin-bottom: 8px; }
.empty-txt { font-size: 13px; }

/* ── TOAST ─────────────────────────────────────────── */
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast-item { padding: 11px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.12); animation: slideUp .18s ease; max-width: 320px; pointer-events: all; }
.toast-ok  { background: var(--azul); color: white; }
.toast-err { background: var(--rojo); color: white; }
.toast-warn { background: var(--naranja); color: white; }
@keyframes slideUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulso { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.4; transform:scale(1.3); } }

/* ── TOOLTIP ───────────────────────────────────────── */
.tooltip-wrap { position: relative; }
.tooltip-box { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--azul); color: white; font-size: 11px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 500; pointer-events: none; opacity: 0; transition: opacity .15s; margin-bottom: 4px; }
.tooltip-wrap:hover .tooltip-box { opacity: 1; }

/* ── HOVER DETAIL ROW ──────────────────────────────── */
.detail-popup { position: fixed; background: var(--blanco); border: 1px solid var(--gris2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 12px 14px; font-size: 12px; z-index: 400; max-width: 280px; pointer-events: none; display: none; }
.detail-popup.visible { display: block; }

/* ── PROGRESO ──────────────────────────────────────── */
.progreso-bar { height: 7px; background: var(--gris2); border-radius: 4px; overflow: hidden; }
.progreso-fill { height: 100%; background: var(--verde); border-radius: 4px; transition: width .3s; }

/* ── TEMAS ─────────────────────────────────────────── */
.tema-row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--gris2); cursor: pointer; transition: background .08s; }
.tema-row:hover { background: var(--gris); }
.tema-detalle { padding: 0 13px 12px; background: var(--gris); }

/* ── POST-ITS ──────────────────────────────────────── */
.postit-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.postit { width: 160px; min-height: 120px; padding: 12px; border-radius: 4px; font-size: 12px; box-shadow: 2px 2px 8px rgba(0,0,0,.1); position: relative; cursor: grab; }
.postit-amarillo { background: #FEF9C3; }
.postit-azul     { background: #DBEAFE; }
.postit-verde    { background: #DCFCE7; }
.postit-rosa     { background: #FCE7F3; }
.postit-naranja  { background: #FFEDD5; }
/* Post-its en modo oscuro — texto legible */
[data-theme="dark"] .postit { color: #1e293b !important; }
[data-theme="dark"] .postit p,
[data-theme="dark"] .postit div,
[data-theme="dark"] .postit span { color: #1e293b !important; }
[data-theme="dark"] .postit .postit-actions button { color: #374151 !important; background: rgba(0,0,0,.1) !important; }
.postit-actions  { display: flex; gap: 4px; margin-top: 8px; }

/* ── FECHAS TAGS ───────────────────────────────────── */
.fechas-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.fecha-tag { background: var(--azul2); color: white; border-radius: 20px; padding: 3px 9px; font-size: 11px; display: flex; align-items: center; gap: 5px; }
.fecha-tag button { background: none; border: none; color: white; cursor: pointer; font-size: 13px; padding: 0; line-height: 1; }

/* ── AGENDA SEMANAL ────────────────────────────────── */
.agenda-grid { display: grid; grid-template-columns: 60px repeat(6,1fr); gap: 1px; background: var(--gris2); border-radius: 8px; overflow: hidden; }
.agenda-header { background: var(--azul); color: white; padding: 8px; text-align: center; font-size: 11px; font-weight: 600; }
.agenda-hora { background: var(--gris); padding: 4px 6px; text-align: right; font-size: 10px; color: var(--gris3); }
.agenda-cell { background: var(--blanco); min-height: 40px; position: relative; }
.agenda-cell.hoy { background: #EFF6FF; }
.agenda-evento { position: absolute; left: 2px; right: 2px; border-radius: 4px; padding: 2px 5px; font-size: 10px; overflow: hidden; cursor: pointer; }

/* ── ASISTENTE PROGRAMACIÓN ────────────────────────── */
.asist-cal { width: 100%; border-collapse: collapse; }
.asist-cal th { background: var(--azul); color: white; padding: 7px 8px; text-align: center; font-size: 11px; }
.asist-cal td { border: 1px solid var(--gris2); vertical-align: top; padding: 5px 6px; min-width: 75px; background: var(--blanco); }
.asist-cal td.nc { background: var(--gris); border-color: transparent; }
.asist-dia-num { font-size: 10px; font-weight: 600; color: var(--texto2); margin-bottom: 4px; }
.asist-doc { display: block; width: 100%; text-align: left; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; cursor: pointer; border: none; margin-bottom: 2px; transition: all .1s; }
.asist-doc.libre { background: var(--gris2); color: var(--texto2); }
.asist-doc.libre:hover { background: var(--verde2); color: #065F46; }
.asist-doc.unico { background: var(--naranja2); color: #92400E; border: 1px solid #FDE68A; }
.asist-doc.ocupado { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; opacity: .7; }
.asist-doc.sel { background: var(--verde); color: white; }

/* ── MAPA DE CALOR ─────────────────────────────────── */
.calor-grid { display: grid; grid-template-columns: 50px repeat(31,1fr); gap: 2px; }
.calor-cell { height: 28px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.calor-0 { background: var(--gris); }
.calor-1 { background: #DCFCE7; }
.calor-2 { background: #86EFAC; }
.calor-3 { background: #22C55E; }
.calor-4 { background: #16A34A; }
.calor-5 { background: #14532D; color: white; }

/* ── AI BOX ────────────────────────────────────────── */
.ai-box { background: linear-gradient(135deg, #EDE9FE, #DBEAFE); border: 1px solid #C4B5FD; border-radius: 10px; padding: 14px; margin-top: 10px; }
.ai-box-title { font-size: 12px; font-weight: 700; color: #4C1D95; margin-bottom: 7px; }
.ai-box-content { font-size: 12px; color: #374151; line-height: 1.6; white-space: pre-wrap; }

/* ── LOGIN ─────────────────────────────────────────── */
#login-screen { position: fixed; inset: 0; background: linear-gradient(150deg, #26223B 0%, #0693C4 55%, #00AEDD 100%); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-box { background: white; border-radius: 18px; padding: 34px 38px; width: 350px; box-shadow: 0 24px 70px rgba(20,17,38,.5), 0 2px 8px rgba(20,17,38,.22); }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { height: 44px; }
.login-title { font-size: 17px; font-weight: 700; color: var(--azul); text-align: center; margin-bottom: 4px; }
.login-sub { font-size: 11px; color: var(--gris3); text-align: center; margin-bottom: 20px; }
.login-guest { margin-top: 12px; text-align: center; font-size: 11px; color: var(--gris3); }
.login-guest a { color: var(--azul); cursor: pointer; text-decoration: underline; }
.login-copy { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gris2); text-align: center; font-size: 10px; color: var(--gris3); }

/* ── SEMÁFORO DOCENTE ──────────────────────────────── */
.semaforo { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-left: 6px; vertical-align: middle; }
.semaforo-verde { background: var(--verde); }
.semaforo-rojo { background: var(--rojo); }
.semaforo-gris { background: var(--gris3); }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-220px); width: 220px; transition: transform .2s; }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
}

.hist-tabla.oculto { display: none; }
.hist-tabla { display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gris2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gris3); }


/* ══════════════════════════════════════════════════════════════
   MI LIBRETA — Cuaderno realista v79
   Lomo espiral con anillos 3D, papel crema rayado, margen rojo,
   pestañas de carpeta, páginas apiladas
══════════════════════════════════════════════════════════════ */

/* ── Wrapper general ── */
.cuaderno-wrap { padding: 0 !important; overflow: visible !important; }
.cuaderno-header {
  padding: 14px 18px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gris2);
}

/* ── Fila de pestañas ── */
.cuaderno-tabs-wrap {
  padding: 0 10px 0 52px;
  background: #D9D3C4;             /* "tapa" del cuaderno, más oscura que el papel */
  border-bottom: none;
}
[data-theme="dark"] .cuaderno-tabs-wrap { background: #0F111A; }

.cuaderno-tabs {
  display: flex; gap: 3px; align-items: flex-end;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 0;
}
.cuaderno-tabs::-webkit-scrollbar { display: none; }

/* Pestaña individual — aspecto de separador de carpeta */
.cuaderno-tab {
  --tab-color: #DBEAFE;
  display: flex; align-items: center; gap: 5px;
  padding: 7px 15px 10px;
  border-radius: 8px 8px 0 0;
  border: 1.5px solid rgba(0,0,0,.18); border-bottom: none;
  cursor: pointer; font-size: 12px; font-weight: 600;
  white-space: nowrap; color: #3A3530;
  background: var(--tab-color);
  position: relative; top: 1px;
  user-select: none; opacity: .70;
  box-shadow: 0 -3px 6px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.55);
  transition: opacity .12s, transform .12s;
  min-width: 80px; max-width: 160px;
}
.cuaderno-tab:hover:not(.activa) { opacity: .90; transform: translateY(-2px); }
.cuaderno-tab.activa {
  background: #FEFAE8;             /* mismo color crema que el papel */
  border-color: rgba(0,0,0,.18); border-bottom-color: #FEFAE8;
  color: #2D2A26; opacity: 1; z-index: 3;
  box-shadow: 0 -3px 10px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.9);
}
.cuaderno-tab-icono { font-size: 15px; flex-shrink: 0; }
.cuaderno-tab-titulo { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.cuaderno-tab-cerrar {
  font-size: 11px; opacity: 0; margin-left: 3px; padding: 1px 4px;
  border-radius: 3px; cursor: pointer; flex-shrink: 0;
  transition: opacity .1s; color: rgba(0,0,0,.4);
}
.cuaderno-tab:hover .cuaderno-tab-cerrar,
.cuaderno-tab.activa .cuaderno-tab-cerrar { opacity: .55; }
.cuaderno-tab-cerrar:hover { opacity: 1 !important; background: rgba(200,40,40,.12); color: #B71C1C; }
.cuaderno-tab-nueva {
  font-size: 11px; padding: 4px 10px; margin-bottom: 3px;
  border-radius: 6px; flex-shrink: 0; align-self: center;
}

/* Dark mode pestañas */
[data-theme="dark"] .cuaderno-tab {
  color: var(--texto2);
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  box-shadow: 0 -2px 6px rgba(0,0,0,.35), inset 0 3px 0 0 var(--tab-color);
  opacity: .75;
}
[data-theme="dark"] .cuaderno-tab.activa {
  background: #1B1F2E;
  border-color: rgba(255,255,255,.13); border-bottom-color: #1B1F2E;
  box-shadow: 0 -3px 8px rgba(0,0,0,.5), inset 0 3px 0 0 var(--tab-color);
  color: var(--texto); opacity: 1;
}

/* ── Zona de páginas apiladas ── */
.cuaderno-paginas-wrap {
  position: relative;
  margin: 0 18px 20px 0;
}
/* Hoja detrás 1 */
.cuaderno-paginas-wrap::before {
  content: '';
  position: absolute;
  inset: 5px -9px -9px 9px;
  background: #F0EDD8;
  border: 1.5px solid rgba(0,0,0,.13);
  border-radius: 0 0 10px 10px;
  z-index: -1;
  box-shadow: 2px 3px 8px rgba(0,0,0,.08);
}
/* Hoja detrás 2 */
.cuaderno-paginas-wrap::after {
  content: '';
  position: absolute;
  inset: 10px -18px -18px 18px;
  background: #E6E3CE;
  border: 1.5px solid rgba(0,0,0,.10);
  border-radius: 0 0 10px 12px;
  z-index: -2;
  box-shadow: 4px 5px 12px rgba(0,0,0,.07);
}
[data-theme="dark"] .cuaderno-paginas-wrap::before {
  background: #181C28; border-color: rgba(255,255,255,.07);
}
[data-theme="dark"] .cuaderno-paginas-wrap::after {
  background: #141722; border-color: rgba(255,255,255,.05);
}

/* ── Cuerpo principal: lomo + página ── */
.cuaderno-body {
  display: flex; min-height: 440px;
  border: 1.5px solid rgba(0,0,0,.18);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: #FEFAE8;
  overflow: hidden;
  position: relative; z-index: 1;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
[data-theme="dark"] .cuaderno-body {
  background: #1B1F2E;
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}

/* ── Lomo / Espiral ── */
.cuaderno-espiral {
  width: 48px; flex-shrink: 0; align-self: stretch;
  /* Degradado que da profundidad al lomo */
  background: linear-gradient(
    to right,
    #1E2230 0%, #2A2F3E 25%, #353C50 55%, #2E3447 80%, #242938 100%
  );
  border-right: 2px solid rgba(0,0,0,.40);
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-around;
  padding: 22px 0;
  position: relative;
}
/* Línea brillante en el borde izquierdo del lomo */
.cuaderno-espiral::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: linear-gradient(to bottom, rgba(255,255,255,.12), rgba(255,255,255,.04), rgba(255,255,255,.12));
}
/* Textura sutil de rayas verticales en el lomo */
.cuaderno-espiral::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 38px,
    rgba(255,255,255,.03) 38px, rgba(255,255,255,.03) 39px
  );
}
[data-theme="dark"] .cuaderno-espiral {
  background: linear-gradient(to right, #090B10 0%, #0F1220 30%, #161A28 60%, #0F1220 100%);
  border-right-color: rgba(0,0,0,.6);
}

/* ── Anillos de la espiral ── */
.cuaderno-anillo {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  /* Gradiente radial: destello en la esquina superior-izquierda → metálico */
  background: radial-gradient(circle at 30% 28%, #CDD2DE, #8A919F 55%, #6B7280);
  border: 2.5px solid #5A6070;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,.45),       /* sombra interior = profundidad */
    inset 0 -1px 2px rgba(255,255,255,.18), /* reflejo inferior */
    0 2px 5px rgba(0,0,0,.50);              /* sombra exterior = elevación */
  position: relative; z-index: 2;
}
/* Agujero central del anillo */
.cuaderno-anillo::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #2C3140, #1A1E2A);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.8);
}
[data-theme="dark"] .cuaderno-anillo {
  background: radial-gradient(circle at 30% 28%, #2E3548, #1E2438 55%, #161B2A);
  border-color: #323A52;
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,.65),
    inset 0 -1px 2px rgba(255,255,255,.06),
    0 2px 5px rgba(0,0,0,.65);
}
[data-theme="dark"] .cuaderno-anillo::after {
  background: radial-gradient(circle at 40% 40%, #070810, #050608);
}

/* ── Área de contenido (margen + escritura) ── */
.cuaderno-contenido {
  flex: 1; min-width: 0;
  display: flex; align-self: stretch;
}

/* Margen izquierdo — zona rosada con línea roja */
.cuaderno-margen {
  width: 54px; flex-shrink: 0; align-self: stretch;
  background: rgba(255,180,180,.08);
  border-right: 2px solid #FFACAC;
  position: relative;
}
[data-theme="dark"] .cuaderno-margen {
  background: rgba(200,80,80,.05);
  border-right-color: rgba(200,80,80,.30);
}

/* Zona de escritura: ocupa el resto */
.cuaderno-zona-escritura {
  flex: 1; min-width: 0;
  padding: 16px 20px 24px 14px;
  /* Líneas horizontales azules sobre papel crema */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 27px,
    #C4D8F2 27px, #C4D8F2 28px
  );
  background-attachment: local;
}
[data-theme="dark"] .cuaderno-zona-escritura {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 27px,
    rgba(100,140,210,.12) 27px, rgba(100,140,210,.12) 28px
  );
}

/* Cabecera de página: título + icono */
.cuaderno-pagina-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 2px solid rgba(196,216,242,.7);
  /* Ocupa aprox. 1 línea reglada */
}
[data-theme="dark"] .cuaderno-pagina-header {
  border-bottom-color: rgba(100,140,210,.20);
}

.cuaderno-titulo-input {
  font-weight: 700; font-size: 16px; flex: 1;
  border: none; border-radius: 0;
  padding: 2px 4px; background: transparent;
  color: #2D2A26;
  transition: background .15s;
}
.cuaderno-titulo-input:focus {
  outline: none;
  background: rgba(196,216,242,.25);
  border-radius: 4px;
}
[data-theme="dark"] .cuaderno-titulo-input { color: var(--texto); }
[data-theme="dark"] .cuaderno-titulo-input:focus { background: rgba(100,140,210,.10); }

.cuaderno-icono-grande { font-size: 22px; opacity: .30; flex-shrink: 0; }

/* Barra de herramientas */
.cuaderno-toolbar {
  display: flex; flex-wrap: wrap; gap: 3px;
  padding: 6px 8px; margin-bottom: 12px;
  background: rgba(196,216,242,.18);
  border: 1px solid rgba(196,216,242,.55);
  border-radius: 8px;
}
[data-theme="dark"] .cuaderno-toolbar {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}

/* Editor — fondo transparente para que se vean las líneas del padre */
.cuaderno-editor {
  min-height: 340px; font-size: 14px;
  line-height: 28px;   /* alineado con el paso de 28px de las líneas */
  padding: 0 2px;
  outline: none; background: transparent;
  color: #2D2A26;
}
[data-theme="dark"] .cuaderno-editor { color: var(--texto); }

/* ══════════════════════════════════════════════════════════════
   PLANIFICADOR DEL MES SIGUIENTE
══════════════════════════════════════════════════════════════ */

/* ── Horario habitual (en seguimiento) ── */
.hh-fila {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.hh-dia  { width: 110px; font-size: 12px; }
.hh-ini, .hh-fin { width: 84px; font-size: 12px; }
.hh-sep  { color: var(--gris3); flex-shrink: 0; }
.hh-doc  { flex: 1; min-width: 150px; font-size: 12px; }
.hh-del  { flex-shrink: 0; color: var(--rojo) !important; }

/* ── Planificador ── */
.plani-wrap { max-width: 960px; }
.plani-paso {
  padding: 18px;
  background: var(--gris);
  border: 1px solid var(--gris2);
  border-radius: 10px;
  margin-bottom: 16px;
}
.plani-paso-titulo {
  font-size: 13px; font-weight: 700;
  color: var(--azul); margin-bottom: 14px;
}

/* Lista de grupos para seleccionar */
.plani-grupos-lista {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 340px; overflow-y: auto;
  padding: 2px;
}
.plani-grupo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--gris2); background: var(--blanco);
  transition: border-color .12s, background .12s;
}
.plani-grupo-item:hover { border-color: var(--azul); }
.plani-grupo-item:has(input:checked) { border-color: var(--azul); background: rgba(59,130,246,.05); }
.plani-sin-hh { opacity: .45; cursor: default; }
.plani-grupo-nombre { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plani-grupo-dias   { font-size: 11px; color: var(--gris3); margin-top: 2px; }

/* Bloqueos de docente */
.plani-doc-row {
  margin-bottom: 16px; padding: 12px;
  background: var(--blanco); border: 1px solid var(--gris2); border-radius: 8px;
}
.plani-doc-nombre { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.plani-dias-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.plani-dia-chip {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; user-select: none;
}
.plani-dia-chip input { display: none; }
.plani-dia-chip span {
  display: flex; flex-direction: column; align-items: center;
  width: 36px; padding: 3px 2px; border-radius: 6px; font-size: 11px; line-height: 1.3;
  border: 1.5px solid var(--gris2); background: var(--blanco);
  transition: background .1s, border-color .1s;
  text-align: center;
}
.plani-dia-chip span em { font-size: 9px; color: var(--gris3); font-style: normal; }
.plani-dia-chip input:checked + span {
  background: #FEE2E2; border-color: var(--rojo); color: var(--rojo); font-weight: 700;
}
.plani-dia-chip:hover span { border-color: var(--azul); }

/* Conflictos en la tabla de resultado */
tr.plani-conflicto td { background: rgba(239,68,68,.05); }
tr.plani-conflicto:hover td { background: rgba(239,68,68,.10); }

/* Badges */
.badge-rojo  { background: #FEE2E2; color: #B91C1C; padding: 2px 7px; border-radius: 999px; font-weight: 700; }
.badge-verde { background: #DCFCE7; color: #166534; padding: 2px 7px; border-radius: 999px; font-weight: 700; }


/* ══════════════════════════════════════════════════════
   MI LIBRETA v91 — Rediseño visual completo
   Espiral dorada 3D, papel crema con textura, pestañas
   de color vivo, marcadores laterales finos, panel derecho
   reorganizado
══════════════════════════════════════════════════════ */

/* Variables de color de la libreta */
:root {
  --lb-paper:   #FEFAE8;
  --lb-line:    #C8D8F0;
  --lb-rline:   #FFBABA;
  --lb-card-b:  rgba(255,255,255,.14);
  --lb-muted:   #94a3b8;
  --lb-spiral:  linear-gradient(160deg,#1a1e2c 0%,#242938 40%,#1c2030 100%);
}

/* ── Página principal ── */
.lib90-page { position:relative; z-index:1; max-width:1580px; margin:0 auto; }

/* ── Cabecera ── */
.lib90-header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.lib90-status { display:flex; align-items:center; gap:8px; color:#d9e3f1; font-size:13px; }
.lib90-status-dot { width:14px; height:14px; border-radius:999px; border:2px solid #19d49e; display:grid; place-items:center; color:#19d49e; font-size:9px; }
.lib90-toptools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.lib90-search { display:flex; align-items:center; gap:10px; min-width:280px; background:rgba(0,0,0,.18); border:1px solid rgba(255,255,255,.16); border-radius:14px; padding:10px 14px; color:#d9e3f1; }
.lib90-search input { background:transparent; border:none; outline:none; color:#fff; width:100%; font-size:13px; }
.lib90-search kbd { font-size:11px; color:#bac8dd; }
.lib90-btn { height:44px; padding:0 18px; border-radius:12px; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06); color:#fff; font-weight:700; font-size:13px; box-shadow:0 8px 20px rgba(0,0,0,.16); cursor:pointer; transition:all .15s; }
.lib90-btn:hover { background:rgba(255,255,255,.12); }
.lib90-btn.primary { background:#dcecff; color:#162235; border-color:transparent; }
.lib90-btn.primary:hover { background:#c8deff; }
.lib90-iconbtn { width:44px; display:grid; place-items:center; padding:0; position:relative; }
.lib90-iconbtn .dot { position:absolute; top:8px; right:8px; width:7px; height:7px; background:#ff6a9b; border-radius:999px; }

/* ── Layout principal ── */
.lib90-main { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:20px; align-items:start; }
.lib90-right { display:flex; flex-direction:column; gap:0; position:sticky; top:0; }

/* ── Panel derecho (post-its) ── */
.lib90-panel {
  background:linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05));
  border:1px solid var(--lb-card-b);
  border-radius:20px; padding:16px;
  backdrop-filter:blur(12px);
  box-shadow:0 16px 32px rgba(0,0,0,.20);
  min-height:calc(100vh - 120px);
}
.lib90-panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.lib90-panel-head h3 { margin:0; color:#fff; font-size:16px; font-weight:700; }
.lib90-panel-head p { margin:4px 0 0; color:var(--lb-muted); font-size:11px; }

/* Botones Papelera / Archivados / Enviados */
.lib90-panel-btns { display:flex; gap:6px; margin-bottom:12px; }
.lib90-panel-btn {
  flex:1; padding:6px 4px; border-radius:10px; border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06); color:#d9e3f1; font-size:10px; font-weight:700;
  cursor:pointer; text-align:center; transition:all .15s;
}
.lib90-panel-btn:hover { background:rgba(255,255,255,.14); }
.lib90-panel-btn.active { background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.3); color:#fff; }

/* ── Post-its mejorados ── */
.lib90-postits { display:grid; grid-template-columns:1fr; gap:8px; margin-bottom:10px; width:100%; box-sizing:border-box; }
.lib90-postit {
  position:relative; min-height:100px; border-radius:12px; padding:10px 8px 6px;
  display:flex; flex-direction:column;
  box-shadow: 3px 3px 0 rgba(0,0,0,.12), 4px 6px 14px rgba(0,0,0,.20);
  transform:rotate(-1deg); transition:transform .18s, box-shadow .18s;
  cursor:pointer; box-sizing:border-box; overflow:hidden; min-width:0;
}
.lib90-postit:nth-child(even) { transform:rotate(0.8deg); }
.lib90-postit:hover { transform:rotate(0deg) scale(1.04); box-shadow:6px 8px 22px rgba(0,0,0,.28); z-index:3; }
/* Doblez en la esquina superior derecha */
.lib90-postit::before {
  content:''; position:absolute; top:0; right:0;
  width:0; height:0;
  border-style:solid; border-width:0 16px 16px 0;
  border-color:transparent rgba(0,0,0,.12) transparent transparent;
  border-radius:0 12px 0 0;
}
/* Sombra inferior */
.lib90-postit::after {
  content:''; position:absolute; inset:auto 6px -8px 6px;
  height:12px; background:rgba(0,0,0,.18);
  filter:blur(8px); border-radius:50%; z-index:-1;
}
.lib90-postit-meta { font-size:9px; font-weight:800; text-transform:uppercase; color:#83531c; margin-bottom:4px; }
.lib90-postit-text { font-size:11px; line-height:1.35; color:#1e2635; white-space:pre-wrap; flex:1; font-family:'Comic Sans MS',cursive; word-break:break-word; overflow:hidden; }
.lib90-postit-time { font-size:10px; color:#6b7280; margin-top:6px; }
.lib90-postit-actions { display:flex; justify-content:flex-end; gap:3px; margin-top:6px; opacity:0; transition:opacity .15s; }
.lib90-postit:hover .lib90-postit-actions { opacity:1; }
.lib90-pibtn { background:rgba(0,0,0,.12); border:none; border-radius:5px; padding:2px 4px; cursor:pointer; font-size:11px; transition:background .1s; line-height:1; }
.lib90-pibtn:hover { background:rgba(0,0,0,.25); }

/* Post-it nuevo */
.lib90-postit-new {
  min-height:110px; border:2px dashed rgba(255,255,255,.20);
  border-radius:14px; padding:10px; background:rgba(255,255,255,.04);
  display:flex; flex-direction:column; gap:8px;
  box-sizing:border-box; width:100%; overflow:hidden;
}
.lib90-postit-new textarea { flex:1; min-height:50px; border:none; background:transparent; color:#1e293b; resize:none; font-size:12px; font-family:'Comic Sans MS',cursive; width:100%; box-sizing:border-box; }
[data-theme="dark"] .lib90-postit-new textarea { color:#e2e8f0; }
.lib90-postit-new textarea::placeholder { color:#64748b; }
.lib90-postit-new textarea::placeholder { color:#8899bb; }
.lib90-postit-new textarea:focus { outline:none; }
.lib90-swatch { width:14px; height:14px; border-radius:999px; display:inline-block; border:2px solid transparent; cursor:pointer; transition:transform .1s; }
.lib90-swatch:hover { transform:scale(1.2); }
.lib90-swatch.active { border-color:#1f2937; box-shadow:0 0 0 2px rgba(255,255,255,.30); }

/* ── Zona izquierda ── */
.lib90-left { position:relative; padding-right:88px; }

/* ── Pestañas de hojas ── */
.lib90-tabs {
  display:flex; gap:6px; align-items:flex-end;
  padding-left:80px; margin-bottom:0;
  overflow-x:auto; scrollbar-width:none;
}
.lib90-tabs::-webkit-scrollbar { display:none; }
.lib90-tab {
  --t:#dbeafe;
  position:relative; display:flex; align-items:center; gap:7px;
  min-width:120px; max-width:180px;
  padding:10px 14px 13px;
  background:var(--t);
  border-radius:14px 14px 0 0;
  color:#1d2738; font-size:13px; font-weight:700;
  border:1.5px solid rgba(0,0,0,.12); border-bottom:none;
  box-shadow:0 -2px 8px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.6);
  opacity:.72; cursor:pointer;
  transition:opacity .15s, transform .15s, box-shadow .15s;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.lib90-tab:not(.active):hover { opacity:.90; transform:translateY(-3px); }
.lib90-tab.active {
  opacity:1; transform:translateY(2px); z-index:2;
  box-shadow:0 -4px 12px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.8);
  border-color:rgba(0,0,0,.15);
}
/* Franja de color vivo en la parte superior de cada pestaña */
.lib90-tab::before {
  content:''; position:absolute; top:0; left:0; right:0; height:6px;
  background:color-mix(in srgb, var(--t) 55%, #333 45%);
  border-radius:14px 14px 0 0;
  z-index:1;
}
.lib90-tab-close { display:none; } /* reemplazado por menú ⋯ */
.lib90-tab-menu {
  margin-left:auto; opacity:0; font-size:14px; padding:0 4px;
  border-radius:4px; flex-shrink:0; cursor:pointer; line-height:1;
  transition:opacity .1s; font-weight:700; color:#374151;
}
.lib90-tab:hover .lib90-tab-menu,
.lib90-tab.active .lib90-tab-menu { opacity:.6; }
.lib90-tab-menu:hover { opacity:1 !important; background:rgba(0,0,0,.10); }
.lib90-dditem {
  display:block; width:100%; text-align:left; padding:8px 12px;
  border:none; background:transparent; color:#d9e3f1; font-size:13px;
  cursor:pointer; border-radius:8px; transition:background .1s;
}
.lib90-dditem:hover { background:rgba(255,255,255,.10); }
.lib90-dditem-danger { color:#f87171; }
.lib90-dditem-danger:hover { background:rgba(248,113,113,.12); }
.lib90-addtab { padding-bottom:6px; align-self:flex-end; }

/* ── Cuaderno: caja exterior ── */
.lib90-book {
  background:linear-gradient(135deg, #2a2830 0%, #1e1c2a 100%);
  border-radius:12px 20px 20px 12px;
  padding:10px;
  box-shadow:
    0 24px 48px rgba(0,0,0,.32),
    inset 0 0 8px rgba(0,0,0,.2);
  position:relative;
  overflow:visible;
}
/* Sombra de páginas apiladas detrás */
.lib90-book::before {
  content:''; position:absolute;
  inset:6px -10px -10px 6px;
  background:#E0DAC8; border-radius:0 20px 20px 0;
  z-index:-1; box-shadow:2px 2px 8px rgba(0,0,0,.10);
}
.lib90-book::after {
  content:''; position:absolute;
  inset:12px -18px -18px 12px;
  background:#D6D0BE; border-radius:0 20px 20px 0;
  z-index:-2; box-shadow:4px 4px 12px rgba(0,0,0,.08);
}

/* ── Interior del cuaderno: espiral + papel ── */
.lib90-book-inner {
  display:flex; min-height:720px;
  background:#FEFAE8; border-radius:0 16px 16px 0;
  overflow:visible;
  position:relative;
}

/* ── Espiral ── */
.lib90-spiral {
  width:64px; flex-shrink:0;
  background:linear-gradient(to right, #0e1018 0%, #1a1f2e 30%, #222838 60%, #1a1f2e 100%);
  border-right:2px solid rgba(0,0,0,.5);
  position:relative; z-index:2;
  overflow:visible;
}
/* Reflejo lateral izquierdo del lomo */
.lib90-spiral::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
  background:linear-gradient(to bottom,
    rgba(255,255,255,.08) 0%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.08) 100%);
}

/* ── Anillos de la espiral — dorados y 3D ── */
.lib90-ring {
  width:56px; height:22px; flex-shrink:0;
  border-radius:999px; position:relative; z-index:10;
  margin-left:-6px; margin-right:-6px;
  background:linear-gradient(180deg,
    #ffffff 0%,
    #dddddd 20%,
    #888888 45%,
    #dddddd 70%,
    #ffffff 100%
  );
  border:2px solid rgba(0,0,0,.4);
  box-shadow:
    0 4px 12px rgba(0,0,0,.6),
    inset 0 2px 4px rgba(255,255,255,.95),
    inset 0 -2px 4px rgba(0,0,0,.35);
}
.lib90-ring::after {
  content:''; position:absolute;
  inset:4px 10px;
  border-radius:999px;
  background:linear-gradient(180deg, #1a1a2e, #0a0a14);
  box-shadow:inset 0 3px 6px rgba(0,0,0,.95);
}
.lib90-ring::before { display:none; }

/* ── Papel del cuaderno ── */
.lib90-paper { flex:1; background:var(--lb-paper); position:relative; }
/* Línea roja de margen */
.lib90-paper::before {
  content:''; position:absolute; left:52px; top:0; bottom:0; width:2px;
  background:linear-gradient(to bottom, #FFACAC, #FF8888, #FFACAC);
  opacity:.8;
}
/* Líneas horizontales */
.lib90-lines {
  position:absolute; inset:0;
  background-image:repeating-linear-gradient(
    to bottom, transparent 0px, transparent 27px,
    var(--lb-line) 27px, var(--lb-line) 28px
  );
  opacity:.8; pointer-events:none;
}
/* Zona de contenido */
.lib90-content { position:relative; z-index:1; padding:20px 20px 30px 72px; min-height:720px; }

/* ── Barra de herramientas ── */
.lib90-editor-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.lib90-pagecolor { display:flex; align-items:center; gap:6px; font-size:11px; color:#5e697d; }
.lib90-pagecolor .dot { width:18px; height:18px; border-radius:999px; border:2px solid rgba(15,23,42,.12); cursor:pointer; transition:transform .1s; }
.lib90-pagecolor .dot:hover { transform:scale(1.2); }
.lib90-pagecolor .dot.active { box-shadow:0 0 0 2.5px rgba(15,23,42,.5); }
.lib90-title-input {
  font-family:Georgia,'Times New Roman',serif; font-size:26px; font-weight:700;
  color:#172033; background:transparent; border:none; box-shadow:none; padding:0; margin-top:16px;
  width:100%;
}
.lib90-title-input:focus { outline:none; }
.lib90-title-display { font-family:Georgia,'Times New Roman',serif; font-size:26px; font-weight:700; color:#172033; margin-top:16px; }
.lib90-toolbar {
  display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  background:rgba(255,255,255,.80); padding:8px 10px; border-radius:14px;
  border:1px solid rgba(15,23,42,.08); box-shadow:0 6px 14px rgba(0,0,0,.06);
}
.lib90-tool, .lib90-toolbar select {
  height:34px; border-radius:10px; border:1px solid rgba(15,23,42,.09);
  background:#fff; color:#1f2937; font-size:12px; font-weight:700;
}
.lib90-tool { padding:0 10px; display:inline-flex; align-items:center; justify-content:center; gap:4px; cursor:pointer; min-width:34px; transition:background .1s; }
.lib90-tool:hover { background:#f1f5f9; }
.lib90-toolbar select { padding:0 8px; }
.lib90-div { width:1px; height:24px; background:rgba(15,23,42,.10); }
.lib90-hl { display:flex; gap:5px; align-items:center; }
.lib90-hl span { width:20px; height:20px; border-radius:999px; border:1px solid rgba(15,23,42,.12); cursor:pointer; transition:transform .1s; }
.lib90-hl span:hover { transform:scale(1.2); }

/* ── Editor ── */
.lib90-editor {
  min-height:560px; padding-top:8px;
  color:#172033; font-size:15px; line-height:1.87;
  outline:none; background:transparent;
  font-family:'Comic Sans MS', cursive;
}
.lib90-editor ul, .lib90-editor ol { margin-left:20px; }

/* ── Marcadores laterales — más finos y elegantes ── */
.lib90-markers {
  position:absolute; top:130px; right:0;
  width:72px; display:flex; flex-direction:column; gap:8px;
}
.lib90-marker {
  min-height:80px; border-radius:0 14px 14px 0;
  padding:10px 7px; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:5px;
  color:#1b2536; border:1px solid rgba(0,0,0,.10); border-left:none;
  box-shadow:2px 4px 12px rgba(0,0,0,.14); cursor:pointer;
  text-align:center; transition:transform .15s, box-shadow .15s;
  position:relative; overflow:hidden;
}
/* Franja de color en el borde izquierdo del marcador */
.lib90-marker::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
  background:rgba(0,0,0,.15);
}
.lib90-marker:hover { transform:translateX(4px); box-shadow:4px 6px 16px rgba(0,0,0,.18); }
.lib90-marker.active { transform:translateX(8px); box-shadow:4px 8px 18px rgba(0,0,0,.22); }
.lib90-marker .ico { font-size:20px; }
.lib90-marker strong { font-size:10px; font-weight:800; line-height:1.1; }

/* ── Calendarios ── */
.lib90-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.lib90-day { background:rgba(255,255,255,.65); border:1px solid rgba(15,23,42,.08); border-radius:12px; padding:8px; box-shadow:0 4px 10px rgba(0,0,0,.05); }
.lib90-day h4 { margin:0; color:#172033; font-size:12px; font-weight:700; }
.lib90-day .sub { font-size:10px; color:#64748b; margin:3px 0 6px; }
.lib90-day textarea { width:100%; min-height:180px; border:none; background:rgba(255,255,255,.5); border-radius:8px; padding:8px; color:#172033; resize:vertical; font-size:12px; font-family:'Comic Sans MS',cursive; }
.lib90-caltop { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:14px; }
.lib90-caltitle { font-family:Georgia,'Times New Roman',serif; font-size:24px; color:#172033; font-weight:700; }
.lib90-calactions { display:flex; gap:6px; }
.lib90-smallbtn { border:none; background:#fff; padding:8px 12px; border-radius:10px; font-weight:700; color:#172033; box-shadow:0 4px 10px rgba(0,0,0,.07); cursor:pointer; font-size:13px; }
.lib90-month { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; }
.lib90-month-head { font-size:10px; text-transform:uppercase; font-weight:800; color:#64748b; text-align:center; padding:4px 0; }
.lib90-month-cell { min-height:100px; background:rgba(255,255,255,.65); border:1px solid rgba(15,23,42,.08); border-radius:10px; padding:6px; display:flex; flex-direction:column; }
.lib90-month-cell .n { font-size:12px; font-weight:800; color:#172033; margin-bottom:4px; }
.lib90-month-cell textarea { flex:1; border:none; background:transparent; resize:none; color:#172033; font-size:11px; font-family:'Comic Sans MS',cursive; }

/* ── Post-it board ── */
.lib90-drop { border:2px dashed rgba(15,23,42,.16); background:rgba(255,255,255,.5); border-radius:14px; padding:16px; min-height:140px; margin-bottom:10px; color:#4b5563; }
.lib90-drop.drag { border-color:#4174a6; background:rgba(191,219,254,.3); }
.lib90-board { display:flex; flex-wrap:wrap; gap:10px; }
.lib90-varios { min-height:500px; border-radius:14px; border:1px solid rgba(15,23,42,.08); background:rgba(255,255,255,.56); padding:12px; color:#172033; font-size:15px; line-height:1.8; font-family:'Comic Sans MS',cursive; }

/* Responsive */
@media (max-width:1400px) { .lib90-main{grid-template-columns:1fr;} .lib90-right{order:2} .lib90-left{padding-right:88px;max-width:1100px;} }
@media (max-width:1180px) { .lib90-left{padding-right:0} .lib90-markers{position:static;width:auto;flex-direction:row;flex-wrap:wrap;margin-top:10px} .lib90-marker{width:auto;min-height:unset;padding:10px 12px;border-radius:12px;border-left:1px solid rgba(0,0,0,.08)} }
@media (max-width:960px) { .lib90-header{flex-direction:column} .lib90-search{min-width:0;width:100%} .lib90-postits{grid-template-columns:1fr 1fr} .lib90-week{grid-template-columns:repeat(4,minmax(0,1fr))} .lib90-month{grid-template-columns:repeat(4,minmax(0,1fr));} }
@media (max-width:760px) { #view-libreta{padding:10px} .lib90-postits{grid-template-columns:1fr} .lib90-week,.lib90-month{grid-template-columns:repeat(2,minmax(0,1fr))} .lib90-tabs{padding-left:8px} .lib90-book-inner{min-height:auto} .lib90-spiral{width:54px} .lib90-ring{width:36px;height:18px} .lib90-content{padding-left:64px} .lib90-main{gap:12px} }

/* ── Swatches subrayador ── */
.lib90-hl-swatch {
  width:20px; height:20px; border-radius:999px;
  border:2px solid rgba(15,23,42,.12); cursor:pointer;
  display:inline-block; transition:transform .1s;
}
.lib90-hl-swatch:hover { transform:scale(1.25); border-color:rgba(15,23,42,.35); }

/* ── MODO OSCURO — CORRECCIONES DE CONTRASTE ─────── */
[data-theme="dark"] tr[style*="line-through"],
[data-theme="dark"] tr[style*="text-decoration: line-through"] {
  color: #6b7280 !important;
  background: rgba(255,255,255,.03) !important;
}
[data-theme="dark"] tr[style*="line-through"] td,
[data-theme="dark"] tr[style*="text-decoration: line-through"] td {
  color: #6b7280 !important;
}
/* Clases realizadas en modo oscuro — fondo más oscuro */
[data-theme="dark"] tr[style*="#F0FDF4"] {
  background: rgba(5,150,105,.12) !important;
}
[data-theme="dark"] tr[style*="#F0FDF4"] td {
  color: #d1fae5 !important;
}
/* Clases en curso en modo oscuro */
[data-theme="dark"] tr[style*="#ECFDF5"] {
  background: rgba(16,185,129,.15) !important;
}
/* Clases canceladas en modo oscuro */
[data-theme="dark"] tr[style*="#F9FAFB"] {
  background: rgba(255,255,255,.04) !important;
}
[data-theme="dark"] tr[style*="#F9FAFB"] td {
  color: #4b5563 !important;
}

/* ── MODO OSCURO — CÁMARAS ───────────────────────── */
[data-theme="dark"] .cam-card { display:none; }



/* ── MODO OSCURO — CÁMARAS ───────────────────────── */
[data-theme="dark"] .camara-card {
  background: #1e293b !important;
  border-color: rgba(255,255,255,.12) !important;
}
[data-theme="dark"] .camara-card.libre {
  background: rgba(5,150,105,.15) !important;
  border-color: rgba(52,211,153,.3) !important;
}
[data-theme="dark"] .camara-card.ocupada {
  background: rgba(185,28,28,.15) !important;
  border-color: rgba(248,113,113,.3) !important;
}
[data-theme="dark"] .camara-card.anfitrion {
  background: rgba(180,83,9,.15) !important;
  border-color: rgba(251,191,36,.3) !important;
}
[data-theme="dark"] .camara-card span[style*="font-weight:700;font-size:13px"] {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .camara-card [style*="color:var(--texto2)"] {
  color: #94a3b8 !important;
}
[data-theme="dark"] .camara-card [style*="background:rgba(0,0,0,.05)"] {
  background: rgba(255,255,255,.06) !important;
}

/* ── SIDEBAR ELEGANTE ─────────────────────────────── */
#sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sb-section {
  color: rgba(255,255,255,.35) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
  padding: 16px 16px 4px !important;
}
.sb-item {
  color: rgba(255,255,255,.70) !important;
  border-radius: 10px !important;
  margin: 1px 8px !important;
}
.sb-item:hover {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  transform: none !important;
}
.sb-item.active {
  background: rgba(99,179,237,.18) !important;
  color: #90cdf4 !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.sb-logo img { filter: brightness(1.1); }
.sb-icon { display:inline-flex !important; align-items:center !important; justify-content:center !important; width:18px !important; }
.sb-copyright { color: rgba(255,255,255,.25) !important; }
.sb-user { color: rgba(255,255,255,.75) !important; }

/* ══════════════════════════════════════════════════════
   MODO NOCHE — LEGIBILIDAD (petición de Marta, 28/07)
   Regla de la casa: si el fondo es claro, la letra va oscura; si el fondo
   se oscurece en modo noche, la letra tiene que aclararse. Aquí se corrigen
   los dos casos de las clases con fondo pastel: en noche, --verde2, --rojo2,
   --naranja2 y --morado2 pasan a ser tonos OSCUROS, y las reglas de arriba
   les dejaban la letra oscura encima (ilegible). Los chips con fondo claro
   fijo (#DBEAFE, #FCE7F3, #CFFAFE) se quedan como están, con letra oscura.
   ══════════════════════════════════════════════════════ */
[data-theme="dark"] .chip-verde,
[data-theme="dark"] .alerta-ok      { color: #9FE1CB; }
[data-theme="dark"] .chip-rojo,
[data-theme="dark"] .alerta-error,
[data-theme="dark"] .btn-danger     { color: #F0AFAF; border-color: #5A3232; }
[data-theme="dark"] .chip-naranja,
[data-theme="dark"] .alerta-warn    { color: #F0C68A; border-color: #5A4A26; }
[data-theme="dark"] .chip-morado    { color: #CDBCF2; }

/* Fondos claros fijos: la letra SIEMPRE oscura, también de noche */
[data-theme="dark"] .chip-azul,
[data-theme="dark"] .chip-rosa,
[data-theme="dark"] .chip-teal,
[data-theme="dark"] .alerta-info    { color: #26223B; }

/* Red de seguridad del modo noche: cualquier caja con fondo claro puesto a
   mano hereda letra oscura. Los hijos que fijan su propio color (rojos de
   aviso, verdes de ok) lo conservan; los que heredaban, ahora se leen. */
[data-theme="dark"] [style*="background:#F8FAFC"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background:#DCFCE7"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background:#FFFF00"],
[data-theme="dark"] [style*="background:#ffff00"],
[data-theme="dark"] [style*="background:#FEF3C7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background:#FEF2F2"],
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background:#F1F5F9"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background:#FEF9C3"],
[data-theme="dark"] [style*="background:#fef9c3"],
[data-theme="dark"] [style*="background:#FEE2E2"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background:#FAEEDA"],
[data-theme="dark"] [style*="background:#faeeda"],
[data-theme="dark"] [style*="background:#BFDBFE"],
[data-theme="dark"] [style*="background:#bfdbfe"],
[data-theme="dark"] [style*="background:#EFF6FF"],
[data-theme="dark"] [style*="background:#eff6ff"],
[data-theme="dark"] [style*="background:#E0E7FF"],
[data-theme="dark"] [style*="background:#e0e7ff"],
[data-theme="dark"] [style*="background:#DBEAFE"],
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background:#E8EEF7"],
[data-theme="dark"] [style*="background:#e8eef7"],
[data-theme="dark"] [style*="background:#E6F6FC"],
[data-theme="dark"] [style*="background:#e6f6fc"],
[data-theme="dark"] [style*="background:#F0FDF4"],
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background:#FFFBEB"],
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background:#CBD5E1"],
[data-theme="dark"] [style*="background:#cbd5e1"],
[data-theme="dark"] [style*="background:#FFF7D6"],
[data-theme="dark"] [style*="background:#fff7d6"],
[data-theme="dark"] [style*="background:#FDE68A"],
[data-theme="dark"] [style*="background:#fde68a"],
[data-theme="dark"] [style*="background:#D1FAE5"],
[data-theme="dark"] [style*="background:#d1fae5"],
[data-theme="dark"] [style*="background:#FCE7F3"],
[data-theme="dark"] [style*="background:#fce7f3"],
[data-theme="dark"] [style*="background:#F9FAFB"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background:#ECFDF5"],
[data-theme="dark"] [style*="background:#ecfdf5"],
[data-theme="dark"] [style*="background:#FDF8EC"],
[data-theme="dark"] [style*="background:#fdf8ec"],
[data-theme="dark"] [style*="background:#E2E8F0"],
[data-theme="dark"] [style*="background:#e2e8f0"],
[data-theme="dark"] [style*="background:#FCD34D"],
[data-theme="dark"] [style*="background:#fcd34d"],
[data-theme="dark"] [style*="background:#FEF08A"],
[data-theme="dark"] [style*="background:#fef08a"],
[data-theme="dark"] [style*="background:#E1F5EE"],
[data-theme="dark"] [style*="background:#e1f5ee"],
[data-theme="dark"] [style*="background:#EDE9FE"],
[data-theme="dark"] [style*="background:#ede9fe"],
[data-theme="dark"] [style*="background:#FFF7ED"],
[data-theme="dark"] [style*="background:#fff7ed"] { color:#26223B; }

/* ══════════════════════════════════════════════════════
   MODO NOCHE — LETRA OSCURA SIN FONDO PROPIO
   De día estos colores van sobre blanco y se leen; de noche quedaban
   oscuro sobre oscuro (lo que se veía en la comparativa de grupos). Cada
   uno pasa a su equivalente claro CONSERVANDO EL SIGNIFICADO: los verdes
   siguen verdes, los rojos rojos, los ámbares ámbares. Si el elemento
   pone su propio fondo no se toca, porque ahí la letra oscura es la que
   toca. Regla de la casa, no lo quites.
   ══════════════════════════════════════════════════════ */
[data-theme="dark"] [style*="color:#166534"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#166534"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#059669"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#059669"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0F6E56"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0f6e56"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#065F46"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#065f46"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#14532D"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#14532d"]:not([style*="background"]) { color: #9FE1CB !important; }

[data-theme="dark"] [style*="color:#DC2626"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#dc2626"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#991B1B"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#991b1b"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#7F1D1D"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#7f1d1d"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#A33E3E"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#a33e3e"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#B91C1C"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#b91c1c"]:not([style*="background"]) { color: #F0AFAF !important; }

[data-theme="dark"] [style*="color:#78350F"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#78350f"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#92400E"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#92400e"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#854F0B"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#854f0b"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#854D0E"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#854d0e"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#B45309"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#b45309"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#633806"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#633806"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#412402"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#412402"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#D97706"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#d97706"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#C2410C"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#c2410c"]:not([style*="background"]) { color: #F0C68A !important; }

[data-theme="dark"] [style*="color:#7C3AED"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#7c3aed"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5B21B6"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5b21b6"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#3730A3"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#3730a3"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#4C1D95"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#4c1d95"]:not([style*="background"]) { color: #C9B8F0 !important; }

[data-theme="dark"] [style*="color:#0D2B5E"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0d2b5e"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1E3A8A"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1e3a8a"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1E40AF"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1e40af"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1D4ED8"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1d4ed8"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1A56A0"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1a56a0"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1E5AA8"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1e5aa8"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0A5A78"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0a5a78"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#164E63"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#164e63"]:not([style*="background"]) { color: #8FC4F5 !important; }

[data-theme="dark"] [style*="color:#26223B"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#26223b"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1E293B"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1e293b"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1E2235"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#1e2235"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0F172A"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#0f172a"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#111827"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#111827"]:not([style*="background"]) { color: var(--texto) !important; }

[data-theme="dark"] [style*="color:#475569"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#475569"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5D6B7E"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5d6b7e"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#334155"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#334155"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5F5E5A"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#5f5e5a"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#64748B"]:not([style*="background"]),
[data-theme="dark"] [style*="color:#64748b"]:not([style*="background"]) { color: var(--texto2) !important; }

/* Vista de páginas del maquetador PRO: el fondo de cada hoja es SIEMPRE blanco
   (simula el papel), independientemente del tema elegido. */
[data-theme="dark"] .mpro-hoja {
  background: #FFFFFF !important;
  color: #26223B !important;
}

[data-theme="dark"] [style*="background:#F4F4F2"] { color: #26223B !important; }

/* Tarjeta de examen próximo (Inicio) en modo noche */
[data-theme="dark"] [style*="background:#FEF3C7"] {
  background: #3D2E00 !important;
  border-color: #A07000 !important;
}
[data-theme="dark"] [style*="background:#FEF3C7"] * {
  color: #F0C68A !important;
}
/* Los textos de cuenta atrás que tienen su propio color (rojo/verde) los conservamos */
[data-theme="dark"] [style*="background:#FEF3C7"] [style*="color:#DC2626"] {
  color: #F0AFAF !important;
}
[data-theme="dark"] [style*="background:#FEF3C7"] [style*="color:#059669"] {
  color: #9FE1CB !important;
}
[data-theme="dark"] [style*="background:#FEF3C7"] [style*="color:#D97706"] {
  color: #F0C68A !important;
}

/* Calendarios de horarios: que quepan SIEMPRE en la pantalla sin scroll horizontal */
#carga-resultado, #horarios-resultado {
  max-width: 100%;
  overflow-x: hidden;
}
#carga-resultado .card, #horarios-resultado .card {
  max-width: 100%;
  overflow: hidden;
}

/* 24/10/2026 — Tablas con cabecera gris claro (ficha del alumno, aprobados...):
   la regla general "thead th" pinta el texto en blanco para las cabeceras azules
   y aquí no se leía. */
thead tr[style*="background:var(--gris)"] th { color: var(--texto); font-weight: 700; }
thead tr[style*="background:var(--gris)"] th:hover { background: transparent; }

