﻿/**
 * 🏰 FORTALEZA PRISMAS - SISTEMA DE DISEÑO MAESTRO V3.5
 * ESTADO: REPARADO - Legibilidad y Contraste Premium
 */

:root {
    --primary-color: #0532c3;
    --secondary-color: #ffa718;
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-blur: blur(30px);
    --shadow-main: 0 40px 80px -15px rgba(0, 0, 0, 0.4);
    --font-main: 'Segoe UI', system-ui, sans-serif;
    --text-white: #ffffff;
    --text-dark: #1e1b4b;
}

/* --- ESTRUCTURA BASE --- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body, html {
    height: 100%; margin: 0; padding: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-family: var(--font-main);
    min-height: 100vh; overflow-x: hidden;
    background: transparent !important; 
}

/* 🌆 Fondo Original Cobertura Total */
.bg-prismas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(160deg, rgba(3, 15, 80, 0.55) 0%, rgba(5, 50, 195, 0.4) 100%),
                url('https://prismascolombia.com/storage/img/fondo_prismas.png');
    background-size: cover; background-position: center;
    z-index: -1; filter: blur(5px); transform: scale(1.1);
}

/* --- TARJETA --- */
.login-card {
    background: #ffffff;
    border-radius: 20px;
    border-top: 5px solid #0532c3;
    padding: 1.6rem 2.4rem 1.8rem;
    width: 92%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- LOGO --- */
.logo-main {
    width: 130px; max-width: 65%;
    margin-top: 0; margin-bottom: 8px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
}

/* --- TÍTULO --- */
h1 {
    font-size: clamp(0.95rem, 5vw, 1.2rem);
    color: #0532c3;
    margin-top: 0; margin-bottom: 1.2rem;
    font-weight: 900; text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
}

/* --- GRUPOS DE FORM --- */
.form-group {
    width: 100%;
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #475569 !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- INPUTS --- */
input {
    width: 100%; padding: 12px 16px; border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc !important;
    font-size: 15px;
    color: #1e293b !important;
    font-weight: 500;
    transition: all 0.25s ease;
}

input:focus {
    outline: none;
    border-color: #0532c3;
    box-shadow: 0 0 0 3px rgba(5, 50, 195, 0.12);
    background: #ffffff !important;
}

input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* --- BOTÓN --- */
.btn-login {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #0532c3 0%, #0428a3 100%) !important;
    color: #ffffff !important;
    border: none; border-radius: 10px;
    font-size: 0.95rem; font-weight: 800; cursor: pointer;
    transition: 0.25s; text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 6px 20px rgba(5, 50, 195, 0.4);
    margin-top: 6px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0428a3 0%, #031a82 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(5, 50, 195, 0.5);
}

/* --- OPCIONES: apilado vertical centrado --- */
.access-options {
    width: 100%;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.remember-me {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    color: #475569 !important;
    font-weight: 600;
}

.remember-me input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #0532c3;
    cursor: pointer;
}

.forgot-pass {
    color: #0532c3 !important;
    text-decoration: none;
    font-weight: 600; font-size: 0.82rem;
    transition: color 0.2s ease;
}

.forgot-pass:hover {
    color: #ffa718 !important;
}

/* 🆕 CTA de registro (matrícula) en el login — enlace de texto compacto */
.register-cta {
    width: 100%;
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
}

.register-cta .register-link {
    color: #0532c3 !important;
    font-weight: 800;
    text-decoration: none;
    transition: color 0.2s ease;
}

.register-cta .register-link:hover {
    color: #ffa718 !important;
    text-decoration: underline;
}

/* 📲 BANNERS PWA */
.app-banner {
    display: none;
    position: fixed; bottom: 20px; width: 90%; max-width: 400px;
    background: rgba(255, 255, 255, 0.95); border-radius: 20px;
    padding: 15px; color: #333; text-align: center; z-index: 10000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.icon-footer { margin: 14px 0 6px; width: 60px; height: auto; animation: floating 4s infinite ease-in-out; }
@keyframes floating { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* --- RESPONSIVIDAD --- */

/* PC / TV (≥ 1024px) */
@media (min-width: 1024px) {
    .login-card {
        max-width: 820px;
        padding: 2rem 7.5rem 2.5rem;
        border-radius: 24px;
    }
    .logo-main { width: 200px; }
    h1 { font-size: 1.6rem; }
}

/* Móvil (≤ 480px) */
@media (max-width: 480px) {
    .login-card { padding: 1.2rem 1.3rem 1.4rem; }
    .icon-footer { display: none; }
    h1 { letter-spacing: 1px; }
}

/* ==========================================================================
   🏰 PARTE 1: ARQUITECTURA INTEGRADA - FORTALEZA PRISMAS V13.8
   ========================================================================== */
:root {
    --p-purple: #0532c3;
    --p-orange: #ffa718;
    --p-dark: #1e1b4b;
    --p-bg: #f4f7fe;
    --white: #ffffff;
    
    --primary-color: var(--p-purple);
    --secondary-color: var(--p-orange);
    --font-main: 'Segoe UI', system-ui, sans-serif;
}

/* 1. SCROLL UNIFICADO: Menú y Bloques suben juntos */
body.dashboard-body {
    margin: 0; 
    padding: 0; 
    background: var(--p-bg);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-y: auto; /* El scroll lo maneja el body para que todo suba junto */
    overflow-x: hidden;
}

.dashboard-wrapper {
    display: flex; 
    width: 100%;
    min-height: 100vh;
    align-items: stretch; /* Asegura que el sidebar crezca con el contenido */
}

/* 2. SIDEBAR PC: Ahora fluye con el scroll (position: relative) */
.sidebar-prismas {
    width: 240px;
    min-width: 240px;
    background: var(--p-dark);
    position: relative; /* CAMBIO CLAVE: No es fijo, sube con la página */
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 30px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 3. ÁREA DE CONTENIDO */
.main-content-area {
    flex: 1;
    min-width: 0;
    background: var(--p-bg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 4. 📱 DIFERENCIACIÓN CORPORATIVA EN CELULARES */
@media (max-width: 1024px) {
    .dashboard-wrapper {
        flex-direction: column; /* Apilado para móvil */
    }

    .sidebar-prismas {
        width: 100%;
        min-width: 100%;
        height: auto;
        /* Graduación corporativa para diferenciar el menú del resto */
        background: linear-gradient(135deg, var(--p-dark) 0%, #2e2a6e 100%);
        border-bottom: 4px solid var(--p-orange); /* Acento visual Prismas */
    }

    /* Botón de Menú con el color Morado derivado */
    .mobile-toggle-btn {
        display: block !important;
        background: var(--p-purple) !important;
        color: var(--white) !important;
        padding: 18px;
        text-align: center;
        font-weight: 800;
        text-transform: uppercase;
        border: none;
        width: 100%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

    /* En móvil el menú sí se queda arriba mientras bajas */
    .sidebar-prismas {
        position: sticky;
        top: 0;
        z-index: 2000;
    }
    
    /* El logo en móvil: centrado y completo (antes lo recortaban márgenes negativos) */
    .brand-logo {
        max-width: 72px !important;
        padding: 0;
        margin: 0 auto;
        display: block;
    }
}

/* Contenedor de Fluidez */
.container-fluid {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}



/* ==========================================================================
   🏰 PARTE 2: NAVEGACIÓN ELÁSTICA - FORTALEZA PRISMAS
   BLOQUEO: Sin botón en PC | Títulos Naranjas | Scroll Infinito
   ========================================================================== */

/* --- 1. SIDEBAR CORE (FLUJO TOTAL PC) --- */
.sidebar-prismas {
    width: 240px;
    min-width: 240px;
    background: var(--p-dark);
    display: flex;
    flex-direction: column;
    position: relative; 
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* --- 2. HEADER CON SEPARADOR DEGRADADO --- */
.sidebar-brand {
    padding: 18px 14px;
    text-align: center;
}

.brand-title {
    font-size: 0.72rem !important;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.75) !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 8px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-logo {
    width: 100%;
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
}

/* Línea divisoria elegante */
.sidebar-brand::after {
    content: "";
    display: block;
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--p-orange), transparent);
    margin: 20px auto 0;
}

/* --- 3. 🚫 BLOQUEO DE BOTÓN "MENU" EN PC --- */
.mobile-toggle-btn {
    display: none !important; /* SE OCULTA EN PC */
}

/* --- 4. TÍTULOS Y ENLACES (ESTILO PREMIUM) --- */
.sidebar-nav-scroll { 
    flex: 1; 
    padding-bottom: 30px;
    overflow: visible; /* Todo el menú visible al bajar en PC */
}

.section-label {
    display: block;
    padding: 16px 18px 8px;
    font-size: 0.65rem;
    color: var(--p-orange) !important;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 32px;
    color: var(--white);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(5, 50, 195, 0.4) 0%, transparent 100%);
    color: var(--white);
    border-left: 5px solid var(--p-orange);
}

/* --- 📱 5. COMPORTAMIENTO PARA MÓVILES Y TABLETS --- */
@media (max-width: 1024px) {
    .sidebar-prismas {
        width: 100%;
        min-width: 100%;
        height: auto;
    }

    /* En móvil/tablet SÍ aparece el botón para ahorrar espacio */
    .mobile-toggle-btn {
        display: flex !important;
        background: var(--p-purple) !important;
        color: white;
        padding: 18px;
        justify-content: center;
        align-items: center;
        font-weight: 900;
        text-transform: uppercase;
        border: none;
        width: 100%;
        cursor: pointer;
    }

    .sidebar-nav-scroll {
        display: none; /* Se activa con .active mediante tu JS */
        width: 100%;
        height: auto; 
        background: rgba(0,0,0,0.2);
    }

    .sidebar-prismas.active .sidebar-nav-scroll {
        display: block !important;
        height: auto !important;
    }
}

/* 📱 Limpieza visual del menú en celular (solo móvil; NO cambia el comportamiento):
   - cabecera compacta, sin la línea decorativa que dejaba un hueco alto
   - enlaces con sangría pareja (el hover/activo ya no desplaza el texto) */
@media (max-width: 1024px) {
    .sidebar-brand { padding: 12px 14px 6px; }
    .sidebar-brand::after { display: none; }       /* quita la línea + sus 20px de margen */
    .brand-title { margin: 6px 0 0; }

    .sidebar-nav-scroll { background: transparent; padding: 6px 0 16px; }
    .menu-section { margin-bottom: 4px; }

    .nav-link { padding: 12px 18px; }
    .nav-link:hover { padding-left: 18px; }         /* sin el corrimiento de 32px */
    .nav-link.active { border-left: 0; box-shadow: inset 4px 0 0 var(--p-orange); }
}

/* 6. PIE DE PÁGINA (LOGOUT) */
.sidebar-footer { 
    padding: 20px 0;
    margin-top: auto;
}

.logout { 
    color: #ff5c5c !important;
    font-weight: 800;
    border-top: 1px solid rgba(255,255,255,0.1);
}




/* ==========================================================================
   🏰 BLOQUE 3: DASHBOARD PRISMAS - VERSIÓN MAESTRA FINAL (CON LATIDO)
   ESTADO: Alineación Izquierda | Radar Infinito | 100% Fluido Móvil
   ========================================================================== */

:root {
    --p-purple: #0532c3;
    --p-orange: #ffa718;
    --p-dark: #1e1b4b;
    --p-silver: #94a3b8;
    --p-red: #ef4444;
    --p-online: #10b981;
}

/* 1. CABECERA (Consola + Online a la Izquierda | Año a la Derecha) */
.dashboard-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    width: 100%;
    box-sizing: border-box;
}

/* Contenedor Título + Pill Online */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 950;
    color: var(--p-purple) !important;
    text-transform: uppercase;
    margin: 0;
}

/* BOTÓN ONLINE CON EFECTO DE LATIDO */
.status-pill {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacio entre punto y texto */
    background: #f0fdf4;
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid #dcfce7;
}

/* El punto verde con animación de latido */
.pulse-dot {
    width: 10px;
    height: 10px;
    min-width: 10px; /* Evita que se encoja */
    background: var(--p-online);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0; /* Asegura posición izquierda */
    animation: heartbeat 1.5s ease-in-out infinite;
    margin-bottom: -16px;
}

/* La onda expansiva (Radar) corregida */
.pulse-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--p-online);
    border-radius: 50%;
    animation: radar_pulse 2s infinite ease-out;
}

@keyframes heartbeat {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.15); }
    100% { transform: scale(0.95); }
}

@keyframes radar_pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; }
}

