/* ============================================================
   BINGLISH — PREMIUM DARK DASHBOARD (Glass & Neumorphism)
   ============================================================ */

/* ---------- Dashboard Layout ---------- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #000000, #06080f, #0b1220);
    position: relative;
    overflow-x: hidden;
}

/* ---------- Animated Background Layer ---------- */
.bg-animation {
    position: fixed;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 40%, rgba(0, 180, 255, 0.10), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(0, 140, 255, 0.12), transparent 50%);
    animation: floatMove 25s ease-in-out infinite;
}

.bg-animation::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(120deg,
            rgba(0, 200, 255, 0.03) 0px,
            rgba(0, 200, 255, 0.03) 2px,
            transparent 2px,
            transparent 40px);
    animation: waveMove 30s linear infinite;
}

@keyframes floatMove {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-3%, -4%);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-200px);
    }
}

/* Z-index layering for content above animation */
.sidebar,
.main-content {
    position: relative;
    z-index: 1;
}

/* ============================================================
   SIDEBAR — Neumorphic Design with Red Accent
   ============================================================ */

/* ---------- Sidebar CSS Variables ---------- */
.sidebar {
    --sb-bg: rgba(13, 27, 62, 0.55);
    --sb-surface: rgba(255, 255, 255, 0.04);
    --sb-surface-hover: rgba(255, 255, 255, 0.10);
    --sb-border: rgba(255, 255, 255, 0.18);
    --sb-border-hover: rgba(255, 255, 255, 0.10);
    --sb-red: #C8102E;
    --sb-red-soft: rgba(200, 16, 46, 0.12);
    --sb-red-glow: rgba(200, 16, 46, 0.25);
    --sb-gold: #FFD700;
    --sb-gold-bg: rgba(255, 215, 0, 0.12);
    --sb-gold-border: rgba(255, 215, 0, 0.30);
    --sb-text: rgba(255, 255, 255, 0.65);
    --sb-text-bright: #ffffff;
    --sb-text-dim: rgba(255, 255, 255, 0.45);
    --sb-shadow-dark: rgba(0, 0, 0, 0.55);
    --sb-shadow-light: rgba(255, 255, 255, 0.04);
    --sb-inset-dark: rgba(0, 0, 0, 0.50);
    --sb-inset-light: rgba(255, 255, 255, 0.03);
    --sb-radius: 12px;
    --sb-transition: all 0.25s ease;

    /* ── Font families ── */
    --sb-font-display: 'Playfair Display', Georgia, serif;
    --sb-font-body: 'DM Sans', 'Inter', sans-serif;
}

/* ---------- Sidebar Container ---------- */
.sidebar {
    width: 260px;
    background: var(--sb-bg);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    color: var(--sb-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    font-family: var(--sb-font-body);
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Scrollbar for sidebar nav (the inner scrollable container) */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    /* Soft Cyan Neon */
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
    /* Glow on scroll */
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

/* ---------- Collapsed State ---------- */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .brand-subtitle,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-role-badge,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout-btn .nav-text {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 1.5rem 0;
}

.sidebar.collapsed .sidebar-header img {
    margin: 0 !important;
}

.sidebar.collapsed .sidebar-user-card {
    padding: 0.8rem 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
}

.sidebar.collapsed .nav-item {
    margin: 0.35rem 0.6rem;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.7rem 0;
}

.sidebar.collapsed .nav-link .nav-emoji {
    font-size: 1.25rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.8rem 0.6rem;
}

.sidebar.collapsed .sidebar-logout-btn {
    justify-content: center;
    padding: 0.7rem 0;
}

/* ---------- Sidebar Header (Logo) — No changes ---------- */
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.5),
        inset 0 -1px 2px rgba(255, 255, 255, 0.02);
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Close button for responsive sidebar */
.sidebar .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.8rem;
    margin-right: -0.5rem;
}

.sidebar .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.sidebar-header .brand-title {
    background: var(--gradient-binglish);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 1.5px;
}

.sidebar-header .brand-subtitle {
    color: #ff4757 !important;
    font-weight: 700;
    font-size: 0.90rem;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(255, 71, 87, 0.6);
}

/* ---------- User Card (Glass + Neumorphism) ---------- */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0.85rem 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--sb-radius);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 4px 4px 10px var(--sb-shadow-dark),
        -3px -3px 8px var(--sb-shadow-light);
    flex-shrink: 0;
}

