/* =====================================================
   YAGO PLATFORM — Global Premium Design System
   Sistema unificado de componentes visuales
   ===================================================== */

/* Scrollbars personalizados (18-ago-2026) — hallazgo real del usuario:
   el menú móvil (.nav-links, overflow-y:auto) mostraba la barra de
   desplazamiento NATIVA del sistema operativo (gris, gruesa, sin
   redondear) porque nunca se había personalizado ningún scrollbar en
   toda la hoja — se notaba mucho cortando el sidebar oscuro. Regla
   global: cualquier contenedor con overflow (sidebar, .main-content,
   .modal-body, etc.) hereda el mismo scrollbar delgado y con los
   tokens del tema, en vez de mezclar el look nativo del navegador con
   el diseño de la plataforma. */
* { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 20px; }
*::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* Fondo oscuro fijo para pantallas de interstitial tipo "seguridad"
   (cambiar_password.php) — deliberadamente el mismo en claro y oscuro,
   como .yago-splash más abajo; no reacciona al tema del usuario. */
:root { --auth-backdrop: linear-gradient(160deg, #0A2540 0%, #0f172a 45%, #1e293b 100%); }

/* Paleta del doughnut chart de reporte_notas.php (Canvas/Chart.js no
   entiende var() directo — se leen con getComputedStyle en el JS).
   Tonos deliberadamente distintos de --success/--warn/--danger (que
   ya usan las píldoras de puntaje de la misma página): son los que ya
   tenía el gráfico, se preserva el valor exacto en vez de unificar. */
:root {
    --chart-excelente: #10b981;
    --chart-regular: #f59e0b;
    --chart-deficiente: #ef4444;
    --chart-sin-puntaje: #94a3b8;
}

/* Paleta del doughnut chart de docente_dashboard.php — mismo criterio
   que --chart-* de arriba (Canvas no lee var() directo), valores
   propios porque el 4to color ("Sin Datos") es distinto del de
   reporte_notas.php (#cbd5e1 vs #94a3b8), no se unifican. */
:root {
    --risk-chart-excelente: #10b981;
    --risk-chart-regular: #f59e0b;
    --risk-chart-riesgo: #ef4444;
    --risk-chart-sin-datos: #cbd5e1;
}

/* ===== SPLASH SCREEN (Pantalla de Carga Premium) ===== */
.yago-splash {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0A2540 0%, #0f172a 40%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.yago-splash.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}
.yago-splash-logo {
    width: 80px; height: 80px;
    border-radius: 20px;
    object-fit: contain;
    animation: splashPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(37,99,235,0.4));
}
.yago-splash-text {
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
    opacity: 0;
    animation: splashTextIn 0.8s 0.3s forwards;
}
.yago-splash-sub {
    margin-top: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    animation: splashTextIn 0.8s 0.6s forwards;
}
.yago-splash-bar {
    width: 200px;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    margin-top: 28px;
    overflow: hidden;
    opacity: 0;
    animation: splashTextIn 0.5s 0.8s forwards;
}
.yago-splash-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #8b5cf6);
    border-radius: 10px;
    animation: splashBarFill 1.2s 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px rgba(37,99,235,0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 50px rgba(37,99,235,0.6)); }
}
@keyframes splashTextIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes splashBarFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* ===== TOAST NOTIFICATION SYSTEM ===== */
.yago-toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99998;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}
.yago-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    transform: translateX(120%);
    animation: toastSlideIn 0.4s cubic-bezier(0.16,1,0.3,1) forwards;
}
.yago-toast.removing {
    animation: toastSlideOut 0.3s cubic-bezier(0.4,0,1,1) forwards;
}
.yago-toast-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.yago-toast-icon i, .yago-toast-icon svg {
    width: 18px; height: 18px;
}
.yago-toast-body {
    flex: 1;
}
.yago-toast-title {
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 2px;
}
.yago-toast-msg {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.yago-toast-close {
    background: none; border: none;
    color: #94a3b8; cursor: pointer;
    padding: 4px; border-radius: 6px;
    transition: all 0.15s;
    display: flex;
}
.yago-toast-close:hover {
    background: #f1f5f9; color: #475569;
}
.yago-toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    animation: toastProgress 4s linear forwards;
}

