:root {
    --primary: #052b91;
    --accent: #488a99;
    --secondary: #B4B4B4;
    --bg: #F4F7F8;
    --white: #ffffff;
    --success: #488a99;
    --danger: #e63946;
    --text-main: #2a3435;
    --shadow: 0 8px 30px rgba(63, 78, 79, 0.08);
    --glass: rgba(255, 255, 255, 0.98);

    /* Evolución Visual Módulo Facturación (SaaS Modern) */
    --fact-blue: #3d7cff;
    --fact-green: #10c57b;
    --fact-orange: #ff9800;
    --fact-purple: #8a55ff;
    --fact-bg-soft: rgba(218, 218, 218, 0.89);
    --fact-shadow: 0 10px 30px rgba(32, 54, 110, 0.08);
    --fact-radius: 20px;

    /* ── LOGIN FUTURISTIC TOKENS (solo para la pantalla de login) ── */
    --login-neon-cyan: #00d4ff;
    --login-neon-blue: #2563ff;
    --login-neon-violet: #7c3aed;
    --login-dark-bg: #060d1f;
    --login-card-bg: rgba(8, 18, 46, 0.78);
    --login-border-glow: rgba(0, 212, 255, 0.20);
    --login-text-muted: rgba(160, 200, 220, 0.75);

    /* Touch targets */
    --touch-min: 44px;

    /* Spacing scale */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 30px;
    --space-xl: 40px;
    --space-2xl: 60px;
}

/* =====================================================
   BASE RESET & BODY
   ===================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll on all devices */
    max-width: 100vw;
    height: 100%;
    /* Safe area support for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   MÓDULO FACTURACIÓN (SaaS Modern)
   ===================================================== */
.fact-section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.fact-header-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    /* prevent shrinking */
    background: linear-gradient(135deg, var(--fact-blue), #7bb1ff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 10px 20px rgba(61, 124, 255, 0.2);
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin-bottom: var(--space-lg);
}

.fact-action-card {
    background: white;
    border-radius: var(--fact-radius);
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--fact-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Prevent card text from overflowing */
    overflow: hidden;
    word-break: break-word;
}

.fact-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(32, 54, 110, 0.12);
}

/* Disable hover lift on touch to avoid sticky states */
@media (hover: none) {
    .fact-action-card:hover {
        transform: none;
    }
}

.fact-stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border-left: 5px solid var(--fact-blue);
    box-shadow: var(--fact-shadow);
    overflow: hidden;
}

.fact-stat-card.green {
    border-left-color: var(--fact-green);
}

.fact-stat-card.orange {
    border-left-color: var(--fact-orange);
}

.fact-stat-card .val {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 800;
    margin: 5px 0;
    color: #1a202c;
}

/* =====================================================
   MODALS / POPUPS — TEST INFORMATIVO
   ===================================================== */
.test-modal-overlay {
    position: fixed;
    inset: 0;
    /* top/right/bottom/left = 0 */
    width: 100%;
    height: 100%;
    /* Use dvh for mobile browsers with dynamic toolbars */
    height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Padding so modal never touches screen edges */
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    /* Allow scrolling the overlay if modal is taller than viewport */
    -webkit-overflow-scrolling: touch;
}

