/* ==========================================
   Estilos Globales y Variables - Línea Institucional Ejecutiva
   Liceo San Francisco (Elegante, Formal y Uniforme)
   ========================================== */
:root {
    /* Paleta Institucional Ejecutiva Prestigiosa */
    --primary-color: #173252; /* Azul marino institucional sobrio y formal */
    --primary-hover: #0f233a;
    --primary-light: #f0f4f9;
    --primary-subtle: #e2ebf5;
    --accent-color: #2563eb; /* Azul ejecutivo */
    --accent-hover: #1d4ed8;
    --bg-light: #f8fafc; /* Fondo claro limpio y moderno */
    --bg-card: #ffffff;
    --text-dark: #0f172a; /* Pizarra oscura profunda */
    --text-main: #334155;
    --text-muted: #64748b; /* Pizarra suave */
    --text-white: #ffffff;
    --sidebar-bg: #0f233a; /* Sidebar marino profundo */
    --sidebar-hover: #173252;
    --border-color: #e2e8f0; /* Bordes nítidos y modernos */
    --border-light: #f1f5f9;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-text: #15803d;
    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --font-family: 'Calibri Light', Calibri, 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Calibri Light', Calibri, 'Segoe UI', sans-serif;
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.09);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

input, button, select, textarea, optgroup {
    font-family: var(--font-family);
}

/* Blindaje para que los íconos de Font Awesome nunca se sobreescriban */
.fa, .fas, .far, .fal, .fad, .fab, .fa-solid, .fa-regular, .fa-brands, [class*="fa-"], [class^="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}
.fa-solid, .fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}
.fa-regular, .far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}
.fa-brands, .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}
.fa::before, .fas::before, .far::before, .fal::before, .fad::before, .fab::before,
.fa-solid::before, .fa-regular::before, .fa-brands::before,
[class*="fa-"]::before, [class^="fa-"]::before {
    font-family: inherit !important;
}

/* ==========================================
   Estilos de la Pantalla de Login (index.php)
   ========================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-light);
    padding: 20px;
}

.login-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 14px 40px rgba(45, 38, 30, 0.06);
    width: 100%;
    max-width: 410px;
    padding: 70px 32px 35px 32px;
    position: relative;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 60px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.imagen-logo {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagen-logo img {
    height: 110px;
    width: auto;
    max-width: 120px;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    filter: drop-shadow(0 4px 12px rgba(45, 38, 30, 0.12));
    object-fit: contain;
    display: block;
}

.login-form h2 {
    text-align: center;
    font-size: 23px;
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

/* Alertas de error */
.alert-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13.5px;
    border-left: 4px solid var(--error-text);
    border: 1px solid rgba(140, 54, 41, 0.2);
    border-left-width: 4px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    background: #ffffff;
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
    font-family: var(--font-family);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(140, 80, 57, 0.14);
}

.btn-submit {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
    letter-spacing: 0.02em;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 80, 57, 0.25);
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--primary-hover);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 25px 0 15px 0;
}

.support-email, .website-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.website-link a {
    color: var(--text-muted);
    text-decoration: none;
}

.website-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}


/* ==========================================
   Estilos del Panel Administrativo (sistema/index.php)
   ========================================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Menú Lateral (Sidebar) */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.sidebar-header img {
    max-height: 120px;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 19px;
    font-weight: 600;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.sidebar-profile {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-hover);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    margin: 0 auto 10px auto;
    border: 2px solid var(--accent-color);
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.profile-role {
    font-size: 11px;
    background: rgba(0, 198, 255, 0.15);
    color: var(--accent-color);
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Navegación del Menú */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.menu-category {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 15px 20px 8px 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.menu-item i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}

.menu-item.active {
    background: var(--sidebar-hover);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

/* Submenús */
.menu-submenu {
    padding-left: 20px;
}

.menu-submenu .menu-item {
    padding: 10px 20px;
    font-size: 13.5px;
}

/* Contenido Principal */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}

.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    min-height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(35, 30, 25, 0.03);
}

.menu-toggle {
    display: block;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-dark);
}

.header-title h1,
#headerTitle {
    font-size: 1.45rem;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-date {
    font-size: 13.5px;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #dc2626;
    color: var(--text-white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-logout:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.28);
}

/* Área de contenido del Dashboard */
.content-body {
    padding: 30px;
    flex: 1;
}

