/* ==========================================================================
   SISTEMA DE DISEÑO - PREICFES GRUPO FÉNIX
   Estilo e Identidad Visual (Cali, Colombia)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    /* Colores Corporativos */
    --bg-dark: #0F172A;          /* Azul Marino Profundo (Slate 900) */
    --bg-dark-accent: #1E293B;   /* Slate 800 */
    --bg-dark-card: #1E293B;     /* Fondo de tarjetas en modo oscuro */
    --orange-fire: #EA580C;      /* Naranja Fuego */
    --orange-hover: #C2410C;
    --gold: #F59E0B;             /* Dorado */
    --gold-hover: #D97706;
    --bg-light: #F8FAFC;         /* Gris Slate 50 (Fondo limpio) */
    --bg-white: #FFFFFF;
    --text-dark: #0F172A;
    --text-muted: #64748B;       /* Gris Slate 500 */
    --text-light: #F8FAFC;
    --border-color: #E2E8F0;     /* Gris Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 20px 25px -5px rgb(15 23 42 / 0.15), 0 8px 10px -6px rgb(15 23 42 / 0.15);
    
    /* Semáforo Académico */
    --sem-critico: #EF4444;      /* Rojo */
    --sem-medio: #F59E0B;        /* Amarillo/Naranja */
    --sem-alto: #10B981;         /* Verde */
    --sem-superior: #8B5CF6;     /* Morado */
    
    /* Fuentes */
    --font-title: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transiciones */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-light);
}

body {
    overflow-x: hidden;
    line-height: 1.6;
}

/* Tipografía y Títulos */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 700;
}

/* Enlaces y Elementos Interactivos */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   COMPONENTES GLOBALES Y UTILIDADES
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--orange-fire), var(--gold));
    color: var(--text-light);
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: 9999px;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(234, 88, 12, 0.6);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    font-weight: 600;
    padding: 0.75rem 1.6rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #EF4444;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
}

/* Efectos de Reveal y Fade-in en Scroll */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   HEADER FIJO
   ========================================================================== */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.fixed-header.scrolled {
    padding: 0.5rem 2rem;
    box-shadow: var(--shadow-lg);
    background-color: rgba(15, 23, 42, 0.98);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.fixed-header.scrolled .logo-img {
    height: 40px;
}

.brand-text {
    color: var(--text-light);
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text span {
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: rgba(248, 250, 252, 0.8);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--orange-fire), var(--gold));
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--gold);
}

.nav-link:hover::after {
    width: 100%;
}

.header-cta {
    display: flex;
    align-items: center;
}