.test-modal-content {
    background: var(--white);
    width: 100%;
    max-width: 900px;
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #eef1f2;
    animation: fadeInModal 0.4s ease-out;
    /* Constrain height so content scrolls inside the modal */
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.test-modal-body {
    padding: 16px;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.test-modal-iframe {
    width: 100%;
    height: 450px;
    border: none;
    border-radius: 10px;
}

.modal-img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    margin: 0 auto;
}

.test-modal-footer {
    padding: 24px 30px;
    background: #F8FAFB;
    text-align: center;
    border-top: 1px solid #eef1f2;
    /* Stick to bottom of modal */
    flex-shrink: 0;
}

/* =====================================================
   VIEW SECTIONS
   ===================================================== */
.view-section {
    display: none;
    /* Force full viewport height */
    height: 100dvh;
    height: 100vh;
    min-height: unset;
}

.view-section.active {
    display: flex;
}

/* =====================================================
   LOGIN SCREEN
   ===================================================== */
/* ╔══════════════════════════════════════════════════════════════╗
   ║          LOGIN SCREEN — VISUAL UPGRADE FUTURISTA             ║
   ║  Todo lo que está en esta sección es SOLO del login.         ║
   ║  El resto del sistema (dashboard, sidebar, tablas, etc.)     ║
   ║  NO se ve afectado. Las variables --login-* son exclusivas.  ║
   ║                                                              ║
   ║  GUÍA RÁPIDA DE EDICIÓN:                                     ║
   ║  • Colores neón    → busca: rgba(0, 212, 255, ...)           ║
   ║  • Azul            → busca: #2563ff                          ║
   ║  • Violeta/morado  → busca: #7c3aed                          ║
   ║  • Transparencias  → busca: rgba(..., 0.XX)                  ║
   ║  • Sombras glow    → busca: box-shadow / text-shadow         ║
   ╚══════════════════════════════════════════════════════════════╝ */


/* ─────────────────────────────────────────────────────────────────
   🌌 FONDO GENERAL DE LA PANTALLA DE LOGIN
   ─────────────────────────────────────────────────────────────────
   Qué es: el fondo azul oscuro que se ve detrás de la card.
   Cómo editarlo:
     · Para más oscuro → sube los últimos valores de linear-gradient
       ej: #060d1f → #020810
     · Para cambiar el color del resplandor izquierdo → cambia el
       primer radial-gradient (actualmente azul eléctrico)
     · Para cambiar el resplandor derecho → segundo radial-gradient
       (actualmente cyan suave)
   ───────────────────────────────────────────────────────────────── */
.login-screen {
    position: relative;
    /* ← necesario para que el canvas se posicione dentro */
    background:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(0, 80, 200, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(0, 212, 255, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 100% 80% at 50% 100%, rgba(37, 99, 255, 0.12) 0%, transparent 60%),
        linear-gradient(160deg, #060d1f 0%, #0a1632 40%, #06122b 100%);
}

.login-screen.active {
    flex-direction: column;
    display: flex;
}


/* ─────────────────────────────────────────────────────────────────
   🌟 CANVAS DE PARTÍCULAS (#login-particles)
   ─────────────────────────────────────────────────────────────────
   Qué es: el lienzo invisible que dibuja las partículas animadas.
   Está fijo detrás de todo el contenido del login.
   Cómo editarlo:
     · Para subir/bajar la intensidad del efecto → edita
       PARTICLES_CONFIG en login-particles.js (no aquí)
     · Para desactivar el efecto completamente → pon display: none
     · z-index: 0 = detrás de todo. No lo subas o tapará el formulario.
   ───────────────────────────────────────────────────────────────── */
#login-particles {
    position: absolute;
    /* ← posicionado dentro de .login-screen */
    inset: 0;
    /* ← ocupa todo el alto y ancho del login */
    width: 100%;
    height: 100%;
    z-index: 0;
    /* ← detrás de navbar y card */
    pointer-events: none;
    /* ← el canvas NO bloquea clics ni inputs */
    display: block;
}

/* Asegura que navbar y card queden ENCIMA del canvas */
.login-screen .navbar-login,
.login-screen .wrapper-login {
    position: relative;
    /* ← necesario para que z-index funcione */
    z-index: 1;
    /* ← encima del canvas */
}


/* ─────────────────────────────────────────────────────────────────
   🔲 BARRA DE NAVEGACIÓN SUPERIOR (navbar del login)
   ─────────────────────────────────────────────────────────────────
   Qué es: la barra donde aparece el logo y los links Inicio /
   Nosotros / Servicios / botón Ingresa.
   Sin cambios de fondo — hereda el fondo oscuro del login-screen.
   ───────────────────────────────────────────────────────────────── */
.navbar-login {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px var(--space-2xl);
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-login {
    background-color: transparent;
    padding: 20px;
}

.logo-login img {
    display: block;
    max-width: 100%;
    height: 40px;
    width: auto;
}

.menu-login {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}


/* ─────────────────────────────────────────────────────────────────
   🔗 LINKS DE NAVEGACIÓN (Inicio / Nosotros / Servicios)
   ─────────────────────────────────────────────────────────────────
   Qué es: los tres textos clickeables en la navbar.
   Cómo editarlo:
     · Color del texto en reposo → color: rgba(200, 220, 240, 0.82)
       Sube el último número (0.82) para más blanco, bájalo para
       más apagado. Ej: 1.0 = blanco puro, 0.5 = muy tenue.
     · Color al pasar el mouse → color: var(--login-neon-cyan)
       Cámbialo por cualquier color hex o rgba.
   ───────────────────────────────────────────────────────────────── */
.menu-login a {
    margin: 0 12px;
    text-decoration: none;
    color: rgba(200, 220, 240, 0.82);
    /* ← COLOR TEXTO LINKS NAVBAR */
    font-weight: 500;
    font-size: 0.9rem;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.menu-login a:hover {
    color: var(--login-neon-cyan);
    /* ← COLOR HOVER LINKS NAVBAR */
}


/* ─────────────────────────────────────────────────────────────────
   🟣 BOTÓN "INGRESA" (navbar, esquina superior derecha)
   ─────────────────────────────────────────────────────────────────
   Qué es: el botón azul-violeta en la barra superior.
   Cómo editarlo:
     · Gradiente del botón → background: linear-gradient(...)
       Primer color: var(--login-neon-blue) = azul (#2563ff)
       Segundo color: var(--login-neon-violet) = violeta (#7c3aed)
     · Brillo del borde → border: 1px solid rgba(0, 212, 255, 0.30)
       Sube 0.30 → más visible, bájalo → más sutil
     · Halo de luz exterior → box-shadow: 0 0 18px rgba(37, 99, 255, 0.30)
       Cambia el último número para más/menos brillo
   ───────────────────────────────────────────────────────────────── */
.ingresa-btn {
    padding: 8px 20px;
    border-radius: 10px;
    color: white !important;
    font-weight: 600;
    background: linear-gradient(135deg, var(--login-neon-blue), var(--login-neon-violet));
    /* ← GRADIENTE BOTÓN INGRESA */
    background-size: 200%;
    border: 1px solid rgba(0, 212, 255, 0.30);
    /* ← BORDE LUMINOSO */
    box-shadow: 0 0 18px rgba(37, 99, 255, 0.30);
    /* ← HALO DE LUZ */
    transition: background-position 0.5s, box-shadow 0.3s;
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
}

.ingresa-btn:hover {
    background-position: right;
    box-shadow: 0 0 28px rgba(0, 212, 255, 0.50);
    /* ← HALO HOVER (más brillante) */
}


/* ─────────────────────────────────────────────────────────────────
   (sin cambios visuales en el wrapper centrador)
   ───────────────────────────────────────────────────────────────── */
.wrapper-login {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* ─────────────────────────────────────────────────────────────────
   🪟 CARD PRINCIPAL DEL LOGIN (contenedor grande con glassmorphism)
   ─────────────────────────────────────────────────────────────────
   Qué es: el rectángulo central que contiene el logo y el formulario.
   Cómo editarlo:
     · Transparencia del vidrio → background: rgba(8, 18, 46, 0.78)
       El último número (0.78) controla cuánto se ve el fondo.
       0.5 = más transparente, 0.95 = casi sólido.
     · Desenfoque del vidrio → backdrop-filter: blur(24px)
       Sube el número para más blur, bájalo para menos.
     · Brillo del borde → border: 1px solid rgba(0, 212, 255, 0.18)
       Sube 0.18 para un borde más visible.
     · Sombra exterior → el primer box-shadow (0 25px 60px...)
   ───────────────────────────────────────────────────────────────── */
.card-login {
    width: min(1000px, 100%);
    height: auto;
    min-height: 420px;
    background: rgba(8, 18, 46, 0.5);
    /* ← FONDO VIDRIO (opacidad) transparencia login */
    backdrop-filter: blur(1px);
    /* ← DESENFOQUE GLASSMORPHISM */
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.95);
    /* ← BORDE CYAN SUTIL */
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.18),
        /* ← BORDE INTERNO MUY SUTIL */
        0 25px 60px rgba(0, 0, 0, 0.55),
        /* ← SOMBRA EXTERIOR OSCURA */
        0 0 80px rgba(0, 80, 200, 0.10);
    /* ← HALO AZUL EXTERIOR */
    display: flex;
    gap: 20px;
    padding: 2px;
    overflow: hidden;
}


/* ─────────────────────────────────────────────────────────────────
   🖼️  PANEL IZQUIERDO (donde está el logo de Edueficiente)
   ─────────────────────────────────────────────────────────────────
   Qué es: la mitad izquierda de la card con el logo animado.
   Cómo editarlo:
     · Color de fondo del panel → background: linear-gradient(...)
       Ambos colores son tonos navy muy oscuros.
     · Línea divisora vertical (entre logo y formulario) →
       border-right: 1px solid rgba(0, 212, 255, 0.20)
       Sube 0.20 → línea más visible, 0 → sin línea
   ───────────────────────────────────────────────────────────────── */
.left-login {
    width: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.image-placeholder-login {
    width: 100%;
    height: 100%;
    max-height: 600px;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(10, 22, 60, 0.10) 0%, rgba(5, 14, 38, 0.95) 100%);
    /* ← FONDO PANEL LOGO */
    border-right: 1px solid rgba(0, 212, 255, 0.55);
    /* ← LÍNEA DIVISORA VERTICAL */
    box-shadow: inset -6px 0 30px rgba(0, 212, 255, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder-login img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}


/* ─────────────────────────────────────────────────────────────────
   📋 PANEL DERECHO (área del formulario de login)
   ─────────────────────────────────────────────────────────────────
   Qué es: la mitad derecha, contiene título, inputs y botón.
   Sin color propio — hereda el fondo de la card.
   ───────────────────────────────────────────────────────────────── */
.right-login {
    width: 45%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-box-container {
    width: 100%;
    max-width: 320px;
    text-align: left;
}


/* ─────────────────────────────────────────────────────────────────
   ✨ TÍTULO "BIENVENIDO"
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Color del texto → color: var(--login-neon-cyan)
       Cámbialo por un hex directo. Ej: color: #ffffff (blanco)
     · Brillo del texto → text-shadow: 0 0 22px rgba(0, 212, 255, 0.40)
       Sube 0.40 para más neón, ponlo en 0 para sin efecto.
   ───────────────────────────────────────────────────────────────── */
.login-box-container h2 {
    margin-bottom: 5px;
    font-weight: 800;
    /* ← GRADIENTE TÍTULO: de cyan brillante a azul eléctrico
       Para cambiar: edita los dos colores del linear-gradient
       Primer color = inicio (izquierda), segundo = fin (derecha) */
    background: linear-gradient(90deg, #b4f3ff 0%, #00d4ff 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 14px rgba(0, 212, 255, 0.45));
    /* ← BRILLO NEÓN TÍTULO */
    font-size: clamp(2.2rem, 3vw, 2.2rem);
}


/* ─────────────────────────────────────────────────────────────────
   📝 SUBTÍTULO "Portal Único de Acceso Vocacional"
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Color → color: rgba(160, 200, 220, 0.70)
       Sube 0.70 → más blanco, bájalo → más apagado.
   ───────────────────────────────────────────────────────────────── */
.login-box-container p {
    margin-bottom: 25px;
    color: rgba(160, 200, 220, 0.70);
    /* ← COLOR SUBTÍTULO */
    font-size: 0.9rem;
}


/* ─────────────────────────────────────────────────────────────────
   👤 MENSAJE DE BIENVENIDA DEL USUARIO (#userWelcomeInfo)
   ─────────────────────────────────────────────────────────────────
   Qué es: el bloque que aparece tras buscar el documento.
   Muestra: "👋 Hola, Usuario 111. Vas a ingresar como ADMIN de..."
   NOTA: este elemento tiene color inline en el HTML (color: var(--primary))
   que queda oscuro sobre el fondo navy. Lo sobreescribimos aquí.
   Cómo editarlo:
     · Color del texto base → color: rgba(180, 215, 235, 0.90)
       Es el texto normal "Hola," y "Vas a ingresar como"
     · Color de los textos en negrita (nombre, rol, institución) →
       color: var(--login-neon-cyan) en el selector strong
     · Fondo del bloque → background: rgba(0, 212, 255, 0.06)
       Sube para más visible, ponlo en transparent para sin fondo
     · Borde izquierdo de acento → border-left: 3px solid ...
       Cámbialo de color o ponlo en "none" para quitarlo
   ───────────────────────────────────────────────────────────────── */
#userWelcomeInfo {
    color: rgba(246, 249, 250, 0.9) !important;
    /* ← COLOR TEXTO BASE DEL MENSAJE */
    background: rgba(0, 212, 255, 0.06);
    /* ← FONDO SUTIL DEL BLOQUE */
    border-left: 3px solid rgba(0, 212, 255, 0.40);
    /* ← BORDE IZQUIERDO ACENTO */
    border-radius: 8px;
    padding: 10px 14px;
}

#userWelcomeInfo strong {
    color: var(--login-neon-cyan);
    /* ← COLOR TEXTOS EN NEGRITA (nombre, rol, institución) */
    font-weight: 700;
}


/* ─────────────────────────────────────────────────────────────────
   🔲 INPUTS (Tipo de Documento / Número de Identificación / Contraseña)
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Fondo del input → background: rgba(10, 25, 60, 0.60)
       0.60 = semitransparente. Sube para más sólido.
     · Color del texto escrito → color: rgba(210, 235, 245, 0.92)
       Casi blanco. Cámbialo si quieres otro tono.
     · Borde del input → border: 1px solid rgba(0, 212, 255, 0.20)
       Sube 0.20 para borde más visible.
     · Placeholder (texto de ayuda) → heredado, mismo color que texto
   ───────────────────────────────────────────────────────────────── */
.input-group-login {
    margin-bottom: 12px;
}

.input-group-login select,
.input-group-login input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.20);
    /* ← BORDE INPUT */
    background: rgba(10, 25, 60, 0.60);
    /* ← FONDO INPUT */
    color: rgba(210, 235, 245, 0.92);
    /* ← COLOR TEXTO INPUT */
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

/* Color de las opciones del select desplegable */
.input-group-login select option {
    background: #0a1632;
    /* ← FONDO OPCIONES DROPDOWN */
    color: #c8dce8;
    /* ← COLOR TEXTO OPCIONES DROPDOWN */
}


/* ─────────────────────────────────────────────────────────────────
   🔵 INPUTS AL HACER FOCO (cuando el usuario hace clic en el campo)
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Color del borde activo → border-color: var(--login-neon-cyan)
     · Anillo exterior de enfoque → box-shadow: 0 0 0 3px rgba(...)
       El primer rgba es el anillo, el segundo es el halo difuso.
     · Fondo al enfocar → background: rgba(10, 30, 70, 0.75)
       Ligeramente más oscuro que el estado normal.
   ───────────────────────────────────────────────────────────────── */
.input-group-login input:focus,
.input-group-login select:focus {
    border-color: var(--login-neon-cyan);
    /* ← BORDE ACTIVO */
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14),
        /* ← ANILLO DE FOCO */
        0 0 16px rgba(0, 212, 255, 0.10);
    /* ← HALO DIFUSO */
    background: rgba(10, 30, 70, 0.75);
    /* ← FONDO ACTIVO */
}


/* ─────────────────────────────────────────────────────────────────
   ☑️  FILA "RECORDARME / ¿OLVIDASTE TU ID?"
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Color del texto "Recordarme" → color: rgba(160, 200, 220, 0.75)
     · Color del link "¿Olvidaste tu ID?" → color: var(--login-neon-cyan)
     · Brillo del link al hover → text-shadow en .options-login a:hover
   ───────────────────────────────────────────────────────────────── */
.options-login {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 20px;
    color: rgba(160, 200, 220, 0.75);
    /* ← COLOR TEXTO "RECORDARME" */
    flex-wrap: wrap;
    gap: 8px;
}

.options-login input {
    margin-right: 5px;
}

.options-login a {
    text-decoration: none;
    /* ← GRADIENTE LINK "¿OLVIDASTE TU ID?": cyan → violeta brillante
       Para cambiar los colores edita el linear-gradient */
    background: linear-gradient(90deg, #00d4ff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    transition: filter 0.3s;
}

.options-login a:hover {
    filter: brightness(1.25) drop-shadow(0 0 6px rgba(0, 212, 255, 0.60));
    /* ← BRILLO HOVER DEL LINK */
}


/* ─────────────────────────────────────────────────────────────────
   🚀 BOTÓN PRINCIPAL (CONTINUAR / INGRESAR AL SISTEMA)
   ─────────────────────────────────────────────────────────────────
   Cómo editarlo:
     · Gradiente del botón → background: linear-gradient(90deg, ...)
       Primer color: var(--login-neon-blue) = #2563ff (azul)
       Segundo color: var(--login-neon-violet) = #7c3aed (violeta)
       Para un botón todo azul: pon el mismo color en ambos lados.
     · Sombra de luz debajo → box-shadow: 0 4px 22px rgba(37, 99, 255, 0.38)
       Sube 0.38 para más resplandor.
     · Separación entre letras → letter-spacing: 0.05em
       Sube para más espaciado tipo "CONTINUAR".
   ───────────────────────────────────────────────────────────────── */
.btn-login-action {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    min-height: var(--touch-min);
    /* ← GRADIENTE BOTÓN PRINCIPAL: igual que btn-main del sistema interno
       #052b91 (azul marino) → #488a99 (teal/cyan) → #052b91
       Para cambiar edita los colores hex de este linear-gradient */
    background: linear-gradient(90deg, #052b91, #00d4ff, #052b91);
    background-size: 200%;
    box-shadow:
        0 4px 22px rgba(5, 43, 145, 0.45),
        /* ← SOMBRA DIFUSA BAJO EL BOTÓN */
        0 0 0 1px rgba(72, 138, 153, 0.30);
    /* ← BORDE INTERIOR MUY SUTIL */
    letter-spacing: 0.05em;
    /* ← ESPACIADO DE LETRAS */
    transition: background-position 0.5s, transform 0.2s, box-shadow 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.btn-login-action:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow:
        0 8px 34px rgba(5, 43, 145, 0.65),
        /* ← SOMBRA HOVER (más intensa) */
        0 0 0 1px rgba(72, 138, 153, 0.55);
    /* ← BORDE HOVER (más visible) */
}

/* =====================================================
   APP CONTAINER
   ===================================================== */
.app-container {
    display: none;
    width: 100%;
}

.btn-main {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200%;
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.5s;
    min-height: var(--touch-min);
    -webkit-appearance: none;
    appearance: none;
}

.btn-main:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 138, 153, 0.2);
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: 280px;
    background: #0d1c1d;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 25px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
    position: fixed;
    top: 0;
    left: 0;
    color: white;
    z-index: 100;
    transition: transform 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 50px;
    color: #fff;
    text-align: center;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
    word-break: break-word;
}

.nav-menu {
    list-style: none;
}

.close-sidebar-btn {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    /* Sit below sidebar but above content */
    z-index: 99;
}

/* =====================================================
   NAV ITEMS
   ===================================================== */
.nav-item {
    position: relative;
    padding: 10px 18px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.4s all;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: linear-gradient(90deg, transparent 50%, var(--primary) 50%, var(--accent));
    background-size: 200% 100%;
    min-height: var(--touch-min);
    /* Prevent text wrap breaking layout */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover,
.nav-item.active {
    background-position: right bottom;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.nav-item.logout-item {
    color: #ff9b9b;
    opacity: 0.8;
    margin-top: 20px;
    border: 1px solid rgba(255, 155, 155, 0.2);
}

.nav-item.logout-item:hover {
    color: white;
    opacity: 1;
    background: var(--danger);
    border-color: var(--danger);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 40px var(--space-2xl);
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    /* Prevent content from ever going under a fixed sidebar */
    max-width: calc(100vw - 280px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    gap: 16px;
    flex-wrap: wrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #eef1f2;
    flex-shrink: 0;
    max-width: 100%;
}

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* =====================================================
   BENTO GRID / CARDS
   ===================================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
}

.card {
    background: var(--white);
    border-radius: 28px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #eef1f2;
    overflow: visible;
    min-width: 0;
}

/* Card que contiene tabla: el scroll va en un wrapper interno */
.card-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -30px;
    padding: 20px;
    border-radius: 28px;
    word-break: normal;
}

.span-4 {
    grid-column: span 4;
}

.span-3 {
    grid-column: span 3;
}

.span-2 {
    grid-column: span 2;
}

.span-6 {
    grid-column: span 6;
}

.stat-num {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.stat-desc {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* =====================================================
   FORM INPUTS
   ===================================================== */
.input-box {
    text-align: left;
    margin-bottom: 20px;
}

.input-box label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    padding-left: 5px;
}

.input-box select,
.input-box input,
.input-box textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid #dce2e3;
    font-family: inherit;
    font-size: 1rem;
    /* 16px — prevents iOS auto-zoom on focus */
    transition: 0.3s;
    background: #F8FAFB;
    color: var(--text-main);
    -webkit-appearance: none;
    appearance: none;
    max-width: 100%;
}

.input-box input:focus,
.input-box select:focus,
.input-box textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(72, 138, 153, 0.08);
    outline: none;
}

/* =====================================================
   DATA TABLE
   ===================================================== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 15px;
    /* Make table scroll horizontally on small screens */
    min-width: 420px;
}

/* Wrapper added in HTML; CSS fallback handles overflow */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.data-table th {
    text-align: left;
    padding: 15px;
    color: var(--secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    word-break: normal;
}

.data-table td {
    padding: 18px 15px;
    background: #ffffff;
    vertical-align: middle;
    border-top: 1px solid #f0f3f4;
    border-bottom: 1px solid #f0f3f4;
    white-space: nowrap;
    word-break: normal;
}

.data-table tr:hover td {
    background: #F8FAFB;
    border-color: var(--secondary);
}

.data-table td:first-child {
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    border-left: 1px solid #f0f3f4;
}

.data-table td:last-child {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    border-right: 1px solid #f0f3f4;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.badge-pending {
    background: #FFF3D6;
    color: #8F6A1A;
}

.badge-success {
    background: #E6F4F5;
    color: #2D5B66;
}

.badge-finalized {
    background: #E2E8F0;
    color: #475569;
    border: 1px solid #CBD5E0;
}

/* =====================================================
   TEST / EVALUACIÓN — CONTENEDOR PRINCIPAL
   ===================================================== */
.test-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    padding: 0 4px;
    /* tiny gutter so card shadows aren't clipped */
}

.progress-container {
    width: 100%;
    background: #e0e6e7;
    border-radius: 10px;
    height: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.4s ease;
    width: 0%;
}

/* =====================================================
   QUESTION CARD
   ===================================================== */
.question-card {
    background: white;
    padding: clamp(20px, 4vw, 35px);
    border-radius: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #eef1f2;
    overflow: hidden;
    word-break: break-word;
}

/* =====================================================
   LIKERT SCALE — EVALUATION QUESTIONS
   ===================================================== */
.likert {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    gap: 10px;
    /* Allow wrapping on narrow screens */
    flex-wrap: wrap;
}

.likert-option {
    flex: 1 1 auto;
    text-align: center;
    min-width: clamp(60px, 15vw, 90px);
}

.likert-option input {
    display: none;
}

.likert-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 5px;
    background: #F8FAFB;
    border: 1.5px solid #dce2e3;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    font-size: 0.85rem;
    height: 100%;
    min-height: var(--touch-min);
    color: var(--text-main);
    /* Stretch label to full column width */
    width: 100%;
    word-break: break-word;
    hyphens: auto;
}

