/* ============================================================
   EDUGEST·PORTAL - SISTEMA DE GESTIÓN EDUCATIVA INTEGRAL
   Diseño Moderno, Premium, Glassmorphism y 100% Responsivo
   ============================================================ */

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

:root {
    /* Paleta Primaria - Azul Zafiro & Marino Institucional */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Acentos y Roles */
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --purple-500: #a855f7;
    --purple-600: #9333ea;

    /* Neutros Sofisticados (Slate) */
    --neutral-25: #fcfdfe;
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Semántica */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #0ea5e9;

    /* Dimensiones y Layout */
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 78px;
    --header-height: 72px;
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Sombras Premium */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.05), 0 1px 2px 0 rgba(15, 23, 42, 0.03);
    --shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 22px 44px -8px rgba(15, 23, 42, 0.12), 0 8px 18px -4px rgba(15, 23, 42, 0.06);
    --shadow-glow-primary: 0 8px 24px rgba(99, 102, 241, 0.25);
    --shadow-glow-success: 0 8px 24px rgba(16, 185, 129, 0.25);

    /* Transiciones */
    --transition-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f6f8fc;
    color: var(--neutral-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    color: var(--neutral-900);
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

/* Preloader */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader-spinner {
    width: 46px;
    height: 46px;
    border: 3.5px solid var(--neutral-100);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ESTRUCTURA GENERAL DEL DASHBOARD
   ============================================================ */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: #f6f8fc;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f6f8fc;
}

.page-content {
    flex: 1;
    padding: 1.75rem 2rem 2.5rem 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   SIDEBAR MODERNO (Desktop & Mobile Drawer)
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    background: #ffffff;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--neutral-100);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.15));
}

.sidebar-brand h5 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-600), #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-toggle {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    color: var(--neutral-600);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-200);
}

/* Sidebar User Profile */
.sidebar-user {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(to bottom, #ffffff, var(--neutral-50));
    border-bottom: 1px solid var(--neutral-100);
}

.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.avatar-bg-1 { background: linear-gradient(135deg, #4f46e5, #6366f1); }
.avatar-bg-2 { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.avatar-bg-3 { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.avatar-bg-4 { background: linear-gradient(135deg, #e11d48, #fb7185); }
.avatar-bg-5 { background: linear-gradient(135deg, #059669, #10b981); }
.avatar-bg-6 { background: linear-gradient(135deg, #d97706, #f59e0b); }

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-info h6 {
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info small {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--neutral-500);
    font-weight: 600;
    margin-top: 1px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-200) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--neutral-200);
    border-radius: var(--radius-full);
}

.nav-section-title,
.sidebar .nav-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neutral-400);
    padding: 0.85rem 0.75rem 0.35rem 0.75rem;
    display: block;
}

.nav-item,
.sidebar .nav-item {
    margin-bottom: 3px;
    list-style: none;
}

.sidebar .nav-link,
.sidebar-nav .nav-link,
.nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    padding: 0.65rem 0.85rem !important;
    color: var(--neutral-600) !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition-fast) !important;
    position: relative !important;
    text-decoration: none !important;
    background: transparent;
}

.sidebar .nav-link i,
.sidebar-nav .nav-link i,
.nav-link i {
    font-size: 1.15rem !important;
    min-width: 1.25rem !important;
    color: var(--neutral-400) !important;
    transition: var(--transition-fast) !important;
}

.sidebar .nav-link:hover,
.sidebar-nav .nav-link:hover,
.nav-link:hover {
    background: var(--neutral-100) !important;
    color: var(--neutral-900) !important;
}

.sidebar .nav-link:hover i,
.sidebar-nav .nav-link:hover i,
.nav-link:hover i {
    color: var(--primary-600) !important;
}

.sidebar .nav-link.active,
.sidebar-nav .nav-link.active,
.nav-link.active {
    background: var(--primary-50) !important;
    color: var(--primary-700) !important;
    font-weight: 600 !important;
}

.sidebar .nav-link.active i,
.sidebar-nav .nav-link.active i,
.nav-link.active i {
    color: var(--primary-600) !important;
}

.sidebar .nav-link.active::before,
.sidebar-nav .nav-link.active::before,
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3.5px;
    background: var(--primary-600);
    border-radius: 0 4px 4px 0;
}

/* Sidebar Collapsed State (Desktop) */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand h5,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span {
    display: none;
}

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

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

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

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Overlay para Mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1030;
    opacity: 0;
    animation: fadeIn 0.25s forwards ease;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================================
   CABECERA FLOTANTE (Sticky Glass Header v2.0)
   ============================================================ */
.page-header {
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.page-header-title {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--neutral-900);
    letter-spacing: -0.02em;
}

.breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    color: var(--neutral-500);
    margin-top: 1px;
}

.breadcrumb-custom a {
    color: var(--neutral-500);
    display: inline-flex;
    align-items: center;
}

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

.breadcrumb-custom .separator {
    color: var(--neutral-300);
}

/* Centro: Status Pill */
.header-status-pill {
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.status-live-dot {
    width: 7px;
    height: 7px;
    background: var(--emerald-500);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
    animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Header Action Shortcut */
.header-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md, 14px);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--neutral-700);
    transition: var(--transition-fast);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.header-quick-action:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 14px);
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    color: var(--neutral-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-200);
    transform: translateY(-1px);
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--rose-500);
    border-radius: 50%;
    box-shadow: 0 0 0 2px #ffffff;
}