/* Avatar Circle with Initials */
.sidebar-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sb-red), #e8344e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sb-font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    letter-spacing: 1px;
    box-shadow: 0 3px 12px rgba(200, 16, 46, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.sidebar-user-name {
    font-family: var(--sb-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sb-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Role Badge — Neon Glow */
.sidebar-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-family: var(--sb-font-body);
    font-size: 0.60rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #00E5FF;
    /* Cyan Neon */
    background: rgba(0, 229, 255, 0.15);
    /* Soft cyan background */
    border: 1px solid rgba(0, 229, 255, 0.4);
    line-height: 1.5;
    width: fit-content;
    text-shadow: 0 0 10px #00E5FF;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

/* ---------- Grouped Navigation ---------- */
.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Section Labels (PRINCIPAL, ACADÉMICO, ADMINISTRACIÓN) */
.sidebar-section-label {
    display: block;
    font-family: var(--sb-font-body);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--sb-text-dim);
    padding: 1rem 1.6rem 0.4rem;
    margin: 0;
    user-select: none;
    line-height: 1;
}

.sidebar-nav .nav-item {
    margin: 0.25rem 1rem;
}

/* ---------- Nav Items: Neumorphism ---------- */
.sidebar-nav .nav-link {
    font-family: var(--sb-font-body);
    color: var(--sb-text);
    padding: 0.65rem 1rem;
    border-radius: var(--sb-radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--sb-transition);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Emoji Icon in Nav */
.nav-emoji {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

/* Badge de notificación en Mensajes */
.sidebar-nav .nav-link .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    background: var(--sb-red);
    border-radius: 50px;
    margin-left: auto;
}

.sidebar-nav .nav-link .badge.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 12px var(--sb-red-glow);
    }
}

/* ---------- Global Scrollbar Effect ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
}

/* ---------- Layout Structure ---------- */
/* ---------- Hover State ---------- */
.sidebar-nav .nav-link:hover {
    color: var(--sb-text-bright);
    background: var(--sb-surface-hover);
    border-color: var(--sb-border-hover);
    box-shadow: 3px 3px 8px var(--sb-shadow-dark),
        -2px -2px 6px var(--sb-shadow-light);
    transform: none;
}

/* ---------- Active State: Red Left Border + Red Tint ---------- */
.sidebar-nav .nav-link.active {
    color: var(--sb-text-bright);
    background: linear-gradient(90deg,
            rgba(200, 16, 46, 0.15) 0%,
            rgba(200, 16, 46, 0.06) 60%,
            transparent 100%);
    border: 1px solid rgba(200, 16, 46, 0.15);
    border-left: 3px solid var(--sb-red);
    box-shadow: 3px 3px 8px var(--sb-shadow-dark),
        -2px -2px 6px var(--sb-shadow-light),
        inset 0 0 15px rgba(200, 16, 46, 0.06);
    transform: none;
}

.sidebar-nav .nav-link.active .nav-emoji {
    filter: drop-shadow(0 0 4px var(--sb-red-glow));
}

/* ---------- Click / Pressed State: Neumorphic Inset ---------- */
.sidebar-nav .nav-link:active {
    box-shadow: inset 3px 3px 7px var(--sb-inset-dark),
        inset -2px -2px 5px var(--sb-inset-light);
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

/* ---------- Sidebar Footer (Logout) ---------- */
.sidebar-footer {
    padding: 0.8rem 1rem 1.2rem;
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: var(--sb-radius);
    background: transparent;
    border: 1px solid transparent;
    color: var(--sb-text);
    font-family: var(--sb-font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--sb-transition);
    box-shadow: none;
}


.sidebar-logout-btn:hover {
    color: var(--sb-red);
    background: rgba(200, 16, 46, 0.06);
    border-color: rgba(200, 16, 46, 0.15);
    box-shadow: 2px 2px 6px var(--sb-shadow-dark),
        -1px -1px 4px var(--sb-shadow-light);
}

.sidebar-logout-btn:active {
    box-shadow: inset 3px 3px 7px var(--sb-inset-dark),
        inset -2px -2px 5px var(--sb-inset-light);
    transform: scale(0.97);
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
    background: transparent;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 80px;
}

/* Ensure horizontal scroll works in flex containers */
.content-area {
    min-width: 0;
    width: 100%;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    .table-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* ── Sidebar Móvil: drawer deslizable ── */
    .sidebar {
        /* Oculto fuera de pantalla por defecto */
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        /* Siempre ocupa el alto completo de la pantalla */
        height: 100dvh;
        /* dvh evita el problema con la barra de URL del móvil */
        height: 100vh;
        /* fallback */
        /* Controlamos el scroll SOLO en la nav, no en toda la sidebar */
        overflow: hidden;
        /* Aseguramos que el footer siempre sea accesible */
        display: flex;
        flex-direction: column;
    }

    /* Sidebar visible cuando tiene clase .show */
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
    }

    /* La navegación ocupa el espacio sobrante y hace scroll internamente */
    .sidebar .sidebar-nav {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        /* Necesario para que flex+overflow funcionen */
    }

    /* El footer/logout SIEMPRE pegado al fondo, nunca se corta */
    .sidebar .sidebar-footer {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: rgba(13, 27, 62, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 0.8rem 1rem 1.2rem;
        z-index: 2;
    }

    /* Overlay oscuro detrás del sidebar cuando está abierto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 1049;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    border-radius: 10px;
}

/* ---------- Top Bar ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.topbar-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

/* ---------- Neumorphic Global Button ---------- */
/* ---------- Neumorphic Global Button (Refined Glass) ---------- */
.neu-btn {
    border: none;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.neu-btn-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hover */
.neu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    color: var(--accent);
    border-color: rgba(0, 229, 255, 0.3);
}

.neu-btn:hover i {
    color: var(--accent);
    filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.5));
}

/* Click */
.neu-btn:active {
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.5);
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.02);
}