.header-btn {
    background-color: var(--bg-dark-accent);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.6rem 1.4rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn:hover {
    background: linear-gradient(135deg, var(--orange-fire), var(--gold));
    color: var(--text-light);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

/* Menú móvil (oculto por defecto) */
.mobile-toggle {
    display: none;
    color: var(--text-light);
    font-size: 1.5rem;
    background: none;
}

/* ==========================================================================
   LANDING PAGE (7 BLOQUES)
   ========================================================================== */

/* Bloque 1: Hero Section */
.hero-section {
    background: radial-gradient(circle at 70% 30%, rgba(234, 88, 12, 0.15) 0%, rgba(15, 23, 42, 0) 50%),
                linear-gradient(135deg, var(--bg-dark) 0%, #020617 100%);
    padding: 10rem 2rem 7rem 2rem;
    min-height: 95vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-badge {
    background-color: rgba(234, 88, 12, 0.1);
    color: var(--gold);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.hero-title {
    color: var(--text-light);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    max-width: 900px;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-title span.highlight {
    background: linear-gradient(to right, var(--gold), var(--orange-fire));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    color: rgba(248, 250, 252, 0.8);
    font-size: 1.25rem;
    max-width: 700px;
    margin-bottom: 3.5rem;
    font-weight: 400;
}

.hero-cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.hero-btn-giant {
    background: linear-gradient(135deg, var(--orange-fire) 0%, var(--gold) 100%);
    color: var(--text-light);
    font-size: 1.35rem;
    font-weight: 800;
    padding: 1.4rem 3.5rem;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(234, 88, 12, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.hero-btn-giant:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 20px 45px rgba(234, 88, 12, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hero-btn-giant .arrow-icon {
    transition: var(--transition-smooth);
}

.hero-btn-giant:hover .arrow-icon {
    transform: translateX(6px);
}

.hero-social-proof {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 5rem;
}

.proof-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.proof-number {
    color: var(--gold);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    font-family: var(--font-title);
}

.proof-label {
    color: rgba(248, 250, 252, 0.6);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    gap: 0.5rem;
    pointer-events: none;
}

.scroll-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Bloque 2: Manifiesto de Rendimiento Académico (Parallax / Slow Scroll) */
.manifiesto-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-light);
    background-color: var(--bg-dark);
}

/* Imagen de fondo parallax real */
.manifiesto-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%; /* Sobredimensionado para efecto de desplazamiento */
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.95)), 
                url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?q=80&w=1920') no-repeat center center;
    background-size: cover;
    z-index: 1;
    transition: transform 0.1s ease-out;
}

.manifiesto-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    padding: 3rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.section-tag {
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    display: block;
}

.manifiesto-title {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    line-height: 1.3;
}

.manifiesto-text {
    font-size: 1.15rem;
    color: rgba(248, 250, 252, 0.85);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.manifiesto-author {
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--gold);
    font-size: 0.95rem;
}

.manifiesto-author span {
    display: block;
    font-size: 0.8rem;
    color: rgba(248, 250, 252, 0.5);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* ==========================================================================
   ESTILOS DEL COMPONENTE DE VIDEOS (NUEVO)
   ========================================================================== */
.video-dashboard-container {
    max-width: 950px;
    margin: 0 auto;
    background-color: var(--bg-dark-accent);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-premium);
}

.video-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.video-tab-btn {
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.video-tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
}

.video-tab-btn.active {
    background: linear-gradient(135deg, var(--orange-fire), var(--gold));
    color: var(--text-light);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

.video-content-wrapper {
    position: relative;
    width: 100%;
}

.video-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInTab 0.5s ease;
}

.video-panel.active {
    display: flex;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-iframe-container {
    position: relative;
    padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
    height: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    color: var(--text-light);
}

.video-info h3 {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.video-info p {
    color: rgba(248, 250, 252, 0.7);
    font-size: 0.95rem;
}

/* ==========================================================================
   ESTILOS DE SELECTOR DE TESTIMONIOS (NUEVO)
   ========================================================================== */
.testimonials-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.test-tab-btn {
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    background-color: var(--bg-white);
    color: var(--bg-dark);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.test-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--orange-fire);
}

.test-tab-btn.active {
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
    box-shadow: var(--shadow-lg);
}

/* Bloque 3: Ingeniería Pedagógica y Módulos por Áreas (Text Reveal) */
.pedagogia-section {
    padding: 8rem 2rem;
    background-color: var(--bg-white);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header .section-title {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.section-title {
    font-size: 2.5rem;
    color: var(--bg-dark);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.section-description {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Efecto Text Reveal */
.text-reveal-container {
    max-width: 900px;
    margin: 0 auto 5rem auto;
    text-align: center;
}

.text-reveal {
    font-size: 1.8rem;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.15); /* Color base apagado */
    line-height: 1.6;
    transition: var(--transition-smooth);
}

.text-reveal span {
    color: var(--bg-dark);
    opacity: 0.15;
    transition: opacity 0.5s ease, color 0.5s ease;
}

.text-reveal span.revealed {
    opacity: 1;
    color: var(--bg-dark);
}

.text-reveal span.highlighted {
    opacity: 1;
    color: var(--orange-fire);
}

/* Grid de Módulos Pedagógicos */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.area-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.area-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--border-color);
    transition: var(--transition-smooth);
}

.area-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-white);
    border-color: rgba(234, 88, 12, 0.15);
}

.area-card:hover::before {
    background: linear-gradient(to bottom, var(--orange-fire), var(--gold));
    height: 100%;
}

.area-icon-container {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.area-card:nth-child(1) .area-icon-container { color: #3B82F6; } /* Matemáticas - Azul */
.area-card:nth-child(2) .area-icon-container { color: #EC4899; } /* Lectura - Rosa */
.area-card:nth-child(3) .area-icon-container { color: #10B981; } /* Naturales - Verde */
.area-card:nth-child(4) .area-icon-container { color: #F59E0B; } /* Sociales - Dorado */
.area-card:nth-child(5) .area-icon-container { color: #8B5CF6; } /* Inglés - Violeta */

.area-card-title {
    font-size: 1.25rem;
    color: var(--bg-dark);
    margin-bottom: 1rem;
}

.area-card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.area-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-tag {
    background-color: rgba(15, 23, 42, 0.05);
    color: var(--bg-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
}

/* Bloque 4: Flexibilidad Formativa (Fondo animado en movimiento) */
.flexibilidad-section {
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
    color: var(--text-light);
    /* Degradado en movimiento */
    background: linear-gradient(135deg, #0b1120 0%, #1e1b4b 50%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.flexibilidad-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.flexibilidad-content {
    max-width: 550px;
}

.flexibilidad-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.flexibilidad-text {
    color: rgba(248, 250, 252, 0.8);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.flexibilidad-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.flex-feature {
    display: flex;
    gap: 1rem;
}

.flex-feature-icon {
    color: var(--gold);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.flex-feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.flex-feature-text {
    color: rgba(248, 250, 252, 0.6);
    font-size: 0.9rem;
}

/* Campus Virtual Preview Component (Glassmorphic) */
.campus-preview {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    position: relative;
}

.campus-preview::after {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.campus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.campus-dots {
    display: flex;
    gap: 6px;
}

.campus-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.campus-dot.red { background-color: #EF4444; }
.campus-dot.yellow { background-color: #F59E0B; }
.campus-dot.green { background-color: #10B981; }

.campus-title {
    font-size: 0.85rem;
    color: rgba(248, 250, 252, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.campus-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.campus-card-mock {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-fast);
}

.campus-card-mock:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.campus-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(245, 158, 11, 0.2));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.2rem;
}

.campus-card-info {
    flex-grow: 1;
}

.campus-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.campus-card-meta {
    font-size: 0.8rem;
    color: rgba(248, 250, 252, 0.45);
}

.campus-card-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10B981;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Bloque 5: Cultura de Simulación Realista (Zoom suave y CTA Secundario) */
.simulacion-section {
    padding: 8rem 2rem;
    background-color: var(--bg-light);
}

.simulacion-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.simulacion-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Zoom suave inicial */
    transform: scale(1);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-img {
    /* Zoom al pasar el mouse */
    transform: scale(1.12);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0) 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    color: var(--text-light);
}

.gallery-overlay-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.simulacion-content {
    max-width: 500px;
}

.simulacion-title {
    font-size: 2.5rem;
    color: var(--bg-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.simulacion-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.simulacion-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.simulacion-stat-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.simulacion-stat-value {
    color: var(--orange-fire);
    font-size: 1.8rem;
    font-weight: 800;
}

.simulacion-stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Bloque 6: Resultados Sostenibles y Legado Fénix (Fade-in Lateral) */
.legado-section {
    padding: 8rem 2rem;
    background-color: var(--bg-white);
    overflow: hidden;
}

.legado-container {
    max-width: 1200px;
    margin: 0 auto;
}

.legado-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.legado-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    transition: var(--transition-smooth);
}

.legado-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(245, 158, 11, 0.25);
    background-color: var(--bg-white);
}

.quote-icon {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    font-size: 3rem;
    color: rgba(234, 88, 12, 0.1);
}

.legado-score-badge {
    background-color: rgba(234, 88, 12, 0.1);
    color: var(--orange-fire);
    font-weight: 800;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.legado-quote {
    font-style: italic;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.legado-student {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-dark-accent);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-title);
    border: 2px solid var(--gold);
}

.student-info {
    display: flex;
    flex-direction: column;
}

.student-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--bg-dark);
}

.student-career {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Bloque 7: Footer (Sedes en Cali y Canales) */
.footer-section {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 5rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.footer-description {
    color: rgba(248, 250, 252, 0.65);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.1rem;
}

.social-link:hover {
    background: linear-gradient(135deg, var(--orange-fire), var(--gold));
    color: var(--text-light);
    transform: translateY(-3px);
}

.footer-heading {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--gold);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(248, 250, 252, 0.65);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--gold);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: rgba(248, 250, 252, 0.65);
    font-size: 0.9rem;
}

.footer-contact-icon {
    color: var(--gold);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: rgba(248, 250, 252, 0.45);
}

/* ==========================================================================
   PORTAL DE RESULTADOS (MODAL & DASHBOARD)
   ========================================================================== */

/* Login Modal / View */
.portal-container {
    display: none; /* Oculto por defecto, se activa con JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 2000;
    overflow-y: auto;
    color: var(--text-dark);
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 10% 10%, rgba(234, 88, 12, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 90%, rgba(245, 158, 11, 0.1) 0%, transparent 40%),
                linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

.login-card {
    background-color: var(--bg-white);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--orange-fire), var(--gold));
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-size: 1.8rem;
    color: var(--bg-dark);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bg-dark);
}

.form-input, .form-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--bg-dark);
    background-color: var(--bg-light);
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus {
    border-color: var(--orange-fire);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.login-btn {
    margin-top: 1rem;
    padding: 0.9rem;
    font-size: 1rem;
    justify-content: center;
    border-radius: 8px;
}

.login-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.login-close-btn:hover {
    background-color: #F1F5F9;
    color: var(--bg-dark);
}

/* ==========================================================================
   ESTILOS DE LOS DASHBOARDS
   ========================================================================== */
.dashboard-layout {
    display: none; /* Se activa tras login */
    min-height: 100vh;
    background-color: var(--bg-light);
    flex-direction: column;
}

/* Barra Superior del Dashboard */
.dashboard-topbar {
    background-color: var(--bg-dark);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
}

.topbar-role-badge {
    background-color: var(--gold);
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Contenedor Principal del Dashboard */
.dashboard-main {
    padding: 2.5rem 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    flex-grow: 1;
}

/* Filtros Generales del Dashboard */
.dashboard-filters-bar {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 200px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   DASHBOARD ESTUDIANTE (VISTA ALUMNO)
   -------------------------------------------------------------------------- */
.student-dashboard-content {
    display: none; /* Se activa si el rol es ALUMNO */
    flex-direction: column;
    gap: 2rem;
}

/* Grid de Resumen del Estudiante */
.student-summary-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 2rem;
}

.card-student-header {
    background: linear-gradient(135deg, var(--bg-dark), #1e293b);
    color: var(--text-light);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.card-student-header::after {
    content: '';
    position: absolute;
    right: -10%;
    bottom: -10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(var(--orange-fire) 0%, transparent 70%);
    opacity: 0.25;
    pointer-events: none;
}

.student-welcome {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.student-welcome span {
    color: var(--gold);
}

.student-meta-info {
    font-size: 0.9rem;
    color: rgba(248, 250, 252, 0.7);
    margin-bottom: 2rem;
}

.score-comparison-box {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-large-display {
    display: flex;
    flex-direction: column;
}

.score-num {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-light);
}

.score-num span {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.5);
}

.score-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    margin-top: 0.25rem;
}

.card-chart-evolution {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.2rem;
    color: var(--bg-dark);
}

.chart-container {
    position: relative;
    flex-grow: 1;
    min-height: 240px;
}

/* Grid de Desglose de Materias Dinámicas */
.student-details-title {
    font-size: 1.5rem;
    color: var(--bg-dark);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.subjects-dynamic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.subject-card-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.subject-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--bg-dark);
}

.subject-card-icon {
    font-size: 1.3rem;
}

.subject-score-badge {
    background-color: var(--bg-light);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.subject-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.subject-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    font-weight: 600;
}

.performance-bar-container {
    background-color: #E2E8F0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.performance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.performance-status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ==========================================================================
   ESTILOS DE ACORDEÓN DE NIVELES DE DESEMPEÑO INTERACTIVOS (NUEVO)
   ========================================================================== */
.levels-accordion-trigger {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-fast);
}

.levels-accordion-trigger:hover {
    background-color: #E2E8F0;
    border-color: var(--text-muted);
}

.levels-details-container {
    display: none;
    margin-top: 1rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
    flex-direction: column;
    gap: 0.75rem;
}

.levels-details-container.active {
    display: flex;
}

.level-desc-row {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    transition: var(--transition-fast);
    font-size: 0.8rem;
    line-height: 1.4;
}

.level-desc-row:hover {
    border-color: var(--text-muted);
    background: var(--bg-white);
}

.level-desc-row.achieved {
    border-width: 2px;
    background-color: rgba(255, 255, 255, 0.9);
    position: relative;
    padding-top: 1.5rem;
}

.level-desc-row.achieved::before {
    content: '✓ Nivel Alcanzado';
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* Colores de nivel en filas */
.subject-card.border-bajo .level-desc-row.achieved { border-color: var(--sem-critico); color: #B91C1C; }
.subject-card.border-bajo .level-desc-row.achieved::before { color: var(--sem-critico); }

.subject-card.border-medio .level-desc-row.achieved { border-color: var(--sem-medio); color: #B45309; }
.subject-card.border-medio .level-desc-row.achieved::before { color: var(--sem-medio); }

.subject-card.border-alto .level-desc-row.achieved { border-color: var(--sem-alto); color: #047857; }
.subject-card.border-alto .level-desc-row.achieved::before { color: var(--sem-alto); }

.subject-card.border-superior .level-desc-row.achieved { border-color: var(--sem-superior); color: #6D28D9; }
.subject-card.border-superior .level-desc-row.achieved::before { color: var(--sem-superior); }

.level-desc-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.level-desc-text {
    color: var(--text-muted);
}

.level-desc-row.achieved .level-desc-text {
    color: var(--text-dark);
}

/* Clases de Color del Semáforo Académico */
.bg-bajo { background-color: var(--sem-critico); color: white; }
.bg-medio { background-color: var(--sem-medio); color: white; }
.bg-alto { background-color: var(--sem-alto); color: white; }
.bg-superior { background-color: var(--sem-superior); color: white; }

.text-bajo { color: var(--sem-critico); }
.text-medio { color: var(--sem-medio); }
.text-alto { color: var(--sem-alto); }
.text-superior { color: var(--sem-superior); }

.border-bajo { border-left: 4px solid var(--sem-critico); }
.border-medio { border-left: 4px solid var(--sem-medio); }
.border-alto { border-left: 4px solid var(--sem-alto); }
.border-superior { border-left: 4px solid var(--sem-superior); }

/* Diagnósticos y Plan de Acción del Estudiante */
.student-insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.insights-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.insights-title {
    font-size: 1.25rem;
    color: var(--bg-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-title i {
    color: var(--gold);
}

.diagnosis-box {
    background-color: var(--bg-light);
    border-left: 4px solid var(--orange-fire);
    padding: 1.25rem;
    border-radius: 0 12px 12px 0;
    font-size: 0.95rem;
    color: var(--bg-dark);
    line-height: 1.6;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.matrix-box {
    padding: 1rem;
    border-radius: 12px;
}

.matrix-box.fortalezas {
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.matrix-box.debilidades {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.matrix-box-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.matrix-box.fortalezas .matrix-box-title { color: #047857; }
.matrix-box.debilidades .matrix-box-title { color: #B91C1C; }

.matrix-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.matrix-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.matrix-list li::before {
    content: '•';
    font-weight: bold;
}

.matrix-box.fortalezas .matrix-list li::before { color: #10B981; }
.matrix-box.debilidades .matrix-list li::before { color: #EF4444; }

/* --------------------------------------------------------------------------
   DASHBOARD DOCENTE / ADMINISTRADOR (VISTA PROFESOR)
   -------------------------------------------------------------------------- */
.teacher-dashboard-content {
    display: none; /* Se activa si el rol es PROFESOR */
    flex-direction: column;
    gap: 2rem;
}

/* Tarjetas de Métricas Consolidadas */
.metrics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.metric-summary-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.metric-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-summary-card:nth-child(1) .metric-summary-icon { background-color: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.metric-summary-card:nth-child(2) .metric-summary-icon { background-color: rgba(16, 185, 129, 0.1); color: #10B981; }
.metric-summary-card:nth-child(3) .metric-summary-icon { background-color: rgba(239, 68, 68, 0.1); color: #EF4444; }
.metric-summary-card:nth-child(4) .metric-summary-icon { background-color: rgba(139, 92, 246, 0.1); color: #8B5CF6; }

.metric-summary-info {
    display: flex;
    flex-direction: column;
}

.metric-summary-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.metric-summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Área de Alertas Tempranas y Gráficos */
.teacher-grid-top {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

.card-alerts-academic {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.alerts-student-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    max-height: 300px;
    padding-right: 0.5rem;
}

.alerts-student-item {
    background-color: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.alerts-student-item:hover {
    background-color: rgba(239, 68, 68, 0.08);
    transform: translateX(3px);
}

.alert-student-info {
    display: flex;
    flex-direction: column;
}

.alert-student-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bg-dark);
}

.alert-student-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.alert-score-badge {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--sem-critico);
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.chart-teacher-container {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* Tabla Dinámica de Estudiantes */
.card-student-table {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-input-wrapper {
    position: relative;
    min-width: 300px;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.search-input:focus {
    border-color: var(--orange-fire);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.student-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.student-table th {
    background-color: var(--bg-light);
    color: var(--bg-dark);
    font-weight: 700;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.student-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.student-table tr:hover td {
    background-color: var(--bg-light);
}

.student-table tr {
    cursor: pointer;
    transition: var(--transition-fast);
}

.table-student-name {
    font-weight: 600;
    color: var(--bg-dark);
}

.table-student-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.table-progress-bar {
    width: 100px;
    background-color: #E2E8F0;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.table-progress-fill {
    height: 100%;
    border-radius: 3px;
}

.audit-action-btn {
    background: none;
    color: var(--orange-fire);
    font-weight: 600;
    font-size: 0.85rem;
}

.audit-action-btn:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* Paginación de Tabla */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--orange-fire);
    color: var(--text-light);
    border-color: var(--orange-fire);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.active {
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
}

/* Estadísticas de Preguntas - Heatmap */
.heatmap-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
    transition: var(--transition-fast);
}

.heatmap-cell:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.heatmap-cell-num {
    font-size: 0.9rem;
}

.heatmap-cell-pct {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Escala de colores del Heatmap (basado en porcentaje de acierto o tasa de falla) */
.heat-low { background-color: #D1FAE5; color: #065F46; border-color: #A7F3D0; }       /* 80-100% acierto (Excelente) */
.heat-med-low { background-color: #ECFDF5; color: #047857; border-color: #6EE7B7; }   /* 70-79% acierto (Alto) */
.heat-med { background-color: #FEF3C7; color: #92400E; border-color: #FDE68A; }       /* 60-69% acierto (Medio) */
.heat-high { background-color: #FFEDD5; color: #9A3412; border-color: #FDBA74; }      /* 50-59% acierto (Alto Riesgo) */
.heat-critical { background-color: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }  /* < 50% acierto (Crítico / Alta Falla) */

/* Pestañas de Sesión del Heatmap */
.btn-session-tab {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
.btn-session-tab:hover {
    border-color: var(--orange-fire);
    color: var(--orange-fire);
}
.btn-session-tab.active {
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-dark-accent));
    color: var(--text-light);
    border-color: var(--bg-dark);
    box-shadow: var(--shadow-sm);
}

.heatmap-area-block {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.heatmap-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.heatmap-area-title {
    font-size: 1.05rem;
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.heatmap-area-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    flex-wrap: wrap;
}
.stat-pill-mini {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    color: var(--text-dark);
}

.heatmap-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* Auditoría Visor Estudiante (Modal o Panel superpuesto) */
.audit-overlay {
    display: none; /* Oculto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    overflow-y: auto;
    padding: 3rem 2rem;
}

.audit-modal {
    background-color: var(--bg-light);
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.audit-header {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audit-header-title {
    font-size: 1.25rem;
}

.audit-close-btn {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audit-close-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.audit-body {
    padding: 2rem;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN (EXPORTACIÓN PDF OFICIAL)
   ========================================================================== */
@media print {
    /* Ocultar todo excepto el reporte */
    body > *:not(#print-report-container) {
        display: none !important;
    }
    
    html, body, .portal-container, .dashboard-layout, #print-report-container {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #0F172A !important;
    }
    
    #print-report-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #0F172A !important;
        background-color: #ffffff !important;
        padding: 0 !important;
        display: block !important;
    }
    
    /* Quitar sombras y bordes pesados */
    .print-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* Configuración de página */
    @page {
        size: letter;
        margin: 1.5cm;
    }
    
    /* Forzar fondo de color e imágenes */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Contenedor invisible en la UI web, se llena dinámicamente y se imprime */
#print-report-container {
    display: none;
    background-color: #ffffff;
    color: #0F172A;
    font-family: var(--font-body);
    width: 800px;
    margin: 0 auto;
    padding: 3rem;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double #0F172A;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.print-logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.print-logo {
    height: 70px;
    width: auto;
}

.print-institution-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
}

.print-institution-info p {
    font-size: 0.8rem;
    color: #64748B;
}

.print-report-type {
    text-align: right;
}

.print-report-type h3 {
    font-size: 1.2rem;
    color: #EA580C;
    margin-bottom: 0.25rem;
}

.print-report-type p {
    font-size: 0.85rem;
    color: #64748B;
}

.print-student-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.print-info-item span {
    font-weight: bold;
}

.print-results-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.print-score-card {
    border: 2px solid #0F172A;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.print-score-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: #0F172A;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
}

.print-table th {
    background-color: #0F172A;
    color: #ffffff;
    padding: 0.75rem;
    text-align: left;
}

.print-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}

.print-table tr:nth-child(even) {
    background-color: #F8FAFC;
}

.print-pill {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.print-pill.bajo { border: 1px solid #EF4444; color: #EF4444; }
.print-pill.medio { border: 1px solid #F59E0B; color: #F59E0B; }
.print-pill.alto { border: 1px solid #10B981; color: #10B981; }
.print-pill.superior { border: 1px solid #8B5CF6; color: #8B5CF6; }

.print-diagnosis {
    border: 1px solid #E2E8F0;
    background-color: #F8FAFC;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    page-break-inside: avoid;
}

.print-diagnosis h4 {
    margin-bottom: 0.75rem;
    color: #0F172A;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 0.5rem;
}

.print-signatures-section {
    display: flex;
    justify-content: space-around;
    margin-top: 4rem;
    page-break-inside: avoid;
}

.signature-block {
    text-align: center;
    width: 200px;
}

.signature-line {
    border-top: 1px solid #64748B;
    margin-bottom: 0.5rem;
}

.signature-name {
    font-weight: bold;
    font-size: 0.85rem;
}

.signature-title {
    font-size: 0.75rem;
    color: #64748B;
}

/* ==========================================================================
   QUICK STATS — PANEL ESTUDIANTE
   ========================================================================== */
.student-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.quick-stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}
.quick-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.quick-stat-icon {
    font-size: 1.6rem;
    color: var(--orange-fire);
    min-width: 2rem;
    text-align: center;
}
.quick-stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.quick-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: var(--font-title);
    color: var(--bg-dark);
    line-height: 1.1;
}
.quick-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* ==========================================================================
   RANKING TABLE — PANEL ESTUDIANTE
   ========================================================================== */
.ranking-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.ranking-header { margin-bottom: 1rem; }
.ranking-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-height: 340px;
    overflow-y: auto;
}
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.ranking-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-dark);
    color: var(--text-light);
}
.ranking-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ranking-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.ranking-table tbody tr:hover { background: var(--bg-light); }
.ranking-table tbody td {
    padding: 0.65rem 1rem;
    color: var(--text-dark);
}
.ranking-row--me {
    background: linear-gradient(90deg, rgba(234,88,12,0.08), rgba(245,158,11,0.08)) !important;
    border-left: 4px solid var(--orange-fire) !important;
}
.ranking-row--me td { color: var(--bg-dark); font-weight: 600; }

/* ==========================================================================
   MODAL DE NIVELES DE DESEMPEÑO — TARJETAS
   ========================================================================== */
.levels-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.levels-modal-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-premium);
    animation: modalFadeIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.93) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.levels-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.levels-modal-title {
    font-size: 1.3rem;
    font-family: var(--font-title);
    color: var(--bg-dark);
    margin-bottom: 0.25rem;
}
.levels-modal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.levels-modal-close {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.levels-modal-close:hover { background: var(--bg-dark); color: white; }
.levels-modal-body { display: flex; flex-direction: column; gap: 1rem; }
.levels-modal-current {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}
.levels-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.level-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    background: var(--bg-white);
    transition: var(--transition-smooth);
    position: relative;
}
.level-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.level-card--achieved {
    border-color: var(--orange-fire);
    background: linear-gradient(135deg, rgba(234,88,12,0.04), rgba(245,158,11,0.06));
    box-shadow: 0 0 0 3px rgba(234,88,12,0.15);
}
.level-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.level-card-name {
    font-weight: 800;
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--bg-dark);
}
.level-card-range {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}
.level-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--orange-fire);
    background: rgba(234,88,12,0.1);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(234,88,12,0.25);
}
.level-card-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.level-card--achieved .level-card-text { color: var(--text-dark); }

/* Override del trigger de acordeón anterior (ahora abre modal) */
.levels-accordion-trigger {
    background: linear-gradient(135deg, rgba(15,23,42,0.06), rgba(15,23,42,0.02));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    transition: var(--transition-fast);
}
.levels-accordion-trigger:hover {
    background: var(--bg-dark);
    color: white;
    border-color: var(--bg-dark);
}
.levels-accordion-trigger i { color: var(--orange-fire); }
.levels-accordion-trigger:hover i { color: var(--gold); }

/* ==========================================================================
   VIDEO IFRAME — FIX PROPORCION
   ========================================================================== */
.video-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}
.video-iframe-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    border-radius: 12px;
}

/* Print: ocultar todos los elementos no-print */
@media print {
    .no-print, .ranking-section, .student-quick-stats,
    .ranking-table-wrapper, .student-insights-grid,
    #student-quick-stats, #ranking-section,
    .dashboard-filters-bar, .dashboard-topbar,
    .student-details-title ~ p { display: none !important; }
}

/* ==========================================================================
   RESPONSIVIDAD
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-title { font-size: 2.8rem; }
    .flexibilidad-container, .simulacion-container { grid-template-columns: 1fr; gap: 3rem; }
    .student-summary-grid, .teacher-grid-top { grid-template-columns: 1fr; }
    .levels-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .fixed-header { padding: 0.75rem 1.5rem; }
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .hero-title { font-size: 2.2rem; }
    .hero-social-proof { flex-direction: column; gap: 1.5rem; }
    .footer-container { grid-template-columns: 1fr; gap: 2rem; }
    .student-insights-grid { grid-template-columns: 1fr; }
    .matrix-grid { grid-template-columns: 1fr; }
    .login-card { padding: 2rem; }
    .topbar-user { gap: 0.5rem; }
    .dashboard-filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { min-width: 100%; }
    .student-quick-stats { grid-template-columns: repeat(2, 1fr); }
    .levels-modal-card { padding: 1.25rem; }
}

@media (max-width: 480px) {
    .student-quick-stats { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LOADING OVERLAY & API ERROR STYLES
   ========================================================================== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: var(--bg-dark);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-spinner-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.loading-logo {
    width: 70px;
    height: auto;
    animation: pulse 1.8s infinite ease-in-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--orange-fire);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-title);
    letter-spacing: 0.5px;
    opacity: 0.85;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* API Error Modal */
.api-error-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.api-error-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.api-error-icon {
    font-size: 3rem;
    color: var(--sem-critico);
}

.api-error-card h3 {
    font-size: 1.25rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--bg-dark);
}

.api-error-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Warning Banner */
.deployment-warning-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 450px;
    background-color: #FEF3C7;
    border: 1px solid #FCD34D;
    color: #92400E;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    z-index: 9999;
    font-size: 0.8rem;
    line-height: 1.5;
}

.warning-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    padding-right: 1.5rem;
}

.warning-banner-content i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
}

.warning-banner-close {
    background: none;
    border: none;
    color: #B45309;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* ==========================================================================
   REDISENO DEL DASHBOARD DEL ESTUDIANTE (Notion/Stripe/Vercel/Linear Style)
   ========================================================================== */

/* Barra de Controles */
.dashboard-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-select-premium {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.45rem 2rem 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-select-premium:focus {
    border-color: var(--orange-fire);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.control-group-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.data-live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-primary-premium {
    background: linear-gradient(135deg, var(--orange-fire), #EA580C);
    border: none;
    color: white;
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.2);
}

.btn-primary-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}

/* 1. Hero Card Principal */
.student-hero-card {
    display: grid;
    grid-template-columns: 1fr auto;
    background: linear-gradient(135deg, #0F172A, #1E293B);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 2.25rem;
    margin-bottom: 2rem;
    color: var(--text-light);
    gap: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
}

.student-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-card-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-card-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--gold);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-student-name {
    font-size: 2rem;
    font-family: var(--font-title);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: #FFFFFF;
}

.hero-meta-grid {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #94A3B8;
}

.hero-meta-item i {
    color: var(--orange-fire);
}

.hero-meta-item strong {
    color: #E2E8F0;
}

.hero-level-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-level-label {
    font-size: 0.8rem;
    color: #94A3B8;
}

.hero-level-badge {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.hero-card-right {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    min-width: 220px;
    text-align: center;
}

.hero-score-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-score-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.hero-score-display {
    font-size: 3.5rem;
    font-family: var(--font-title);
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.hero-score-display .max-score {
    font-size: 1.25rem;
    color: #64748B;
    font-weight: 600;
}

.hero-accuracy-text {
    font-size: 0.78rem;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* 2. Tarjetas Resumen */
.summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.summary-card-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.summary-card-icon {
    font-size: 0.95rem;
}

.summary-card-value {
    font-size: 1.6rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--text-dark);
    margin: 0.25rem 0;
    letter-spacing: -0.02em;
}

.summary-card-footer {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 3 y 7. Rendimiento y Evolución (Bloques de detalles) */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.details-section-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.section-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-card-title {
    font-size: 1.15rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chart-container-premium {
    position: relative;
    width: 100%;
    height: 280px;
}

.diagnosis-text-container {
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.6;
    border-left: 4px solid var(--orange-fire);
    margin-bottom: 1.5rem;
}

.matrix-grid-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.matrix-column-premium {
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
}

.matrix-column-premium.fortalezas {
    border-top: 3px solid #10B981;
}

.matrix-column-premium.debilidades {
    border-top: 3px solid var(--sem-critico);
}

.matrix-title-premium {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.matrix-column-premium.fortalezas .matrix-title-premium { color: #10B981; }
.matrix-column-premium.debilidades .matrix-title-premium { color: var(--sem-critico); }

.matrix-list-premium {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.matrix-list-premium li {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
    position: relative;
    padding-left: 0.85rem;
}

.matrix-list-premium li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-dark);
}

/* Encabezados de Sección */
.section-heading-wrapper {
    margin-top: 2rem;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.25rem;
    font-family: var(--font-title);
    font-weight: 800;
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Session Tabs Wrapper */
.session-tabs-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

/* Responsividad Dashboard */
@media (max-width: 1200px) {
    .summary-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .student-hero-card {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .hero-card-right {
        min-width: 100%;
        padding: 1.25rem;
    }
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
    .matrix-grid-premium {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .summary-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-controls-bar {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    .control-group {
        justify-content: space-between;
    }
    .control-group-actions {
        justify-content: space-between;
    }
}

@media (max-width: 400px) {
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ESTILOS DE AUDITORÍA DE COMPETENCIAS INTERACTIVAS
   ========================================================================== */
.competencies-tabs-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.competency-tab-btn {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.competency-tab-btn:hover {
    background-color: #E2E8F0;
}

.competency-tab-btn.active {
    background-color: var(--orange-fire);
    border-color: var(--orange-fire);
    color: #FFFFFF;
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.2);
}

.competencies-panel-content {
    background-color: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.competency-area-title-inside {
    font-size: 1rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.competency-area-level-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.competency-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.competency-item-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.5;
    background-color: #FFFFFF;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #10B981;
}

.competency-item-check i {
    color: #10B981;
    font-size: 1.05rem;
    margin-top: 0.1rem;
}

.competency-item-lock {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.84rem;
    color: #94A3B8;
    line-height: 1.5;
    background-color: #F1F5F9;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px dashed #CBD5E1;
    opacity: 0.75;
}

.competency-item-lock i {
    color: #94A3B8;
    font-size: 1.05rem;
    margin-top: 0.1rem;
}

.competency-item-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.competency-item-badge.badge-pending {
    background-color: #E2E8F0;
    color: #475569;
}

/* ==========================================================================
   PORTAL LOGIN MODAL OVERLAY
   ========================================================================== */
.portal-container.modal-mode {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: none; /* Controlled dynamically by JS flex/none */
    align-items: center;
    justify-content: center;
}
.portal-container.modal-mode .login-screen {
    background: transparent !important;
    min-height: auto !important;
    padding: 0 !important;
    width: 100%;
}
.portal-container.modal-mode .login-card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   MENÚ MÓVIL PRINCIPAL (LANDING)
   ========================================================================== */
@media (max-width: 768px) {
    .main-nav.active {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #0f172a;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 1.5rem;
        gap: 1rem;
        z-index: 1000;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
    }
}

/* ==========================================================================
   PORTAL DOCENTE - SIDEBAR Y CONTENIDO TABS
   ========================================================================== */
.teacher-dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
}

.teacher-sidebar {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 70px;
    z-index: 999;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-header i {
    font-size: 1.25rem;
    color: var(--orange-fire);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-dark);
}

.teacher-menu-checkbox {
    display: none;
}

.teacher-menu-hamburger-label {
    display: none; /* Oculto en escritorio */
}

.sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.sidebar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: auto;
}

.sidebar-btn:hover {
    background-color: #F8FAFC;
    color: var(--orange-fire);
}

.sidebar-btn.active {
    background-color: #FFF7ED;
    color: var(--orange-fire);
    font-weight: 700;
}

.teacher-main-content {
    width: 100%;
    min-width: 0;
}

.teacher-tab-pane {
    display: none;
}
.teacher-tab-pane.active {
    display: block;
}

/* Vista del Contrato Estilo Legal */
.contract-document {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
}
.contract-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 1rem;
}
.contract-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: #0f172a;
}
.contract-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}
.contract-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem 0;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
}
.contract-body {
    font-size: 0.95rem;
    text-align: justify;
}
.contract-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}
.signature-box {
    border-top: 1px solid #475569;
    padding-top: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* Vista del Reglamento Estilo Lector */
.reglamento-document {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    color: #334155;
    line-height: 1.7;
    max-width: 850px;
    margin: 0 auto;
}
.reglamento-preambulo {
    font-style: italic;
    background-color: #f8fafc;
    border-left: 4px solid var(--orange-fire);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}
.chapter-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--orange-fire);
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid #fed7aa;
    padding-bottom: 0.35rem;
}
.article-box {
    margin-bottom: 1.5rem;
}
.article-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}
.acapite-box {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border-left: 2px solid #e2e8f0;
}

/* Perfil Premium Card */
.profile-premium-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.profile-avatar-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--orange-fire);
    box-shadow: 0 10px 20px -3px rgba(234, 88, 12, 0.2), 0 4px 6px -2px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.profile-avatar-container:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 25px -5px rgba(234, 88, 12, 0.35), 0 8px 10px -3px rgba(0,0,0,0.1);
}
.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.profile-cargo {
    font-size: 1rem;
    color: var(--orange-fire);
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.profile-details-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.75rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
}
.profile-detail-label {
    color: var(--text-muted);
    font-weight: 500;
}
.profile-detail-value {
    color: #1e293b;
    font-weight: 700;
}

@media (max-width: 768px) {
    .teacher-dashboard-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }
    .teacher-sidebar {
        width: 100%;
        padding: 1rem;
    }
    .sidebar-header {
        margin-bottom: 1rem;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 1rem;
        width: auto;
    }
    .contract-document, .reglamento-document, .profile-premium-card {
        padding: 1.5rem;
    }
    .contract-signatures {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   DASHBOARD DOCENTE — DISEÑO PREMIUM FULL WIDTH & HERO
   ========================================================================== */
.dashboard-layout:has(#teacher-dashboard-content:not([style*="display: none"])) .dashboard-main {
    max-width: 96% !important;
    padding-left: 2rem;
    padding-right: 2rem;
}

.teacher-welcome-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.2rem 2.5rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.teacher-welcome-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(234, 88, 12, 0.15) 0%, rgba(234, 88, 12, 0) 70%);
    pointer-events: none;
}

.welcome-hero-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 75%;
}

.welcome-avatar-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--orange-fire);
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.3);
    flex-shrink: 0;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-avatar-wrapper:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 15px 30px rgba(234, 88, 12, 0.45);
    border-color: var(--gold);
}

.welcome-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.welcome-avatar-wrapper:hover img {
    filter: brightness(1.05);
}

.welcome-hero-text-details {
    display: flex;
    flex-direction: column;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(234, 88, 12, 0.2);
    color: #FFedd5;
    border: 1px solid rgba(234, 88, 12, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0 0 0.25rem 0;
    color: #FFFFFF;
    font-family: var(--font-title);
    letter-spacing: -0.5px;
}

.welcome-title span {
    color: var(--orange-fire);
}

.welcome-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0;
}

.welcome-hero-right {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.hero-info-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 145px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.hero-info-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-info-label i {
    color: var(--orange-fire);
}

.hero-info-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFFFFF;
}

@media (max-width: 992px) {
    .teacher-sidebar {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .sidebar-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .teacher-menu-hamburger-label {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--orange-fire);
        color: #fff;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-weight: 700;
        font-size: 0.88rem;
        cursor: pointer;
        user-select: none;
        margin-top: 0.75rem;
    }

    .sidebar-nav {
        display: none; /* Oculto por defecto en móvil */
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .teacher-menu-checkbox:checked ~ .sidebar-nav {
        display: flex;
    }
    
    .sidebar-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .teacher-welcome-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .welcome-hero-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
        max-width: 100%;
        gap: 1rem;
    }
    
    .welcome-avatar-wrapper {
        width: 90px;
        height: 90px;
    }
    
    .welcome-hero-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        width: 100%;
    }
    
    .hero-info-item {
        min-width: 0;
        text-align: center;
    }
    
    .hero-info-label {
        justify-content: center;
    }
}

/* Dashboard Docente Full Width Optimization */
.dashboard-layout:has(#teacher-dashboard-content:not([style*="display: none"])) .dashboard-main {
    max-width: 98% !important;
    width: 98% !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    margin-left: auto;
    margin-right: auto;
}

.teacher-main-content {
    width: 100% !important;
}

.teacher-tab-pane {
    width: 100% !important;
}

.dashboard-filters-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.metrics-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    width: 100% !important;
}

.teacher-grid-top {
    display: grid !important;
    grid-template-columns: 1fr 1.5fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

.card-alerts-academic, .chart-teacher-container {
    width: 100% !important;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .teacher-grid-top {
        grid-template-columns: 1fr !important;
    }
}

/* Animacion de pulso de resalte al volver de auditar */
@keyframes rowHighlightPulse {
    0% {
        background-color: rgba(234, 88, 12, 0.25);
        box-shadow: inset 0 0 10px rgba(234, 88, 12, 0.2);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

.row-highlight-pulse {
    animation: rowHighlightPulse 2s ease-out;
}

/* Estilos para edición de Contabilidad Docente y Calendarios */
.edit-table-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
    background-color: #ffffff;
    box-sizing: border-box;
}
.edit-table-input:focus {
    outline: none;
    border-color: var(--orange-fire);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}
.btn-contabilidad-save {
    background: #10B981;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.2s;
}
.btn-contabilidad-save:hover {
    background: #059669;
}
.btn-contabilidad-cancel {
    background: #64748B;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.2s;
}
.btn-contabilidad-cancel:hover {
    background: #475569;
}
.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-control-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}



/* ---------------------------------------------------------------------------
   ESTILOS PARA EL MÓDULO DE CERTIFICADOS ESTUDIANTILES
   --------------------------------------------------------------------------- */

/* Segmentos de pestañas internas */
.cert-segments .segment-btn:hover {
    border-color: #EA580C !important;
    color: #EA580C !important;
    background: #FFF7ED !important;
}
.cert-segments .segment-btn.active {
    box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.2), 0 2px 4px -2px rgba(234, 88, 12, 0.1);
}

/* Buscador de estudiantes */
#student-cert-search-results::-webkit-scrollbar {
    width: 6px;
}
#student-cert-search-results::-webkit-scrollbar-track {
    background: #F1F5F9;
}
#student-cert-search-results::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
#student-cert-search-results::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Vista previa interactiva */
#student-cert-live-preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#student-cert-live-preview-container::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 6px;
}
#student-cert-live-preview-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 6px;
}
#student-cert-live-preview-container::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

@media print {
    /* Configuración de página con márgenes nativos de 18mm */
    @page {
        size: letter;
        margin: 18mm !important;
    }
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    /* Contenedor principal de impresión en pantalla que ocupa todo el ancho disponible */
    #print-report-container:not(.student-cert-print-mode) {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
    }

    /* Estilos específicos para la certificación de estudiantes (mantener intactos) */
    body.student-cert-print-mode {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    #print-report-container.student-cert-print-mode {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
    }

    .single-page-print {
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        height: 9.8in !important;
        max-height: 9.8in !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .student-certificate-page {
        width: 8.5in !important;
        height: 11.0in !important;
        max-width: 8.5in !important;
        max-height: 11.0in !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        padding: 0.8in 0.6in 0.6in 0.6in !important;
        position: relative !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-family: 'Montserrat', 'Arial', sans-serif !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
        overflow: hidden !important;
    }
}

/* ==========================================================================
   OPTIMIZACIÓN DE ESPACIADO VERTICAL DEL DASHBOARD (VERSIÓN 6.0)
   ========================================================================== */

/* 1. Gap entre bloques principales del dashboard estudiante */
#student-dashboard-content {
    gap: 1.15rem !important;
}

#student-dashboard-content .student-hero-card {
    margin-bottom: 0.95rem !important;
}

#student-dashboard-content .summary-cards-grid {
    margin-bottom: 0.95rem !important;
}

#student-dashboard-content .dashboard-details-grid {
    margin-bottom: 0.95rem !important;
}

#student-dashboard-content #student-competencies-section {
    margin-top: 0.95rem !important;
}

#student-dashboard-content .section-heading-wrapper {
    margin-top: 0.95rem !important;
    margin-bottom: 0.65rem !important;
}

/* 2. Layout 3x2 del desglose de asignaturas y unificación de altura */
#student-dashboard-content .subjects-dynamic-grid {
    display: grid !important;
    align-items: stretch !important;
    gap: 1.15rem !important;
}

@media (min-width: 901px) {
    #student-dashboard-content .subjects-dynamic-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 900px) and (min-width: 601px) {
    #student-dashboard-content .subjects-dynamic-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 600px) {
    #student-dashboard-content .subjects-dynamic-grid {
        grid-template-columns: 1fr !important;
    }
}

#student-dashboard-content .subject-card {
    height: 100% !important;
}

#student-dashboard-content .summary-cards-grid {
    align-items: stretch !important;
    gap: 1rem !important;
}

#student-dashboard-content .summary-card {
    height: 100% !important;
}

/* Ocultar el contenedor de certificados en modo pantalla */
#print-student-certificate {
    display: none;
}