/* Vistas de Módulos (SPA - Show/Hide) */
.module-view {
    display: none;
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.module-view.active {
    display: block;
}

.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 26px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.card h2 {
    font-size: 1.35rem;
    font-family: var(--font-serif);
    color: var(--text-dark);
    margin-bottom: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
    letter-spacing: -0.01em;
}

/* Tablas y elementos generales de contenido */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

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

.stat-card:nth-child(2) { border-left-color: #5b6f53; }
.stat-card:nth-child(3) { border-left-color: #b88a44; }
.stat-card:nth-child(4) { border-left-color: #4d453d; }

.stat-info h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.stat-info p {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    font-family: var(--font-family);
}

.stat-icon {
    font-size: 30px;
    color: var(--primary-color);
    opacity: 0.35;
}

.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
}

/* Estilos compactos específicos para la planilla de cursos */
#cursosTable th, #cursosTable td {
    padding: 8px 6px;
    font-size: 12.5px;
}

#cursosTable thead th {
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: middle;
}

.data-table th {
    background-color: #f1f5f9;
    color: var(--text-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.badge {
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(54, 80, 51, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(122, 94, 36, 0.2);
}

/* Botones de acción dentro del panel */
.btn-action {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 5px;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(140, 80, 57, 0.2);
}

.btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(140, 80, 57, 0.28);
}

/* ==========================================
   Media Queries para Responsividad
   ========================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .main-header {
        padding: 0 15px;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .header-date {
        display: none;
    }
    
    .content-body {
        padding: 15px;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ==========================================
   Reloj Profesional del Sidebar (Redondo Análogo)
   ========================================== */
.sidebar-clock {
    padding: 10px 15px;
    margin: 15px 15px 5px 15px;
    background: transparent;
    border: none;
    text-align: center;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.analog-clock {
    width: 90px;
    height: 90px;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    position: relative;
    background: transparent;
    box-shadow: 0 0 10px rgba(0, 198, 255, 0.15);
    margin-bottom: 5px;
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
}

.clock-tick {
    position: absolute;
    background: rgba(0, 198, 255, 0.5);
}
.tick-12 { top: 4px; left: 50%; width: 1.5px; height: 6px; transform: translateX(-50%); }
.tick-6  { bottom: 4px; left: 50%; width: 1.5px; height: 6px; transform: translateX(-50%); }
.tick-3  { right: 4px; top: 50%; width: 6px; height: 1.5px; transform: translateY(-50%); }
.tick-9  { left: 4px; top: 50%; width: 6px; height: 1.5px; transform: translateY(-50%); }

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 3px;
    transform: rotate(0deg);
}

.hour-hand {
    width: 3px;
    height: 26px;
    margin-left: -1.5px;
    background-color: var(--text-white);
    z-index: 3;
}

.min-hand {
    width: 2px;
    height: 36px;
    margin-left: -1px;
    background-color: #cbd5e1;
    z-index: 2;
}

.second-hand {
    width: 1px;
    height: 39px;
    margin-left: -0.5px;
    background-color: #ff4757; /* Rojo para segundero */
    z-index: 1;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4757;
    transform: translate(-50%, -50%);
    z-index: 10;
    border: 1px solid var(--text-white);
}

.clock-day {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.clock-date {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   Estilos de Footer del Contenido
   ========================================== */
.main-footer {
    background-color: #eaeaea; /* Plomo claro */
    border-top: 1px solid #d8d8d8;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: #4a5568; /* Plomo oscuro para legibilidad */
    margin-top: auto; /* Empuja el footer hacia abajo */
    flex-wrap: wrap;
}

.main-footer strong {
    color: var(--primary-color);
}

.footer-logo {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    vertical-align: middle;
    margin: -3px 6px 0 6px;
}

/* Alert Boxes para Configuración */
.alert-success-box {
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 5px solid #145a32;
    text-align: left;
}

.alert-error-box {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 5px solid #c0392b;
    text-align: left;
}

/* ==========================================
   Estilos de la Ventana Modal para Importación
   ========================================== */
.modal {
    display: flex; /* Siempre flex para centrar contenido */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay oscuro */
    backdrop-filter: blur(4px); /* Difuminado de fondo profesional */
    align-items: center;
    justify-content: center;
    
    /* Soporte de entrada y salida fluidas */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

.modal.open {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    
    /* Animación elástica de escala y desplazamiento */
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
}

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

.modal-header {
    background-color: #ffffff;
    color: var(--text-dark);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
    color: var(--primary-color);
}

.modal-body {
    padding: 24px;
}

.import-step {
    margin-bottom: 24px;
}

.import-step h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.import-step p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.btn-download-template {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f8fafc;
    color: var(--text-dark);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.btn-download-template:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary-color);
}

.upload-drag-zone {
    border: 2px dashed #dcd5c7;
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background-color: #fdfcf9;
    transition: var(--transition);
}

.upload-drag-zone:hover, .upload-drag-zone.dragover {
    border-color: var(--primary-color);
    background-color: #faf5f0;
}

.upload-drag-zone i {
    font-size: 32px;
    color: var(--primary-color);
    opacity: 0.5;
    display: block;
    margin-bottom: 8px;
}

.upload-drag-zone span {
    font-size: 14px;
    color: var(--text-dark);
    display: block;
    font-weight: 600;
}

.upload-drag-zone small {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.selected-file-info {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success-text);
    display: none;
    text-align: center;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-cancel {
    background-color: #ffffff;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-modal-cancel:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.btn-modal-submit {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(23, 50, 82, 0.2);
}

.btn-modal-submit:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(23, 50, 82, 0.28);
}

/* ==========================================
   Estilos de la Paginación
   ========================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.btn-pagination {
    background-color: #ffffff;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pagination:hover:not(:disabled) {
    background-color: #f1f2f6;
    border-color: #b2bec3;
}

.btn-pagination.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

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

/* ==========================================
   Estilos de Acordeón en Sidebar
   ========================================== */
.menu-submenu {
    display: none; /* Ocultar por defecto */
    padding-left: 20px;
}

.menu-submenu.show {
    display: block; /* Mostrar cuando tiene la clase show */
}

.accordion-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
}

.accordion-header:hover {
    color: var(--text-white);
    background-color: var(--sidebar-hover);
}

.accordion-header.active {
    color: var(--accent-color);
}

.accordion-arrow {
    font-size: 10px;
    opacity: 0.6;
    margin-right: 20px;
}

/* ==========================================
   Tema Oscuro de Sidebar (Replicando Daniel)
   ========================================== */
:root {
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-300: #cbd5e1;
    --white: #ffffff;
    --text-muted: #64748b;
    --accent-color: #173252;
}

/* Sidebar General */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--slate-900) !important;
    color: var(--white) !important;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}

.sidebar-header {
    min-height: 70px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.logo img {
    height: 85px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.logo span {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    text-align: center;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--slate-300);
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
    transition: all 0.3s ease;
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10;
}

/* User Profile Panel in Sidebar */
.user-panel {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--slate-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 1px solid rgba(255,255,255,0.05);
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
}

.user-role {
    font-size: 0.75rem;
    color: var(--slate-300);
    margin-top: 0.125rem;
    opacity: 0.8;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-header {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem 0.375rem 1.5rem;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--slate-300) !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover, .nav-item.active .nav-link, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--white) !important;
}

/* Accordion Submenus CSS Transition */
.nav-item.has-submenu {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.nav-item.open > .nav-link > .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.nav-item.open .submenu {
    max-height: 500px;
    transition: max-height 0.3s ease-in-out;
}

.submenu li {
    margin: 0.25rem 0;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--slate-300) !important;
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.submenu a:hover, .submenu a.active {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Ajustes de Layout Principal para Menú Horizontal */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Ocultar sidebar vertical previo */
.sidebar, .sidebar-clock-container, .sidebar-overlay {
    display: none !important;
}

/* ==========================================
   Estilos de Tarjetas KPI y Tablas Interactivas
   ========================================== */
.stat-card-clickable {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.table-hover-effect tbody tr {
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.table-hover-effect tbody tr:hover {
    background-color: #f8fafc !important;
    transform: scale(1.006);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    cursor: pointer;
}

/* ==========================================================
   Efectos e interacciones de botones del sistema (tipo Bootstrap)
   ========================================================== */
.btn-action,
.btn-submit,
.btn-logout,
.btn-download-template,
.btn-modal-cancel,
.btn-modal-submit,
.btn-pagination,
.btn-import-excel {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.btn-action:hover,
.btn-submit:hover,
.btn-logout:hover,
.btn-modal-submit:hover,
.btn-pagination:hover:not(:disabled),
.btn-import-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.btn-modal-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    background-color: #cbd5e1 !important; /* Fondo plomo medio */
    color: var(--primary-color) !important; /* Letra azul institucional */
    border-color: var(--primary-color) !important;
}

.btn-download-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    background-color: #cbd5e1 !important; /* Fondo plomo medio */
    color: var(--primary-color) !important; /* Letra azul institucional */
    border-color: var(--primary-color) !important;
}

/* Efecto click (active) - hundirse y reducir escala levemente */
.btn-action:active,
.btn-submit:active,
.btn-logout:active,
.btn-download-template:active,
.btn-modal-cancel:active,
.btn-modal-submit:active,
.btn-pagination:active:not(:disabled),
.btn-import-excel:active {
    transform: translateY(1px) scale(0.97) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Estilo moderno para inputs de archivo (File Inputs) */
.file-input-styled {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13.5px;
    outline: none;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.file-input-styled::file-selector-button {
    background-color: var(--primary-color);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.file-input-styled::file-selector-button:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ==========================================
   Collapse y Dropdowns de Acciones
   ========================================== */

/* Colapsar sidebar en desktop */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-right: none !important;
    }
}

/* Contenedor del Dropdown de Acciones en Tablas */
.action-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

/* Botón de tres puntos / líneas para acciones */
.action-btn-trigger {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.action-btn-trigger:hover {
    background-color: #e2e8f0;
    color: #1e3a8a;
    border-color: #94a3b8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Contenido del Dropdown (oculto por defecto) */
.action-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background-color: #ffffff;
    min-width: 130px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    z-index: 9999;
    padding: 5px 0;
}

/* Mostrar dropdown al activarse */
.action-dropdown.open .action-dropdown-content {
    display: block !important;
}

/* Enlaces y botones dentro del dropdown */
.action-dropdown-content a,
.action-dropdown-content button {
    color: #334155;
    padding: 8px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    font-size: 13.5px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease;
    margin: 0;
    box-sizing: border-box;
}

.action-dropdown-content a:hover,
.action-dropdown-content button:hover {
    background-color: #f1f5f9;
    color: #1e3a8a;
}

.action-dropdown-content i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Sincronizar el colapso del contenido principal con el sidebar */
@media (min-width: 769px) {
    .sidebar.collapsed + .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ==========================================================================
   MENÚ HORIZONTAL SUPERIOR INSTITUCIONAL (Liceo San Francisco)
   ========================================================================== */

/* Estructura general de la barra superior */
.top-horizontal-header {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1200;
    box-shadow: 0 2px 10px rgba(35, 30, 25, 0.04);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.top-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2rem;
}

/* Identidad y Logo */
.nav-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-img {
    height: 48px;
    width: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.brand-link:hover .brand-img {
    transform: scale(1.05);
}

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

.brand-name {
    font-size: 1.25rem;
    font-family: var(--font-family);
    font-weight: 700;
    color: #0f2744;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.brand-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.brand-tag i {
    color: var(--primary-color);
}

/* Widgets superiores en tiempo real */
.top-bar-widgets {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8125rem;
    border-radius: 20px;
    padding: 6px 14px;
}

.widget-date {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.widget-date i {
    color: var(--primary-color);
}

.widget-clock {
    background: #f8fafc;
    color: #0f2744;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.widget-clock i {
    color: var(--primary-color);
}

/* Ficha del Usuario */
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 6px;
    background: #f8fafc;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
}

.user-chip-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(23, 50, 82, 0.2);
}

.user-chip-details {
    display: flex;
    flex-direction: column;
}

.user-chip-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    white-space: nowrap;
}

.user-chip-role {
    font-size: 0.6875rem;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Botón Salir */
.btn-nav-logout {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    background: #dc2626;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-nav-logout:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.28);
}

/* Botón móvil hamburguesa */
.nav-mobile-toggle {
    display: none;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   BARRA DE MENÚ HORIZONTAL INSTITUCIONAL (DESTACADA ENTRE ARRIBA Y ABAJO)
   ========================================================================== */
.horizontal-navbar {
    background: linear-gradient(90deg, #10243d 0%, #173252 50%, #112640 100%);
    padding: 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 3px solid #0b1a2c;
    box-shadow: 0 4px 16px rgba(15, 35, 60, 0.16);
    position: relative;
    z-index: 1050;
}

.nav-menu-container {
    width: 100%;
}

.nav-h-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    align-items: center;
}

.nav-h-item {
    position: relative;
}

.nav-h-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.90rem;
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.nav-h-link i:first-child {
    font-size: 0.95rem;
    color: #93c5fd;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-h-link-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mobile-user-drawer-card,
.mobile-nav-footer {
    display: none;
}

.nav-arrow {
    font-size: 0.7rem;
    margin-left: 2px;
    transition: transform 0.2s ease;
    color: #93c5fd;
}

.nav-h-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-bottom-color: #38bdf8;
}

.nav-h-link:hover i:first-child {
    color: #ffffff;
}

.nav-h-item.active > .nav-h-link {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-bottom-color: #38bdf8;
    font-weight: 700;
}

.nav-h-item.active > .nav-h-link i:first-child {
    color: #38bdf8;
}

.has-dropdown:hover .nav-arrow,
.has-dropdown.open .nav-arrow {
    transform: rotate(180deg);
    color: #ffffff;
}

/* Menú Desplegable (Dropdown List) */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: #ffffff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 16px 36px rgba(15, 35, 60, 0.18), 0 4px 12px rgba(15, 35, 60, 0.08);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    border: 1px solid #cbd5e1;
    border-top: 3px solid var(--primary-color);
    display: none;
    z-index: 2500;
    animation: navDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* En desktop se muestra con hover */
@media (min-width: 993px) {
    .has-dropdown:hover > .dropdown-list {
        display: block;
    }
}

/* En móvil o al abrir por JS */
.has-dropdown.open > .dropdown-list {
    display: block;
}

.dropdown-list li {
    margin: 0;
}

.dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-dark) !important;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.dropdown-list li a i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}

.dropdown-list li a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color);
    padding-left: 24px;
    font-weight: 600;
}

.dropdown-list li a:hover i {
    transform: scale(1.15);
}

.dropdown-list li a.active {
    background-color: var(--primary-light);
    color: var(--primary-color) !important;
    font-weight: 700;
    border-left-color: var(--primary-color);
}

/* ==========================================================================
   Submenú Anidado de Segundo Nivel (ej. Asignar -> Electivo, NEE, Certificado Médico)
   ========================================================================== */
.dropdown-list li.has-submenu {
    position: relative;
}

.dropdown-list li.has-submenu > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 16px;
    cursor: pointer;
}

.dropdown-list li.has-submenu > a .submenu-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.dropdown-list .submenu-arrow {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform 0.2s ease, color 0.2s ease;
}

@media (min-width: 993px) {
    .dropdown-list .has-submenu > .submenu-list {
        display: none;
        position: absolute;
        top: -4px;
        left: 100%;
        min-width: 220px;
        background: #ffffff;
        border-radius: var(--radius-md);
        box-shadow: 0 16px 36px rgba(15, 35, 60, 0.16), 0 4px 10px rgba(15, 35, 60, 0.05);
        list-style: none;
        margin: 0;
        padding: 8px 0;
        border: 1px solid #cbd5e1;
        border-left: 3px solid var(--primary-color);
        z-index: 2600;
        animation: navDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .dropdown-list .has-submenu:hover > .submenu-list,
    .dropdown-list .has-submenu.open > .submenu-list {
        display: block;
    }

    .dropdown-list .has-submenu:hover > a,
    .dropdown-list .has-submenu.open > a {
        background-color: #f1f5f9;
        color: var(--primary-color) !important;
        border-left-color: var(--primary-color);
    }

    .dropdown-list .has-submenu:hover > a .submenu-arrow,
    .dropdown-list .has-submenu.open > a .submenu-arrow {
        transform: translateX(4px);
        color: var(--primary-color);
    }

    .submenu-list li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 9px 20px;
        color: var(--text-dark) !important;
        text-decoration: none;
        font-size: 0.88rem;
        font-weight: 500;
        transition: var(--transition);
        border-left: 3px solid transparent;
    }

    .submenu-list li a i {
        width: 20px;
        text-align: center;
        color: var(--primary-color);
        font-size: 0.95rem;
    }

    .submenu-list li a:hover {
        background-color: #fbf9f5;
        color: var(--primary-color) !important;
        border-left-color: var(--primary-color);
        padding-left: 24px;
        font-weight: 600;
    }

    .submenu-list li a.active {
        background-color: var(--primary-light);
        color: var(--primary-color) !important;
        font-weight: 700;
        border-left-color: var(--primary-color);
    }
}

/* Capa oscura móvil */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 26, 23, 0.55);
    z-index: 1150;
    backdrop-filter: blur(3px);
}

.nav-overlay.open {
    display: block;
}

/* ==========================================================================
   CABECERA DE PÁGINA (MAIN-HEADER) Y BREADCRUMB
   ========================================================================== */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    min-height: 64px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.header-left h1 {
    font-size: 1.45rem;
    font-family: var(--font-family);
    font-weight: 700;
    color: #0f2744;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
}

.header-breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.header-breadcrumb a:hover {
    color: var(--primary-color);
}

.header-breadcrumb .sep {
    color: #cbd5e1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-status-school {
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.header-user-tag {
    font-size: 0.8125rem;
    color: var(--text-main);
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Cuerpo de contenido principal */
.content-body {
    flex: 1;
    padding: 1.75rem 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   FOOTER INSTITUCIONAL PROFESIONAL (Liceo San Francisco © 2026)
   ========================================================================== */
.main-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 16px 2rem;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

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

.footer-brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.footer-text-group {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-size: 0.84rem;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
}

.footer-title strong {
    color: var(--primary-color);
    font-weight: 700;
}

.footer-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.footer-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: #f5f2ea;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
}

.badge-school {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--primary-light);
    border-color: var(--primary-subtle);
}

.badge-year {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: rgba(54, 80, 51, 0.2);
    font-weight: 600;
}

.badge-version {
    color: var(--text-muted);
    background: #f5f2ea;
    border-color: var(--border-color);
    font-weight: 600;
}

/* ==========================================================================
   RESPONSIVIDAD MÓVIL Y TABLET PARA MENÚ HORIZONTAL Y PLATAFORMA
   ========================================================================== */
@media (max-width: 992px) {
    /* Barra Superior Fija */
    .top-horizontal-header {
        position: sticky;
        top: 0;
        z-index: 1050;
    }

    .top-nav-container {
        padding: 8px 16px;
        gap: 10px;
    }

    .brand-img {
        height: 40px;
        width: 40px;
        border-radius: 8px;
    }

    .brand-info {
        max-width: 220px;
    }

    .brand-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-tag {
        display: none !important;
    }

    /* Widgets Superiores */
    .top-bar-widgets {
        gap: 8px;
    }

    .widget-date,
    .user-chip {
        display: none !important;
    }

    .widget-clock {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .btn-nav-logout {
        padding: 7px 11px;
        font-size: 0.78rem;
    }

    /* Botón Menú Hamburguesa Interactivo */
    .nav-mobile-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #f5f2ea;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-dark);
        font-size: 1.25rem;
        cursor: pointer;
        transition: var(--transition);
        padding: 0;
    }

    .nav-mobile-toggle:hover,
    .nav-mobile-toggle:active,
    .nav-mobile-toggle.open {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: #ffffff;
        transform: scale(1.04);
    }

    /* Panel Desplegable Móvil (Drawer) */
    .horizontal-navbar {
        display: none !important;
        position: fixed;
        top: 57px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: calc(100vh - 57px);
        max-height: calc(100vh - 57px);
        background: #ffffff;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1050;
        padding: 0;
    }

    .horizontal-navbar.open {
        display: block !important;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        animation: mobileNavbarSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes mobileNavbarSlide {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Tarjeta de Usuario en Menú Móvil */
    .mobile-user-drawer-card {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        background: #f8fafc;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-user-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--primary-color);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        flex-shrink: 0;
        box-shadow: var(--shadow-sm);
        border: 2px solid var(--border-color);
    }

    .mobile-user-details {
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow: hidden;
    }

    .mobile-user-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-user-role {
        font-size: 0.72rem;
        font-weight: 700;
        color: var(--primary-color);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .mobile-user-sub {
        font-size: 0.72rem;
        color: var(--text-muted);
        margin-top: 2px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    /* Lista Vertical de Ítems del Menú */
    .nav-h-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 6px 0;
        margin: 0;
    }

    .nav-h-item {
        border-bottom: 1px solid var(--border-light);
        width: 100%;
    }

    .nav-h-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 20px;
        color: var(--text-main);
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: none;
        border-bottom: none;
        border-left: 4px solid transparent;
        transition: background 0.15s ease, border-color 0.15s ease;
        box-sizing: border-box;
        min-height: 48px;
    }

    .nav-h-link-title {
        display: inline-flex;
        align-items: center;
        gap: 12px;
    }

    .nav-h-link-title i {
        font-size: 1.1rem;
        width: 22px;
        text-align: center;
        color: var(--text-muted);
        transition: color 0.15s ease;
    }

    .nav-h-link:hover,
    .nav-h-link:active {
        background: #ebe4d8;
        color: var(--text-dark);
    }

    .nav-h-link:hover .nav-h-link-title i {
        color: var(--primary-color);
    }

    .nav-h-item.active > .nav-h-link {
        background: #ffffff;
        color: var(--primary-color);
        border-left-color: var(--primary-color);
        font-weight: 700;
    }

    .nav-h-item.active > .nav-h-link .nav-h-link-title i {
        color: var(--primary-color);
    }

    .nav-arrow {
        font-size: 0.85rem;
        color: var(--text-muted);
        transition: transform 0.25s ease, color 0.2s ease;
        margin-left: auto;
        padding: 4px;
    }

    .has-dropdown.open > .nav-h-link .nav-arrow {
        transform: rotate(180deg);
        color: var(--primary-color);
    }

    .has-dropdown.open > .nav-h-link {
        background: #f5f2ea;
        border-left-color: var(--primary-color);
    }

    /* Submenús Desplegables Tipo Acordeón */
    .dropdown-list {
        display: none;
        position: static;
        box-shadow: inset 0 2px 6px rgba(45, 38, 30, 0.05);
        background: #ffffff;
        border: none;
        border-top: 1px solid var(--border-light);
        border-bottom: 1px solid var(--border-light);
        border-radius: 0;
        padding: 4px 0 6px 0;
        list-style: none;
        margin: 0;
    }

    .has-dropdown.open > .dropdown-list {
        display: block;
        animation: mobileDropdownSlide 0.2s ease-out;
    }

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

    .dropdown-list li {
        width: 100%;
    }

    .dropdown-list li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 20px 12px 42px;
        color: var(--text-main) !important;
        font-size: 0.88rem;
        font-weight: 500;
        text-decoration: none;
        border-left: 3px solid transparent;
        transition: all 0.15s ease;
        min-height: 44px;
        box-sizing: border-box;
    }

    .dropdown-list li a i {
        width: 20px;
        text-align: center;
        color: var(--primary-color);
        font-size: 0.95rem;
    }

    .dropdown-list li a:hover,
    .dropdown-list li a:active {
        background: #fbf9f5;
        color: var(--primary-color) !important;
        border-left-color: var(--primary-color);
        padding-left: 45px;
    }

    .dropdown-list li a.active {
        background: var(--primary-light);
        color: var(--primary-color) !important;
        font-weight: 700;
        border-left-color: var(--primary-color);
    }

    /* Submenú en Móvil (Acordeón Anidado) */
    .dropdown-list li.has-submenu > a .submenu-arrow {
        color: var(--text-muted);
        font-size: 0.8rem;
        transition: transform 0.25s ease;
    }

    .dropdown-list li.has-submenu.open > a .submenu-arrow {
        transform: rotate(90deg);
        color: var(--primary-color);
    }

    .dropdown-list .has-submenu > .submenu-list {
        display: none;
        list-style: none;
        padding: 4px 0 6px 0;
        margin: 4px 14px 6px 36px;
        background: #fbf9f5;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        border-left: 3px solid var(--primary-color);
    }

    .dropdown-list .has-submenu.open > .submenu-list {
        display: block;
        animation: mobileDropdownSlide 0.2s ease-out;
    }

    .submenu-list li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        color: var(--text-main) !important;
        font-size: 0.84rem;
        text-decoration: none;
        transition: all 0.15s ease;
    }

    .submenu-list li a i {
        color: var(--primary-color);
        font-size: 0.9rem;
        width: 18px;
        text-align: center;
    }

    .submenu-list li a:hover,
    .submenu-list li a:active,
    .submenu-list li a.active {
        color: var(--primary-color) !important;
        background: var(--primary-light);
        font-weight: 600;
    }

    /* Pie del Drawer Móvil */
    .mobile-nav-footer {
        display: block !important;
        padding: 18px 20px 30px 20px;
        border-top: 1px solid var(--border-color);
        margin-top: 8px;
    }

    .mobile-nav-logout-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 12px 20px;
        background: #8c4632;
        color: #ffffff !important;
        text-decoration: none;
        border-radius: var(--radius-sm);
        font-size: 0.92rem;
        font-weight: 700;
        transition: var(--transition);
        box-shadow: 0 4px 12px rgba(140, 70, 50, 0.25);
        box-sizing: border-box;
    }

    .mobile-nav-logout-btn:hover,
    .mobile-nav-logout-btn:active {
        background: #733725;
        transform: translateY(-1px);
    }

    /* Bloqueo de Scroll */
    body.nav-mobile-open {
        overflow: hidden !important;
    }

    /* Capa Oscura de Fondo */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(30, 26, 23, 0.55);
        backdrop-filter: blur(2px);
        z-index: 1040 !important;
    }

    .nav-overlay.open {
        display: block !important;
    }

    /* Cabecera y Contenido en Móvil */
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 1rem;
    }

    .content-body {
        padding: 1rem;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand-box {
        flex-direction: column;
        text-align: center;
    }
}

/* Celulares Medianos y Pequeños (menores a 576px) */
@media (max-width: 576px) {
    .top-nav-container {
        padding: 7px 12px;
    }

    .brand-info {
        max-width: 155px;
    }

    .brand-name {
        font-size: 0.88rem;
    }

    .widget-clock {
        display: none !important;
    }

    .btn-nav-logout span {
        display: none;
    }

    .btn-nav-logout {
        padding: 8px 10px;
        border-radius: 8px;
    }
}

/* ==========================================================================
   REGLAS ESPECÍFICAS DE ESCRITORIO (PANTALLA COMPLETA / MAXIMIZADA > 992px)
   ========================================================================== */
@media (min-width: 993px) {
    .horizontal-navbar {
        display: block !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: #f5f2eb !important;
        border-bottom: 1px solid var(--border-color) !important;
        box-shadow: 0 2px 6px rgba(35, 30, 25, 0.03) !important;
        overflow: visible !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
        padding: 0 2rem !important;
        border-top: none !important;
    }

    .nav-h-menu {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-h-item {
        border-bottom: none !important;
        width: auto !important;
        position: relative !important;
    }

    .nav-h-link {
        padding: 12px 18px !important;
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
        min-height: auto !important;
        justify-content: flex-start !important;
        background: transparent !important;
        color: var(--text-main) !important;
    }

    .nav-h-link:hover {
        background: #ebe4d8 !important;
        color: var(--text-dark) !important;
        border-bottom-color: var(--primary-color) !important;
    }

    .nav-h-item.active > .nav-h-link {
        border-left-color: transparent !important;
        border-bottom-color: var(--primary-color) !important;
        background: #ffffff !important;
        color: var(--primary-color) !important;
    }

    .nav-arrow {
        transform: none !important;
    }

    .has-dropdown:hover .nav-arrow,
    .has-dropdown.open .nav-arrow {
        transform: rotate(180deg) !important;
        color: var(--primary-color) !important;
    }

    .dropdown-list {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        min-width: 250px !important;
        background: #ffffff !important;
        border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
        box-shadow: 0 16px 32px rgba(45, 38, 30, 0.08), 0 4px 10px rgba(45, 38, 30, 0.03) !important;
        border: 1px solid var(--border-color) !important;
        border-top: 3px solid var(--primary-color) !important;
        padding: 8px 0 !important;
        z-index: 2500 !important;
    }

    .has-dropdown:hover > .dropdown-list,
    .has-dropdown.open > .dropdown-list {
        display: block !important;
    }

    .dropdown-list li a {
        color: var(--text-main) !important;
        padding: 10px 20px !important;
        min-height: auto !important;
        background: transparent !important;
        border-left: 3px solid transparent !important;
    }

    .dropdown-list li a:hover {
        background-color: #fbf9f5 !important;
        color: var(--primary-color) !important;
        border-left-color: var(--primary-color) !important;
        padding-left: 24px !important;
    }

    .dropdown-list li a.active {
        background-color: var(--primary-light) !important;
        color: var(--primary-color) !important;
        border-left-color: var(--primary-color) !important;
    }

    .nav-mobile-toggle,
    .mobile-user-drawer-card,
    .mobile-nav-footer {
        display: none !important;
    }

    .nav-overlay {
        display: none !important;
    }
}

/* ==============================================================
   BOTÓN DESTACADO: PROCESO DE MATRÍCULA 2027 (TERRACOTA / CARMESÍ PROFESIONAL)
   ============================================================== */
.nav-btn-matricula-2027 {
    background-color: #9c4132 !important; /* Carmesí terracota refinado */
    color: #ffffff !important;           /* Letra blanca */
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    padding: 8px 16px !important;
    margin: 4px 6px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-bottom: none !important;
    box-shadow: 0 2px 6px rgba(156, 65, 50, 0.3) !important;
    transition: var(--transition) !important;
}

.nav-btn-matricula-2027:hover,
.nav-btn-matricula-2027:focus {
    background-color: #823427 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(130, 52, 39, 0.4) !important;
}

.nav-btn-matricula-2027 * {
    color: #ffffff !important;
}

.nav-h-item.active .nav-btn-matricula-2027 {
    background-color: #702b20 !important;
    color: #ffffff !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(255, 255, 255, 0.6) !important;
}

@media (max-width: 992px) {
    .nav-btn-matricula-2027 {
        margin: 8px 16px !important;
        justify-content: center !important;
        text-align: center !important;
    }
}


