/* ============================================================
   SISTEMA DE ESTILOS MVC - COMPLEJO EDUCATIVO PARROQUIAL
   Desarrollado para alta vistosidad y adaptabilidad
============================================================ */

/* ============================================================
   01. VARIABLES GLOBALES & RESET
   (Aquí controlas los colores principales de todo el sistema)
============================================================ */
:root {
    --cyan:      #00f5ff;
    --cyan-dim:  rgba(0, 245, 255, 0.18);
    --cyan-glow: rgba(0, 245, 255, 0.45);
    --gold:      #fbbf24;
    --gold-dim:  rgba(251, 191, 36, 0.15);
    --violet:    #7c3aed;
    --success:   #10b981;
    --danger:    #ef4444;
    --bg:        #020817;
    --bg-card:   rgba(255, 255, 255, 0.030);
    --text:      #e2f4ff;
    --text-muted:#64748b;
    --border:    rgba(0, 245, 255, 0.15);
    --radius:    16px;
    --font-head: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
}

*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html { 
    scroll-behavior: smooth; 
}

body {
    background: var(--bg);
    font-family: var(--font-body);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 16px;
    line-height: 1.6;
}

/* ============================================================
   02. FONDOS ANIMADOS (COSMOS Y CUADRÍCULA)
   (Efectos visuales del fondo)
============================================================ */
#cosmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Cuadrícula de líneas de fondo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,245,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,245,255,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
    pointer-events: none;
}

/* Sombra circular (Vignette) para dar profundidad */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(2,8,23,0.85) 100%);
    z-index: 2;
    pointer-events: none;
}

/* ============================================================
   03. ESTRUCTURA PRINCIPAL (LAYOUT)
============================================================ */
main {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
    gap: 3rem;
    width: 100%;
}

/* ============================================================
   04. TARJETAS EFECTO CRISTAL (GLASSMORPHISM)
   (Contenedores principales de perfil, pagos y notas)
============================================================ */
@property --rotacion {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.glass {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    /* ¡CRUCIAL!: Quitamos overflow: hidden para que el rayo y su brillo puedan verse por fuera del borde */
    overflow: visible; 
}

/* El rayo que órbita persiguiendo el contorno exacto */
.glass::before {
    content: '';
    position: absolute;
    /* Se posiciona exactamente en la línea del borde exterior */
    inset: -1px; 
    border-radius: var(--radius);
    padding: 2px; /* Grosor de la línea del rayo */
    
    /* Gradiente cónico hiperbrillante */
    background: conic-gradient(
        from var(--rotacion),
        transparent 40%,
        rgba(0, 119, 255, 0.4) 70%,  /* Azul Eléctrico */
        rgba(0, 245, 255, 0.9) 90%,  /* Azul Neón */
        #00f5ff 100%                 /* Cabeza del rayo */
    );
    
    /* Máscara perfecta: el 'content-box' hace que el centro se vuelva invisible */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    /* Animación fluida de rotación periférica */
    animation: girar-rayo 4s linear infinite;
    filter: drop-shadow(0 0 5px rgba(0, 245, 255, 0.6));
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s, filter 0.3s;
}

/* Efecto Hover potenciado */
.glass:hover::before { 
    opacity: 1; 
    animation-duration: 2s; 
    filter: drop-shadow(0 0 8px #00f5ff) drop-shadow(0 0 15px #0077ff);
}

/* La animación que altera el ángulo del gradiente para obligarlo a dar la vuelta completa */
@keyframes girar-rayo {
    0% {
        --rotacion: 0deg;
    }
    100% {
        --rotacion: 360deg;
    }
}

/* Acento de la esquina superior izquierda */
.glass::after {
    content: '';
    position: absolute;
    top: -1px; left: -1px; /* Alineado al nuevo borde exterior */
    width: 40px; height: 40px;
    border-top: 2px solid #00f5ff;
    border-left: 2px solid #00f5ff;
    border-radius: var(--radius) 0 0 0;
    box-shadow: -3px -3px 12px rgba(0, 245, 255, 0.4);
    pointer-events: none;
    z-index: 2;
}
/* ============================================================
   05. SECCIÓN DEL LOGO INSTITUCIONAL
   (Se mantiene en tamaño grande por solicitud)
============================================================ */
.logo-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    animation: fadeInDown 0.8s ease both;
    max-width: 110%;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Contenedor del logo y anillos */
.logo-wrapper {
    position: relative;
    width: 200px; /* Tamaño grande respetado */
    height: 200px; /* Tamaño grande respetado */
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrapper img {
    width: 200px; /* Tamaño grande respetado */
    height: 200px; /* Tamaño grande respetado */
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px var(--cyan-glow));
}

/* Anillos giratorios */
.ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
}
.ring-1 {
    inset: 0;
    border-color: var(--cyan);
    opacity: 0.5;
    animation: spin 8s linear infinite;
    border-top-color: transparent;
    border-left-color: transparent;
}
.ring-2 {
    inset: -10px;
    border-color: var(--gold);
    opacity: 0.35;
    animation: spin 14s linear infinite reverse;
    border-right-color: transparent;
    border-bottom-color: transparent;
}
.ring-3 {
    inset: -22px;
    border-color: var(--violet);
    opacity: 0.2;
    animation: spin 20s linear infinite;
    border-top-color: transparent;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* Puntos brillantes en los anillos */
.ring-1::before, .ring-2::before {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    top: 0; left: 50%;
    transform: translateX(-50%);
}
.ring-1::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.ring-2::before { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

/* Textos del Logo */
.logo-title {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, var(--gold) 0%, #fff 50%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    line-height: 1.1;
}

.logo-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.line-deco {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 400px;
}
.line-deco::before, .line-deco::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--cyan), transparent);
}
.line-deco span {
    color: var(--cyan);
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-family: var(--font-head);
    white-space: nowrap;
}