/* User Trigger Button */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    padding: 4px 10px 4px 5px;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.header-user-btn:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.header-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 2px;
}

.header-user-role {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    color: #ffffff;
    display: inline-block;
}

/* Avatares y Roles con Degradados Vivos */
.avatar-gradient {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.avatar-gradient-lg {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.badge-role-admin {
    background: linear-gradient(135deg, #4338ca, #6366f1) !important;
    color: #ffffff !important;
}

.badge-role-auxiliar {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: #ffffff !important;
}

.badge-role-docente {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #ffffff !important;
}

.badge-role-psicologia {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    color: #ffffff !important;
}

/* Dropdown Menús de Cabecera */
.profile-dropdown-menu,
.notif-dropdown-menu {
    border-radius: 18px !important;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.06) !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    min-width: 250px;
    animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
    0% { opacity: 0; transform: translateY(-8px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-card-header {
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--neutral-100);
}

.notif-header {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--neutral-200);
}

.notif-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.notif-item:hover {
    background: var(--neutral-50);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notif-title {
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--neutral-800);
    margin-bottom: 1px;
}

.notif-text {
    font-size: 0.72rem;
    color: var(--neutral-500);
    line-height: 1.35;
}

.notif-time {
    font-size: 0.65rem;
    color: var(--neutral-400);
    margin-top: 2px;
}

.notif-footer {
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--neutral-100);
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    border-radius: 50%;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
}

/* ============================================================
   TARJETAS Y COMPONENTES VISUALES MODERNOS
   ============================================================ */

/* Welcome Banner */
.welcome-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    color: #ffffff;
    margin-bottom: 1.75rem;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.welcome-section::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-section h3 {
    color: #ffffff;
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
}

.welcome-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

/* Stat Cards Elevadas */
.stat-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}

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

.stat-card-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-500);
    margin-top: 2px;
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.primary { background: var(--primary-50); color: var(--primary-600); }
.stat-card-icon.success { background: #ecfdf5; color: var(--emerald-600); }
.stat-card-icon.warning { background: #fffbeb; color: var(--amber-600); }
.stat-card-icon.danger { background: #fff1f2; color: var(--rose-600); }
.stat-card-icon.info { background: #f0f9ff; color: var(--sky-600); }

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
}

.stat-card-change.up { background: #ecfdf5; color: var(--emerald-600); }
.stat-card-change.down { background: #fff1f2; color: var(--rose-600); }

/* Card Modern Container */
.card-modern {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    transition: var(--transition-normal);
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-md);
}

.card-modern-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-modern-header h5 {
    font-size: 1.05rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.card-modern-body {
    padding: 1.5rem;
}

/* ============================================================
   TABLAS MODERNAS & RESPONSIVAS
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.table-modern {
    width: 100%;
    margin-bottom: 0;
    color: var(--neutral-700);
    vertical-align: middle;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background-color: var(--neutral-50);
    color: var(--neutral-600);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--neutral-200);
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 0.88rem;
    background-color: #ffffff;
    transition: var(--transition-fast);
}

.table-modern tbody tr:hover td {
    background-color: var(--primary-50) !important;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   BOTONES MODERNOS
   ============================================================ */
.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: var(--transition-normal);
    cursor: pointer;
}

.btn-modern:hover {
    transform: translateY(-2px);
}

.btn-modern-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-modern-primary:hover {
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.btn-modern-success {
    background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-modern-outline {
    background: #ffffff;
    border-color: var(--neutral-200);
    color: var(--neutral-700);
}

.btn-modern-outline:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
    color: var(--neutral-900);
}

/* ============================================================
   ESTILOS GLOBALES DE BOTONES ESTÁNDAR Y ALTO CONTRASTE (EduGest)
   Garantiza contraste óptimo y que el texto nunca sea del mismo color que el fondo
   ============================================================ */
.btn {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none !important;
}

/* Botón Primario: Fondo Azul Real con Texto e Íconos Blanco Puro */
.btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}
.btn-primary i, .btn-primary svg, .btn-primary span {
    color: #ffffff !important;
}

/* Botón Warning: Fondo Amarillo/Ámbar con Texto e Íconos Oscuro Profundo (Legibilidad Total) */
.btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}
.btn-warning i, .btn-warning svg, .btn-warning span {
    color: #0f172a !important;
}

/* Botón Success: Fondo Verde Esmeralda con Texto Blanco */
.btn-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}
.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}
.btn-success i, .btn-success svg, .btn-success span {
    color: #ffffff !important;
}

/* Botón Danger: Fondo Rojo con Texto Blanco */
.btn-danger {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}
.btn-danger i, .btn-danger svg, .btn-danger span {
    color: #ffffff !important;
}

/* Botón Light: Fondo Blanco Sólido con Borde y Texto Oscuro */
.btn-light {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.btn-light:hover, .btn-light:focus, .btn-light:active {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
.btn-light i, .btn-light svg {
    color: inherit;
}

/* Botón Dark: Fondo Oscuro con Texto Blanco */
.btn-dark {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}
.btn-dark:hover, .btn-dark:focus, .btn-dark:active {
    background-color: #1e293b !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
}
.btn-dark i, .btn-dark svg, .btn-dark span {
    color: #ffffff !important;
}

/* Botón Secondary: Fondo Gris Pizarra con Texto Blanco */
.btn-secondary {
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
    background-color: #475569 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
}
.btn-secondary i, .btn-secondary svg, .btn-secondary span {
    color: #ffffff !important;
}

/* Botones Outline: Borde definido y contraste total al pasar el cursor */
.btn-outline-primary {
    border: 1.5px solid #2563eb !important;
    background-color: transparent !important;
    color: #2563eb !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}
.btn-outline-primary:hover i, .btn-outline-primary:hover span {
    color: #ffffff !important;
}

.btn-outline-secondary {
    border: 1.5px solid #cbd5e1 !important;
    background-color: transparent !important;
    color: #475569 !important;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.btn-outline-danger {
    border: 1.5px solid #ef4444 !important;
    background-color: transparent !important;
    color: #dc2626 !important;
}
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}
.btn-outline-danger:hover i {
    color: #ffffff !important;
}

.btn-outline-warning {
    border: 1.5px solid #f59e0b !important;
    background-color: transparent !important;
    color: #b45309 !important;
}
.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}
.btn-outline-warning:hover i {
    color: #0f172a !important;
}

.btn-outline-success {
    border: 1.5px solid #10b981 !important;
    background-color: transparent !important;
    color: #059669 !important;
}
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}
.btn-outline-success:hover i {
    color: #ffffff !important;
}

.btn-outline-light {
    border: 1.5px solid rgba(255, 255, 255, 0.75) !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}
.btn-outline-light:hover, .btn-outline-light:focus, .btn-outline-light:active {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
    color: #0f172a !important;
}
.btn-outline-light:hover i, .btn-outline-light:hover span {
    color: #0f172a !important;
}


/* Form Controls */
.form-control, .form-select {
    padding: 0.65rem 0.95rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--neutral-200);
    color: var(--neutral-800);
    background-color: #ffffff;
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.15);
    outline: none;
}