/* Toast variants */
.yago-toast.success .yago-toast-icon { background: #ecfdf5; color: #059669; }
.yago-toast.success .yago-toast-progress { background: #10b981; }
.yago-toast.error .yago-toast-icon { background: #fef2f2; color: #dc2626; }
.yago-toast.error .yago-toast-progress { background: #ef4444; }
.yago-toast.warning .yago-toast-icon { background: #fffbeb; color: #d97706; }
.yago-toast.warning .yago-toast-progress { background: #f59e0b; }
.yago-toast.info .yago-toast-icon { background: #eff6ff; color: #2563eb; }
.yago-toast.info .yago-toast-progress { background: #3b82f6; }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===== KEYBOARD NAVIGATION HINTS ===== */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ===== MICRO-ANIMATIONS FOR BUTTONS ===== */
.btn-animate {
    transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
}
.btn-animate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.btn-animate:active {
    transform: translateY(0) scale(0.98);
}

/* ===== FOCUS RING (Accessibility) ===== */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== PAGE TRANSITION ===== */
.yago-page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE TOAST ===== */
@media (max-width: 480px) {
    .yago-toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .yago-toast {
        min-width: unset;
        max-width: unset;
    }
}

/* ===== THEMES & TYPOGRAPHY PREFERENCES ===== */
:root {
    --font-scale: 1;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --bg-color: #f4f7fe;
    --bg-sidebar: #0f172a;
    --border-color: #e2e8f0;
    --border-dark: #1e293b;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --text-muted-light: #94a3b8;
    --accent-green: #059669;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-amber: #d97706;
    --panel: #ffffff;
    --banner-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #4f46e5 100%);
    --banner-text: #ffffff;
    --banner-subtext: #eef2ff;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 12px 30px rgba(0,0,0,0.09);
    --dropdown-bg: #1e293b;
    --dropdown-text: #f8fafc;
    --dropdown-border: #334155;
    --section-title: #0f172a;
    --stat-icon-blue-bg: rgba(37,99,235,0.1);
    --stat-icon-green-bg: rgba(5,150,105,0.1);
    --stat-icon-purple-bg: rgba(124,58,237,0.1);
    --stat-icon-amber-bg: rgba(217,119,6,0.1);
    --stat-icon-red-bg: rgba(220,38,38,0.1);

    /* ===== ALIAS TOKENS =====
       Varias páginas usan estos nombres cortos (--border, --success, --error, --warn,
       --danger, --accent, --muted, --text-color, --surface-color). Se mapean aquí a los
       tokens oficiales para que TODA la plataforma comparta exactamente la misma paleta
       azul/blanca en vez de heredar el color por defecto del navegador. */
    --border: var(--border-color);
    --success: var(--accent-green);
    --error: #dc2626;
    --danger: #dc2626;
    --warn: var(--accent-amber);
    --accent: var(--primary);
    --muted: var(--text-muted);
    --text-color: var(--text-dark);
    --surface-color: var(--panel);
    --surface-2: var(--bg-color);
    --white: #ffffff;
    --sidebar-bg: var(--bg-sidebar);
    --text-body: var(--text-dark);
    --border-radius: 12px;
}

/* Light Theme (Luminoso, nítido y ejecutivo) */
html.yago-theme-light, [data-theme="light"] {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --bg-color: #f4f7fe;
    --bg-sidebar: #0f172a;
    --border-color: #e2e8f0;
    --border-dark: #1e293b;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --text-muted-light: #94a3b8;
    --accent-green: #059669;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-amber: #d97706;
    --panel: #ffffff;
    --banner-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #4f46e5 100%);
    --banner-text: #ffffff;
    --banner-subtext: #eef2ff;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 12px 30px rgba(0,0,0,0.09);
    --dropdown-bg: #1e293b;
    --dropdown-text: #f8fafc;
    --dropdown-border: #334155;
    --section-title: #0f172a;
    --stat-icon-blue-bg: rgba(37,99,235,0.1);
    --stat-icon-green-bg: rgba(5,150,105,0.1);
    --stat-icon-purple-bg: rgba(124,58,237,0.1);
    --stat-icon-amber-bg: rgba(217,119,6,0.1);
    --stat-icon-red-bg: rgba(220,38,38,0.1);
}

/* Dark Theme (Elegante con buen contraste) */
html.yago-theme-dark, [data-theme="dark"] {
    --primary: #f5f7fd;
    --primary-light: #818cf8;
    --bg-color: #0f172a;
    --bg-sidebar: #090d16;
    --border-color: rgba(255,255,255,0.08);
    --border-dark: #1e293b;
    --text-dark: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    --text-muted-light: #64748b;
    --accent-green: #34d399;
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-amber: #fbbf24;
    --panel: #1e293b;
    --banner-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    --banner-text: #ffffff;
    --banner-subtext: #c7d2fe;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.25);
    --card-hover-shadow: 0 15px 35px rgba(0,0,0,0.4);
    --dropdown-bg: #1e293b;
    --dropdown-text: #f8fafc;
    --dropdown-border: #334155;
    --section-title: #f8fafc;
    --stat-icon-blue-bg: rgba(96,165,250,0.15);
    --stat-icon-green-bg: rgba(52,211,153,0.15);
    --stat-icon-purple-bg: rgba(167,139,250,0.15);
    --stat-icon-amber-bg: rgba(251,191,36,0.15);
    --stat-icon-red-bg: rgba(248,113,113,0.15);

    /* Alias tokens (ver definición en :root) recalculados para modo oscuro */
    --border: var(--border-color);
    --success: var(--accent-green);
    --error: #f87171;
    --danger: #f87171;
    --warn: var(--accent-amber);
    --accent: var(--primary-light);
    --muted: var(--text-muted);
    --text-color: var(--text-dark);
    --surface-color: var(--panel);
    --surface-2: #263349;
    --white: #ffffff;
    --sidebar-bg: var(--bg-sidebar);
    --text-body: var(--text-dark);
}

/* Font Size Scales */
html.font-normal {
    font-size: 100%;
}
html.font-large {
    font-size: 112.5%; /* 18px base */
}
html.font-xlarge {
    font-size: 125%; /* 20px base */
}

/* =====================================================
   GLOBAL LAYOUT & COMPONENTS (Unified Dashboard Style)
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background: var(--bg-color); display: flex; height: 100vh; color: var(--text-dark); overflow: hidden; letter-spacing: -0.01em; position: relative; transition: background 0.3s ease, color 0.3s ease; }

/* ===== DASHBOARD STYLE SIDEBAR ===== */
.sidebar { width: 270px; background: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; z-index: 10; color: var(--text-light); transition: width 0.22s ease; }
.sidebar-brand { padding: 28px 24px 22px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid rgba(255,255,255,0.08); transition: padding 0.22s ease; }
.sidebar-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: white; padding: 2px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand-text h2 { font-size: 15px; font-weight: 800; color: var(--text-light); line-height: 1.2; }
.sidebar-brand-text span { font-size: 11px; color: var(--text-muted-light); font-weight: 600; letter-spacing: 0.3px; }

/* ----- Sidebar colapsable (18-ago-2026, pedido del usuario) — se
   guarda en localStorage (SidebarCollapse en yago_global.js), se
   aplica antes de DOMContentLoaded para no destellar expandido.
   Colapsado: solo el riel de íconos queda visible, el resto de la
   plataforma (.main-content) gana ese ancho de vuelta. */
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .sidebar-brand { padding: 24px 0 20px; justify-content: center; }
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-menu .nav-section-title,
.sidebar.collapsed .nav-menu .nav-link-text,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-btn .chevron { display: none; }
.sidebar.collapsed .nav-menu-wrap { padding: 8px; }
.sidebar.collapsed .nav-item .nav-link { padding: 12px; justify-content: center; }
.sidebar.collapsed .nav-item .nav-link i { margin: 0; }
.sidebar.collapsed .sidebar-user-btn { justify-content: center; padding: 10px 4px; }
.sidebar.collapsed .config-dropdown { left: calc(100% + 10px); right: auto; bottom: 8px; width: 220px; }

.sidebar-collapse-btn { background: none; border: none; padding: 0; cursor: pointer; border-radius: 10px; margin-top: auto; }
.sidebar-collapse-btn .nav-icon { background: rgba(255,255,255,0.05); color: var(--text-muted-light); }
.sidebar-collapse-btn:hover .nav-icon { background: rgba(255,255,255,0.1); color: var(--text-light); }
.sidebar-collapse-btn .nav-icon i { transition: transform 0.22s ease; }
.sidebar.collapsed .sidebar-collapse-btn .nav-icon i { transform: rotate(180deg); }
@media (max-width: 900px) { .sidebar-collapse-btn { display: none; } } /* en móvil el sidebar ya se muestra/oculta completo con el hamburguesa */

/* .nav-section/.nav-section-title: etiqueta simple de sección — se
   queda sin cambios porque editor_libro.php la sigue usando sola
   (su sidebar del CMS no tiene .nav-link/.nav-links, es un árbol de
   contenido distinto, fuera de alcance de este rediseño). */
.nav-section { padding: 24px 16px 8px; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 8px; }
.nav-section:first-of-type { border-top: none; margin-top: 4px; }
.nav-section-title { font-size: 11px; text-transform: uppercase; color: var(--text-muted-light); font-weight: 800; letter-spacing: 1.5px; padding: 0 12px; margin-bottom: 10px; }

/* ----- Menú unificado (Rediseño) ----- */
.nav-menu-wrap { display: flex; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 12px; }
.nav-menu { width: 100%; list-style: none; margin: 0; padding: 0; }
.nav-section-title { font-size: 11px; text-transform: uppercase; color: var(--text-muted-light); font-weight: 800; letter-spacing: 1.5px; padding: 16px 12px 8px; }
.nav-section-title:first-child { padding-top: 4px; }
.nav-item { margin-bottom: 2px; }
.nav-item .nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: 12px; text-decoration: none; font-size: 13.5px; font-weight: 600;
    color: var(--text-muted-light); transition: all 140ms cubic-bezier(0.23,1,0.32,1);
}
.nav-item .nav-link i { width: 18px; height: 18px; stroke-width: 2.2; flex-shrink: 0; }
.nav-item .nav-link:hover { background: rgba(255,255,255,0.06); color: var(--text-light); }
.nav-item.active .nav-link {
    background: color-mix(in srgb, var(--primary) 20%, transparent);
    color: var(--primary-light);
}
.nav-item.active .nav-link i { color: var(--primary-light); }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: auto; position: relative; }
.sidebar-user-btn { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; transition: all 0.2s; width: 100%; text-align: left; }
.sidebar-user-btn:hover { background: rgba(255,255,255,0.06); }
.sidebar-user-info-wrap { display: flex; align-items: center; gap: 12px; }
/* Sólido, no degradado (rediseño 23-ago-2026, "mismo estilo que el
   resto del dashboard" — Dirección B ya sacó los degradados
   decorativos del contenido, el avatar del sidebar era el último
   que quedaba). */
.sidebar-avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--primary); display: flex; align-items: center; justify-content: center; color: var(--text-light); font-weight: 800; font-size: 15px; flex-shrink: 0; overflow: hidden; }
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Selector de avatar ilustrado en perfil.php (18-ago-2026) — el propio
   estudiante/docente elige entre varias opciones generadas con un
   servicio externo (DiceBear); "sin avatar" vuelve a las iniciales. */
.avatar-opcion { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--border-color); background: var(--surface-2); cursor: pointer; padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; transition: transform .15s, border-color .15s; }
.avatar-opcion:hover { transform: scale(1.05); }
.avatar-opcion.seleccionada { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.avatar-opcion img { width: 100%; height: 100%; object-fit: cover; }
.avatar-opcion-iniciales { font-weight: 800; font-size: 16px; color: var(--text-muted); }
.sidebar-user-info .user-name { font-size: 13px; font-weight: 700; color: var(--text-light); line-height: 1.2; }
.sidebar-user-info .user-role { font-size: 11px; color: var(--text-muted-light); font-weight: 600; text-transform: capitalize; }
.sidebar-user-btn i.chevron { color: var(--text-muted-light); transition: transform 0.3s; }

/* Dropdown Menu de Configuración */
.config-dropdown { position: absolute; bottom: calc(100% + 10px); left: 16px; right: 16px; background: var(--dropdown-bg, #1e293b); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.25s cubic-bezier(0.16,1,0.3,1); z-index: 50; overflow: hidden; }
.config-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.config-menu-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.15); }
.config-menu-header p { margin: 0; font-size: 11px; font-weight: 700; color: var(--text-muted-light); text-transform: uppercase; letter-spacing: 0.5px; }
.config-menu-list { list-style: none; padding: 8px; }
.config-menu-list li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text-light); transition: all 0.2s; }
.config-menu-list li a i { width: 16px; height: 16px; color: var(--text-muted-light); }
.config-menu-list li a:hover { background: rgba(255,255,255,0.08); }
.config-menu-list li.logout-item a { color: #fca5a5; margin-top: 4px; border-top: 1px dashed rgba(255,255,255,0.08); border-radius: 0 0 8px 8px; padding-top: 12px; }
.config-menu-list li.logout-item a i { color: #fca5a5; }

/* ===== MAIN CONTENT ===== */
.main-content { flex-grow: 1; padding: 32px 36px; overflow-y: auto; scroll-behavior: smooth; position: relative; z-index: 10; }
.bento-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.bento-box { background: var(--panel); border: 1px solid var(--border-color); border-radius: 20px; padding: 28px; box-shadow: var(--card-shadow); transition: all 0.25s ease; }
.bento-box:hover { box-shadow: var(--card-hover-shadow); }

/* Standard Cards (for secondary pages) */
.card { background: var(--panel); border-radius: 20px; border: 1px solid var(--border-color); box-shadow: var(--card-shadow); margin-bottom: 32px; overflow: hidden; transition: box-shadow 0.25s ease; }
.card:hover { box-shadow: var(--card-hover-shadow); }
.card-header { padding: 24px 32px; border-bottom: 1px solid var(--border-color); background: var(--panel); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.card-title { font-size: 16px; font-weight: 800; color: var(--text-dark); display: flex; align-items: center; gap: 10px; margin:0; }
.card-body { padding: 32px; }
.card-body.no-padding { padding: 0; }

/* Page Header */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.5px; }
.page-header p { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* Alerts */
.alert-msg { background: var(--panel); color: var(--primary-light); padding: 16px 20px; border-radius: 14px; border: 1px solid var(--border-color); margin-bottom: 28px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--card-shadow); }

/* Forms & Inputs */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 12px; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; text-transform: uppercase; }
input, select, textarea { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-color); font-size: 14px; outline: none; transition: all 0.2s; color: var(--text-dark); font-family: 'Poppins', sans-serif; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-light); background: var(--panel); box-shadow: 0 0 0 4px rgba(37,99,235,0.06); }

/* Buttons */
.btn-main { background: var(--primary-light); color: white; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: 'Poppins', sans-serif; font-size: 14px; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59,130,246,0.3); background: var(--primary); color: white; }
.btn-action { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--panel); color: var(--text-muted); cursor: pointer; transition: all 0.2s; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-action:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(59,130,246,0.05); }
.btn-primary { background: var(--primary-light); color: white; border: none; cursor: pointer; transition: all 0.2s; font-family: 'Poppins', sans-serif; font-weight: 700; }
.btn-primary:hover { background: var(--primary); }