/* ============================================================
   06. BARRA DE BÚSQUEDA (FORMULARIO)
============================================================ */
.search-wrapper {
    width: 100%;
    max-width: 560px;
    animation: fadeInUp 0.9s ease 0.2s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 245, 255, 0.04);
    border: 1px solid var(--cyan);
    border-radius: 60px;
    padding: 6px;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: box-shadow 0.3s;
}

.search-form:focus-within {
    box-shadow: 0 0 40px rgba(0, 245, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Animación de escáner en el buscador */
.search-form::after {
    content: '';
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 50%;
    border-radius: 60px;
    background: linear-gradient(90deg, transparent, rgba(0,245,255,0.06), transparent);
    animation: scan 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scan {
    0%   { left: -50%; }
    100% { left: 100%; }
}

.search-form input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    padding: 0.85rem 1.25rem;
    -moz-appearance: textfield;
}

.search-form input::-webkit-outer-spin-button,
.search-form input::-webkit-inner-spin-button { -webkit-appearance: none; }

.search-form input::placeholder {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 0.1em;
}


@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50%       { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

/* ============================================================
   06-B. BOTONES DE ICONO (.btn-icon) — BÚSQUEDA Y MICRÓFONO
   Diseño moderno glassmorphism cyberpunk con hover premium
============================================================ */

/* Base compartida para todos los botones de icono */
.btn-icon {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform        0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow       0.3s ease,
        background-color 0.3s ease,
        border-color     0.3s ease;
    overflow: hidden;
    outline: none;
    z-index: 1;
}

/* Efecto de onda interior al hacer clic (ripple) */
.btn-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.btn-icon:active::after {
    opacity: 1;
    transform: scale(1.6);
    transition: opacity 0s, transform 0s;
}
.btn-icon:active {
    transform: scale(0.92);
}

/* ── Botón BUSCAR (lupa) ── */
.btn-search {
    background: linear-gradient(135deg,
        rgba(0, 245, 255, 0.25) 0%,
        rgba(0, 136, 170, 0.35) 100%
    );
    border: 1.5px solid rgba(0, 245, 255, 0.6);
    color: var(--cyan);
    box-shadow:
        0 0 14px rgba(0, 245, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.btn-search svg,
.btn-search i {
    filter: drop-shadow(0 0 4px rgba(0, 245, 255, 0.7));
    transition: filter 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-search:hover {
    background: linear-gradient(135deg,
        rgba(0, 245, 255, 0.45) 0%,
        rgba(0, 200, 230, 0.55) 100%
    );
    border-color: #00f5ff;
    color: #ffffff;
    transform: scale(1.12) rotate(-8deg);
    box-shadow:
        0 0 28px rgba(0, 245, 255, 0.55),
        0 0 60px rgba(0, 245, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-search:hover svg,
.btn-search:hover i {
    filter: drop-shadow(0 0 8px #00f5ff) drop-shadow(0 0 18px rgba(0,245,255,0.6));
    transform: scale(1.15);
}

.btn-search:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

/* Anillo de escaneo giratorio visible en hover */
.btn-search::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: var(--cyan);
    border-right-color: rgba(0,245,255,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: btn-spin 1.2s linear infinite paused;
}
.btn-search:hover::before {
    opacity: 1;
    animation-play-state: running;
}

/* ── Botón MICRÓFONO ── */
.btn-voice {
    margin-right: 4px;
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 0.18) 0%,
        rgba(124, 58, 237, 0.22) 100%
    );
    border: 1.5px solid rgba(251, 191, 36, 0.45);
    color: var(--gold);
    box-shadow:
        0 0 14px rgba(251, 191, 36, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.btn-voice svg,
.btn-voice i {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
    transition: filter 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-voice:hover {
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 0.38) 0%,
        rgba(167, 100, 255, 0.38) 100%
    );
    border-color: var(--gold);
    color: #ffffff;
    transform: scale(1.12);
    box-shadow:
        0 0 28px rgba(251, 191, 36, 0.5),
        0 0 60px rgba(124, 58, 237, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-voice:hover svg,
.btn-voice:hover i {
    filter: drop-shadow(0 0 6px #fbbf24) drop-shadow(0 0 16px rgba(251,191,36,0.55));
    transform: scale(1.2);
}

.btn-voice:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* Pulso de onda sonora en hover del micrófono */
.btn-voice::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(251, 191, 36, 0.5);
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.3s ease;
    animation: btn-wave 1.4s ease-out infinite paused;
}
.btn-voice:hover::before {
    opacity: 1;
    animation-play-state: running;
}

/* Estado activo de grabación del micrófono */
.btn-voice.recording {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.3) 0%,
        rgba(239, 68, 68, 0.15) 100%
    );
    border-color: var(--danger);
    color: var(--danger);
    animation: btn-recording-pulse 1.2s ease infinite;
}

@keyframes btn-recording-pulse {
    0%, 100% {
        box-shadow: 0 0 16px rgba(239,68,68,0.3);
    }
    50% {
        box-shadow: 0 0 32px rgba(239,68,68,0.65), 0 0 64px rgba(239,68,68,0.2);
    }
}

/* ── Animaciones de soporte ── */
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

@keyframes btn-wave {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(1.8); opacity: 0;   }
}

.btn-search {
    background: linear-gradient(135deg, var(--cyan), #0088aa);
    color: #020817;
    box-shadow: 0 0 18px var(--cyan-glow);
}
.btn-search:hover {
    transform: scale(1.1);
    box-shadow: 0 0 35px var(--cyan);
    background: linear-gradient(135deg, #fff, var(--cyan));
}
.btn-search:active { transform: scale(0.95); }

.search-hint {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    min-height: 1.4em;
    transition: color 0.3s;
}
.search-hint.error { color: var(--danger); }
.search-hint.success { color: var(--success); }

/* ============================================================
   07. ÁREA DE RESULTADOS (PERFIL DEL ESTUDIANTE)
============================================================ */
.results-area {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease both;
}

.profile-card { 
    padding: 2.5rem 2rem 2rem; 
}

.profile-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Marco de foto del estudiante */
.photo-frame {
    width: 140px; 
    height: 140px;
    margin: 0 auto 1.5rem auto; /* 'margin: 0 auto' centra el marco perfectamente */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(0,245,255,0.3);
    box-shadow: 0 0 0 6px rgba(0,245,255,0.07), 0 0 40px rgba(0,245,255,0.3);
    position: relative;
    z-index: 2;
}

.photo-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1.5px dashed rgba(0,245,255,0.4);
    animation: spin 10s linear infinite;
    z-index: 1;
}
.photo-ring::before {
    content: '';
    position: absolute;
    width: 8px; height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    top: 50%; left: -4px;
    transform: translateY(-50%);
    box-shadow: 0 0 12px var(--cyan);
}

.photo-ring-outer {
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    border: 1px solid rgba(251,191,36,0.2);
    animation: spin 18s linear infinite reverse;
    z-index: 1;
}

    .student-name {
        font-family: var(--font-head);
        font-size: clamp(1.3rem, 4vw, 2rem);
        font-weight: 700;
        text-align: center;
        background: linear-gradient(90deg, var(--cyan), #fff, var(--gold));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: 0.04em;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

/* Cuadrícula de información (Grado, Sección, etc.) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: rgba(0, 245, 255, 0.03);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: 12px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.info-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    border-radius: 3px 0 0 3px;
}

.info-item:hover {
    background: rgba(0, 245, 255, 0.07);
    border-color: rgba(0, 245, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 245, 255, 0.1);
}

.info-icon-wrap {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(0, 245, 255, 0.1);
    color: var(--cyan);
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(0,245,255,0.15);
}

.info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.info-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

/* ============================================================
   08. ESTADO DE PAGOS Y ALERTAS
============================================================ */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.section-header-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(0,245,255,0.2), rgba(0,245,255,0.05));
    border: 1px solid rgba(0,245,255,0.3);
    color: var(--cyan);
    box-shadow: 0 0 18px rgba(0,245,255,0.2);
    flex-shrink: 0;
}

.section-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.payment-card { 
    padding: 2rem; 
}

.payment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Insignias de solvencia */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.badge-status::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    filter: blur(8px);
    opacity: 0.4;
    z-index: -1;
}

.badge-solvente {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    animation: pulse-success 2.5s ease infinite;
}

@keyframes pulse-success {
    0%,100% { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
    50%      { box-shadow: 0 0 30px rgba(16,185,129,0.4); }
}

.badge-insolvente {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    animation: pulse-error 2.5s ease infinite;
}

@keyframes pulse-error {
    0%,100% { box-shadow: 0 0 20px rgba(239,68,68,0.2); }
    50%      { box-shadow: 0 0 30px rgba(239,68,68,0.4); }
}

.payment-count { text-align: right; }
.payment-count .big-num {
    font-family: var(--font-head);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--cyan);
    line-height: 1;
    text-shadow: 0 0 20px var(--cyan-glow);
}
.payment-count .big-denom { color: var(--text-muted); font-size: 1.3rem; }
.payment-count .months-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}
.months-paid-list {
    font-size: 0.88rem;
    color: rgba(0,245,255,0.7);
    margin-top: 0.3rem;
    letter-spacing: 0.02em;
}

/* Barra de progreso de pagos */
.progress-track {
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,245,255,0.1);
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cyan), var(--success));
    box-shadow: 0 0 12px var(--cyan-glow);
    transition: width 1s ease;
}

/* Cajas de mensajes (Success, Warning, Error) */
.msg-box {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.02em;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}
.msg-box.success { background: rgba(16, 185, 129, 0.07); border: 1px solid rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.msg-box.warning { background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.25); color: var(--gold); }
.msg-box.error { background: rgba(239, 68, 68, 0.07); border: 1px solid rgba(239, 68, 68, 0.25); color: #fca5a5; }

/* Texto en movimiento para alertas */
.ticker-text {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 10s linear infinite;
}
@keyframes ticker {
    0%   { transform: translateX(60%); }
    100% { transform: translateX(-100%); }
}

/* Tarjeta de acceso restringido */
.restricted-card {
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.lock-icon-wrap {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.08);
    border: 2px solid rgba(239, 68, 68, 0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--danger);
    box-shadow: 0 0 30px rgba(239,68,68,0.2);
    animation: pulse-error 3s ease infinite;
}

.restricted-title {
    font-family: var(--font-head);
    font-size: 1.3rem;
    color: var(--danger);
    letter-spacing: 0.08em;
}
.restricted-text {
    color: var(--text-muted);
    max-width: 420px;
    font-size: 1rem;
    line-height: 1.7;
}

/* ============================================================
   09. TABLAS DE CALIFICACIONES
============================================================ */
.grades-card {
    padding: 2rem;
    /* Esto asegura que la tabla haga scroll horizontal si la pantalla es muy chica */
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}

.grades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px; /* Evita que las columnas se aplasten demasiado */
}

.grades-table thead tr {
    background: rgba(0, 245, 255, 0.06);
}

.grades-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(0, 245, 255, 0.2);
    white-space: nowrap;
}

.grades-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 245, 255, 0.06);
    color: var(--text);
    transition: background 0.2s;
    font-weight: 500;
}