.likert-option input:checked+label {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 138, 153, 0.2);
}

/* =====================================================
   ACTION BUTTONS (small icon buttons)
   ===================================================== */
.btn-action {
    width: 35px;
    height: 35px;
    min-width: 35px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #EDF1F2;
    color: rgb(0, 0, 0);
    transition: 0.3s;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.btn-struct:hover {
    background: var(--primary);
}

.btn-users:hover {
    background: var(--text-main);
}

.btn-link-test {
    background: #E6F4F5;
    color: var(--primary);
}

.btn-rector-assign {
    background: #3F4E4F;
    color: white;
}

.edit-input {
    width: 100%;
    padding: 8px;
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    /* 16px — prevents iOS auto-zoom */
}

/* =====================================================
   LIST COMPONENTS
   ===================================================== */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.list-item {
    padding: 15px;
    background: #F8FAFB;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    border: 1.5px solid transparent;
    color: var(--text-main);
    /* Prevent overflow on very long names */
    min-width: 0;
    overflow: hidden;
}

.list-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(63, 78, 79, 0.05);
    color: var(--primary);
    border-color: rgba(72, 138, 153, 0.2);
}

/* =====================================================
   DROPZONE
   ===================================================== */
.dropzone {
    border: 2px dashed var(--secondary);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #ffffff;
    color: var(--secondary);
    /* On small screens reduce padding */
}