.status-txt {
    color: var(--p-online);
    font-weight: 900;
    font-size: 0.75rem;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
    animation: glow_online 2s infinite alternate;
    margin-left: 20px;
}

@keyframes glow_online {
    from { opacity: 0.8; }
    to { opacity: 1; text-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
}

/* 2. BLOQUE PERIODO FISCAL (DISEÑO DERECHA) */
/* 📦 Contenedor (Tu estilo original de cápsula) */
.year-filter-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 5px 5px 5px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

/* 🛡️ Label Protegido (Aquí estaba el fallo, ahora es inmune) */
.year-filter-box .label-fiscal-prismas {
    font-size: 0.7rem !important;
    font-weight: 900 !important;
    color: #0532c3 !important; /* Tu Púrpura Imperial */
    text-transform: uppercase !important;
    margin: 0 !important;
    white-space: nowrap; /* Evita que el texto se parta en dos líneas */
}

/* 🔘 Select (Tu estilo de botón púrpura) */
.custom-select {
    background: #0532c3 !important; /* Usando el color directo o var(--primary-color) */
    color: #fff !important;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

/* 3. MÉTRICAS (KPI GRID) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #ffffff;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kpi-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(30, 27, 75, 0.1);
}

.kpi-clickable { cursor: pointer; }
.kpi-clickable:focus-visible {
    outline: 2px solid var(--p-purple);
    outline-offset: 3px;
}
.kpi-clickable:hover .kpi-status,
.kpi-clickable:hover .kpi-status-danger { text-decoration: underline; }

.kpi-info small {
    display: block;
    color: var(--p-silver) !important;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.kpi-card h2 {
    font-size: 1.8rem;
    font-weight: 950;
    margin: 6px 0;
    letter-spacing: -1.5px;
    transition: 0.4s;
}

.kpi-card:hover h2 { transform: scale(1.1); }

/* --- SINCRONIZACIÓN DE COLORES --- */
.purple-kpi h2 { color: var(--p-purple); }
.purple-kpi .kpi-status { background: #f3e8ff; color: var(--p-purple); }

.orange-kpi h2 { color: var(--p-orange); }
.orange-kpi .kpi-status { background: #fff7ed; color: var(--p-orange); }

.red-kpi h2 { color: var(--p-red); }
.red-kpi .kpi-status-danger, .red-kpi .kpi-status { background: #fef2f2; color: var(--p-red); }

.green-kpi h2 { color: #059669; }
.green-kpi .kpi-status { background: #ecfdf5; color: #059669; }

.kpi-status, .kpi-status-danger {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* 4. OPTIMIZACIÓN MÓVIL (100% FLUIDO) */
@media (max-width: 768px) {
    .dashboard-header-modern {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-radius: 0;
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
    }
    
    .header-left { 
        width: 100%; 
        flex-direction: column;
        gap: 10px;
    }

    .header-right { width: 100%; }
    .year-filter-box { width: 100%; justify-content: space-between; }

    .kpi-grid { grid-template-columns: 1fr; gap: 15px; }
    .kpi-card { text-align: center; }
}






/* ==========================================================================
   📱 FIX CRÍTICO PARA CELULARES
   ========================================================================== */
@media (max-width: 1024px) {
    /* Cabecera: Apilado vertical para que no se encime */
    .dashboard-header-modern {
        flex-direction: column;
        padding: 25px;
        gap: 20px;
        text-align: center;
        border-radius: 0 0 24px 24px; /* Ajuste estético para móvil */
    }

    .header-left {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    /* El filtro de año ocupa todo el ancho para ser legible */
    .year-filter-box {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    .custom-select {
        width: auto;
        min-width: 120px;
    }

    /* KPI Grid: Una sola columna para que el número 2.8rem quepa bien */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }

    .kpi-card {
        padding: 25px;
    }

    .kpi-card .kpi-info h2 {
        font-size: 2.4rem; /* Reducción mínima para pantallas pequeñas */
    }
}









/* ==========================================================================
   🌌 BLOQUE 4: RENDIMIENTO COMERCIAL MAESTRO
   Características: Animación de Crecimiento, Vista Dual & Colores Corporativos
   ========================================================================== */

.chart-section {
    background: radial-gradient(circle at top, #0b1f7e 0%, #1e1b4b 100%);
    padding: 30px;
    border-radius: 30px;
    border: 1px solid rgba(255, 167, 24, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* Título Futurista con Glow Naranja */
.chart-section .card-header h3 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--p-orange);
    text-shadow: 0 0 15px rgba(255, 167, 24, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.chart-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 320px;
    padding: 20px 0;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Ocultar scrollbar para estética de consola */
.chart-wrapper::-webkit-scrollbar { display: none; }

.chart-item {
    flex: 1;
    min-width: 65px; /* Base para PC */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Valores (45M, etc) con micro-animación */
.bar-val {
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    background: rgba(5, 50, 195, 0.8);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 167, 24, 0.5);
    transition: all 0.3s ease;
    z-index: 2;
}

.bar-track {
    width: 40px;
    height: 230px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* --- 🔥 LÓGICA DE ANIMACIÓN DE CRECIMIENTO --- */
.bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, var(--p-purple) 0%, var(--p-orange) 100%);
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(5, 50, 195, 0.6);
    
    /* Punto de anclaje en la base para el crecimiento */
    transform-origin: bottom;
    /* Transición inicial de carga */
    transition: height 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animación al pasar el mouse: Crecimiento desde CERO */
.chart-item:hover .bar-fill {
    animation: cyberGrow 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: brightness(1.2);
    box-shadow: 0 0 30px rgba(255, 167, 24, 0.5);
}

.chart-item:hover .bar-val {
    background: var(--p-orange);
    color: var(--p-dark);
    transform: translateY(-5px) scale(1.1);
}

@keyframes cyberGrow {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

.bar-label {
    margin-top: 15px;
    font-weight: 800;
    font-size: 0.75rem;
    color: #fff;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 📱 AJUSTE QUIRÚRGICO MÓVIL (6 MESES VISIBLES) */
@media (max-width: 1024px) {
    .chart-item {
        min-width: calc(100% / 5.5); /* Fuerza el scroll lateral */
    }
    
    .chart-section {
        padding: 25px 15px;
        border-radius: 20px;
    }

    .chart-section .card-header h3 {
        font-size: 1.1rem;
    }
}






/* =============================================
   BLOQUE 5: PRISMAS DATA PRECISION (V4.2 - SUPREMO)
   EDICIÓN: Efectos Neón & Background Icons
   ESTADO: Reparado (Porcentajes a la derecha)
   ============================================= */

.intel-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.intel-card {
    background: rgba(15, 12, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

/* Efecto Emoji de Fondo con Transparencia - MANTENIDO */
.intel-card::after {
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.05;
    filter: grayscale(1);
    z-index: -1;
    transition: 0.4s;
}

.intel-card:nth-child(1)::after { content: '📅'; }
.intel-card:nth-child(2)::after { content: '💳'; }
.intel-card:nth-child(3)::after { content: '🏆'; opacity: 0.08; filter: none; }

.intel-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 157, 0.4);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.intel-card:hover::after {
    transform: scale(1.2) rotate(-10deg);
    opacity: 0.15;
}

.intel-header-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.intel-title-sm {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.intel-subtext {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.9rem;
    font-weight: 800;
    color: #00ff9d;
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.3);
    margin: 8px 0;
}

/* 📊 BARRAS NEÓN DINÁMICAS - REPARADO: POSICIÓN DE NÚMEROS */
.p-bar-container { margin-top: 15px; }

.p-item {
    display: flex; /* Cambiado a flex para control total del flujo horizontal */
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
}

.p-name { color: #cbd5e1; font-size: 0.7rem; font-weight: 700; }

/* Forzamos que el porcentaje esté siempre en la última columna */
.p-perc { 
    color: #00ff9d; 
    font-size: 0.75rem; 
    font-weight: 800; 
    width: 45px; /* Ancho fijo para el número */
    text-align: right;
    flex-shrink: 0;
}

.p-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.03);
    flex-grow: 1; /* La barra toma todo el espacio central */
}

.p-bar-fill {
    height: 100%;
    width: 0%; 
    border-radius: 20px;
    background: linear-gradient(90deg, #00ff9d, #00b8ff);
    box-shadow: 0 0 12px rgba(0, 255, 157, 0.4);
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.intel-card:hover .p-bar-fill {
    filter: brightness(1.2);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.6);
}

/* 🏆 AGENTE ORO SUPREMO - MANTENIDO TU EFECTO ORIGINAL */
.agente-nombre {
    font-size: 1.8rem;
    font-weight: 950 !important; 
    background: linear-gradient(
        to right, 
        #bf953f 0%, 
        #fcf6ba 25%, 
        #b38728 50%, 
        #fcf6ba 75%, 
        #bf953f 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineGold 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(184, 134, 11, 0.3));
    margin: 5px 0;
    display: block;
}

@keyframes shineGold {
    to { background-position: 200% center; }
}

.intel-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 255, 157, 0.03) 0%, transparent 70%);
    pointer-events: none;
}



/* ==========================================================================
    🛠️ PARTE 6: COMPONENTES DE ACCIÓN (BOTONES Y TABLAS)
    ESTADO: SUPREMO - Optimizado para Motor V36.5
   ========================================================================== */

/* Contenedor de botones en la celda */
.action-cell {
    width: 160px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* Botón Editar (Efecto Oro Prisma) */
.btn-edit {
    background: rgba(255, 167, 24, 0.08);
    color: #ffa718;
    border: 1px solid rgba(255, 167, 24, 0.25);
    padding: 4px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
}

.btn-edit:hover {
    background: #ffa718;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 167, 24, 0.35);
    border-color: #ffa718;
}

/* Botón Eliminar (Efecto Sangre) */
.btn-delete {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 4px 9px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-delete:hover {
    background: #ef4444;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
    border-color: #ef4444;
}

/* --- TABLA MODERNA (EL ESQUELETO) --- */
.ui-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    margin-top: -6px;
}

.ui-modern-table tbody tr {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.ui-modern-table tbody tr:hover {
    transform: scale(1.003);
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
    z-index: 5;
    position: relative;
}

.ui-modern-table td {
    padding: 7px 10px;
    border: none;
    font-size: 0.75rem;
    color: #475569;
}

.id-badge {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    color: #1e293b;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

/* REPARACIÓN DE BÓVEDA: POSICIONAMIENTO DEL MODAL */
.modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75); /* Slate-900 con opacidad */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 95%;
    max-width: 600px;
    max-height: 90vh; /* Seguridad para pantallas pequeñas */
    overflow-y: auto; /* Scroll interno si el form es largo */
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* ==========================================================================
    🏰 BLOQUE 7: MATRIZ DE GESTIÓN (EFECTO CYBER-DYNAMIC)
    Estado: OPTIMIZADO - Recto en reposo, Giro tecnológico en Hover
   ========================================================================== */

.management-matrix {
    margin-top: 25px;
    padding-bottom: 80px;
}

.matrix-header h3 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--p-dark);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

/* Estilo Base del Tile */
.matrix-tile {
    background: #ffffff;
    padding: 40px 20px;
    border-radius: 32px;
    text-align: center;
    cursor: pointer;
    /* Transiciones específicas para suavidad total */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease,
                border-color 0.3s ease;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    /* Estabilización de hardware */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animación de Elevación del Tile */
.matrix-tile:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(5, 50, 195, 0.15);
}

/* Iconos/Emojis: Rectos por defecto */
.matrix-tile i {
    font-size: 3rem;
    display: block;
    font-style: normal;
    /* El truco está en una transición elástica para el giro */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.05));
    transform: rotate(0deg) scale(1); /* Siempre recto al inicio */
}

/* EFECTO DINÁMICO: Giro y Escala al poner el mouse */
.matrix-tile:hover i {
    /* Giro tecnológico de 8 grados y aumento de tamaño */
    transform: scale(1.2) rotate(8deg); 
}

/* Texto del Módulo */
.matrix-tile span {
    font-weight: 850;
    font-size: 1rem;
    color: #1e293b;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}

/* --- 🎨 CATEGORIZACIÓN CYBER-GLOW --- */

.acad-tile:hover { 
    border-color: var(--p-purple);
    border-bottom: 6px solid var(--p-purple); 
}
.acad-tile:hover i { filter: drop-shadow(0 0 15px rgba(5, 50, 195, 0.4)); }

.mkt-tile:hover { 
    border-color: var(--p-orange);
    border-bottom: 6px solid var(--p-orange);
}
.mkt-tile:hover i { filter: drop-shadow(0 0 15px rgba(255, 167, 24, 0.4)); }

.sys-tile:hover { 
    border-color: #1e1b4b;
    border-bottom: 6px solid #1e1b4b;
}

/* 📱 AJUSTES MÓVIL */
@media (max-width: 1024px) {
    .tiles-container {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
    }
    .matrix-tile:hover i {
        transform: scale(1.15) rotate(5deg); /* Giro más leve en móvil */
    }
}



/* ==========================================================================
    🏰 BLOQUE 8: VIEWPORT DE DATOS (REFORZADO V19.0)
    Sincronizado con: fetch_table, save_data y motores dinámicos
    ESTADO: SUPREMO - Optimizado para Motor V36.5
   ========================================================================== */

.ajax-viewport { 
    animation: fadeInSlide 0.6s cubic-bezier(0.23, 1, 0.32, 1); 
    width: 100%;
}

/* 1. CABECERA MAESTRA (BUSCADOR + ACCIONES) */
.table-ui-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 30px; 
    padding: 0 5px; 
    flex-wrap: wrap; 
    gap: 20px;
}

/* Contenedor del Buscador Pro */
.search-container-pro {
    position: relative;
    flex: 1;
    max-width: 450px;
}

/* Icono de lupa inyectado por CSS o FontAwesome */
.search-container-pro::before {
    content: '🔍';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    z-index: 10;
    opacity: 0.5;
}

#table-search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: #ffffff;
    border: 2px solid #f1f5f9 !important;
    border-radius: 20px;
    font-weight: 700;
    color: var(--p-dark);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

#table-search-input:focus {
    border-color: var(--p-purple) !important;
    box-shadow: 0 12px 25px rgba(5, 50, 195, 0.12);
    outline: none;
    transform: translateY(-2px);
}

/* 2. ARQUITECTURA DE TABLA DINÁMICA (GLASS CONTAINER) */
.ui-scroll-container {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(241, 245, 249, 0.8);
}

.ui-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
}

.ui-modern-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 0.62rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
}

/* Herramientas de tabla: indicador de orden */
.ui-modern-table thead tr:first-child th:hover { color: #0532c3; }
.ui-modern-table .sort-ind { color: #0532c3; font-size: 0.7rem; }

/* Botón "Filtrar" + panel desplegable */
.filtros-wrap { position: relative; display: inline-block; }
.btn-filtrar {
    background: #0532c3; color: #fff; border: none;
    padding: 8px 16px; border-radius: 20px; font-weight: 700;
    font-size: 0.82rem; cursor: pointer; transition: background .2s;
}
.btn-filtrar:hover { background: #0428a3; }
.filtros-panel {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 14px; min-width: 220px;
}
.filtros-wrap.abierto .filtros-panel { display: block; }
.filtros-item { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.filtros-item label {
    font-size: 0.68rem; font-weight: 800; color: #475569;
    text-transform: uppercase; letter-spacing: .04em;
}
.filtros-item select {
    padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 0.8rem; color: #334155; background: #fff;
}
.filtros-item select:focus { outline: none; border-color: #0532c3; }
.filtros-limpiar {
    width: 100%; margin-top: 4px; background: #f1f5f9; color: #334155;
    border: none; padding: 8px; border-radius: 8px; font-weight: 700;
    cursor: pointer; font-size: 0.76rem;
}
.filtros-limpiar:hover { background: #e2e8f0; }
.filtros-vacio { font-size: 0.78rem; color: #94a3b8; }

.ui-modern-table td {
    padding: 7px 12px;
    background: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--p-dark);
    vertical-align: middle;
    border-top: 1px solid #f8fafc;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s ease;
}

/* Efecto Premium en Filas */
.ui-modern-table tr:hover td {
    background: #fdfaff; /* Sutil toque púrpura */
    border-color: #e2e8f0;
}

/* Columnas largas: truncar con elipsis para que la tabla quepa sin scroll
   horizontal. El atributo title muestra el valor completo al pasar el mouse. */
.ui-modern-table .col-email   { max-width: 150px; }
.ui-modern-table .col-nombre  { max-width: 180px; }
.ui-modern-table .col-direccion { max-width: 150px; }
.ui-modern-table td.col-email,
.ui-modern-table td.col-nombre,
.ui-modern-table td.col-direccion {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Curvatura de las celdas laterales */
.ui-modern-table td:first-child { border-left: 1px solid #f8fafc; border-radius: 20px 0 0 20px; }
.ui-modern-table td:last-child { border-right: 1px solid #f8fafc; border-radius: 0 20px 20px 0; }

/* 3. SOPORTE MULTIMEDIA (Miniaturas de Usuario/Documentos) */
.img-table-thumb {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: zoom-in;
}

.img-table-thumb:hover { 
    transform: scale(2.8); 
    z-index: 50; 
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* 4. ESTADOS Y PILLS (Categorización rápida) */
.status-pill { 
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* 📱 5. BLINDAJE MÓVIL (VISTA DE CARTAS APP) */
@media (max-width: 1024px) {
    .ui-modern-table thead { display: none; } 
    
    .ui-modern-table tr { 
        display: block; 
        background: #fff; 
        margin-bottom: 20px; 
        border-radius: 25px; 
        border: 1px solid #f1f5f9;
        box-shadow: 0 8px 20px rgba(0,0,0,0.02);
        overflow: hidden;
    }

    .ui-modern-table td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 14px 20px !important;
        border: none !important;
        font-size: 0.9rem;
    }

    .ui-modern-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #94a3b8;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .ui-modern-table td:first-child {
        background: #f8fafc;
        border-bottom: 1px solid #f1f5f9 !important;
        justify-content: center;
        font-size: 1rem;
        color: var(--p-purple);
    }
    
    .action-cell {
        width: 100% !important;
        justify-content: center !important;
        gap: 15px;
        background: #fdfaff;
    }
}

/* 📋 EXCEPCIÓN: gestión de módulos/exámenes del admin = vista de LISTA (tabla)
   también en celular, igual que en PC, con scroll lateral en vez de tarjetas.
   Acotado a .ui-modern-table.tabla-lista — no afecta ninguna otra tabla. */
@media (max-width: 1024px) {
    .ui-modern-table.tabla-lista { white-space: nowrap; }
    .ui-modern-table.tabla-lista thead { display: table-header-group; }
    .ui-modern-table.tabla-lista tr {
        display: table-row;
        background: transparent;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }
    .ui-modern-table.tabla-lista td {
        display: table-cell;
        justify-content: initial;
        align-items: initial;
        padding: 7px 12px !important;
        border-top: 1px solid #f8fafc !important;
        border-bottom: 1px solid #f8fafc !important;
        font-size: 0.72rem;
    }
    .ui-modern-table.tabla-lista td::before { content: none !important; }
    .ui-modern-table.tabla-lista td:first-child {
        background: transparent;
        justify-content: initial;
        font-size: inherit;
        color: inherit;
        border-bottom: 1px solid #f8fafc !important;
    }
    .ui-modern-table.tabla-lista .action-cell {
        width: auto !important;
        justify-content: flex-start !important;
        background: transparent;
    }
}

.ajax-viewport {
    animation: fadeInSlide 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    width: 100%;
}

.table-ui-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 30px; 
    flex-wrap: wrap; 
    gap: 20px;
}

/* 🚀 BOTÓN "+ NUEVO" (NARANJA SECUNDARIO - ACCIÓN POSITIVA) */
.btn-add-pro {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #e68a00 100%);
    color: var(--text-dark) !important; /* Texto oscuro para contraste con naranja */
    border: none;
    padding: 12px 28px;
    border-radius: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 167, 24, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-add-pro:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 167, 24, 0.45);
    filter: brightness(1.1);
}

/* ⬅️ BOTÓN "VOLVER AL PANEL" (REFORZADO) */
.viewport-header .btn-back-master {
    background: var(--primary-color) !important;
    color: var(--text-white) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    padding: 12px 25px !important;
    border-radius: 18px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(5, 50, 195, 0.2) !important;
    outline: none !important;
}

.viewport-header .btn-back-master:hover {
    background: #0428a3 !important; /* Púrpura más profundo */
    transform: translateX(-8px) !important; /* Efecto retroceso visual */
    box-shadow: 0 12px 25px rgba(5, 50, 195, 0.4) !important;
    color: #ffffff !important;
}

/* 2. ARQUITECTURA DE TABLA (GLASS CONTAINER) */
.ui-scroll-container {
    width: 100%; 
    overflow-x: auto; 
    background: #ffffff; 
    border-radius: 35px;
    padding: 25px; 
    box-shadow: var(--shadow-main); /* Usando tu variable de sombra */
    border: 1px solid #f1f5f9;
}

#table-search-input {
    padding: 14px 20px 14px 50px;
    border: 2px solid #f1f5f9;
    border-radius: 20px;
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--text-dark);
}

#table-search-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 12px 25px rgba(5, 50, 195, 0.15);
    outline: none;
}

/* 📱 5. BLINDAJE MÓVIL */
@media (max-width: 1024px) {
    .table-ui-header {
        flex-direction: column;
        gap: 15px;
    }
    .btn-add-pro, .btn-back-master {
        width: 100%;
        justify-content: center;
    }
}





/* ==========================================================================
    🏰 BLOQUE 9: SISTEMA DE MODALES (GHOST-GLASS DESIGN V20.0)
    ESTADO: SUPREMO - Blindaje de botones y renderizado Pro
   ========================================================================== */

/* 1. Capa de Fondo (Overlay) */
/* SweetAlert2 siempre por encima de cualquier modal (errores de validación, etc.) */
.swal2-container { z-index: 2000000 !important; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 12, 41, 0.6);
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Bajamos un punto para dar margen */
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
    /* REPARACIÓN MAESTRA: Evita que bloquee clics si no está activo */
    pointer-events: none; 
}

.modal-overlay.active { 
    display: flex; 
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Solo recibe clics cuando está activo */
}

/* 2. Contenedor (La Bóveda) */
.modal-content {
    background: #ffffff;
    width: 95%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 40px; 
    padding: 45px;
    box-shadow: 0 50px 100px rgba(0,0,0,0.4);
    position: relative;
    transform: scale(0.85) translateY(40px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
    scrollbar-width: thin; 
    scrollbar-color: var(--p-purple) #f1f5f9;
}

.modal-overlay.active .modal-content { 
    transform: scale(1) translateY(0); 
}

/* 3. Cabecera (Sticky Header) */
.modal-header {
    position: sticky;
    top: -45px;
    background: rgba(255, 255, 255, 0.98);
    z-index: 101;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 10px 0 25px 0;
    border-bottom: 2px solid #f1f5f9;
}

/* 🛡️ REPARACIÓN: Botón Volver / Control Maestro */
.btn-control-panel, .btn-volver-maestro {
    position: relative;
    z-index: 102 !important; /* Siempre por encima de todo */
    cursor: pointer !important;
    pointer-events: auto !important;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(90deg, var(--p-dark), var(--p-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 4. Grid de Formulario */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

/* Sección de Credenciales */
.user-credentials-section {
    grid-column: 1 / -1;
    background: #f8fafc;
    padding: 25px;
    border-radius: 25px;
    border: 1px dashed #cbd5e1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    margin-left: 8px;
}

.input-prismas {
    width: 100%;
    padding: 15px 20px;
    border-radius: 18px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    font-weight: 700;
    transition: all 0.2s ease;
}

.input-prismas:focus {
    border-color: var(--p-purple);
    box-shadow: 0 0 0 5px rgba(5, 50, 195, 0.15);
    outline: none;
}

/* 📂 5. CARGA DE ARCHIVOS */
.file-custom-label {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 35px;
    background: #fdfaff;
    border: 2px dashed #3d5fe0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 6. Footer Accionable */
.modal-footer {
    display: flex;
    gap: 15px;
    padding-top: 30px;
    border-top: 2px solid #f1f5f9;
}

.btn-save {
    flex: 1;
    background: linear-gradient(135deg, var(--p-purple) 0%, #0428a3 100%);
    color: white;
    padding: 18px;
    border-radius: 20px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(5, 50, 195, 0.3);
    transition: all 0.3s ease;
}

/* 📱 7. RESPONSIVE QUIRÚRGICO */
@media (max-width: 768px) {
    .modal-content { padding: 30px 20px; border-radius: 30px; }
    .grid-form, .user-credentials-section { grid-template-columns: 1fr; }
    .modal-footer { flex-direction: column; }
    /* REPARACIÓN: Evitamos que el orden tape clics */
    .btn-save { order: 0; width: 100%; } 
    .modal-header { top: -30px; }
}




/* ==========================================================================
    🏰 BLOQUE 10: FOOTER CORPORATIVO (FULL WIDTH & CLEAN)
    Estado: Reparado - Sin conflictos con Tiles o Modales
   ========================================================================== */
.admin-footer {
    background: #ffffff;
    border-top: 2px solid #f1f5f9;
    padding: 20px 40px;
    margin-top: auto; /* Mantiene el footer al fondo si el contenido es poco */
    width: 100%;
    box-sizing: border-box; /* Crucial para evitar que el padding rompa el 100% */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--p-dark);
}

.platform-name {
    font-weight: 700;
}

.separator {
    color: #cbd5e1;
    font-weight: 300;
}

.author-link {
    text-decoration: none;
    transition: 0.3s ease;
}

.author-link:hover {
    filter: brightness(1.2);
    text-shadow: 0 0 10px rgba(255, 167, 24, 0.2);
}

.author-link strong {
    color: var(--p-orange);
    font-weight: 800;
}

.copyright-legal {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* 📱 AJUSTE PARA VISTA MÓVIL */
@media (max-width: 1024px) {
    .admin-footer {
        padding: 25px 20px;
        text-align: center;
    }

    .footer-container {
        flex-direction: column;
        gap: 12px;
    }

    .footer-left {
        flex-direction: column;
        gap: 5px;
    }

    .separator { display: none; }

    .copyright-legal {
        line-height: 1.4;
        max-width: 300px;
    }
}

/* ==========================================================================
   🏰 BLOQUE 11: BANNER PWA INTELIGENTE (VERSIÓN SUPREMA V1.1.0)
   Optimizado para: iPhone, Android, Windows y Mac
   ========================================================================== */

.pwa-banner-prismas {
    position: fixed;
    bottom: -180px; /* Oculto inicialmente bajo el margen */
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(5, 50, 195, 0.25);
    border-radius: 30px;
    padding: 18px 22px;
    box-shadow: 0 25px 50px -12px rgba(30, 27, 75, 0.3);
    z-index: 999999;
    /* Animación de entrada con rebote elástico tipo iOS */
    transition: bottom 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: bottom;
}

/* Estado Activo: Se posiciona sobre el área de navegación */
.pwa-banner-prismas.active {
    bottom: 30px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Icono de la App con efecto de elevación */
.pwa-icon-box {
    position: relative;
    flex-shrink: 0;
}

.pwa-icon-box img {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(5, 50, 195, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Área de Texto y Mensajes Dinámicos */
.pwa-text-box {
    flex: 1;
}

.pwa-title {
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--p-dark); /* Color oscuro profesional */
    margin: 0;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.pwa-desc {
    font-size: 0.82rem;
    color: #475569;
    margin: 5px 0 0 0;
    line-height: 1.4;
    font-weight: 600;
}

/* 🍎 FIX ESPECÍFICO: Icono de Compartir de Apple */
.pwa-desc img {
    width: 18px !important;
    height: auto !important;
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    filter: brightness(0.8) contrast(1.2);
    box-shadow: none !important;
}

/* Botones de Acción: Instalación y Cierre */
.pwa-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.pwa-btn-main {
    background: linear-gradient(135deg, var(--p-purple) 0%, #3d5fe0 100%);
    color: #ffffff !important;
    border: none;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(5, 50, 195, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-btn-main:hover {
    background: var(--p-orange);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 167, 24, 0.3);
}

.pwa-btn-close {
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.pwa-btn-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* 📱 RESPONSIVIDAD PARA DISPOSITIVOS PEQUEÑOS */
@media (max-width: 480px) {
    .pwa-banner-prismas {
        width: 94%;
        padding: 14px 18px;
        bottom: -200px;
    }

    .pwa-banner-prismas.active {
        bottom: 20px;
    }
    
    .pwa-icon-box img {
        width: 48px;
        height: 48px;
    }

    .pwa-title { font-size: 0.95rem; }
    .pwa-desc { font-size: 0.75rem; line-height: 1.3; }

    .pwa-btn-main {
        padding: 10px 16px;
        font-size: 0.7rem;
    }
}

/* 🌙 SOPORTE MODO OSCURO (Opcional si el sistema lo usa) */
@media (prefers-color-scheme: dark) {
    .pwa-banner-prismas {
        background: rgba(30, 27, 75, 0.85);
        border-color: rgba(255, 255, 255, 0.1);
    }
    .pwa-title { color: #ffffff; }
    .pwa-desc { color: #cbd5e1; }
    .pwa-btn-close { background: rgba(255, 255, 255, 0.1); color: #94a3b8; }
}

/* ==========================================================================
    💎 BLOQUE 12: Formulario de Editar Datos (Identidad Prismas)
    Refinado para Gestión de Archivos y Responsividad Pro (PC & Móvil)
   ========================================================================== */

/* 1. Visibilidad y Legibilidad de Etiquetas (Gris Plata Elegante) */
.grid-form .form-group label {
    display: block !important;
    color: #9b929a !important; 
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    margin-bottom: 8px !important;
    letter-spacing: 0.8px !important;
}

/* 2. Botón de Cerrar Superior (X) - Estilo Rojo Prismas */
.btn-close-modal {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
    font-size: 1.1rem !important;
    width: 35px; 
    height: 35px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-close-modal:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    transform: rotate(90deg);
}

/* 3. 🏷️ Títulos Dinámicos (Categorías Únicas) */
#modal-titulo {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px !important;
    border-radius: 10px;
    transition: all 0.2s ease-in-out;
}

/* 🟠 MODO: NUEVO REGISTRO (NARANJA) */
#modal-titulo.titulo-nuevo {
    color: #f97316 !important;
    background-color: #fff7ed !important;
    border-left: 5px solid #f97316 !important;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.1);
}

/* 🟣 MODO: EDICIÓN DE DATOS (MORADO) */
#modal-titulo.titulo-edicion {
    color: #0532c3 !important;
    background-color: #f5f3ff !important;
    border-left: 5px solid #0532c3 !important;
    box-shadow: inset 0 0 0 1px rgba(5, 50, 195, 0.1);
}

/* 4. File inputs compactos */
.file-input-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.file-input-prismas {
    display: none !important;
}

.file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    user-select: none;
}

.file-btn:hover {
    background: #e2e8f0;
    border-color: #0532c3;
    color: #0532c3;
}

.file-name-text {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.file-name-text.selected {
    color: #059669;
    font-weight: 600;
}

.file-current-link {
    font-size: 0.78rem;
    color: #0532c3;
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.file-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    user-select: none;
}

.file-clear-btn:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

.file-success small {
    display: block;
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-size: 0.72rem !important;
    margin-top: 4px;
    word-break: break-all;
    text-align: center;
}

/* 5. Inputs y Listas Desplegables Modernas */
.input-prismas {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    transition: all 0.3s ease !important;
    background-color: #ffffff !important;
}

.input-prismas:focus {
    border-color: #0532c3 !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(5, 50, 195, 0.1) !important;
}

select.input-prismas {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2003/svg' fill='none' viewBox='0 0 24 24' stroke='%230532c3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 18px !important;
    padding-right: 45px !important;
}

/* 6. 🔐 Alerta de Credenciales */
.user-section-alert {
    grid-column: span 2;
    background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%) !important;
    color: #9a3412 !important;
    border: 1px solid #fdba74 !important;
    padding: 12px !important;
    border-radius: 12px !important;
    font-weight: 800;
    font-size: 0.75rem;
    text-align: center;
    margin: 10px 0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 7. Footer y Botones de Acción */
.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-cancel {
    background: #ffffff !important;
    color: #ef4444 !important;
    border: 2px solid #ef4444 !important;
    padding: 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-cancel:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-save {
    background: #0532c3 !important;
    color: #ffffff !important;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    box-shadow: 0 4px 15px rgba(5, 50, 195, 0.3);
    transition: all 0.3s ease;
}

.btn-save:hover {
    background: #22c55e !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

/* Botón Eliminar dentro del modal de edición — mismo tamaño que Cancelar/Guardar */
.btn-delete-modal {
    background: #e74c3c !important;
    color: #ffffff !important;
    border: none;
    padding: 12px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
}
.btn-delete-modal:hover {
    background: #c0392b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

/* 📱 8. AJUSTES PARA MÓVIL */
@media (max-width: 768px) {
    .grid-form {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 15px !important;
    }
    .user-section-alert { grid-column: span 1 !important; }
    .modal-footer { flex-direction: column-reverse; padding: 20px; }
    .btn-save, .btn-cancel, .btn-delete-modal { width: 100%; max-width: 100% !important; padding: 15px !important; }


/* 🍯 ESTILOS PARA ALERTAS DE INTEGRIDAD - PRISMAS */

/* Contenedor Principal del Modal */
.swal2-popup {
    background: #1a1a1a !important; 
    color: #ffffff !important;
    border: 1px solid #333333 !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Títulos de la Alerta */
.swal2-title {
    color: #ffffff !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    margin-bottom: 10px !important;
}

/* Iconos (Advertencia y Éxito) */
.swal2-icon.swal2-warning {
    border-color: #f97316 !important;
    color: #f97316 !important;
}

.swal2-icon.swal2-success {
    border-color: #22c55e !important;
    color: #22c55e !important;
}

/* Bloque de Contenido (Lista de datos faltantes) */
.swal2-html-container {
    color: #cbd5e1 !important;
    text-align: left !important;
    background: rgba(249, 115, 22, 0.05) !important;
    padding: 15px 20px !important;
    border-radius: 12px !important;
    margin: 20px 0 !important;
    line-height: 1.6 !important;
    border-left: 4px solid #f97316 !important;
    font-size: 0.9rem !important;
}

/* Botón de Confirmación */
.swal2-confirm {
    background-color: #0532c3 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 12px 35px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(5, 50, 195, 0.3) !important;
}

.swal2-confirm:hover {
    background-color: #0428a3 !important;
    transform: translateY(-2px) !important;
}

/* Ajuste para el overlay (fondo oscuro externo) */
.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px) !important;
}

/* SweetAlert siempre por encima de los modales del dashboard */
.swal2-container {
    z-index: 999999 !important;
}
}



/* ================================================================
   🛰️ BLOQUE 13: UI SYSTEM - ESTILOS DINÁMICOS PARA LA TABLA ALUMNOS
   ================================================================ */

/* 1. ESTILO DE NOMBRES (Legibilidad Premium) */
.ui-modern-table td:nth-child(2) {
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.3px;
}

/* 2. DISEÑO DE STATUS PILLS (Base Común) */
.status-pill {
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.3);
}

/* 3. COLORES PARA ESTADOS DE MATRÍCULA */
/* Activo: verde — estudiante en semestre vigente */
.cat-activo, .cat-matriculado {
    background: #dcfce7; color: #166534;
    border-left: 4px solid #22c55e;
}
/* Inactivo: gris azulado — más de 2 semestres sin renovar */
.cat-inactivo {
    background: #f1f5f9; color: #475569;
    border-left: 4px solid #94a3b8;
}
/* Terminó: azul marino — completó Ciclo VI pero aún no se graduó */
.cat-termino {
    background: #eff6ff; color: #1e40af;
    border-left: 4px solid #3b82f6;
}
/* Retirado: rojo apagado — entregó carta de retiro */
.cat-retirado {
    background: #fef2f2; color: #991b1b;
    border-left: 4px solid #ef4444;
    opacity: 0.85;
}
/* Rematrícula: índigo — terminó ciclo y compró mínimo 1 módulo del siguiente */
.cat-rematricula {
    background: #eef2ff; color: #3730a3;
    border-left: 4px solid #6366f1;
}
/* Pnd. Carta: naranja — dijo que se retira pero no ha entregado carta */
.cat-pnd-carta {
    background: #fff7ed; color: #c2410c;
    border-left: 4px solid #f97316;
}
/* Graduado: dorado especial */
.cat-graduado {
    background: #fefce8; color: #854d0e;
    border-left: 4px solid #eab308;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}
/* Pre-inscrito / No Matriculado */
.cat-pre-inscrito {
    background: #fef9c3; color: #854d0e;
    border-left: 4px solid #f59e0b;
}
.cat-no-matriculado {
    background: #f8fafc; color: #64748b;
    border-left: 4px solid #cbd5e1;
}

/* 4. COLORES PARA CICLOS / CLEI (Derivados del Púrpura Sistema) */
.cat-ciclo-i, .cat-ciclo-1 { background: rgba(5, 50, 195, 0.1); color: var(--primary-color); }
.cat-ciclo-ii, .cat-ciclo-2 { background: rgba(5, 50, 195, 0.15); color: var(--primary-color); }
.cat-ciclo-iii, .cat-ciclo-3 { background: rgba(5, 50, 195, 0.2); color: var(--primary-color); }
.cat-ciclo-iv, .cat-ciclo-4 { background: rgba(5, 50, 195, 0.25); color: var(--primary-color); }
.cat-ciclo-v, .cat-ciclo-5 { background: rgba(5, 50, 195, 0.3); color: var(--primary-color); }
.cat-ciclo-vi, .cat-ciclo-6 { background: rgba(5, 50, 195, 0.35); color: var(--primary-color); }

/* 5. TIPOS DE DOCUMENTO (Estilo Minimalista) */
.cat-cedula-de-ciudadania, .cat-cc { 
    background: #f8fafc; color: #334155; border: 1px solid #e2e8f0; 
}
.cat-tarjeta-de-identidad, .cat-ti { 
    background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; 
}
.cat-registro-civil, .cat-rc { 
    background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; 
}

/* 6. EFECTO HOVER EN FILAS (Glassmorphism) */
.ui-modern-table tbody tr {
    transition: all 0.3s ease;
}

.ui-modern-table tbody tr:hover {
    background: rgba(5, 50, 195, 0.04) !important;
    transform: scale(1.002);
    box-shadow: inset 4px 0 0 var(--secondary-color);
}

/* 7. CONTENEDOR DE LA TABLA (Ajuste al Sistema) */
.ui-scroll-container {
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: var(--shadow-main);
    border: 1px solid var(--glass-border);
}



/* ================================================================
   🛰️ BLOQUE 14: MOTOR PRISMAS: PAGINACIÓN CYBER-VIBE
   ================================================================ */

/* --- PAGINACIÓN MINIMALISTA PRISMAS --- */
.pagination-ui {
    padding: 20px;
    text-align: center;
}

/* Botón Anterior (Morado 1) */
.btn-pag:first-of-type {
    background-color: #0d38b8;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

/* Botón Siguiente (Morado 2) */
.btn-pag:last-of-type {
    background-color: #0428a3;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

/* Hover a Naranja Corporativo */
.btn-pag:hover {
    background-color: #ffa718 !important;
    color: #1e1b4b !important;
}

/* Texto de Página en Gris Plata */
.pagination-ui span {
    color: #64748b; /* Gris Plata */
    font-size: 0.9rem;
    margin: 0 15px;
    font-weight: 500;
}

/* Estado cuando no hay más páginas */
.btn-pag:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}



/* ==========================================================================
   💳 MOTOR DE PAGOS & CARRITO DE COMPRAS - EDICIÓN SUPREMA
   Optimizado para: Wompi
   ========================================================================== */

/* 1. BOTÓN "COBRAR" (En la tabla de alumnos) */
.btn-prismas.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-prismas.success:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
    filter: brightness(1.1);
}

.btn-prismas.success i {
    font-size: 0.9rem;
}

/* 2. MODAL DEL CARRITO (The Checkout UI) */
#modal-cobro-prismas .modal-content {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--p-purple);
    overflow: hidden;
}

.info-pago-box {
    border: 1px solid rgba(5, 50, 195, 0.1);
    background: rgba(5, 50, 195, 0.03);
}

/* 3. GRID DE PASARELAS (Botones de Pago) */
.pasarelas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.btn-pay {
    padding: 15px;
    border-radius: 16px;
    border: none;
    font-weight: 900;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: white;
}

/* Colores de Marca Pasarelas */
.btn-pay.wompi { background: #3b82f6; box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3); }

.btn-pay:hover {
    transform: translateY(-4px);
    filter: brightness(1.1);
}

/* 4. INPUTS DE MONTO (Estilo Financiero) */
#cart-monto {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem !important;
    color: var(--p-purple) !important;
    text-align: center;
    border: 2px solid #e2e8f0;
    background: #f1f5f9 !important;
}

/* 5. 📱 ADAPTACIÓN TOTAL MÓVIL (PWA READY) */
@media (max-width: 768px) {
    .pasarelas-grid {
        grid-template-columns: 1fr; /* Una sola columna para que el dedo toque fácil */
        gap: 10px;
    }

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

    /* El botón "Cobrar" en móvil se vuelve un icono flotante o expandido */
    .btn-prismas.success {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Modal ajustado a la pantalla del celular */
    #modal-cobro-prismas .modal-content {
        padding: 20px;
        width: 95%;
        border-radius: 25px;
    }
}

/* 6. INDICADOR DE ESTADO DE PAGO EN TABLAS */
.cat-aprobado { background: #dcfce7 !important; color: #166534 !important; border-left: 4px solid #22c55e !important; }
.cat-rechazado { background: #fee2e2 !important; color: #991b1b !important; border-left: 4px solid #ef4444 !important; }
.cat-al-dia { background: #dcfce7 !important; color: #166534 !important; border-left: 4px solid #22c55e !important; }
.cat-pendiente-certificado { background: #fef9c3 !important; color: #854d0e !important; border-left: 4px solid #f59e0b !important; }

/* Profesor master en el listado de docentes: fila destacada + insignia junto al nombre */
tr.row-master > td { background: #fffbeb !important; }
tr.row-master > td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }

/* Alumno autogestionado SIN verificar: fila resaltada en naranja ("revísame").
   Al verificarlo desaparece el resaltado. Funciona en tabla y en tarjetas (móvil). */
tr.row-auto-pend > td { background: #fff7ed !important; }
tr.row-auto-pend > td:first-child { box-shadow: inset 4px 0 0 #ea580c; }
.ui-modern-table.tabla-lista tr.row-auto-pend,
tr.row-auto-pend { border-left: 4px solid #ea580c; }
.master-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .4px;
    vertical-align: middle;
    white-space: nowrap;
}


/* ==========================================================================
   ⚖️ BARRA LEGAL INSTITUCIONAL — Visible en todas las páginas
   ========================================================================== */
.legal-footer-prismas {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0b1f7e;
    border-top: 2px solid #0532c3;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.68rem;
    font-family: var(--font-main);
    padding: 7px 20px;
    z-index: 9500;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.legal-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3px 14px;
    max-width: 1400px;
    margin: 0 auto;
    line-height: 1.5;
}

.legal-footer-inner strong {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
}

.legal-sep {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* Redes sociales en la barra legal */
.legal-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.legal-social-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.72rem;
    text-decoration: none;
    transition: transform .15s ease, filter .15s ease;
}
.legal-social-ico:hover { transform: translateY(-1px) scale(1.08); filter: brightness(1.1); }
.legal-social-ico.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.legal-social-ico.fb { background: #1877f2; }
.legal-social-ico.sk { background: #f5c518; color: #1e293b; }
.legal-social-ico.yt { background: #ff0000; }

@media (max-width: 768px) {
    .legal-social-ico { width: 20px; height: 20px; font-size: 0.66rem; }
}

/* Login: sin scroll, la barra legal flota encima sin afectar el layout */
body:not(.dashboard-body) {
    overflow: hidden;
}

/* Dashboard: padding para que el contenido no quede tapado por la barra fija */
body.dashboard-body { padding-bottom: 38px; }

@media (max-width: 768px) {
    .legal-footer-prismas { padding: 6px 12px; font-size: 0.6rem; }
    .legal-footer-inner { gap: 2px 10px; }
    body.dashboard-body { padding-bottom: 52px; }
}

/* ============================================================
   VISOR DE MÓDULOS (tipo Moodle) — pantalla completa
   Menú lateral con los módulos del alumno + panel de contenido.
   ============================================================ */
.mv-overlay {
    position: fixed; inset: 0; z-index: 4000;
    /* Altura dinámica: en iOS (Safari/iPad) `inset:0` deja el fondo bajo la
       barra del navegador y recorta el contenido; 100dvh sí respeta el viewport
       visible. 100vh queda de fallback para navegadores sin soporte de dvh. */
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    background: #eef2f7;
    font-family: inherit;
    animation: mvFade .18s ease;
}
@keyframes mvFade { from { opacity: 0; } to { opacity: 1; } }

.mv-top {
    flex: none; height: 60px; display: flex; align-items: center; gap: 12px;
    padding: 0 16px; color: #fff;
    background: linear-gradient(135deg, var(--primary-color, #0532c3), #2563eb);
    box-shadow: 0 2px 12px rgba(5, 50, 195, .25);
}
.mv-top .mv-brand { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mv-top .mv-crumb { font-size: 12.5px; opacity: .85; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mv-hamb, .mv-close {
    flex: none; background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
}
.mv-hamb:hover, .mv-close:hover { background: rgba(255,255,255,.3); }
.mv-hamb { display: none; }

.mv-body { flex: 1; display: flex; min-height: 0; position: relative; }

.mv-side {
    flex: none; width: 300px; background: #fff; border-right: 1px solid #e2e8f0;
    overflow-y: auto; padding: 14px 12px 30px;
}
.mv-side-title { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #94a3b8; margin: 4px 4px 10px; }
.mv-ciclo { font-size: 11px; font-weight: 800; color: var(--primary-color, #0532c3); text-transform: uppercase; letter-spacing: .5px; margin: 14px 6px 7px; }
.mv-ciclo:first-of-type { margin-top: 4px; }

.mv-item {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px;
    padding: 10px 11px; margin-bottom: 8px; cursor: pointer; transition: all .15s;
}
.mv-item:hover { background: #eff4ff; border-color: #c7d7fe; }
.mv-item.active { background: linear-gradient(135deg, var(--primary-color, #0532c3), #2563eb); border-color: transparent; box-shadow: 0 4px 12px rgba(5,50,195,.28); }
.mv-item.active .mv-item-num { background: rgba(255,255,255,.25); color: #fff; }
.mv-item.active .mv-item-name { color: #fff; }
.mv-item.active .mv-item-sub { color: rgba(255,255,255,.8); }
.mv-item-num {
    flex: none; width: 32px; height: 32px; border-radius: 9px; background: #e0e7ff; color: var(--primary-color, #0532c3);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.mv-item-body { flex: 1; min-width: 0; }
.mv-item-name { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.25; }
.mv-item-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mv-main { flex: 1; overflow-y: auto; padding: 24px clamp(16px, 4vw, 44px) 60px; min-width: 0; }
.mv-main-inner { max-width: 900px; margin: 0 auto; }
.mv-main-head { margin-bottom: 20px; }
.mv-main-head h2 { font-size: clamp(18px, 3vw, 24px); font-weight: 800; color: #0f172a; margin: 0 0 6px; line-height: 1.2; }
.mv-main-head .mv-meta { font-size: 13px; color: #64748b; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mv-main-head .mv-meta b { color: #334155; }

.mv-section-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; font-weight: 800; letter-spacing: .8px; margin: 24px 0 12px; }
.mv-pdf {
    display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
    background: linear-gradient(135deg, #16a34a, #15803d); color: #fff;
    padding: 11px 18px; border-radius: 11px; font-weight: 700; font-size: 13px; margin: 0 10px 10px 0;
    box-shadow: 0 2px 8px rgba(22,163,74,.25); transition: transform .12s;
}
.mv-pdf:hover { transform: translateY(-1px); }
.mv-video { background: #fff; border: 1px solid #e8edf3; border-radius: 14px; padding: 14px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.mv-video-title { font-size: 14px; font-weight: 700; color: #1e293b; margin: 0 0 3px; }
.mv-video-desc { font-size: 12px; color: #64748b; margin: 0 0 10px; line-height: 1.45; }
.mv-video-frame { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; background: #000; }
.mv-video-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.mv-wa { background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; }
.mv-empty { text-align: center; color: #94a3b8; padding: 50px 16px; }
.mv-empty .mv-empty-ico { font-size: 46px; margin-bottom: 12px; }

/* ── Vista estilo Coursera: subsecciones + contenido a pantalla completa ── */
/* Subsecciones (PDF/video) anidadas bajo el módulo activo en el menú lateral */
.mv-subs { margin: 2px 0 8px; display: flex; flex-direction: column; gap: 2px; }
.mv-sub { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; padding: 9px 10px 9px 16px; border-radius: 9px; cursor: pointer; color: #475569; }
.mv-sub:hover { background: #eff4ff; }
.mv-sub.active { background: #e8efff; color: #0532c3; }
.mv-sub-ico { width: 20px; text-align: center; flex: 0 0 auto; font-size: 13px; }
.mv-sub-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-sub.active .mv-sub-name { font-weight: 700; }
.mv-sub.done .mv-sub-name { color: #16a34a; }
.mv-item-chev { flex: 0 0 auto; color: #94a3b8; font-size: 11px; margin-left: 6px; }
.mv-item.active .mv-item-chev { color: rgba(255,255,255,.85); }
.mv-lessonbtn.done { background: #dcfce7; color: #166534; }

/* Cuando el panel muestra una lección, ocupa toda el área (sin padding) */
.mv-main.mv-main--lesson { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.mv-lessonwrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mv-lessonbar { display: flex; align-items: center; gap: 10px; row-gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 11px clamp(14px, 3vw, 26px); border-bottom: 1px solid #e8edf3; background: #fff; flex: 0 0 auto; }
.mv-lessontitle { font-size: 15px; font-weight: 800; color: #0f172a; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-lessonact { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mv-lessonbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-color, #0532c3); color: #fff; text-decoration: none; border: none; border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mv-lessonbtn.wa { background: #25D366; }
.mv-lessonbtn.ghost { background: #eef2f8; color: #334155; }
.mv-lesson { flex: 1 1 auto; min-height: 0; overflow: auto; background: #f6f8fb; }
.mv-lesson.mv-lesson--pdf { overflow: hidden; background: #525659; }
.mv-lesson-pdf { width: 100%; height: 100%; border: 0; display: block; }
/* Visor PDF.js (funciona en iOS): páginas a canvas, apiladas y scrolleables */
.mv-lesson.mv-lesson--pdfjs { overflow: auto; background: #525659; -webkit-overflow-scrolling: touch; }
.mv-pdfdoc { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 10px 44px; }
.mv-pdfpage { max-width: 100%; background: #fff; border-radius: 2px; box-shadow: 0 3px 14px rgba(0,0,0,.45); overflow: hidden; }
.mv-pdfpage canvas { display: block; width: 100%; height: 100%; }
.mv-pdfloading { color: #e5e7eb; text-align: center; padding: 44px 16px; font-size: 14px; }
.mv-lesson-videowrap { max-width: 1000px; margin: 0 auto; padding: clamp(16px, 3vw, 30px); }
.mv-lesson-vdesc { font-size: 13.5px; color: #475569; margin: 0 0 14px; line-height: 1.6; }
.mv-lesson-video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 6px 22px rgba(0,0,0,.14); }
.mv-lesson-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.mv-backdrop { display: none; }

/* Móvil / tablet: el menú se vuelve un cajón deslizable */
@media (max-width: 768px) {
    .mv-hamb { display: inline-flex; }
    .mv-top .mv-brand span { display: none; }
    .mv-side {
        position: absolute; top: 0; bottom: 0; left: 0; z-index: 20;
        width: 82%; max-width: 320px; transform: translateX(-100%);
        transition: transform .22s ease; box-shadow: 4px 0 24px rgba(0,0,0,.18);
    }
    .mv-side.open { transform: translateX(0); }
    .mv-backdrop { display: block; position: absolute; inset: 0; z-index: 15; background: rgba(15,23,42,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .mv-backdrop.show { opacity: 1; pointer-events: auto; }
    .mv-main { padding: 18px 16px 50px; }
}

/* Examen del curso dentro del visor */
.mv-exam-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e8edf3; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.mv-exam-card.ok { background: #f0fdf4; border-color: #bbf7d0; }
.mv-exam-info { flex: 1; min-width: 0; }
.mv-exam-info b { display: block; font-size: 14px; color: #0f172a; }
.mv-exam-info span { font-size: 12.5px; color: #64748b; }
.mv-exam-badge { font-size: 26px; flex: none; }
.mv-exam-start { flex: none; background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; border: none; border-radius: 11px; padding: 11px 18px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(124,58,237,.28); transition: transform .12s; }
.mv-exam-start:hover { transform: translateY(-1px); }
.mv-exam-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.mv-exam-back { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; border-radius: 11px; padding: 11px 18px; font-weight: 700; font-size: 13px; cursor: pointer; }
.mv-exam-send { background: linear-gradient(135deg, var(--primary-color, #0532c3), #2563eb); color: #fff; border: none; border-radius: 11px; padding: 11px 24px; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 2px 10px rgba(5,50,195,.28); }
.mv-exam-send:disabled { opacity: .7; cursor: default; }

/* Quiz (compartido con el modal): estilos globales para renderizar en el panel.
   La versión modal (SweetAlert) trae su propio <style> con max-height. */
.cx-exam { text-align: left; }
.cx-progress { position: sticky; top: 0; background: #eef2f7; padding: 4px 2px 12px; z-index: 3; }
.cx-pbar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.cx-pfill { height: 100%; width: 0%; background: linear-gradient(90deg,#0532c3,#3b82f6); transition: width .3s ease; }
.cx-pcount { font-size: 12px; font-weight: 700; color: #475569; margin-top: 7px; }
.mv-main .cx-list { padding: 2px 0 0; }
.cx-q { background: #fff; border: 1.5px solid #e9eef5; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; transition: .18s; }
.cx-q.answered { border-color: #bfdbfe; background: #f6faff; }
.cx-qhead { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 11px; }
.cx-qnum { flex: none; width: 27px; height: 27px; border-radius: 9px; background: #0532c3; color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.cx-qtext { font-size: 14px; font-weight: 700; color: #1e293b; line-height: 1.4; padding-top: 3px; }
.cx-qimg { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; border: 1px solid #e2e8f0; margin: 0 0 12px; }
.cx-opt { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1.5px solid #e2e8f0; border-radius: 11px; background: #fff; margin: 7px 0; cursor: pointer; font-size: 13px; color: #334155; transition: .15s; }
.cx-opt:hover { border-color: #93c5fd; background: #f0f7ff; }
.cx-opt input { display: none; }
.cx-letter { flex: none; width: 25px; height: 25px; border-radius: 50%; border: 1.5px solid #cbd5e1; color: #64748b; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; transition: .15s; }
.cx-opt.is-selected { border-color: #0532c3; background: #eef4ff; color: #0532c3; font-weight: 600; box-shadow: 0 0 0 3px rgba(5,50,195,.09); }
.cx-opt.is-selected .cx-letter { background: #0532c3; border-color: #0532c3; color: #fff; }
.cat-pendiente, .cat-pnd-carta { background: #fff7ed !important; color: #c2410c !important; border-left: 4px solid #f97316 !important; }

/* ============================================================
   📱 TABLET TÁCTIL EN HORIZONTAL (iPad landscape, 1025–1366px)
   Los iPad en horizontal miden 1080–1366px CSS: quedan por encima
   del breakpoint de 1024px y caían en el layout de ESCRITORIO
   (sidebar fijo de 240px pensado para portátiles ≥1280), dejando el
   contenido apretado y con botones/toggles sin espacio.
   Con (hover:none)+(pointer:coarse) detectamos el dispositivo táctil
   (iPad/tablet) SIN afectar a portátiles con mouse, y les damos el
   mismo layout apilado ya probado en móvil: menú colapsable + contenido
   a todo el ancho.
   ============================================================ */
@media (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
    .dashboard-wrapper { flex-direction: column; }

    .sidebar-prismas {
        width: 100%; min-width: 100%; height: auto;
        position: sticky; top: 0; z-index: 2000;
        background: linear-gradient(135deg, var(--p-dark) 0%, #2e2a6e 100%);
        border-bottom: 4px solid var(--p-orange);
    }

    .mobile-toggle-btn {
        display: flex !important;
        background: var(--p-purple) !important;
        color: var(--white) !important;
        padding: 18px; justify-content: center; align-items: center;
        font-weight: 900; text-transform: uppercase; border: none;
        width: 100%; cursor: pointer;
    }

    .sidebar-nav-scroll {
        display: none; width: 100%; height: auto;
        background: transparent; padding: 6px 0 16px;
    }
    .sidebar-prismas.active .sidebar-nav-scroll { display: block !important; height: auto !important; }

    .sidebar-brand { padding: 12px 14px 6px; }
    .sidebar-brand::after { display: none; }
    .nav-link { padding: 12px 18px; }
    .nav-link:hover { padding-left: 18px; }
    .nav-link.active { border-left: 0; box-shadow: inset 4px 0 0 var(--p-orange); }

    /* La cabecera deja de encimarse al recuperar el ancho completo */
    .dashboard-header-modern { flex-wrap: wrap; gap: 14px; }
}
/* --- Filtro global por institución (sidebar) — usa los tokens del menú --- */
.inst-scope-switch { padding: 10px 14px 4px; }
.inst-scope-switch .iss-cap {
    display: block; font-size: 0.65rem; color: var(--p-orange); font-weight: 900;
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
}
.inst-scope-switch .iss-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.inst-scope-switch .iss-btn {
    flex: 1 1 auto; min-width: 46px; padding: 7px 8px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8); font-size: 0.72rem; font-weight: 800; white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.inst-scope-switch .iss-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.inst-scope-switch .iss-btn.active {
    background: var(--secondary-color); border-color: var(--secondary-color);
    color: var(--p-dark); box-shadow: 0 4px 12px rgba(255,167,24,0.28);
}