/* ============================================================
   PÁGINA DE LOGIN ELEVADA (Glassmorphism & Mesh Background)
   ============================================================ */
.login-page {
    background: #0f172a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.login-bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
}

.shape-1 {
    width: 450px;
    height: 450px;
    background: #4f46e5;
    top: -10%;
    left: -5%;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -10%;
    right: -5%;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 40%;
    left: 45%;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
}

.login-branding {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    padding: 3.5rem 2.5rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.brand-logo {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.brand-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.brand-subtitle {
    color: var(--primary-200);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.feature-item i {
    color: #38bdf8;
    font-size: 1.15rem;
}

.login-form-side {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--neutral-900);
    margin-bottom: 0.35rem;
}

.login-header p {
    color: var(--neutral-500);
    font-size: 0.92rem;
    margin-bottom: 2rem;
}

/* Input Groups con Íconos y Botón Ver Contraseña */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-400);
    font-size: 1.15rem;
    pointer-events: none;
    transition: var(--transition-fast);
}

.input-icon-wrapper .form-control {
    padding-left: 2.85rem;
    padding-right: 2.85rem;
    height: 48px;
    font-size: 0.95rem;
}

.input-icon-wrapper .form-control:focus + .input-icon {
    color: var(--primary-600);
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.25rem;
    transition: var(--transition-fast);
}