/* Ícono */
.neu-btn i {
    font-size: 18px;
    color: var(--text-primary);
}


/* ---------- Dashboard Glass Cards ---------- */
.dash-stat-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.dash-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.dash-stat-card.purple::before {
    background: var(--accent-purple);
    box-shadow: 0 0 15px var(--accent-purple);
}

.dash-stat-card.green::before {
    background: var(--accent-green);
    box-shadow: 0 0 15px var(--accent-green);
}

.dash-stat-card.pink::before {
    background: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-pink);
}

.dash-stat-card.blue::before {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.dash-stat-card.yellow::before {
    background: #FFD500;
    box-shadow: 0 0 15px #FFD500;
}

.dash-stat-card.orange::before {
    background: #FF8C00;
    box-shadow: 0 0 15px #FF8C00;
}

.dash-stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(0, 229, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.dash-stat-icon.purple {
    background: rgba(123, 47, 247, 0.15);
    color: var(--accent-purple);
}

.dash-stat-icon.green {
    background: rgba(0, 107, 86, 0.15);
    color: var(--accent-green);
}

.dash-stat-icon.pink {
    background: rgba(255, 101, 132, 0.15);
    color: var(--accent-pink);
}

.dash-stat-icon.blue {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent);
}

.dash-stat-icon.yellow {
    background: rgba(255, 213, 0, 0.15);
    color: #FFD500;
}

.dash-stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---------- Glass Tabs (Nav Tabs) ---------- */
.nav-tabs-glass {
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.nav-tabs-glass .nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs-glass .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-tabs-glass .nav-link.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.15), inset 0 2px 5px rgba(0, 229, 255, 0.05);
}

/* Custom Neumorphism Nav Tabs Option */
.nav-tabs-glass.neu-tabs {
    border: none;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem;
    border-radius: 50px;
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.3), inset -4px -4px 8px rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: center;
    gap: 0;
    width: fit-content;
}

.nav-tabs-glass.neu-tabs .nav-link {
    border-radius: 50px;
    padding: 0.6rem 2rem;
    height: 100%;
}

.nav-tabs-glass.neu-tabs .nav-link.active {
    background: #0d121c;
    border: none;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5), -4px -4px 8px rgba(255, 255, 255, 0.03);
    color: #fff;
}

/* ---------- Tables ---------- */
.table-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.table-card .table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table-card .table thead th {
    background: rgba(13, 18, 28, 0.95);
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 1rem 1rem;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.table-card .table tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.015);
}

.table-card .table tbody tr {
    transition: all 0.2s ease;
}

.table-card .table tbody tr:hover td {
    background: rgba(0, 229, 255, 0.08);
    /* Glow cyan soft */
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.05);
}

.table-card .table tbody td {
    padding: 1rem 1rem;
    vertical-align: middle;
    border-color: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-secondary);
}