.dropzone:hover {
    border-color: var(--primary);
    background: #F4F9FA;
    color: var(--primary);
}

/* =====================================================
   STATE HELPERS
   ===================================================== */
.empty-msg {
    text-align: center;
    padding: 20px;
    color: var(--secondary);
    font-size: 0.8rem;
    opacity: 0.6;
}

.active-item {
    border-color: var(--accent) !important;
    background: white !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: var(--accent) !important;
}

.student-item {
    padding: 8px 15px !important;
    margin-bottom: 5px;
}

.student-item:hover {
    color: var(--primary) !important;
}

/* =====================================================
   HORIZONTAL PICKER / GRADE CIRCLES
   ===================================================== */
.horizontal-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.circle-btn {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 50%;
    border: 2px solid #dce2e3;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    color: var(--secondary);
    position: relative;
    /* Ensure touch target */
    touch-action: manipulation;
}

.circle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.circle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 138, 153, 0.3);
}

/* =====================================================
   PILL BUTTONS
   ===================================================== */
.pill-btn {
    padding: 10px 25px;
    border-radius: 30px;
    border: 2px solid #dce2e3;
    background: white;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    color: var(--secondary);
    min-height: var(--touch-min);
    touch-action: manipulation;
    white-space: nowrap;
}

.pill-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pill-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(219, 174, 88, 0.3);
}