.password-toggle-btn:hover {
    color: var(--neutral-700);
}

.btn-login {
    height: 48px;
    background: linear-gradient(135deg, var(--primary-600), #7c3aed);
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-glow-primary);
    transition: var(--transition-normal);
}

.btn-login:hover {
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

/* Toast Notifications Flotantes en Esquina Superior Derecha */
.toast-container-top-right {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 440px;
    width: calc(100% - 3rem);
    pointer-events: none;
}

.alert-toast-floating {
    pointer-events: auto;
    background: #ffffff;
    border-radius: var(--radius-md, 14px);
    box-shadow: 0 14px 35px -4px rgba(15, 23, 42, 0.18), 0 4px 14px -2px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-left: 5px solid var(--primary-600);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    animation: slideInFromRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: all 0.3s ease;
    position: relative;
}

@keyframes slideInFromRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-toast-floating.alert-success { border-left-color: var(--emerald-500); }
.alert-toast-floating.alert-danger, 
.alert-toast-floating.alert-error { border-left-color: var(--rose-500); }
.alert-toast-floating.alert-warning { border-left-color: var(--amber-500); }
.alert-toast-floating.alert-info { border-left-color: var(--sky-500); }

.alert-toast-floating .toast-icon {
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 1px;
}

.alert-toast-floating .toast-body {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--neutral-800);
    line-height: 1.45;
}

.alert-toast-floating .toast-close {
    background: transparent;
    border: none;
    color: var(--neutral-400);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    margin-top: -3px;
    margin-right: -4px;
    transition: color 0.18s ease;
}

.alert-toast-floating .toast-close:hover {
    color: var(--neutral-800);
}

.alert-toast-floating.alert-push-urgente {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    box-shadow: 0 16px 40px -4px rgba(239, 68, 68, 0.22), 0 4px 14px -2px rgba(239, 68, 68, 0.12);
}
.alert-toast-floating.alert-push-importante {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    box-shadow: 0 16px 40px -4px rgba(245, 158, 11, 0.2), 0 4px 14px -2px rgba(245, 158, 11, 0.1);
}
.alert-toast-floating.alert-push-informativa {
    border-left-color: #3b82f6;
    background: #ffffff;
}