/* ============================================================
   CORRECCIÓN DE COLUMNAS SALTADAS (TABLA DE NOTAS)
   ============================================================ */

/* 1. Quitamos el relative del TR para que las columnas vuelvan a su sitio */
.grades-table tbody tr {
    transition: all 0.2s;
    position: static; /* Forzamos a que no interfiera con las celdas */
}

/* 2. El fondo de toda la fila cambia al pasar el mouse */
.grades-table tbody tr:hover td {
    background: rgba(0, 245, 255, 0.05);
}

/* 3. Preparamos la PRIMERA CELDA (#) para contener el brillo */
.grades-table tbody tr td:first-child {
    position: relative;
}

/* 4. El "Palito" brillante cian ahora nace desde la primera celda */
.grades-table tbody tr td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--cyan);
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.3s ease;
    box-shadow: 0 0 12px var(--cyan);
    z-index: 5;
}

/* 5. Al pasar el mouse por la FILA, activamos el brillo de la PRIMERA CELDA */
.grades-table tbody tr:hover td:first-child::before {
    opacity: 1;
}

/* Pastillas de colores para las notas */
.grade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.grade-excellent {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}
.grade-good {
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.grade-poor {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

/* ============================================================
   10. PANEL DE ESTUDIANTES CONECTADOS (ONLINE)
============================================================ */
.online-btn {
    position: fixed;
    top: 14px; right: 14px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.4);
    color: #38bdf8;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    backdrop-filter: blur(12px);
    transition: all 0.3s;
    box-shadow: 0 0 16px rgba(14,165,233,0.2);
}
.online-btn:hover { 
    background: rgba(14, 165, 233, 0.22); 
    box-shadow: 0 0 30px rgba(14,165,233,0.4); 
    transform: translateY(-2px); 
}
.online-btn.blink { animation: blink-pulse 1s ease 4; }

@keyframes blink-pulse {
    0%,100% { box-shadow: 0 0 16px rgba(14,165,233,0.2); }
    50%      { box-shadow: 0 0 40px rgba(14,165,233,0.7); }
}

.online-badge {
    background: var(--danger);
    color: white;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 0 10px rgba(239,68,68,0.5);
}

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: live-pulse 1.5s ease infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.online-panel {
    position: fixed;
    top: 70px; right: 14px;
    width: 310px;
    background: rgba(2, 10, 28, 0.9);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(0,245,255,0.1), 0 20px 60px rgba(0,0,0,0.5);
    display: none;
    z-index: 9998;
    overflow: hidden;
    animation: panelIn 0.1s ease;
}
@keyframes panelIn {
    from { opacity:0; transform: translateY(-10px) scale(0.96); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}

.panel-header {
    background: linear-gradient(135deg, rgba(0,245,255,0.1), rgba(0,245,255,0.04));
    border-bottom: 1px solid rgba(0,245,255,0.15);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-head);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--cyan);
    text-transform: uppercase;
}
.panel-header-left { display: flex; align-items: center; gap: 8px; }