/* =====================================================
   STUDENT TABLE
   ===================================================== */
.student-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 480px;
    /* scroll before breaking layout */
}

.student-table th {
    text-align: left;
    padding: 15px;
    color: var(--secondary);
    font-size: 0.8rem;
    border-bottom: 2px solid #f0f3f4;
    white-space: nowrap;
    word-break: normal;
}

.student-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f3f4;
    white-space: nowrap;
    word-break: normal;
}

.student-table tr:hover {
    background: #F8FAFB;
}

/* =====================================================
   DELETE / BADGE HELPERS
   ===================================================== */
.delete-icon {
    margin-left: 8px;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: 0.3s;
}

.delete-icon:hover {
    color: var(--danger);
    opacity: 1;
    transform: scale(1.2);
}

.delete-grade-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: var(--danger);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.circle-btn:hover .delete-grade-btn,
.circle-btn.active .delete-grade-btn {
    display: flex;
}

/* =====================================================
   NAV BADGES
   ===================================================== */
.nav-item .menu-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.nav-item .menu-badge--muted {
    background: var(--secondary);
}

.nav-item .menu-badge--ok {
    background: var(--primary);
}

.header-notif-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--primary);
    cursor: default;
    border: 1px solid #eef1f2;
    flex-shrink: 0;
}