/* Empty / placeholder states (listas vacías, resultados sin datos) */
.empty-state { grid-column: 1 / -1; background: var(--panel); border-radius: 20px; border: 1px dashed var(--border-color); padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; font-weight: 500; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 14px 32px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; border-bottom: 1px solid var(--border-color); }
td { padding: 16px 32px; border-bottom: 1px solid var(--border-color); font-size: 14px; color: var(--text-dark); }
tr:last-child td { border-bottom: none; }
tr:hover { background: rgba(15,23,42,0.02); }

/* Table Grouping (Admin Panel) */
.grade-group-header { background: var(--bg-color); padding: 12px 32px; font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); }


/* User Info in Tables */
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar.est { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar.doc { background: linear-gradient(135deg, #10b981, #059669); }
.u-name { font-weight: 700; color: var(--text-dark); display: block; }
.u-email { font-size: 12px; color: var(--text-muted); }

/* Badges */
.badge { padding: 4px 10px; border-radius: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; display: inline-block; text-align: center;}
.badge.activo { background: rgba(16,185,129,0.15); color: #10b981; }
.badge.inactivo { background: rgba(239,68,68,0.15); color: #ef4444; }
/* Rol del usuario (ADMIN/DOCENTE/ESTUDIANTE) en admin_panel.php — antes vivía como style="" inline. */
.badge.rol { background: rgba(37,99,235,0.15); color: #1e40af; }

/* ===== Carga masiva de usuarios (admin_panel.php) =====
   Antes vivía como <style> inline dentro de la página, con los mismos
   colores repetidos literalmente. .result-item/.summary-pill son la
   misma familia que .alert-box/.yago-toast (mensaje de estado fijo,
   deliberadamente igual en claro/oscuro) — se preserva ese criterio. */
.upload-zone { border: 2px dashed var(--border-color); border-radius: 20px; padding: 48px 32px; text-align: center; cursor: pointer; transition: all 0.3s; background: var(--surface-2); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary-light); background: var(--stat-icon-blue-bg); }
.upload-zone i { color: var(--text-muted-light); margin-bottom: 16px; }
.upload-zone.dragover i { color: var(--primary-light); }
.upload-zone h3 { font-size: 18px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: var(--text-muted); }
.progress-bar-wrap { background: var(--border-color); border-radius: 99px; height: 8px; overflow: hidden; margin: 16px 0; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); border-radius: 99px; transition: width 0.4s ease; width: 0%; }
.result-item { padding: 10px 14px; border-radius: 10px; font-size: 12px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: flex-start; gap: 8px; }
.result-item.creado  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.result-item.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.result-item.omitido { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.summary-pills { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.summary-pill { padding: 8px 16px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.pill-green  { background: #ecfdf5; color: #065f46; }
.pill-red    { background: #fef2f2; color: #991b1b; }
.pill-yellow { background: #fffbeb; color: #92400e; }
.pill-blue   { background: #eff6ff; color: #1e40af; }
.csv-template-box { background: #0f1f45; border-radius: 12px; padding: 16px 20px; font-family: monospace; font-size: 12px; color: #93c5fd; margin-top: 12px; overflow-x: auto; white-space: nowrap; }
.step-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: white; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Tabs Bar */
.tabs-bar { display: flex; gap: 8px; margin-bottom: 32px; background: rgba(15,23,42,0.05); padding: 6px; border-radius: 16px; width: fit-content; flex-wrap: wrap; }
.tab-btn { padding: 10px 20px; border-radius: 12px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--text-muted); transition: all 0.2s; display: flex; align-items: center; gap: 8px; }
.tab-btn.active { background: var(--panel); color: var(--primary); box-shadow: var(--card-shadow); }

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,37,64,0.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 1000; animation: fadeIn 0.3s; }
.modal-content { background: var(--panel); width: 90%; max-width: 550px; border-radius: 24px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); border: 1px solid var(--border-color); }
.modal-header { padding: 24px 32px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; color: var(--text-dark); font-weight: 700; font-size: 18px; }
.modal-body { padding: 32px; max-height: 70vh; overflow-y: auto; color: var(--text-dark); }
.modal-footer { padding: 20px 32px; background: var(--bg-color); border-top: 1px solid var(--border-color); text-align: right; display:flex; justify-content: flex-end; gap: 10px;}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================
   SHARED SECONDARY-PAGE COMPONENTS
   (Banner de bienvenida, stat cards, badges de riesgo,
   tabs de grado, filtros, reportes) — usados por perfil.php,
   docente_dashboard.php, reporte_notas.php, asignar_libros.php
   para que TODAS las páginas compartan el mismo lenguaje visual
   azul/blanco en vez de depender de estilos locales duplicados.
   ===================================================== */

/* ----- Welcome / Page Banner (azul degradado, texto blanco) ----- */
.welcome-banner, .page-banner {
    grid-column: span 12;
    /* --banner-imagen (opcional, colegio_config.banner_imagen_url) se
       superpone al degradado/color de siempre con una capa de
       oscurecido para que el texto blanco del banner siga siendo
       legible sobre cualquier imagen. Sin imagen, --banner-imagen cae
       al "none" del propio var() y el resultado es igual a antes. */
    background: linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.15)), var(--banner-imagen, none) center/cover no-repeat, var(--banner-bg);
    color: var(--banner-text);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
    position: relative; overflow: hidden;
    padding: 36px 40px; border: none; border-radius: 24px;
    box-shadow: 0 15px 35px rgba(37,99,235,0.15);
    margin-bottom: 28px;
}
.welcome-banner::before, .page-banner::before {
    content: ""; position: absolute; top: -50%; right: -10%; width: 60%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    filter: blur(45px); z-index: 0; pointer-events: none;
}
.welcome-banner::after, .page-banner::after {
    content: ""; position: absolute; bottom: -50%; left: 20%; width: 40%; height: 150%;
    background: radial-gradient(circle, rgba(59,130,246,0.35) 0%, transparent 60%);
    filter: blur(40px); z-index: 0; pointer-events: none;
}
.welcome-banner h1, .page-banner h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; z-index: 1; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; color: var(--banner-text); }
.welcome-banner p, .page-banner p { font-size: 14px; color: var(--banner-subtext); font-weight: 400; z-index: 1; position: relative; line-height: 1.6; max-width: 620px; margin: 0; }
.welcome-badges { display: flex; gap: 10px; z-index: 1; position: relative; margin-top: 16px; flex-wrap: wrap; }
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-pill.role { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); color: #ffffff; backdrop-filter: blur(8px); }
/* Variante verde para info secundaria sobre el banner (ej. grado del estudiante en perfil.php) — antes vivía como style="" literal en la página. */
.badge-pill.role.exito { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: #a7f3d0; }

/* Botones dentro del banner (imprimir, exportar, etc.) */
.banner-buttons, .report-header-buttons { display: flex; gap: 10px; flex-wrap: wrap; z-index: 1; position: relative; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 13px; text-decoration: none; cursor: pointer; border: none; transition: all 0.2s; font-family: 'Poppins', sans-serif; }
.btn-ghost { background: rgba(255,255,255,0.18); color: #ffffff; border: 1px solid rgba(255,255,255,0.35); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,0.3); transform: translateY(-1px); }
.btn-ghost-dark { background: var(--panel); color: var(--primary); border: 1px solid var(--border-color); }
.btn-ghost-dark:hover { border-color: var(--primary-light); background: rgba(37,99,235,0.06); }

/* ----- Stat Cards (fila de métricas rápidas) ----- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--panel); border: 1px solid var(--border-color); border-radius: 18px; padding: 20px 22px; display: flex; align-items: center; gap: 16px; box-shadow: var(--card-shadow); transition: all 0.25s ease; }
.stat-card:hover { box-shadow: var(--card-hover-shadow); transform: translateY(-2px); }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

/* ----- Stat Icon (ficha de dos tonos: fondo suave + ícono sólido) -----
   Dirección 1 (Geométrico dual-tono, elegida 18-ago-2026): antes vivía
   solo como copia local en dashboard.php — docente_dashboard.php usa
   las mismas clases (.stat-card > .stat-icon + .stat-info) pero se
   renderizaban sin ningún estilo por no existir acá. Ficha redondeada
   en vez de círculo (identidad de la dirección elegida), sin borde ni
   sombra de color — esas dos capas extra eran lo que hacía sentir
   "saturado"; el fondo tintado (--stat-icon-*-bg) + el ícono sólido ya
   son los dos tonos, no hace falta una tercera/cuarta capa de color. */
.stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon i, .stat-icon svg { width: 24px; height: 24px; stroke-width: 2.2; }
.stat-icon.blue   { background: var(--stat-icon-blue-bg);   color: var(--accent-blue); }
.stat-icon.green  { background: var(--stat-icon-green-bg);  color: var(--accent-green); }
.stat-icon.purple { background: var(--stat-icon-purple-bg); color: var(--accent-purple); }
.stat-icon.amber  { background: var(--stat-icon-amber-bg);  color: var(--accent-amber); }
.stat-icon.red    { background: var(--stat-icon-red-bg);    color: var(--danger); }

.stat-info h3 { font-size: 26px; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: 4px; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.stat-info span { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

/* ----- Summary / Filter Grids ----- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.filter-card { background: var(--panel); border: 1px solid var(--border-color); border-radius: 18px; padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--card-shadow); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: end; }
.filter-group label { display: block; font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ----- Charts ----- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 28px; }
.chart-card, .chart-container { background: var(--panel); border: 1px solid var(--border-color); border-radius: 18px; padding: 22px 24px; box-shadow: var(--card-shadow); }
.chart-card-title { font-size: 14px; font-weight: 800; color: var(--text-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.chart-card-title i { width: 18px; height: 18px; color: var(--primary); }

/* ----- Grade Tabs (Aula Virtual) ----- */
.grade-tabs { display: flex; gap: 8px; margin-bottom: 24px; background: rgba(15,23,42,0.05); padding: 6px; border-radius: 16px; width: fit-content; flex-wrap: wrap; }
.grade-tab { padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif; }
.grade-tab i { width: 15px; height: 15px; }
.grade-tab.active { background: var(--panel); color: var(--primary); box-shadow: var(--card-shadow); }
.grade-content { display: none; }
.grade-content.active { display: block; animation: pageEnter 0.4s ease; }

/* ----- Student rows / cells ----- */
.student-cell { display: flex; align-items: center; gap: 12px; }
.student-avatar { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #2563eb); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.student-name { font-weight: 700; color: var(--text-dark); }
.student-email { font-size: 12px; color: var(--text-muted); }

/* ----- Risk / Score badges ----- */
.risk-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }
.risk-badge.excellent { background: rgba(5,150,105,0.12); color: #047857; }
.risk-badge.average { background: rgba(217,119,6,0.12); color: #b45309; }
.risk-badge.at-risk { background: rgba(220,38,38,0.12); color: #b91c1c; }
.risk-badge.no-data { background: rgba(100,116,139,0.12); color: #475569; }

.score-pill { display: inline-flex; align-items: center; justify-content: center; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; min-width: 48px; font-variant-numeric: tabular-nums; }
.score-pill.score-high { background: rgba(5,150,105,0.12); color: #047857; }
.score-pill.score-mid { background: rgba(217,119,6,0.12); color: #b45309; }
.score-pill.score-low { background: rgba(220,38,38,0.12); color: #b91c1c; }
.score-pill.score-zero { background: rgba(100,116,139,0.12); color: #475569; }
.cap-badge { background: rgba(37,99,235,0.08); color: var(--primary); padding: 4px 12px; border-radius: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ----- Report sections ----- */
.report-section { background: var(--panel); border: 1px solid var(--border-color); border-radius: 18px; margin-bottom: 22px; overflow: hidden; box-shadow: var(--card-shadow); }
.report-section-header { padding: 18px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; background: var(--bg-color); }
.report-section-title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-dark); font-size: 14px; flex-wrap: wrap; }
.table-wrap, .table-container { overflow-x: auto; }

/* Agrupador por Bloque (reporte_notas.php, 24-ago-2026): un nivel arriba
   de .report-section (que ya representa un TEMA) — el libro se organiza
   en bloques[].temas[], y el reporte impreso/en pantalla ahora respeta
   esa misma jerarquía en vez de listar todos los temas sueltos uno tras
   otro. print-color-adjust fuerza que Chrome imprima el degradado del
   encabezado en vez de descartarlo (el comportamiento por defecto al
   imprimir es quitar fondos de color para ahorrar tinta). */
.bloque-group { margin-bottom: 32px; }
.bloque-group-header {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 20px; border-radius: 16px 16px 0 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; font-weight: 800; font-size: 15px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.bloque-group-header i { width: 18px; height: 18px; flex-shrink: 0; }
.bloque-group-count { margin-left: auto; font-size: 12px; font-weight: 600; opacity: 0.85; }
.bloque-group-body { border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 16px 16px; padding: 18px; background: var(--bg-color); }
.bloque-group-body .report-section:last-child { margin-bottom: 0; }

/* ----- Misc content blocks ----- */
.libro-section { padding: 8px 0; border-bottom: 1px dashed var(--border-color); }
.libro-section:last-child { border-bottom: none; }
.libro-header { font-size: 13px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.libro-header i { width: 15px; height: 15px; color: var(--primary); }
.matrix-dot { transition: transform 0.15s; }
.matrix-dot:hover { transform: scale(1.25); }
.empty-msg, .no-data { text-align: center; color: var(--text-muted); font-size: 13.5px; font-weight: 500; padding: 24px 12px; }
.no-data { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--panel); border: 1px dashed var(--border-color); border-radius: 16px; }
.no-data i { width: 32px; height: 32px; color: #94a3b8; }

/* ----- Perfil: preferencias, formularios, alertas ----- */
.profile-form-grid, .preferences-grid { grid-column: span 12; }
.box-title { font-size: 15px; font-weight: 800; color: var(--text-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.box-title i { width: 18px; height: 18px; color: var(--primary); }
.alert-box { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.alert-box.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-box.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
/* Aviso informativo (ej. "copia al primer cambio" en libro_editar_catalogo.php)
   — misma familia deliberadamente invariante que .success/.error. */
.alert-box.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-box i { width: 18px; height: 18px; flex-shrink: 0; }

/* Banner de "modo soporte" (Fase 4, CLAUDE.md §8): visible en las páginas
   del colegio mientras un miembro de staff impersona al admin para dar
   soporte. Ver includes/impersonacion_banner.php. Usa var(--warn), no un
   literal nuevo — sigue la regla de §4.4.
   position:fixed a propósito: body{display:flex} en estas páginas hace
   que cualquier hijo normal compita por ancho con .sidebar/.main-content
   en el eje principal (fila) — fixed lo saca de ese flujo por completo.
   body.modo-soporte-activo reserva el alto exacto del banner para que no
   tape el borde superior del sidebar/contenido (ver el <body> de cada
   página en alcance). */
.modo-soporte-banner { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--warn); color: #fff; font-size: 13px; font-weight: 600; z-index: 999; }
.modo-soporte-banner a { color: #fff; border: 1px solid rgba(255, 255, 255, 0.6); padding: 4px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.modo-soporte-banner a:hover { background: rgba(255, 255, 255, 0.15); }
body.modo-soporte-activo { padding-top: 44px; }
.btn-save { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-light); color: white; border: none; padding: 12px 26px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; transition: all 0.2s; font-family: 'Poppins', sans-serif; margin-top: 8px; }
.btn-save:hover { background: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,0.3); }
/* Estado de carga (18-ago-2026, pedido del usuario) — initFormLoadingState()
   en yago_global.js lo activa solo mientras el formulario está en
   camino al servidor, para que no parezca que el clic no hizo nada. */
.btn-save:disabled { opacity: 0.75; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: btnSpin 0.7s linear infinite; flex-shrink: 0; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

.pref-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.pref-option:last-child { border-bottom: none; }
.pref-details h4 { font-size: 13.5px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.pref-details p { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.select-custom select { width: auto; min-width: 140px; padding: 8px 14px; }

/* Toggle switch (usado en Preferencias) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: 0.3s; border-radius: 24px; }
.switch .slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background-color: var(--primary-light); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ----- Impresión: encabezado/pie exclusivos de reportes ----- */
.print-header, .print-footer { display: none; }
.print-header-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.print-header-brand img { width: 44px; height: 44px; object-fit: contain; }
.print-header-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; color: #334155; margin: 8px 0; }
.print-header-meta strong { color: #0f172a; }
.print-confidential { font-size: 10px; color: #b91c1c; font-weight: 700; }
@media print {
    .print-header { display: block !important; margin-bottom: 18px; border-bottom: 2px solid #0f172a; padding-bottom: 12px; }
    .print-header h2 { font-size: 17px; margin-bottom: 2px; }
    .print-header p { font-size: 11px; color: #475569; margin: 2px 0; }
    .print-footer { display: block !important; margin-top: 24px; font-size: 10px; color: #64748b; border-top: 1px solid #cbd5e1; padding-top: 10px; }
    .mobile-hamburger, .mobile-overlay { display: none !important; }

    /* Reporte de calificaciones (reporte_notas.php): controles interactivos
       fuera, jerarquía de bloques con saltos de página sensatos. Las
       columnas de "Ver Respuesta"/toggles no aportan nada en papel. */
    .report-header-buttons, .filter-card, .no-print-link,
    .report-section-header button, .report-section table button,
    .bloque-group-header a, .report-section-header a {
        display: none !important;
    }
    .bloque-group { break-inside: avoid-page; page-break-inside: avoid; }
    .bloque-group-header { break-after: avoid-page; page-break-after: avoid; }
    .bloque-group-body { border-color: #cbd5e1; }
    .report-section { box-shadow: none !important; border: 1px solid #cbd5e1 !important; }
    .report-section-header { break-after: avoid-page; page-break-after: avoid; background: #f8fafc !important; }
    /* Si un bloque no entra completo, que al menos no corte una fila de
       estudiante a la mitad. */
    .report-section tr { break-inside: avoid; page-break-inside: avoid; }
}

/* ----- Resumen de una hoja por unidad (resumen_unidad.php, 24-ago-2026)
   ----- pedido explícito: "resumen en una hoja... por cada alumno o
   masivo". Cada .resumen-hoja es un estudiante completo — en pantalla se
   ven apiladas con espacio entre ellas; al imprimir, cada una ocupa su
   propia página (salvo la última). */
/* Sin .sidebar/.main-content a propósito (es un documento imprimible, no
   una pantalla de la app — mismo criterio que
   admin_panel.php::imprimirCredenciales()) — pero body{display:flex;
   height:100vh; overflow:hidden} de arriba está pensado para el armazón
   sidebar+contenido de TODA la plataforma y se aplica igual acá: sin
   este reset, las hojas quedaban en fila (flex-direction:row) en vez de
   apiladas, y el alto se recortaba a una sola pantalla. Hallazgo real,
   24-ago-2026. */
body.pagina-resumen-unidad { display: block; height: auto; min-height: 100vh; overflow: visible; background: var(--bg-color); padding: 24px 16px; }
.resumen-hoja { max-width: 800px; margin: 0 auto 40px; background: var(--panel); border: 1px solid var(--border-color); border-radius: 16px; padding: 32px; box-shadow: var(--card-shadow); }
.resumen-encabezado { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--border-color); padding-bottom: 16px; margin-bottom: 18px; }
.resumen-encabezado img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.resumen-encabezado h2 { margin: 0; font-size: 18px; }
.resumen-encabezado p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.resumen-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px; }
.resumen-meta strong { color: var(--text-dark); }
.resumen-promedio-box { text-align: center; padding: 18px; border-radius: 14px; margin: 20px 0; }
.resumen-promedio-box .valor { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.resumen-promedio-box .etiqueta { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
/* Mismos 4 tonos que .score-pill.score-* (no colores nuevos, la misma
   escala ya sancionada en este archivo) — solo un tamaño mayor. */
.resumen-promedio-box.score-high { background: rgba(5,150,105,0.12); color: #047857; }
.resumen-promedio-box.score-mid { background: rgba(217,119,6,0.12); color: #b45309; }
.resumen-promedio-box.score-low { background: rgba(220,38,38,0.12); color: #b91c1c; }
.resumen-promedio-box.score-zero { background: rgba(100,116,139,0.12); color: #475569; }
.resumen-feedback { background: var(--surface-2); border: 1px solid var(--border-color); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.resumen-feedback-tema { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.resumen-feedback p { margin: 0; font-size: 13px; color: var(--text-dark); white-space: pre-wrap; }
.resumen-firma { display: flex; gap: 32px; margin-top: 52px; }
.resumen-firma-linea { flex: 1; border-top: 1px solid var(--text-muted); padding-top: 6px; font-size: 11px; color: var(--text-muted); text-align: center; }
@media print {
    .resumen-print-toolbar { display: none !important; }
    .resumen-hoja { box-shadow: none !important; border: none !important; border-radius: 0; max-width: 100%; margin: 0; padding: 0; page-break-after: always; }
    .resumen-hoja:last-child { page-break-after: auto; }
    body { background: white !important; }
}

/* ===== RESPONSIVE MÓVIL GLOBALES ===== */
.mobile-menu-btn, .mobile-hamburger { display: none; position: fixed; top: 12px; left: 12px; background: var(--bg-sidebar); color: white; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 2000; cursor: pointer; font-size: 18px; }
.sidebar-overlay, .mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; backdrop-filter: blur(3px); }
.sidebar-overlay.active, .mobile-overlay.show { display: block; }

@media (max-width: 900px) {
    body { flex-direction: row !important; overflow: hidden !important; height: 100vh !important; }
    .mobile-menu-btn, .mobile-hamburger { display: flex !important; }
    .sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        width: 270px !important;
        height: 100vh !important;
        z-index: 999 !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
    }
    .sidebar.mobile-open, .sidebar.open { left: 0 !important; box-shadow: 10px 0 40px rgba(0,0,0,0.4) !important; }
    .main-content { padding: 20px 16px 40px !important; padding-top: 70px !important; overflow-y: auto; }
    
    .bento-container { flex-direction: column; display: flex; }
    .books-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }

    .card-header { flex-direction: column; align-items: flex-start; }
    .filters { width: 100%; flex-wrap: wrap; margin-top: 10px; }
    .filters input, .filters select { flex: 1 1 100%; }
}
@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr !important; }
}

/* ===== SELECTOR DE PALETA + VISTA PREVIA (marca_colegio.php, 18-ago-2026) ===== */
.paletas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.paleta-chip { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; border: 2px solid var(--border-color); background: var(--panel); cursor: pointer; transition: border-color .15s, transform .15s; text-align: left; }
.paleta-chip:hover { transform: translateY(-2px); }
.paleta-chip.activa { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.paleta-chip-franjas { display: flex; height: 28px; border-radius: 8px; overflow: hidden; }
.paleta-chip-franjas span { flex: 1; }
.paleta-chip-nombre { font-size: 12px; font-weight: 700; color: var(--text-dark); }

.color-fino-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.color-fino-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--surface-2); }
.color-fino-item label { font-size: 12px; font-weight: 700; color: var(--text-dark); flex-grow: 1; }
.color-fino-item input[type="color"] { width: 40px; height: 40px; border: none; border-radius: 8px; cursor: pointer; background: none; padding: 0; flex-shrink: 0; }
.color-fino-hex { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text-muted); width: 72px; text-align: right; flex-shrink: 0; }

.marca-preview { border-radius: 18px; border: 1px solid var(--border-color); overflow: hidden; background: var(--panel); }
.marca-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.marca-preview-header strong { font-size: 13px; color: var(--text-dark); }
.marca-preview-toggle { display: flex; gap: 4px; background: var(--surface-2); border-radius: 20px; padding: 3px; }
.marca-preview-toggle button { border: none; background: none; padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.marca-preview-toggle button.activo { background: var(--primary); color: #fff; }
.marca-preview-mock { display: flex; min-height: 220px; transition: background .2s, color .2s; }
.marca-preview-mock.tema-claro { background: #eef1f8; color: #0f172a; }
.marca-preview-mock.tema-oscuro { background: #0b0f19; color: #f1f5f9; }
.marca-preview-sidebar { width: 30%; min-width: 110px; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: background .2s; }
.marca-preview-sidebar img { max-width: 36px; max-height: 36px; border-radius: 8px; background: #fff; object-fit: contain; }
.marca-preview-sidebar span { font-size: 10px; font-weight: 700; text-align: center; color: #fff; line-height: 1.3; }
.marca-preview-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.marca-preview-banner { border-radius: 12px; padding: 16px; color: #fff; transition: background .2s; }
.marca-preview-banner strong { display: block; font-size: 14px; margin-bottom: 4px; }
.marca-preview-banner span { font-size: 11px; opacity: .85; }
.marca-preview-btn { align-self: flex-start; padding: 8px 16px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 700; transition: background .2s; }
.marca-preview-nota { font-size: 11px; color: var(--text-muted); padding: 10px 18px; border-top: 1px solid var(--border-color); }
.marca-preview-aviso { font-size: 11px; color: var(--danger, #dc2626); padding: 0 18px 12px; }

/* ===== IMPRESIÓN SEGURA GLOBALES ===== */
@media print {
    .sidebar, .tabs-bar, .btn-action, .modal, .config-dropdown,
    .alert-msg, .filters, .filters input, .filters select,
    form, .card-header > div:last-child, .mobile-menu-btn, .sidebar-overlay {
        display: none !important;
    }
    /* Scopeado a .admin-users-table (admin_panel.php, pestaña Usuarios) a
       propósito — antes era un selector `table` a secas y sin querer
       también le comía columnas reales (Estudiante, Última Actividad) a
       la tabla de reporte_notas.php al imprimir. Hallazgo real, 24-ago-2026. */
    .admin-users-table th:nth-child(2), .admin-users-table td:nth-child(2) { display: none !important; }
    .admin-users-table th:last-child, .admin-users-table td:last-child { display: none !important; }
    .u-email { display: none !important; }
    body { background: white !important; height: auto !important; overflow: visible !important; display: block !important; }
    .main-content { overflow: visible !important; padding: 20px !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
    .page-header::after { content: ' — Confidencial: Solo uso interno del Colegio Privado Yago'; font-size: 11px; color: #666; display: block; margin-top: 10px; }
}