@keyframes pulseDotGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.notif-dot.pulse-dot {
    display: block !important;
    animation: pulseDotGlow 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.notif-item.read {
    opacity: 0.75;
    background-color: #ffffff;
}
.notif-item.unread {
    background-color: #f8fafc;
    border-left: 3px solid var(--primary-600);
}
.notif-item:hover {
    background-color: #f1f5f9 !important;
}

/* Toast Notifications Antiguos (Compatibilidad) */
.toast-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.35rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border-left: 4.5px solid var(--primary-600);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 100000;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideInFromRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================================
   RESPONSIVIDAD AVANZADA (Mobile, Tablet, Desktop)
   ============================================================ */

/* Pantallas Medianas (Tablets <= 992px) */
@media (max-width: 992px) {
    .main-content {
        margin-left: 0 !important;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .page-header {
        padding: 0 1.25rem;
    }

    .page-content {
        padding: 1.25rem 1.25rem 2rem 1.25rem;
    }

    .login-branding {
        display: none !important;
    }

    .login-card {
        max-width: 480px;
        margin: 0 auto;
        border-radius: var(--radius-xl, 22px);
        box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    }

    .login-form-side {
        width: 100% !important;
        padding: 2.75rem 2rem;
    }
}

/* Pantallas Pequeñas (Móviles <= 576px) */
@media (max-width: 576px) {
    .page-header {
        padding: 0 0.85rem;
    }

    .page-header-left h4 {
        font-size: 1.05rem;
    }

    .page-content {
        padding: 0.85rem 0.75rem 2rem 0.75rem;
    }

    .welcome-section {
        padding: 1.15rem 1rem;
        border-radius: var(--radius-md, 14px);
    }

    .welcome-section h3 {
        font-size: 1.2rem;
    }

    .stat-card {
        padding: 1rem;
        border-radius: var(--radius-md, 14px);
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .card-modern-header {
        padding: 0.85rem 1rem;
    }

    .card-modern-body {
        padding: 1rem;
    }

    .login-wrapper {
        padding: 1rem 0.5rem;
    }

    .login-card {
        max-width: 100%;
        border-radius: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }

    .login-form-side {
        padding: 1.75rem 1.15rem;
    }

    .login-header h2 {
        font-size: 1.45rem;
    }

    .login-header p {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .input-icon-wrapper .form-control {
        font-size: 16px; /* Evita zoom automático en iOS Safari */
        height: 48px;
    }

    .mobile-login-brand img {
        width: 44px;
        height: 44px;
    }

    .mobile-login-brand h4 {
        font-size: 1.2rem;
    }

    /* Botones y formularios táctiles en móvil */
    .btn {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .table-responsive {
        border-radius: var(--radius-md, 14px);
        -webkit-overflow-scrolling: touch;
    }

    /* Contenedor horizontal deslizable para filtros en móvil */
    .mobile-scroll-x {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mobile-scroll-x::-webkit-scrollbar {
        display: none;
    }
}

/* ============================================================
   UTILIDADES DE OPACIDAD Y BADGES DE ALTO CONTRASTE
   ============================================================ */
.bg-opacity-10 { --bs-bg-opacity: 0.10 !important; }
.bg-opacity-15 { --bs-bg-opacity: 0.15 !important; }
.bg-opacity-20 { --bs-bg-opacity: 0.20 !important; }
.bg-opacity-25 { --bs-bg-opacity: 0.25 !important; }
.bg-opacity-50 { --bs-bg-opacity: 0.50 !important; }
.bg-opacity-75 { --bs-bg-opacity: 0.75 !important; }

/* Badges modernos con alto contraste para Categoría, Urgencia y Notificación */
.obs-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.32rem 0.65rem;
    border-radius: 8px;
    line-height: 1.25;
    text-decoration: none;
    letter-spacing: 0.01em;
    border-width: 1px;
    border-style: solid;
    white-space: normal;
    word-break: break-word;
    text-align: left;
}
.obs-badge i {
    font-size: 0.85rem;
    flex-shrink: 0;
}
.obs-badge-success {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    border-color: #a7f3d0 !important;
}
.obs-badge-danger {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}
.obs-badge-warning {
    background-color: #fffbeb !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}
.obs-badge-info {
    background-color: #f0f9ff !important;
    color: #075985 !important;
    border-color: #bae6fd !important;
}
.obs-badge-secondary {
    background-color: #f8fafc !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}
.obs-badge-primary {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-color: #bfdbfe !important;
}