.header-notif-wrap i {
    font-size: 1.15rem;
}

.header-notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* =====================================================
   INFORME VISUAL
   ===================================================== */
#informe-visual {
    font-family: 'Outfit', sans-serif;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(63, 78, 79, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 800px;
}

#informe-visual header {
    background: linear-gradient(135deg, #3F4E4F, var(--primary));
    color: white;
    padding: clamp(16px, 3vw, 30px) clamp(20px, 4vw, 40px);
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

#informe-visual .logo {
    width: 120px;
    height: auto;
    filter: brightness(0) invert(1);
}

#informe-visual .titulo-informe h1 {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

#informe-visual .titulo-informe p {
    font-size: clamp(13px, 1.5vw, 16px);
    margin: 0;
    opacity: 0.9;
}

#informe-visual .info-estudiante {
    display: flex;
    justify-content: space-between;
    padding: 20px clamp(20px, 4vw, 40px);
    background: #F8FAFB;
    border-bottom: 1px solid #e0e6e7;
    flex-wrap: wrap;
    gap: 12px;
}

#informe-visual .info-estudiante div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#informe-visual .info-estudiante p {
    margin: 0;
    font-size: 14px;
    color: var(--text-main);
}

#informe-visual .info-estudiante strong {
    font-weight: 600;
    color: var(--primary);
}

#informe-visual main {
    display: flex;
    flex: 1;
    padding: 0 clamp(16px, 4vw, 40px);
    gap: 40px;
    overflow: hidden;
    flex-wrap: wrap;
}

#informe-visual .columna-izquierda,
#informe-visual .columna-derecha {
    display: flex;
    flex-direction: column;
    flex: 1 1 300px;
    /* fluid columns that wrap */
    min-width: 0;
}

#informe-visual .seccion-titulo {
    background-color: #3F4E4F;
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px 6px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#informe-visual .seccion-contenido {
    padding: 16px;
    border: 1px solid #E0E6E7;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: white;
    overflow-x: auto;
    /* handle wide tables */
}

#informe-visual table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

#informe-visual th,
#informe-visual td {
    text-align: left;
    padding: 12px 16px;
}

#informe-visual th {
    background-color: #f1f4f5;
    color: var(--text-main);
    font-weight: 700;
}

#informe-visual td:last-child {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

#informe-visual tbody tr:nth-child(even) {
    background-color: #F8FAFB;
}

#informe-visual .area-dominante,
#informe-visual .descripcion {
    margin-top: 20px;
}

#informe-visual .area-dominante p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

#informe-visual .descripcion p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    text-align: justify;
    color: #4b5a5c;
}

#informe-visual .area-dominante strong {
    font-weight: 700;
    color: var(--accent);
    font-size: 16px;
}

#informe-visual .grafico-container {
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E0E6E7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

#informe-visual .carreras-sugeridas ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

#informe-visual .carreras-sugeridas ul li {
    padding: 8px 12px;
    background: linear-gradient(135deg, #3F4E4F, var(--primary));
    color: white;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    word-break: break-word;
}

#informe-visual footer {
    background: #3F4E4F;
    color: rgba(255, 255, 255, 0.7);
    padding: 20px clamp(20px, 4vw, 40px);
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    margin-top: auto;
    border-top: 2px solid var(--accent);
}

#informe-visual .btn-volver {
    background: #3F4E4F;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    margin-top: 20px;
    align-self: center;
    transition: all 0.3s ease;
    min-height: var(--touch-min);
}

#informe-visual .btn-volver:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 138, 153, 0.3);
}

/* =====================================================
   MOBILE MENU TOGGLE (hidden by default)
   ===================================================== */
.mobile-menu-toggle {
    display: none;
    background: var(--white);
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--primary);
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    flex-shrink: 0;
}

/* =====================================================
   HEADER SEMANTIC CLASSES (reemplazan inline styles)
   ===================================================== */
.header-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex: 1;
    flex-wrap: wrap;
}

.header-title-text {
    min-width: 0;
    flex: 1;
}