.panel-close {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}
.panel-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

.panel-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,245,255,0.2) transparent;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.2); border-radius: 2px; }

.student-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0,245,255,0.05);
}
.student-entry:last-child { border-bottom: none; }
.student-entry:hover { background: rgba(0,245,255,0.06); }

.student-entry img {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0,245,255,0.3);
    flex-shrink: 0;
}

.student-entry-name { font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.student-entry-info { font-size: 0.75rem; color: var(--text-muted); }
.student-entry-time { font-size: 0.7rem; color: rgba(0,245,255,0.5); margin-top: 2px; font-family: var(--font-head); }

/* ============================================================
   11. PIE DE PÁGINA (FOOTER) Y ALERTAS GLOBALES (SWAL)
============================================================ */
footer {
    position: relative;
    z-index: 10;
    padding: 1.5rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(0, 245, 255, 0.08);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(6px);
    letter-spacing: 0.03em;
}
footer span.accent { color: var(--cyan); font-weight: 600; }
footer span.gold   { color: var(--gold); font-weight: 700; }

.swal2-popup {
    background: rgba(2, 12, 30, 0.96) !important;
    border: 1px solid rgba(0,245,255,0.3) !important;
    border-radius: 16px !important;
    box-shadow: 0 0 40px rgba(0,245,255,0.2) !important;
    font-family: var(--font-body) !important;
}
.swal2-title { color: var(--cyan) !important; font-family: var(--font-head) !important; }
.swal2-html-container { color: var(--text) !important; }
.swal2-confirm { background: var(--cyan) !important; color: #020817 !important; font-weight: 700 !important; }

/* ============================================================
   12. DISEÑO RESPONSIVO (MEJORAS DE ADAPTABILIDAD)
   (Garantiza que se vea perfecto en cualquier dispositivo)
============================================================ */

/* Dispositivos medianos (Tablets en vertical) */
@media (max-width: 900px) {
    main { 
        padding: 1.5rem 1rem; 
        gap: 2rem; 
    }
    .results-area { 
        max-width: 100%; 
    }
    .payment-row { 
        flex-direction: column; 
        gap: 1.5rem; 
    }
    .payment-count { 
        text-align: left; 
    }
}

/* Dispositivos pequeños (Smartphones normales) */
@media (max-width: 600px) {
    .profile-card, .payment-card, .grades-card { 
        padding: 1.5rem; /* Menos espacio interior en móviles */
    }
    .profile-top { 
        padding: 0; 
    }
    
    /* El logo permanece igual de imponente (No se cambia el width/height) */
    
    .student-name {
        font-size: 1.5rem; /* Ajuste para que nombres largos no se salgan */
    }

    .info-grid { 
        grid-template-columns: 1fr; /* Una columna para la info del perfil */
    }
    
    .grades-table { 
        font-size: 0.82rem; 
    }
    .grades-table th, .grades-table td { 
        padding: 0.65rem 0.6rem; 
    }
    
    .online-panel { 
        width: calc(100vw - 28px); /* El panel ocupa todo el ancho de la pantalla */
        right: 14px;
    }
}

/* Dispositivos ultra pequeños (Smartphones antiguos) */
@media (max-width: 380px) {
    .logo-title { 
        font-size: 1.6rem; 
    }
    .search-form { 
        flex-direction: column; 
        border-radius: 20px; 
        padding: 12px; 
    }
    .search-form input[type="number"] { 
        width: 100%; 
        text-align: center; 
    }
    .search-form::after { 
        border-radius: 20px; 
    }
    .btn-icon { 
        width: 100%; 
        border-radius: 12px; 
        margin-top: 8px; 
    }
    .btn-voice { margin-right: 0; }
}

/* ============================================================
   SISTEMA DE DISEÑO UNIFICADO (ASIGNATURAS & MÓDULOS)
   Efectos Cyberpunk, Glassmorphism y Grid Responsivo
============================================================ */

:root {
    --glass-bg: rgba(13, 25, 48, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --stat-card-bg: rgba(255, 255, 255, 0.03);
    
    /* Colores de estado */
    --success: #10b981;
    --danger: #ef4444;
    --gold: #fbbf24;
    --cyan: #00f5ff;
    --text-muted: #94a3b8;
}

/* Contenedor de Sección */
.uni-section-container {
    padding: 2rem;
    border-radius: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* Encabezado de Sección */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.uni-materia-count {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: none;
    font-weight: 400;
}

/* Grid de Tarjetas Estadísticas */
.uni-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.uni-stat-card {
    background: var(--stat-card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.uni-stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--stat-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), 0 0 15px -5px var(--stat-color);
}

/* Efecto de barra lateral en tarjeta */
.uni-stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--stat-color);
    box-shadow: 0 0 10px var(--stat-color);
}

.uni-stat-icon {
    color: var(--stat-color);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.uni-stat-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.uni-stat-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Diseño de Tabla Unificada */
.uni-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.uni-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0,0,0,0.2);
}

.uni-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    border-bottom: 2px solid var(--glass-border);
}