.badge-role {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.badge-role.admin {
    background: rgba(0, 229, 255, 0.2);
    color: #e0faff;
    border-color: rgba(0, 229, 255, 0.5);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.badge-role.docente {
    background: rgba(0, 212, 170, 0.2);
    color: #a3f7e5;
    border-color: rgba(0, 212, 170, 0.5);
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.6);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.2);
}

.badge-role.estudiante {
    background: rgba(255, 215, 0, 0.2);
    color: #fffbdf;
    border-color: rgba(255, 215, 0, 0.5);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}



/* ---------- Dashboard Modal ---------- */
.modal-dashboard .modal-content {
    background: rgba(22, 28, 36, 0.95);
    backdrop-filter: blur(25px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.modal-dashboard .modal-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.2rem 1.5rem;
}

.modal-dashboard .modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
}

/* Fields in Modal Dashboard */
.modal-dashboard .form-control,
.modal-dashboard .form-select {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.modal-dashboard .form-control:focus,
.modal-dashboard .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.25) !important;
}

.modal-dashboard .form-label {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 0.875rem;
}

.modal-dashboard .form-text {
    color: rgba(255, 255, 255, 0.45) !important;
}

.modal-dashboard .form-check-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

.modal-dashboard .form-select option {
    background: #1a2030;
    color: #fff;
}

.modal-dashboard .invalid-feedback {
    color: #ff6b6b !important;
}

.modal-dashboard .modal-body {
    padding: 1.5rem;
}

.modal-dashboard .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Report Card Specific Styles */
.assessment-table {
    border-collapse: separate;
    border-spacing: 0 4px;
}

.assessment-table thead th {
    background: rgba(0, 180, 255, 0.1) !important;
    color: #fff;
    font-size: 0.75rem;
    padding: 12px 8px !important;
}

.score-input {
    transition: all 0.3s ease;
}

.score-input:focus {
    background: rgba(0, 229, 255, 0.15) !important;
    transform: scale(1.05);
}

/* Modal Tabs styling */
.nota-modal-tabs .nav-link {
    color: rgba(255, 255, 255, 0.6);
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.8rem 1.2rem;
    transition: all 0.3s ease;
}

.nota-modal-tabs .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nota-modal-tabs .nav-link.active {
    background: transparent !important;
    color: var(--accent) !important;
    border-bottom: 2px solid var(--accent);
}

@media (max-width: 768px) {
    .assessment-table {
        font-size: 0.8rem;
    }

    .assessment-table th,
    .assessment-table td {
        padding: 8px 4px !important;
    }

    .score-input {
        max-width: 65px !important;
        font-size: 0.8rem !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
    }

    .neu-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .neu-btn i {
        font-size: 16px;
    }
}

/* Forzar que los grupos de entrada no se rompan en la tabla de evaluación */
.assessment-table .input-group {
    flex-wrap: nowrap !important;
}

.assessment-table .input-group-text {
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 0.65rem !important;
    min-width: 32px;
    justify-content: center;
}