.page-title {
    font-weight: 800;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-desc {
    color: var(--secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.student-help-tools {
    display: none;
    /* JS lo activa con display:flex */
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px 18px;
    border-radius: 16px;
    border: 1px solid #eef1f2;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.support-label {
    font-size: 0.85rem;
    color: var(--secondary);
    white-space: nowrap;
}

.btn-bienvenida {
    width: auto !important;
    height: auto !important;
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
}

.user-info-text {
    text-align: right;
    min-width: 0;
}

/* =====================================================
   SIDEBAR LOGOUT (reemplaza inline absolute)
   ===================================================== */
.sidebar-logout {
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
}

/* =====================================================
   ╔══════════════════════════════════════════════════╗
   ║            RESPONSIVE BREAKPOINTS               ║
   ╚══════════════════════════════════════════════════╝
   Breakpoint strategy (mobile-first cascade):
     xs   < 480px   — small phones
     sm   < 640px   — large phones
     md   < 768px   — phablets / tablets portrait
     lg   < 992px   — tablets landscape / small laptops
     xl   < 1280px  — laptops
     2xl  ≥ 1280px  — large desktops / ultra-wide
   ===================================================== */

/* ─── LARGE DESKTOPS / ULTRA-WIDE ─────────────────── */
@media (min-width: 1600px) {
    .main-content {
        padding: 40px 80px;
    }

    .bento-grid {
        gap: 32px;
    }

    .test-container {
        max-width: 1000px;
    }
}

/* ─── LAPTOP / MEDIUM DESKTOP (≤ 1280px) ───────────── */
@media (max-width: 1280px) {
    .main-content {
        padding: 32px 40px;
    }
}

/* ─── TABLETS LANDSCAPE / SMALL LAPTOPS (≤ 992px) ─── */
@media (max-width: 992px) {

    /* Login navbar */
    .navbar-login {
        padding: 12px 24px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .logo-login img {
        height: 32px;
    }

    .menu-login {
        display: none;
    }

    /* collapses to hamburger if implemented */

    /* Login card — stack vertically */
    .wrapper-login {
        align-items: flex-start;
        padding-top: 24px;
    }

    .card-login {
        width: 100%;
        max-width: 520px;
        height: auto;
        flex-direction: column;
        align-items: center;
        padding: 28px 20px;
        margin: 0 auto;
        gap: 16px;
    }

    .left-login {
        width: 100%;
        height: 180px;
        flex-shrink: 0;
    }

    .right-login {
        width: 100%;
        padding: 0;
        display: flex;
        justify-content: center;
    }

    .login-box-container {
        width: 100%;
        max-width: 360px;
        text-align: center;
    }

    .options-login {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    /* Sidebar still visible but narrower */
    .sidebar {
        width: 240px;
        padding: 30px 18px;
    }

    .sidebar h2 {
        font-size: 1.2rem;
        margin-bottom: 30px;
    }

    .main-content {
        margin-left: 240px;
        max-width: calc(100vw - 240px);
        padding: 28px 28px;
    }

    /* Bento grid — collapse some spans */
    .span-4 {
        grid-column: span 6;
    }

    .span-3 {
        grid-column: span 3;
    }

    .span-2 {
        grid-column: span 3;
    }

    /* Informe: columns stack */
    #informe-visual main {
        flex-direction: column;
        overflow: visible;
    }

    #informe-visual .grafico-container {
        height: 280px;
    }
}

/* ─── TABLETS PORTRAIT / LARGE PHONES (≤ 768px) ───── */
@media (max-width: 768px) {

    /* ── Sidebar: fly-out drawer ── */
    .sidebar-overlay.active {
        display: block;
    }

    .close-sidebar-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 2001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        z-index: 2000;
    }

    /* ── Main content: full width ── */
    .main-content {
        margin-left: 0 !important;
        max-width: 100%;
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    /* ── Mobile toggle button ── */
    .mobile-menu-toggle {
        display: flex;
    }

    /* ── Header groups en móvil ── */
    .header-title-group {
        flex-wrap: nowrap;
    }

    .page-title {
        font-size: clamp(1.1rem, 4vw, 1.4rem);
    }

    .page-desc {
        display: none;
    }

    .header-actions-group {
        width: 100%;
        justify-content: flex-end;
    }

    .student-help-tools {
        width: 100%;
        justify-content: space-between;
    }

    /* ── Header ── */
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-top>* {
        width: 100%;
        min-width: 0;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
        padding: 10px 16px;
    }

    /* ── Bento grid: single column ── */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .span-2,
    .span-3,
    .span-4,
    .span-6 {
        grid-column: span 1;
    }

    .card {
        padding: 20px;
        border-radius: 20px;
    }

    .card-table-wrapper {
        margin: -20px;
        padding: 20px;
        border-radius: 20px;
    }

    /* ── Fact grid ── */
    .fact-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* ── Test / Evaluation ── */
    .test-container {
        padding: 0;
    }

    .question-card {
        padding: 20px;
        border-radius: 18px;
    }

    /* Likert: 2-column grid on phablets */
    .likert {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        flex-wrap: unset;
    }

    .likert-option {
        min-width: unset;
        flex: unset;
    }

    .likert-option label {
        padding: 14px 8px;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    /* ── Modals ── */
    .test-modal-content {
        width: 100%;
        border-radius: 20px;
        max-height: calc(100dvh - 32px);
    }

    .test-modal-iframe {
        height: 260px;
    }

    .test-modal-footer {
        padding: 18px 20px;
    }

    /* ── Dropzone ── */
    .dropzone {
        padding: 28px 20px;
    }

    /* ── Pill buttons: wrap and stretch ── */
    .horizontal-picker {
        gap: 10px;
    }

    .pill-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    /* ── Informe visual ── */
    #informe-visual {
        border-radius: 8px;
        min-height: unset;
    }

    #informe-visual .carreras-sugeridas ul {
        grid-template-columns: 1fr;
    }

    #informe-visual .grafico-container {
        height: 220px;
    }
}

/* ─── LARGE PHONES (≤ 640px) ────────────────────────── */
@media (max-width: 640px) {

    /* ── Login ── */
    .navbar-login {
        padding: 12px 16px;
    }

    .logo-login {
        padding: 10px;
    }

    .logo-login img {
        height: 28px;
    }

    .card-login {
        padding: 20px 14px;
        border-radius: 16px;
        gap: 12px;
    }

    .left-login {
        height: 140px;
    }

    .login-box-container h2 {
        font-size: 1.4rem;
    }

    .btn-login-action {
        padding: 16px;
        font-size: 1rem;
    }

    /* ── Likert: stacked single column on small phones ── */
    .likert {
        grid-template-columns: 1fr;
    }

    .likert-option label {
        justify-content: flex-start;
        text-align: left;
        padding: 14px 16px;
        border-radius: 12px;
    }

    /* ── Question card ── */
    .question-card {
        padding: 16px;
        border-radius: 14px;
    }

    /* ── Fact cards ── */
    .fact-action-card {
        padding: 18px;
        border-radius: 16px;
    }

    .fact-header-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 20px;
    }

    /* ── Stat numbers ── */
    .stat-num {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }

    /* ── Data table scrollable container hint ── */
    .data-table th,
    .data-table td {
        padding: 12px 10px;
    }

    /* ── Student table ── */
    .student-table th,
    .student-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    /* ── Action buttons row — let them wrap ── */
    .btn-action {
        margin-right: 4px;
        margin-bottom: 4px;
    }

    /* ── Horizontal picker wraps tighter ── */
    .horizontal-picker {
        gap: 8px;
    }

    .circle-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    /* ── Modal ── */
    .test-modal-overlay {
        padding: 10px;
    }

    .test-modal-content {
        border-radius: 16px;
    }

    .test-modal-iframe {
        height: 220px;
    }

    .test-modal-body {
        padding: 12px;
    }

    /* ── Informe ── */
    #informe-visual .logo {
        width: 80px;
    }

    #informe-visual td,
    #informe-visual th {
        padding: 10px 12px;
    }

    #informe-visual .grafico-container {
        height: 180px;
        padding: 10px;
    }

    #informe-visual footer {
        padding: 16px;
        font-size: 12px;
    }
}