.uni-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

/* Nombres de Materia y Docente */
.uni-materia-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.uni-docente-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Badges de Notas */
.uni-badge-nota {
    display: inline-block;
    min-width: 40px;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.np-ok     { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.np-bad    { background: rgba(239, 68, 68, 0.15);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3);  }
.np-warn   { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.np-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.np-none   { color: var(--text-muted); opacity: 0.5; font-weight: 400; }

/* Puntos Totales */
.uni-puntos-val {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

/* Pie de Tabla: Promedios por Periodo */
.uni-table tfoot td {
    background: rgba(255, 255, 255, 0.02);
    border-top: 2px solid var(--glass-border);
    border-bottom: none;
    padding: 0.9rem 1rem;
}

.uni-footer-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

/* Iconos de Acción del Encabezado (Buzón / Boleta PDF) */
.section-action-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--action-color, var(--cyan));
    color: var(--action-color, var(--cyan));
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.section-action-icon:hover {
    background: var(--action-color, var(--cyan));
    color: #05070d;
    box-shadow: 0 0 15px var(--action-color, var(--cyan));
    transform: translateY(-2px);
}

.section-action-icon i {
    width: 18px; height: 18px;
}

/* Alineaciones */
.left   { text-align: left; }
.center { text-align: center; }

/* Empty State */
.uni-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.uni-empty-state i {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    opacity: 0.2;
}

/* Responsivo */
@media (max-width: 768px) {
    .uni-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .uni-section-container {
        padding: 1rem;
    }
}
/* ============================================================
   13. PARCHE PARA ZOOM 300% (Buscador y Botones Redondos)
============================================================ */
.search-form {
    flex-direction: row !important; /* Obliga a que estén en la misma línea */
    flex-wrap: nowrap !important; 
    align-items: center !important;
}

.search-form input[type="number"] {
    min-width: 50px !important; 
}

.btn-icon {
    flex: 0 0 46px !important; 
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important; /* Asegura que siga siendo círculo */
    margin-top: 0 !important; /* Anula el margen de pantallas pequeñas */
    overflow: hidden !important; 
}
/* ============================================================
   14. RENDIMIENTO EN MÓVIL
   El blur() de las tarjetas .glass + el borde animado infinito
   (girar-rayo) es lo más pesado para el GPU de celulares de gama
   media/baja. Aquí lo simplificamos SOLO en pantallas chicas,
   sin tocar cómo se ve en computadora.
============================================================ */
@media (max-width: 768px) {
    .glass {
        /* Menos blur (más barato) en vez de quitarlo del todo,
           así se sigue viendo "cristal" pero sin tanto costo */
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        background: rgba(10, 20, 40, 0.55); /* algo más opaco para compensar el blur bajo */
    }

    /* El rayo que gira alrededor de cada tarjeta: se queda como
       borde fijo (sin animación) en vez de recalcular el gradiente
       cónico + drop-shadow en cada frame */
    .glass::before {
        animation: none;
        opacity: 0.35;
    }

    .online-panel {
        backdrop-filter: blur(6px);
    }
}

/* Respeta a quienes desactivaron animaciones en su sistema/celular
   (ahorro de batería, mareo por movimiento, etc.) */
@media (prefers-reduced-motion: reduce) {
    .glass::before,
    .ring,
    #cosmos {
        animation: none !important;
    }
}