/* Hybrid Modal Sections (Tabs on Mobile, Stacked on Desktop) */
@media (min-width: 992px) {
    .custom-section-pane {
        display: block !important;
        opacity: 1 !important;
        margin-bottom: 2rem;
    }

    .custom-section-pane:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 991.98px) {
    .custom-section-pane {
        display: none;
    }

    .custom-section-pane.active {
        display: block !important;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Asignaciones Tab Styles */
.glass-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 12px;
}

.glass-select option {
    background: #1a2030;
    color: #fff;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
}

.btn-remove-student {
    color: rgba(255, 71, 87, 0.6);
    transition: all 0.3s ease;
}

.btn-remove-student:hover {
    color: #ff4757;
    transform: scale(1.1);
}

.avatar-mini {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}


.modal-footer {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- SweetAlert2 Dark Mode Overrides ---------- */
div:where(.swal2-container) div:where(.swal2-popup) {
    background: rgba(22, 28, 36, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    color: #ffffff !important;
    font-family: var(--font-heading) !important;
}

div:where(.swal2-container) div:where(.swal2-html-container) {
    color: rgba(255, 255, 255, 0.7) !important;
}

div:where(.swal2-container) button:where(.swal2-confirm),
div:where(.swal2-container) button:where(.swal2-cancel) {
    border-radius: 8px !important;
}

/* ---------- Content Area ---------- */
.content-area {
    padding: 2.5rem;
}

/* ---------- Spinner overlay ---------- */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---------- Notification Dropdown (Topbar Bell) ---------- */
.notif-dropdown-panel {
    border-radius: var(--radius-md) !important;
    background: rgba(22, 28, 36, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

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

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

.notif-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notif-header h6 {
    color: #ffffff;
    font-size: 0.95rem;
}

.notif-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.notif-list::-webkit-scrollbar {
    width: 6px;
}

.notif-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.notif-item {
    transition: background 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-icon-wrapper {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.notif-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.notif-footer a {
    color: var(--accent) !important;
    font-weight: 600;
}

.notif-footer a:hover {
    background: rgba(0, 229, 255, 0.05);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .sidebar {
        margin-left: -260px;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dash-stat-value {
        font-size: 1.5rem;
    }

    .table-card {
        padding: 1rem 0;
    }

    .table-card .table tbody td,
    .table-card .table thead th {
        padding: 0.75rem 0.6rem;
    }
}

/* ============================================================
   TYPOGRAPHY & CONTRAST FIXES (Dark Mode High Contrast)
   ============================================================ */

/* Boostrap Global Overrides for Dark UX */
.text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-dark {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

p.text-muted {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8) !important;
}

.main-content p {
    color: #ffffff !important;
    font-weight: 300;
}

.main-content span,
.main-content div {
    color: inherit;
}

/* Form Controls (Inputs, Selects) in Dark Mode */
.main-content .form-control,
.main-content .form-select,
.main-content .input-group-text {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) !important;
}

.main-content .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.main-content .form-control:focus,
.main-content .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    outline: none !important;
    /* Evita el salto visual del outline de sistema */
}

/* Efecto hover suave para el icono sin mover el input */
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Glass Search Overrides */
.glass-search {
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.glass-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.3);
    background: rgba(0, 229, 255, 0.05);
}

.glass-search .input-group-text,
.glass-search .form-control,
.glass-search .form-select {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.glass-search .form-control:focus,
.glass-search .form-select:focus {
    background: transparent !important;
}

.glass-search i {
    color: var(--text-muted) !important;
    transition: color 0.3s;
}

.glass-search:focus-within i {
    color: var(--accent) !important;
}

/* Glass Select — misma estética que glass-search */
.glass-select {
    border-radius: var(--radius-pill) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #fff !important;
    padding: 0.45rem 2rem 0.45rem 1rem;
    font-size: 0.875rem;
}

.glass-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2), inset 0 2px 5px rgba(0, 0, 0, 0.3) !important;
    background: rgba(0, 229, 255, 0.05) !important;
    color: #fff !important;
}

.glass-select option {
    background: #1a2030;
    color: #fff;
}

/* Override fixed Bootstrap backgrounds that clash */
.bg-white,
.bg-light {
    background-color: transparent !important;
}


/* Headings in White Neon */
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4,
.main-content h5,
.main-content h6,
.modal-title {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

/* Subheadings and specific labels in Cyan Neon */
.dash-stat-card .text-muted.small,
.card .text-muted.small {
    color: var(--accent) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.dash-stat-value {
    color: #ffffff !important;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Tables Improvements */
.table-card .table thead th {
    color: var(--accent) !important;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.table-card strong {
    color: #ffffff;
    font-weight: 600;
}

/* ============================================================
   MODALS — Dark Glassmorphism
   ============================================================ */
.modal-content {
    background: rgba(10, 15, 30, 0.92) !important;
    backdrop-filter: blur(25px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(150%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
}

.modal-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.2rem 1.5rem !important;
}

.modal-title {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.modal-body {
    color: rgba(255, 255, 255, 0.85) !important;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Modal Close Button — White */
.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

/* Modal Form Controls */
.modal .form-control,
.modal .form-select {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.modal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
}

.modal .form-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ============================================================
   SWEETALERT2 — Dark Glassmorphism Overrides
   ============================================================ */
div:where(.swal2-container) div:where(.swal2-popup) {
    background: rgba(10, 15, 30, 0.95) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    color: #ffffff !important;
}

div:where(.swal2-container) div:where(.swal2-html-container) {
    color: rgba(255, 255, 255, 0.75) !important;
}

div:where(.swal2-container) input:where(.swal2-input) {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
}

div:where(.swal2-container) input:where(.swal2-input):focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.25) !important;
}

div:where(.swal2-container) button:where(.swal2-confirm) {
    border-radius: 10px !important;
}

div:where(.swal2-container) button:where(.swal2-cancel) {
    border-radius: 10px !important;
}