/* ─── SMALL PHONES (≤ 480px) ────────────────────────── */
@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    .main-content {
        padding: 12px;
    }

    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .card-table-wrapper {
        margin: -16px;
        padding: 16px;
        border-radius: 16px;
    }

    .bento-grid {
        gap: 12px;
        overflow-x: hidden;
    }

    /* ── Header top ── */
    .header-top {
        gap: 10px;
    }

    .user-profile {
        padding: 8px 12px;
        gap: 10px;
        border-radius: 14px;
    }

    /* ── Login ── */
    .card-login {
        padding: 16px 12px;
        border-radius: 14px;
    }

    .login-box-container h2 {
        font-size: 1.3rem;
    }

    /* ── Sidebar wider touch area ── */
    .sidebar {
        width: min(300px, 85vw);
    }

    /* ── Buttons ── */
    .btn-main {
        padding: 14px;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .pill-btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

    /* ── Dropzone compact ── */
    .dropzone {
        padding: 20px 16px;
        border-radius: 14px;
    }

    /* ── Question progress ── */
    .progress-container {
        height: 10px;
    }

    /* ── Modal fills nearly full screen ── */
    .test-modal-overlay {
        padding: 8px;
    }

    .test-modal-content {
        border-radius: 14px;
        max-height: calc(100dvh - 16px);
    }

    .test-modal-iframe {
        height: 190px;
    }

    /* ── Fact header ── */
    .fact-section-header {
        gap: 12px;
    }

    .fact-header-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 12px;
        font-size: 18px;
    }

    /* ── Informe ── */
    #informe-visual header {
        gap: 14px;
    }

    #informe-visual .logo {
        width: 60px;
    }

    #informe-visual main {
        padding: 0 12px;
        gap: 20px;
    }

    #informe-visual .info-estudiante {
        padding: 14px;
        gap: 8px;
    }

    #informe-visual .carreras-sugeridas ul {
        grid-template-columns: 1fr;
    }

    #informe-visual .grafico-container {
        height: 160px;
    }
}

/* ─── LANDSCAPE PHONE / ORIENTATION ────────────────── */
@media (max-width: 900px) and (orientation: landscape) {

    /* Reduce vertical spacing when viewport height is limited */
    .main-content {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .sidebar {
        /* Allow sidebar to scroll in landscape */
        overflow-y: auto;
    }

    .test-modal-content {
        /* Shorter modal in landscape mode */
        max-height: 90dvh;
    }

    .test-modal-iframe {
        height: 180px;
    }

    .question-card {
        padding: 16px 20px;
    }

    .likert {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .left-login {
        height: 120px;
    }

    .card-login {
        gap: 10px;
    }
}

/* ─── HOVER MEDIA — disable heavy hover animations on touch ── */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover {
        transform: none;
    }

    .btn-main:hover {
        transform: none;
    }

    .btn-action:hover {
        transform: none;
    }

    .pill-btn:hover {
        border-color: #dce2e3;
        color: var(--secondary);
    }

    .fact-action-card:hover {
        transform: none;
        box-shadow: var(--fact-shadow);
    }

    .list-item:hover {
        background: #F8FAFB;
        box-shadow: none;
        color: var(--text-main);
        border-color: transparent;
    }

    #informe-visual .btn-volver:hover {
        transform: none;
    }

    .btn-login-action:hover {
        transform: none;
    }

    .btn-main:hover {
        box-shadow: none;
    }

    .delete-icon:hover {
        transform: none;
    }
}

/* ─── REDUCED MOTION ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================
   OPTIMIZACIÓN DE IMPRESIÓN GLOBAL
   ===================================================== */
@media print {

    /* Ocultar elementos de la interfaz de la aplicación */
    .sidebar,
    .sidebar-overlay,
    .header-top,
    .mobile-menu-toggle,
    .btn-print-hide,
    .no-print,
    .sidebar-logout,
    .header-actions-group {
        display: none !important;
    }

    /* Ajustar el contenedor principal para impresión */
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: white !important;
    }

    .app-container,
    #dynamicBoard {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}