/* ==========================================================================
   ACADEMIAQR - DESIGN SYSTEM & SUITE THEME
   Ecosistema SOSQR Guatemala
   ========================================================================== */

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

:root {
    /* Typography */
    --font-brand: 'Quicksand', sans-serif;

    /* Brand & Accent Colors */
    --primary: #005a9c;
    --primary-dark: #003f6d;
    --primary-light: #e0f2fe;
    --primary-hover: #0284c7;
    
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #dcfce7;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --danger-light: #fee2e2;

    /* Neutrals */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: rgba(0, 90, 156, 0.25);

    /* Elevation & Radii */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar - Desplazamiento vertical independiente en Web y Móvil */
.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    z-index: 100;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
    transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.65);
}

.sidebar .brand-header,
.sidebar .nav-group,
.sidebar .nav-item,
.sidebar .sidebar-power-section {
    flex-shrink: 0 !important;
}

.sidebar,
.sidebar * {
    touch-action: pan-y !important;
}

/* Estado Colapsado en Escritorio */
@media (min-width: 1025px) {
    .app-container.sidebar-collapsed .sidebar,
    .sidebar.collapsed {
        margin-left: -270px !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Solo mostrar el botón de expandir cuando el menú está colapsado */
    .app-container.sidebar-collapsed .sidebar-expand-btn,
    .sidebar.collapsed ~ .main-content .sidebar-expand-btn,
    .app-container.sidebar-collapsed #sidebarExpandBtn {
        display: inline-flex !important;
        animation: expandBtnReveal 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
}

@keyframes expandBtnReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) translateX(-6px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.brand-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(88, 138, 211, 0.28));
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo-img:hover {
    transform: scale(1.08) rotate(3deg);
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 90, 156, 0.25);
    flex-shrink: 0;
}

.brand-title {
    font-family: var(--font-brand), sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Botón de Colapsar Menú en Sidebar */
.sidebar-collapse-btn {
    margin-left: auto;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
    border-color: #cbd5e1;
    transform: scale(1.05);
}

/* Botón de Expansión / Toggle en Topbar */
.sidebar-expand-btn {
    display: none; /* Oculto por defecto mientras el menú esté visible */
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    margin-right: 0.85rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.sidebar-expand-btn:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
}

.nav-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-light);
    padding: 0.5rem 0.8rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    border-left: 3.5px solid transparent;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-item:hover i {
    transform: scale(1.15);
}

/* ==========================================================================
   CÓDIGO DE COLOR DISTINTIVO PARA CADA MÓDULO CENTRAL EN LA BARRA
   ========================================================================== */

/* 0. Panel Principal (Azul Rey) */
.nav-item-dashboard {
    border-left-color: transparent;
}
.nav-item-dashboard i {
    color: #2563eb;
}
.nav-item-dashboard:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #2563eb;
}
.nav-item-dashboard.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border-left-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.nav-item-dashboard.active i {
    color: #ffffff !important;
}

/* 1. Finanzas & Control de Recibos (Verde Esmeralda) */
.nav-item-finance {
    border-left-color: transparent;
}
.nav-item-finance i {
    color: #10b981;
}
.nav-item-finance:hover {
    background: #ecfdf5;
    color: #047857;
    border-left-color: #10b981;
}
.nav-item-finance.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-left-color: #a7f3d0;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.nav-item-finance.active i {
    color: #ffffff !important;
}

/* 2. CRM Admisiones & Pipeline (Ámbar / Oro) */
.nav-item-crm {
    border-left-color: transparent;
}
.nav-item-crm i {
    color: #f59e0b;
}
.nav-item-crm:hover {
    background: #fffbeb;
    color: #b45309;
    border-left-color: #f59e0b;
}
.nav-item-crm.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-left-color: #fde68a;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.nav-item-crm.active i {
    color: #ffffff !important;
}

/* 3. Asistencia, Lector QR & Carnets (Azul Cyan Óptico) */
.nav-item-attendance {
    border-left-color: transparent;
}
.nav-item-attendance i {
    color: #0284c7;
}
.nav-item-attendance:hover {
    background: #f0f9ff;
    color: #0369a1;
    border-left-color: #0284c7;
}
.nav-item-attendance.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-left-color: #bae6fd;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.nav-item-attendance.active i {
    color: #ffffff !important;
}

/* 4. Calendario Escolar, Actividades & Efemérides (Púrpura / Violeta Real) */
.nav-item-calendar {
    border-left-color: transparent;
}
.nav-item-calendar i {
    color: #8b5cf6;
}
.nav-item-calendar:hover {
    background: #faf5ff;
    color: #6d28d9;
    border-left-color: #8b5cf6;
}
.nav-item-calendar.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border-left-color: #ddd6fe;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.nav-item-calendar.active i {
    color: #ffffff !important;
}

/* 5. Perfil del Estudiante & Neuroeducación (Fucsia Neón / Rosa Energético) */
.nav-item-student {
    border-left-color: transparent;
}
.nav-item-student i {
    color: #ec4899;
}
.nav-item-student:hover {
    background: #fdf2f8;
    color: #be185d;
    border-left-color: #ec4899;
}
.nav-item-student.active {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border-left-color: #fbcfe8;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
}
.nav-item-student.active i {
    color: #ffffff !important;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Top Bar */
.topbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.topbar-left-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.page-title-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ==========================================================================
   ANIMACIÓN DE EXPANSIÓN DE TEXTO ELEGANTE (CAMBIO DE MÓDULO)
   ========================================================================== */
@keyframes headerTitleExpand {
    0% {
        opacity: 0;
        transform: translateY(7px);
        letter-spacing: 0.08em;
        filter: blur(3px);
    }
    55% {
        letter-spacing: 0.02em;
        filter: blur(0.5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: -0.015em;
        filter: blur(0);
    }
}

@keyframes headerSubFade {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 0.85;
        transform: translateY(0);
    }
}

.page-title-box h1 {
    font-size: 1.36rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: headerTitleExpand 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity, letter-spacing;
}

.page-title-box p {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0 0;
    line-height: 1.35;
    animation: headerSubFade 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Insignias de Módulo Temáticas en Header */
.header-module-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.header-module-badge:hover {
    transform: scale(1.08);
}

.header-badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.header-badge-green {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}

.header-badge-amber {
    background: #fffbeb;
    color: #f59e0b;
    border: 1px solid #fde68a;
}

.header-badge-cyan {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.header-badge-purple {
    background: #faf5ff;
    color: #8b5cf6;
    border: 1px solid #ddd6fe;
}

.header-badge-emerald {
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.header-badge-pink {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.institution-pill {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Dashboard Container */
.page-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.kpi-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success-dark); }
.kpi-icon.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0.3rem 0;
}

.kpi-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Cards & Sections */
.content-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ==========================================================================
   FICHAS Y BOTONES CON CÓDIGO DE COLOR DE MÓDULO (CENTRO DE CONTROL)
   ========================================================================== */
.content-card.module-card {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s;
    border-top-width: 4px;
    border-top-style: solid;
}

.content-card.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.module-card-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* 1. Tesorería & Recibos (Verde Esmeralda) */
.module-card-finance {
    border-top-color: #10b981 !important;
}
.module-card-finance:hover {
    border-color: #10b981;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.16) !important;
}
.module-card-finance .module-card-icon-wrap {
    background: #ecfdf5;
    color: #059669;
}
.btn-module-finance {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-finance:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    filter: brightness(1.04);
}

/* 2. CRM Admisiones (Ámbar / Oro) */
.module-card-crm {
    border-top-color: #f59e0b !important;
}
.module-card-crm:hover {
    border-color: #f59e0b;
    box-shadow: 0 12px 28px rgba(245, 158, 11, 0.16) !important;
}
.module-card-crm .module-card-icon-wrap {
    background: #fffbeb;
    color: #d97706;
}
.btn-module-crm {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-crm:hover {
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
    filter: brightness(1.04);
}

/* 3. Asistencia & Garita (Azul Cyan Óptico) */
.module-card-attendance {
    border-top-color: #0284c7 !important;
}
.module-card-attendance:hover {
    border-color: #0284c7;
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.16) !important;
}
.module-card-attendance .module-card-icon-wrap {
    background: #f0f9ff;
    color: #0284c7;
}
.btn-module-attendance {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-attendance:hover {
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
    filter: brightness(1.04);
}

/* 4. Calendario Escolar (Púrpura / Violeta Real) */
.module-card-calendar {
    border-top-color: #8b5cf6 !important;
}
.module-card-calendar:hover {
    border-color: #8b5cf6;
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.16) !important;
}
.module-card-calendar .module-card-icon-wrap {
    background: #faf5ff;
    color: #7c3aed;
}
.btn-module-calendar {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-calendar:hover {
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
    filter: brightness(1.04);
}

/* 5. Perfil del Estudiante & Neuroeducación (Fucsia Neón / Rosa) */
.module-card-student {
    border-top-color: #ec4899 !important;
}
.module-card-student:hover {
    border-color: #ec4899;
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.16) !important;
}
.module-card-student .module-card-icon-wrap {
    background: #fdf2f8;
    color: #db2777;
}
.btn-module-student {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-student:hover {
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.45);
    filter: brightness(1.04);
}

/* 6. Tareas & Retos SUTZ (Índigo Eléctrico / STEM) */
.module-card-tasks {
    border-top-color: #6366f1 !important;
}
.module-card-tasks:hover {
    border-color: #6366f1;
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.16) !important;
}
.module-card-tasks .module-card-icon-wrap {
    background: #eef2ff;
    color: #4f46e5;
}
.btn-module-tasks {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-tasks:hover {
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
    filter: brightness(1.04);
}

/* Admin Panel (Verde Escudo SOSQR) */
.module-card-admin {
    border-top-color: #10b981 !important;
}
.module-card-admin:hover {
    border-color: #10b981;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.16) !important;
}
.module-card-admin .module-card-icon-wrap {
    background: #ecfdf5;
    color: #059669;
}
.btn-module-admin {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-admin:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    filter: brightness(1.04);
}

/* 7. Gestión Administrativa & Horarios (Cyan / Teal Ejecutivo) */
.module-card-gestion-admin {
    border-top-color: #0891b2 !important;
}
.module-card-gestion-admin:hover {
    border-color: #0891b2;
    box-shadow: 0 12px 28px rgba(8, 145, 178, 0.16) !important;
}
.module-card-gestion-admin .module-card-icon-wrap {
    background: #ecfeff;
    color: #0891b2;
}
.btn-module-gestion-admin {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
    border: none;
    font-weight: 700;
}
.btn-module-gestion-admin:hover {
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.45);
    filter: brightness(1.04);
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.custom-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-table tr:hover td {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: var(--text-light);
}

/* ==========================================================================
   MÓDULO 2: CRM ADMISIONES, KANBAN CON CÓDIGO DE COLOR Y TRACKING VISUAL
   ========================================================================== */

/* Barra Superior de Filtros y Búsqueda del CRM */
.crm-filters-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.crm-filters-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
}

.crm-search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 360px;
}

.crm-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.crm-search-input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: #f8fafc;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.crm-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.crm-filter-select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.crm-filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.crm-filters-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
}

.crm-stats-pill {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 3px 8px;
    border-radius: 9999px;
    font-weight: 800;
}

/* Tablero Kanban Multi-Columna */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(270px, 1fr));
    gap: 1.25rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 1rem;
}

/* Columna de Etapa con Código de Color */
.kanban-column {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--stage-color, var(--primary));
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 540px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kanban-column:hover {
    box-shadow: var(--shadow-md);
}

/* Códigos de Color por Etapa */
.stage-nuevo { --stage-color: #0284c7; --stage-bg-light: #f0f9ff; }
.stage-entrevista { --stage-color: #8b5cf6; --stage-bg-light: #faf5ff; }
.stage-evaluacion { --stage-color: #f59e0b; --stage-bg-light: #fffbeb; }
.stage-aceptado { --stage-color: #4f46e5; --stage-bg-light: #eef2ff; }
.stage-inscrito { --stage-color: #10b981; --stage-bg-light: #ecfdf5; }

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.kanban-column-title-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Iconos Grandes y Reconocibles en Cabecera */
.kanban-stage-icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--stage-bg-light, #f1f5f9);
    color: var(--stage-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.kanban-stage-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-main);
    line-height: 1.2;
}

.kanban-counter {
    background: var(--stage-color, var(--text-muted));
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Tarjeta del Prospecto (Kanban Card) */
.kanban-card {
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
    cursor: pointer;
}

.kanban-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.kanban-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.prospect-avatar-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.prospect-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--stage-color, #0284c7), #1e293b);
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kanban-card-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges de Nivel de Interés (Temperatura) */
.interest-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
}

.interest-badge-hot {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.interest-badge-warm {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.interest-badge-cold {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Metadatos del Prospecto */
.kanban-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.kanban-card-meta-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-meta-row i {
    width: 14px;
    color: var(--text-muted);
}

.prospect-channel-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

/* ==========================================================================
   PROCESO DE SEGUIMIENTO VISUAL TIPO TRACKING (STEPPER / PROGRESS BAR)
   ========================================================================== */
.prospect-tracking-wrap {
    margin-top: 0.2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.6rem;
}

.tracking-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.tracking-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tracking-percent {
    color: var(--stage-color, var(--primary));
    font-weight: 800;
}

.tracking-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.tracking-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0284c7, var(--stage-color, #10b981));
    border-radius: 9999px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tracking-steps-dots {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 2px;
}

.tracking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
}

.tracking-dot.active {
    background: var(--stage-color, var(--primary));
}

/* Acciones de la Tarjeta */
.kanban-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.btn-card-action {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-action:hover {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-card-advance {
    background: var(--stage-color, var(--primary));
    border: 1px solid transparent;
    color: #ffffff;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-advance:hover {
    filter: brightness(0.92);
    transform: translateX(2px);
}

/* ==========================================================================
   TIMELINE DE SEGUIMIENTO 360° EN MODAL
   ========================================================================== */
.crm-timeline {
    position: relative;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.2rem 0;
}

.crm-timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 11px;
    width: 2px;
    background: #e2e8f0;
}

.crm-timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.crm-timeline-dot {
    position: absolute;
    left: -2rem;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #64748b;
    z-index: 2;
}

.crm-timeline-item.completed .crm-timeline-dot {
    border-color: #10b981;
    background: #10b981;
    color: #ffffff;
}

.crm-timeline-item.current .crm-timeline-dot {
    border-color: #0284c7;
    background: #eff6ff;
    color: #0284c7;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.crm-timeline-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
}

.crm-timeline-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Recibo / Comprobante Badge */
.dte-badge,
.recibo-badge {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   ADMINISTRATIVE PANEL & SECURITY SUITE (EXCLUSIVE ACCESS)
   ========================================================================== */

/* Full Screen Security Lock Gate (Rediseño Integrado AcademiaQR) */
.admin-lock-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 15%, rgba(224, 242, 254, 0.85) 0%, rgba(241, 245, 249, 0.94) 100%);
    backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.admin-lock-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 60px -15px rgba(0, 90, 156, 0.18), 0 12px 24px -6px rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 2.6rem 2.4rem;
    color: var(--text-main);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.admin-lock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #005a9c 0%, #0284c7 50%, #10b981 100%);
}

.admin-lock-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.3rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
    border: 2px solid rgba(0, 90, 156, 0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    box-shadow: 0 6px 20px rgba(0, 90, 156, 0.12);
    animation: pulseLock 3s infinite ease-in-out;
}

@keyframes pulseLock {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 20px rgba(0, 90, 156, 0.12); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(0, 90, 156, 0.25); }
}

.admin-lock-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.45rem;
    font-family: 'Outfit', sans-serif;
}

.admin-lock-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.8rem;
}

.admin-field-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.admin-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #334155;
    margin-bottom: 0.45rem;
}

.admin-input-wrap {
    position: relative;
}

.admin-input-wrap i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.admin-input {
    width: 100%;
    padding: 0.85rem 1.1rem 0.85rem 2.85rem;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-input::placeholder {
    color: #94a3b8;
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.18);
}

.admin-input:focus + i,
.admin-input-wrap:focus-within i {
    color: var(--primary);
}

.admin-btn-login {
    width: 100%;
    padding: 0.95rem 1.2rem;
    background: linear-gradient(135deg, #005a9c 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 90, 156, 0.28);
    font-family: inherit;
    margin-top: 0.5rem;
}

.admin-btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 90, 156, 0.38);
    background: linear-gradient(135deg, #004578 0%, #005a9c 100%);
}

.admin-btn-login:active {
    transform: translateY(0);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.admin-tab-btn {
    padding: 0.8rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-tab-btn:hover {
    color: var(--primary);
}

.admin-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* SOSQR Live Hub Card */
.sosqr-hub-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border-radius: var(--radius-md);
    padding: 1.8rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sosqr-hub-card::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.admin-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.admin-badge-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: livePulse 2s infinite;
}

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

/* Progress bar for sync */
.sync-progress-wrap {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}

.sync-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #0284c7, #38bdf8);
    border-radius: 50px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

/* Real-Time Sync Terminal Log */
.sync-terminal {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    color: #38bdf8;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 1rem;
}

.terminal-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.terminal-line.success { color: #4ade80; }
.terminal-line.warn { color: #fbbf24; }
.terminal-line.info { color: #94a3b8; }

/* School Card */
.school-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.school-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.school-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 90, 156, 0.3);
    transform: translateY(-2px);
}

.school-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.school-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
}

/* Nav Item Admin Special */
.nav-item-admin {
    background: rgba(0, 90, 156, 0.08);
    border: 1px dashed rgba(0, 90, 156, 0.3);
    color: var(--primary);
    font-weight: 700;
}

.nav-item-admin:hover, .nav-item-admin.active {
    background: var(--primary);
    color: white;
    border-style: solid;
}

/* ==========================================================================
   MODULO 3: SESIÓN DOCENTE, LECTOR QR Y CUADRO DE ACCIONES
   ========================================================================== */

/* Pestañas de Navegación */
.tab-navigation-bar {
    display: flex;
    gap: 0.8rem;
    background: #e2e8f0;
    padding: 0.4rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    width: fit-content;
    max-width: 100%;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Banner Resumen de Sesión */
.session-hero-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.session-hero-item .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.session-hero-item strong {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 800;
}

/* Visor de Cámara para Escáner QR */
.scanner-camera-box {
    position: relative;
    width: 100%;
    min-height: 240px;
    background: #0b1320;
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #334155;
}

#qr-camera-reader {
    width: 100%;
}

#qr-camera-reader video {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.scanner-crosshair-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.crosshair-guide {
    width: 180px;
    height: 180px;
    border: 2px solid rgba(16, 185, 129, 0.85);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    animation: scannerGlow 2s infinite alternate ease-in-out;
}

@keyframes scannerGlow {
    0% { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 10px rgba(16, 185, 129, 0.3), 0 0 0 9999px rgba(0, 0, 0, 0.35); }
    100% { border-color: rgba(16, 185, 129, 1); box-shadow: 0 0 25px rgba(16, 185, 129, 0.8), 0 0 0 9999px rgba(0, 0, 0, 0.35); }
}

/* Indicadores de Estado de Cámara */
.camera-status-idle {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.camera-status-live {
    font-size: 0.78rem;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulseLive 1.2s infinite;
}

@keyframes pulseLive {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.test-pill {
    background: #e2e8f0;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.test-pill:hover {
    background: var(--primary);
    color: white;
}

/* Métricas de Quórum */
.quorum-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.quorum-stat-box {
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.quorum-stat-box .stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.quorum-stat-box .stat-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.box-total { background: #f8fafc; color: var(--text-main); }
.box-present { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
.box-present .stat-number { color: #059669; }
.box-late { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.box-late .stat-number { color: #d97706; }
.box-pending { background: #f8fafc; border-color: #e2e8f0; color: #64748b; }

.progress-bar-track {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Elementos de la Tabla de Asistencia */
.student-avatar-wrap {
    position: relative;
    width: 38px;
    height: 38px;
}

.student-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.avatar-solvencia-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.dot-solvente { background: #10b981; }
.dot-moroso { background: #ef4444; }

.att-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.att-badge-present { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.att-badge-late { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.att-badge-absent { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.att-badge-pending { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.row-present {
    background: rgba(16, 185, 129, 0.03);
}

.row-highlight-pulse {
    animation: rowPulse 1.2s ease-out;
}

@keyframes rowPulse {
    0% { background: #bbf7d0; transform: scale(1.01); }
    100% { background: transparent; transform: scale(1); }
}

/* ==========================================================================
   MODAL CUADRO DE ACCIONES AL LEER QR
   ========================================================================== */
.action-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.action-modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    padding: 1.8rem;
    border: 1px solid var(--border-color);
    animation: cardZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.action-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.2rem;
}

.action-modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.action-modal-close {
    border: none;
    background: #f1f5f9;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.action-modal-close:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.action-modal-context-pill {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1.2rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botones del Cuadro de Acciones */
.action-buttons-stack {
    display: flex;
    flex-direction: column;
}

.btn-action-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-action-primary .btn-action-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.btn-action-secondary {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.btn-action-secondary:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-action-sos {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-action-sos:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
}

/* ==========================================================================
   OPTIMIZACIÓN MÓVIL (HEADER, DRAWER HAMBURGUESA & BOTTOM NAVIGATION APP)
   ========================================================================== */

/* Header Móvil Superior (Oculto en Desktop) */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.mobile-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.mobile-brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(88, 138, 211, 0.25));
}

.mobile-brand-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-brand-text {
    display: flex;
    flex-direction: column;
}

.mobile-brand-title {
    font-family: var(--font-brand), sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.mobile-brand-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-mobile-scan {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-mobile-scan:active {
    transform: scale(0.92);
}

.mobile-menu-toggle {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.15s;
    touch-action: manipulation;
}

.mobile-menu-toggle:active {
    background: #e2e8f0;
}

/* Botón de Apagar / Sesión en Cabecera Móvil */
.mobile-header-power-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1.5px solid #f87171;
    color: #dc2626;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    touch-action: manipulation;
}

.mobile-header-power-btn:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #ffffff;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.mobile-header-power-btn:active {
    transform: translateY(0) scale(0.96);
}

/* Overlay para Drawer Móvil */
.mobile-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

/* Barra de Navegación Inferior Móvil (App-Style) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px)) 0.5rem;
    z-index: 9995;
    justify-content: space-around;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    min-width: 58px;
}

.bottom-nav-item i {
    font-size: 1.15rem;
    transition: transform 0.15s;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active i {
    transform: scale(1.15);
}

/* Botón central flotante de acción rápida en Bottom Bar (Estilo Modern App / Circular FAB) */
.bottom-nav-item-highlight {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0.3rem !important;
    margin-top: -24px !important;
    text-decoration: none;
    cursor: pointer;
    min-width: 64px;
    -webkit-tap-highlight-color: transparent;
}

/* El círculo central flotante con corte de borde blanco */
.bottom-nav-item-highlight i {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.45);
    border: 4px solid #ffffff;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.bottom-nav-item-highlight:active i {
    transform: scale(0.92);
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
}

.bottom-nav-item-highlight span {
    font-size: 0.65rem;
    font-weight: 800;
    color: #0284c7 !important;
    margin-top: 3px;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

/* Botón inteligente Qʼuqʼumatz en Bottom Bar */
.bottom-nav-item-ququmatz {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    padding: 0.2rem 0.35rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 54px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ququmatz-nav-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #0284c7 50%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.4);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ququmatz-nav-icon-wrap i {
    font-size: 0.95rem !important;
    color: #fbbf24 !important;
    transform: rotate(-10deg);
}

.ququmatz-pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: pulseLive 1.4s infinite;
}

.bottom-nav-item-ququmatz:hover .ququmatz-nav-icon-wrap,
.bottom-nav-item-ququmatz:active .ququmatz-nav-icon-wrap {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.6);
}

.bottom-nav-item-ququmatz span {
    font-weight: 800;
    font-size: 0.64rem;
    color: #059669;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   MEDIA QUERIES RESPONSIVAS
   ========================================================================== */

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    /* Mostrar Header Móvil */
    .mobile-header {
        display: flex;
    }

    /* Sidebar se convierte en Drawer deslizante con scroll vertical fluido e independiente */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: -320px !important;
        width: 295px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        z-index: 9999 !important;
        padding-bottom: calc(6rem + env(safe-area-inset-bottom, 20px)) !important;
    }

    .sidebar.drawer-open {
        transform: translateX(320px) !important;
    }

    body.mobile-drawer-locked {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    .main-content {
        width: 100%;
        padding-bottom: 75px; /* Espacio para no tapar con bottom bar */
    }

    .topbar {
        padding: 1rem 1.25rem;
    }

    /* Mostrar barra inferior en tablets y móviles */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Ocultar botón duplicado de topbar en móvil (el escáner se accede desde la barra inferior fija) */
    .btn-topbar-quick-scan {
        display: none !important;
    }

    /* Ocultar botón redundante de apagar en topbar en móvil: solo debe existir en mobile-header junto al desplegable */
    .topbar .btn-topbar-power,
    .topbar-actions .btn-topbar-power,
    .user-session-widget-group .btn-topbar-power,
    #btnLogoutAdmin {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.65rem 0.9rem;
    }

    .topbar-left-wrap {
        width: 100%;
        justify-content: flex-start;
    }

    .page-title-box h1 {
        font-size: 1.12rem;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .page-title-box p {
        font-size: 0.74rem;
        line-height: 1.3;
    }

    .topbar-actions {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .role-switcher-wrap {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        width: auto;
    }

    .btn-topbar-quick-scan {
        flex-shrink: 0;
    }

    .institution-pill {
        max-width: 100%;
        font-size: 0.74rem;
        padding: 0.3rem 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #adminUserDisplay {
        max-width: 160px;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-body {
        padding: 0.9rem 0.75rem 5.5rem 0.75rem;
        gap: 1.1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Encabezados de tarjetas fluidos - previene colisión de títulos largos con badges/botones */
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.55rem !important;
        padding: 0.9rem 1rem !important;
    }

    .card-title {
        font-size: 1.02rem !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        width: 100% !important;
    }

    /* Convertir todos los grids de dos columnas a 1 sola columna vertical */
    div[style*="grid-template-columns: 1.15fr 1fr"],
    div[style*="grid-template-columns: 1.25fr 1fr"],
    div[style*="grid-template-columns: 1.3fr 1fr"],
    .quorum-metrics-grid {
        grid-template-columns: 1fr !important;
    }

    /* Pestañas táctiles completas */
    .tab-navigation-bar {
        width: 100%;
        flex-direction: column;
        gap: 0.4rem;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1rem;
    }

    /* Banner de Sesión en móvil */
    .session-hero-banner {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
        padding: 0.85rem;
    }

    /* Visor de Cámara QR optimizado para pantalla vertical */
    .scanner-camera-box {
        min-height: 280px;
        max-height: 380px;
    }

    .crosshair-guide {
        width: 200px;
        height: 200px;
    }

    /* Modal Cuadro de Acciones transformado en BOTTOM SHEET táctil */
    .action-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .action-modal-card {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 1.4rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom, 0px)) 1.2rem;
        max-height: 90vh;
        overflow-y: auto;
        animation: bottomSheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes bottomSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .btn-action-primary {
        padding: 1.15rem 1.2rem;
        min-height: 60px;
        touch-action: manipulation;
    }

    .btn-action-primary .btn-action-icon {
        font-size: 2rem;
    }

    /* Tabla responsiva y tarjetas de fila */
    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .custom-table {
        min-width: 620px;
    }

    /* Navegación de mes del calendario */
    .calendar-nav-header {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: space-between !important;
    }

    .calendar-current-title {
        font-size: 1.05rem !important;
        min-width: unset !important;
    }

    .calendar-controls-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    /* Pestañas de Gestión Administrativa con Scroll Horizontal Táctil */
    .admin-tab-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        white-space: nowrap !important;
        gap: 0.35rem !important;
        padding-bottom: 4px !important;
    }

    .admin-tab-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-tab-btn {
        padding: 0.55rem 0.85rem !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 0.55rem 0.75rem;
    }

    .page-title-box h1 {
        font-size: 1.02rem;
        gap: 0.3rem;
    }

    .header-module-badge {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .topbar-actions {
        gap: 0.35rem;
    }

    .institution-pill {
        font-size: 0.7rem;
        padding: 0.25rem 0.55rem;
    }

    .role-switcher-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .role-btn {
        padding: 0.3rem 0.25rem;
        font-size: 0.68rem;
    }

    .kpi-grid {
        gap: 0.75rem !important;
    }

    .kpi-card {
        padding: 1.1rem !important;
    }
}

/* ==========================================================================
   MÓDULO 4: CALENDARIO ESCOLAR MULTI-PERFIL, FORMAS Y EFEMÉRIDES
   ========================================================================== */

/* Barra de selección de rol (Estudiante, Maestro, Directivo) */
.calendar-role-selector-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.role-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-tab-btn i {
    font-size: 1.05rem;
}

.role-tab-btn:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.role-tab-btn.active-role-student {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.role-tab-btn.active-role-teacher {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.role-tab-btn.active-role-admin {
    background: #faf5ff;
    border-color: #e9d5ff;
    color: #7e22ce;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.15);
}

/* Banner de contexto del rol */
.active-role-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.role-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filtros de Categoría con Formas y Colores */
.category-filters-scroll {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.category-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.category-chip-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
    transform: translateY(-1px);
}

.category-chip-btn.active {
    background: var(--text-main);
    border-color: var(--text-main);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* FORMAS DISTINTIVAS */
.chip-shape {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.shape-hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #3b82f6;
}

.shape-pill {
    border-radius: 9999px;
    background: #10b981;
}

.shape-rounded {
    border-radius: 3px;
    background: #f59e0b;
}

.shape-strip {
    border-radius: 2px;
    background: #ef4444;
    width: 16px;
    height: 8px;
}

.shape-tag {
    clip-path: polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%);
    background: #8b5cf6;
}

/* Layout Principal del Calendario */
.calendar-main-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.calendar-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.role-selector-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

.role-tabs-group {
    display: flex;
    flex: 1;
    gap: 0.5rem;
}

.role-banner-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary);
    flex-shrink: 0;
}

.calendar-header-nav,
.calendar-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-month-title,
.calendar-current-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: capitalize;
    margin: 0;
    min-width: 170px;
    text-align: center;
}

.calendar-nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cal-nav {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cal-nav:hover {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-cal-today {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-cal-today:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* Malla del Calendario (Grid) */
.calendar-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    margin-bottom: 6px;
}

.calendar-weekday-col,
.weekday-name {
    padding: 0.6rem 0.2rem;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weekday-name.weekend {
    color: #ef4444;
}

.calendar-grid-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day-cell {
    min-height: 96px;
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.calendar-day-cell:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.calendar-day-cell.other-month {
    background: #f8fafc;
    opacity: 0.45;
}

.calendar-day-cell.today-cell {
    background: #f0fdf4;
    border-color: #86efac;
}

.calendar-day-cell.today-cell .calendar-day-num {
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-day-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.calendar-cell-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

/* Micro-etiquetas de eventos en la celda */
.event-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
}

.event-chip:hover {
    filter: brightness(0.92);
    transform: scale(1.02);
}

.event-chip.chip-shape-hexagon {
    border-radius: 3px;
}

.event-chip.chip-shape-pill {
    border-radius: 9999px;
    padding: 2px 8px;
}

.event-chip.chip-shape-rounded {
    border-radius: 4px;
}

.event-chip.chip-shape-strip {
    border-left-width: 4px;
}

.event-chip-icon {
    font-size: 0.72rem;
    flex-shrink: 0;
}

.event-chip-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.more-events-indicator {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    margin-top: 2px;
}

/* Panel Lateral: Agenda Próximos Eventos */
.calendar-sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ==========================================================================
   AGENDA DE ACTIVIDADES PROFESIONAL (ESTILO MÓDULO 5 NEUROEDUCACIÓN)
   ========================================================================== */
.agenda-card-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    background: #ffffff;
}

/* Mini KPIs de la Agenda (Estilo Neuro-KPIs) */
.agenda-mini-kpis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}

.agenda-mini-kpi-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.2s ease;
}

.agenda-mini-kpi-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

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

.agenda-mini-kpi-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    font-family: 'Outfit', sans-serif;
}

.agenda-mini-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Buscador Rápido de la Agenda */
.agenda-quick-search-box {
    position: relative;
    width: 100%;
    margin-bottom: 0.4rem;
}

.agenda-quick-search-box i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s;
}

.agenda-quick-search-input {
    width: 100%;
    padding: 0.55rem 0.9rem 0.55rem 2.4rem;
    background: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.agenda-quick-search-input:focus {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.agenda-quick-search-input:focus + i,
.agenda-quick-search-box:focus-within i {
    color: #7c3aed;
}

/* Feed de Actividades */
.upcoming-events-feed {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 580px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 8px 10px 4px;
    scroll-behavior: smooth;
}

.upcoming-events-feed::-webkit-scrollbar {
    width: 6px;
}

.upcoming-events-feed::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

/* Tarjeta de Evento Estilo Módulo 5 (Elevación & Micro-animaciones) */
.upcoming-event-card {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: min-content;
    box-sizing: border-box;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    animation: slideUpCard 0.4s ease-out both;
}

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

/* Línea de acento lateral dinámica */
.upcoming-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color, var(--primary));
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    transition: width 0.2s ease;
}

.upcoming-event-card:hover {
    border-color: rgba(124, 58, 237, 0.35);
    transform: translateY(-4px) scale(1.008);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(124, 58, 237, 0.08);
}

.upcoming-event-card:hover::before {
    width: 6px;
}

/* Insignia de Fecha Estilo Ticket con Relieve */
.event-card-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    min-width: 54px;
    height: auto;
    padding: 0.45rem 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease;
}

.upcoming-event-card:hover .event-card-date-badge {
    transform: scale(1.05);
}

.date-badge-weekday {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 2px;
}

.date-badge-day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.05;
    font-family: 'Outfit', sans-serif;
}

.date-badge-month {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

/* Contenido Principal de la Tarjeta */
.upcoming-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.upcoming-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-pill-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 50px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

/* Badges de Proximidad con Micro-Animación */
.event-proximity-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
}

.proximity-today {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.proximity-pulse-dot {
    width: 6px;
    height: 6px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulseGlow 1.4s infinite;
}

.proximity-soon {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.proximity-normal {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.proximity-past {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.upcoming-card-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    transition: color 0.15s ease;
}

.upcoming-event-card:hover .upcoming-card-title {
    color: var(--primary);
}

.upcoming-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upcoming-card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.upcoming-card-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

/* Botón Circular de Flecha con Micro-Interacción */
.event-card-btn-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    font-size: 0.82rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.upcoming-event-card:hover .event-card-btn-arrow {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateX(3px) scale(1.08);
    box-shadow: 0 4px 10px rgba(0, 90, 156, 0.3);
}

/* Estado Vacío de la Agenda */
.agenda-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    margin: 0.5rem 0;
}

.agenda-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.8rem auto;
}

/* Modales de Calendario */
.cal-modal-header-hero {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cal-modal-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.cal-detail-field {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.cal-detail-field i {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 2px;
}

/* Adaptación Responsiva para Calendario */
@media (max-width: 1024px) {
    .calendar-main-layout {
        grid-template-columns: 1fr;
    }

    .calendar-sidebar-panel {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .calendar-card {
        padding: 1rem 0.75rem;
    }

    .calendar-role-selector-bar {
        flex-direction: column;
    }

    .calendar-weekday-col {
        font-size: 0.68rem;
        padding: 0.4rem 0.1rem;
    }

    .calendar-day-cell {
        min-height: 64px;
        padding: 4px;
        gap: 2px;
    }

    .calendar-day-num {
        font-size: 0.72rem;
    }

    .event-chip {
        padding: 2px 4px;
        font-size: 0.6rem;
    }

    .event-chip-icon {
        display: none; /* Ahorrar espacio en celda móvil */
    }

    .calendar-header-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .calendar-nav-buttons {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==========================================================================
   MÓDULO 5: PERFIL DEL ESTUDIANTE & NEURODISEÑO EDUCATIVO
   Estimulación Dopaminérgica, Chunking Cognitivo & Matriz de Habilidades
   ========================================================================== */

/* Badge Fucsia / Neón para el Header del Módulo */
.header-badge-pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

/* Selector de Estudiante en Header */
.student-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.3rem 0.8rem;
    box-shadow: var(--shadow-sm);
}

.student-selector-wrap label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.student-selector-dropdown {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-dark);
    cursor: pointer;
    outline: none;
}

/* 1. HERO BANNER DE IDENTIDAD & NEUROESTIMULACIÓN */
.student-hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    color: #ffffff;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15), 0 0 40px rgba(236, 72, 153, 0.12);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.student-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.student-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

/* Avatar con Marco Dopaminérgico de Nivel */
.student-avatar-hero-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.student-avatar-img-hero {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.45);
    background: #1e293b;
    position: relative;
    z-index: 2;
}

.student-avatar-glow-ring {
    position: absolute;
    inset: -6px;
    border-radius: 34px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6, #06b6d4);
    z-index: 1;
    animation: rotateGlow 8s linear infinite;
    opacity: 0.85;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.student-level-corner-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Información de Identidad */
.student-hero-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.student-hero-name-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.student-hero-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.student-honor-title-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.5);
    color: #fbcfe8;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.student-hero-meta-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
}

.student-hero-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.student-hero-meta-row i {
    color: #ec4899;
}

/* Barra de Nivel & Experiencia (XP) */
.student-xp-bar-box {
    margin-top: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    max-width: 520px;
}

.xp-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.xp-bar-current-level {
    color: #fbcfe8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.xp-bar-points {
    color: #93c5fd;
}

.xp-track {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 50%, #06b6d4 100%);
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Acciones Rápidas del Banner (Carnet QR SOSQR & Estado de Cuenta) */
.student-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
    position: relative;
    z-index: 2;
}

.btn-student-qr {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-student-qr:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-student-aux {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-student-aux:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #ffffff;
}

/* 2. GRID DE KPIS NEUROCOGNITIVOS */
.student-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.student-kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.student-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.student-kpi-icon-wrap {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.kpi-icon-average {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.kpi-icon-tasks {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.kpi-icon-streak {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.kpi-icon-xp {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
}

.student-kpi-info {
    display: flex;
    flex-direction: column;
}

.student-kpi-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.student-kpi-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.student-kpi-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: #10b981;
    margin-top: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 3. SECCIONES Y LAYOUT DUAL */
.student-dual-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.student-dual-layout > div,
.student-layout-column {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.neuro-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.neuro-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.neuro-card-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.neuro-card-title-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--primary);
    flex-shrink: 0;
}

.neuro-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.neuro-badge-pill {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
    flex-shrink: 0;
}

/* Grid de Materias */
.academic-subjects-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.subject-item-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.subject-item-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.subject-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    box-sizing: border-box;
}

.subject-meta-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
}

.subject-meta-left > div {
    min-width: 0;
    overflow: hidden;
}

.subject-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.subject-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.subject-teacher {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-score-pill {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.subject-grade-status {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
    white-space: nowrap;
}

.grade-status-sobresaliente { background: #dcfce7; color: #15803d; }
.grade-status-notable { background: #eff6ff; color: #1d4ed8; }
.grade-status-proceso { background: #fffbeb; color: #b45309; }

.subject-progress-track {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    box-sizing: border-box;
}

.subject-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Trabajos y Exámenes */
.tasks-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-timeline-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    transition: all 0.15s ease;
}

.task-timeline-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.task-type-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.task-type-exam { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.task-type-homework { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.task-type-project { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.task-content {
    flex: 1;
    min-width: 0;
}

.task-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.task-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-score-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: #10b981;
    white-space: nowrap;
}

.task-sub-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0.2rem 0 0.35rem 0;
}

.task-feedback-dopamine {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    padding: 0.35rem 0.6rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.72rem;
    color: #1e40af;
    font-weight: 600;
    font-style: italic;
}

/* 4. MATRIZ DUAL DE HABILIDADES (BLANDAS & DURAS) */
.skills-matrix-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-category-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.skill-category-header h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.skill-category-header .soft-icon {
    color: #ec4899;
}

.skill-category-header .hard-icon {
    color: #0284c7;
}

.skill-items-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.skill-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.skill-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.skill-growth-pill {
    font-size: 0.7rem;
    font-weight: 800;
    color: #10b981;
    background: #ecfdf5;
    padding: 1px 6px;
    border-radius: 9999px;
}

.skill-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.skill-fill-soft {
    height: 100%;
    background: linear-gradient(90deg, #ec4899 0%, #f43f5e 100%);
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.4);
    transition: width 0.6s ease;
}

.skill-fill-hard {
    height: 100%;
    background: linear-gradient(90deg, #0284c7 0%, #3b82f6 100%);
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
    transition: width 0.6s ease;
}

/* 5. VITRINA DE INSIGNIAS Y TROFEOS (GAMIFICACIÓN) */
.trophies-shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.trophy-badge-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.1rem 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.trophy-badge-card.unlocked {
    background: #ffffff;
    border-color: #fde68a;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.12);
}

.trophy-badge-card.unlocked:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
}

.trophy-badge-card.locked {
    opacity: 0.55;
    filter: grayscale(0.8);
}

.trophy-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.trophy-icon-circle.locked-icon {
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
}

.trophy-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.trophy-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

.trophy-status-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.trophy-status-pill.unlocked-pill {
    background: #ecfdf5;
    color: #059669;
}

.trophy-status-pill.locked-pill {
    background: #f1f5f9;
    color: #64748b;
}

/* RESPONSIVIDAD DEL PERFIL */
@media (max-width: 1024px) {
    .student-hero-banner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .student-avatar-hero-wrap {
        margin: 0 auto;
    }

    .student-hero-name-row {
        justify-content: center;
    }

    .student-hero-meta-row {
        justify-content: center;
    }

    .student-xp-bar-box {
        margin: 0.6rem auto 0 auto;
    }

    .student-hero-actions {
        align-items: center;
        flex-direction: row;
        justify-content: center;
    }

    .student-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .student-dual-layout {
        grid-template-columns: 1fr;
    }

    .skills-matrix-dual {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .student-kpi-grid {
        grid-template-columns: 1fr;
    }

    .student-hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-student-qr,
    .btn-student-aux {
        width: 100%;
        justify-content: center;
    }

    .trophies-shelf-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   CONTROL DE VISIBILIDAD DUAL: LECTOR QR SOLO EN MÓVIL
   ========================================================================== */
.only-mobile-scanner {
    display: block;
}

@media (min-width: 993px) {
    .only-mobile-scanner {
        display: none !important;
    }
}

/* Barra de Filtros de Asistencia Web */
.attendance-filters-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.attendance-filters-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.att-filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.att-filter-item label {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.att-filter-select {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.att-filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.att-search-box {
    position: relative;
    min-width: 220px;
    flex: 1;
    max-width: 320px;
}

.att-search-box input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.att-search-box i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Badges de Género y Rendimiento */
.badge-gender-m {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-gender-f {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-score-sobresaliente {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-score-notable {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-score-riesgo {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Live Class Header Badge */
.live-pulse-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 20px;
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ==========================================================================
   SISTEMA MODULAR MULTI-TENANT & MODULE GUARD
   ========================================================================== */

/* Switcher de colegio en el topbar */
.school-switcher-select {
    border: none;
    background: transparent;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.school-switcher-select:hover {
    background: rgba(0, 0, 0, 0.05);
}

.school-switcher-select:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Ítem del sidebar deshabilitado / no contratado */
.nav-item-disabled {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: #94a3b8 !important;
    text-decoration: none;
    cursor: not-allowed;
    background: transparent;
    transition: all 0.2s ease;
}

.nav-item-disabled:hover {
    background: rgba(241, 245, 249, 0.6);
    color: #64748b !important;
}

/* Pantalla de bloqueo Module Guard (cuando el colegio no tiene contratado el módulo) */
.module-guard-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.module-guard-card {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    padding: 2.2rem 2rem;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.module-guard-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 1.2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.module-guard-tag {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0.8rem;
}

.module-guard-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.6rem 0;
}

.module-guard-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 1.4rem 0;
}

.module-guard-details {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.module-guard-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pills de módulos en tarjetas de colegios */
.modules-badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.module-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.module-badge-pill.active {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.module-badge-pill.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    text-decoration: line-through;
    opacity: 0.65;
}

/* Switches & Toggles para el Modal de Licencias del SuperAdmin */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-card-custom {
    background: white;
    width: 100%;
    max-width: 620px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header-custom {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body-custom {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer-custom {
    padding: 1.1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.module-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.7rem;
    background: white;
    transition: all 0.2s ease;
}

.module-toggle-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.module-toggle-item.is-core {
    background: #f8fafc;
    border-style: dashed;
}

.switch-control {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-control input:checked + .switch-slider {
    background-color: #10b981;
}

.switch-control input:checked + .switch-slider:before {
    transform: translateX(22px);
}

.switch-control input:disabled + .switch-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   SUITE AVANZADA DE OPTIMIZACIÓN MÓVIL (ACADEMIAQR MOBILE PRO)
   Diseñado meticulosamente para Viewports 320px - 768px (iOS & Android)
   ========================================================================== */

/* 1. Prevención Global de Desbordamiento Horizontal & Espaciado Safe-Area */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    /* Despeje de seguridad para no tapar contenido con la barra inferior fija */
    .main-content {
        padding-bottom: 96px !important;
    }
    .page-body {
        padding-bottom: 3.5rem !important;
    }
}

/* 2. Topbar & Header Móvil Pulido */
@media (max-width: 768px) {
    .mobile-header {
        height: 60px;
        padding: 0 1rem;
        background: #ffffff;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-xs);
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
        background: #f8fafc;
        border: 1px solid var(--border-color);
        color: var(--text-main);
        font-size: 1.15rem;
    }

    .topbar {
        padding: 0.85rem 1rem !important;
        gap: 0.75rem !important;
        border-bottom: 1px solid var(--border-color);
    }

    .topbar-left-wrap {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .page-title-box {
        min-width: 0;
        flex: 1;
    }

    .page-title-box h1 {
        font-size: 1.18rem !important;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-title-box p {
        font-size: 0.76rem !important;
        line-height: 1.35;
        color: var(--text-muted);
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .topbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.55rem;
        align-items: center;
        margin-top: 0.25rem;
    }

    /* 1. Widget de usuario y botón de apagar: Fila 1 izquierda */
    .topbar-user-session-widget {
        order: 1;
        grid-column: 1 / 2;
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .user-session-widget-group {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        max-width: 100%;
    }

    .user-session-pill {
        min-width: 0;
        max-width: calc(100% - 44px);
        padding: 3px 8px 3px 3px;
    }

    .user-session-name {
        max-width: 110px;
    }

    /* 2. Botón de ayuda: Fila 1 derecha */
    .role-switcher-wrap,
    #globalRoleSwitcherWrap {
        order: 2;
        grid-column: 2 / 3;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin: 0;
    }

    .btn-topbar-help {
        margin-right: 0 !important;
        white-space: nowrap;
        padding: 0.42rem 0.75rem !important;
        font-size: 0.78rem !important;
    }

    /* 3. Botón de acción principal (Nueva Actividad): Fila 2 ancho completo */
    .topbar-actions > .btn-primary,
    .topbar-actions > .btn {
        order: 3;
        grid-column: 1 / -1;
        width: 100% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 42px !important;
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    }

    .institution-pill {
        max-width: 100% !important;
        flex: 1;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        overflow: hidden;
        padding: 0.4rem 0.75rem !important;
    }

    .school-switcher-select {
        max-width: 180px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        font-size: 0.8rem;
    }
}

/* 3. Módulo 1: Finanzas & Control de Recibos (Tesoreria) */
@media (max-width: 768px) {
    .treasury-metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        background: #ffffff;
        margin-bottom: 1rem;
    }

    .custom-table {
        min-width: 640px;
    }

    .custom-table th, 
    .custom-table td {
        padding: 0.75rem 0.65rem !important;
        font-size: 0.82rem !important;
    }

    /* Botones de acción táctiles cómodos */
    .btn-action-charge {
        min-height: 44px;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        border-radius: var(--radius-sm);
        touch-action: manipulation;
    }
}

/* 4. Módulo 2: CRM Admisiones & Pipeline Kanban Móvil */
@media (max-width: 768px) {
    .kanban-board {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 1rem !important;
        padding: 0.4rem 0.4rem 1.2rem 0.4rem !important;
        scrollbar-width: none;
    }

    .kanban-board::-webkit-scrollbar {
        display: none;
    }

    .kanban-column {
        flex: 0 0 85vw !important;
        max-width: 320px !important;
        scroll-snap-align: center !important;
        min-height: auto !important;
        border-radius: 16px !important;
    }

    .kanban-card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .kanban-card-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .kanban-card-actions .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        font-size: 0.86rem;
    }

    .kanban-counter {
        padding: 2px 7px;
        font-size: 0.72rem;
    }
}

/* 5. Módulo 3: Asistencia, Quórum & Lector QR Móvil */
@media (max-width: 768px) {
    .quorum-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.65rem !important;
    }

    .quorum-metric-card {
        padding: 0.85rem 0.75rem !important;
    }

    .quorum-metric-val {
        font-size: 1.35rem !important;
    }

    .session-hero-banner {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }

    .attendance-filters-bar {
        padding: 0.9rem !important;
        gap: 0.65rem !important;
    }

    .attendance-filters-group {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.6rem !important;
    }

    .att-filter-item {
        width: 100% !important;
    }

    .att-filter-item select,
    .att-filter-item input,
    #attSearchInput {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 0.88rem !important;
        padding: 0.65rem 0.85rem !important;
    }

    #attResetBtn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
    }
}

/* 6. Módulo 4: Calendario Escolar & Agenda en Móvil */
@media (max-width: 768px) {
    .calendar-main-layout {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* Selector de Roles con Scroll Horizontal Táctil */
    .calendar-role-selector-bar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        scrollbar-width: none !important;
        padding: 0.4rem !important;
    }

    .calendar-role-selector-bar::-webkit-scrollbar {
        display: none;
    }

    .role-tabs-group {
        display: flex !important;
        width: max-content !important;
        gap: 0.45rem !important;
    }

    .role-tab-btn {
        flex: none !important;
        white-space: nowrap !important;
        min-height: 44px !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.82rem !important;
        scroll-snap-align: start !important;
    }

    /* Chips de Categorías con Scroll Táctil */
    .category-filters-scroll {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0.45rem !important;
        padding-bottom: 0.5rem !important;
    }

    .category-filters-scroll::-webkit-scrollbar {
        display: none;
    }

    .category-chip-btn {
        flex: none !important;
        white-space: nowrap !important;
        min-height: 40px !important;
        padding: 0.45rem 0.85rem !important;
        font-size: 0.78rem !important;
    }

    /* Cuadrícula de Días Compacta y Nítida */
    .calendar-weekdays-grid {
        gap: 2px !important;
        padding-bottom: 0.4rem !important;
    }

    .weekday-name {
        font-size: 0.72rem !important;
        font-weight: 800 !important;
    }

    .calendar-grid-cells {
        gap: 3px !important;
    }

    .calendar-day-cell {
        min-height: 52px !important;
        padding: 3px 2px !important;
    }

    .calendar-day-cell .day-number {
        font-size: 0.82rem !important;
        font-weight: 800 !important;
    }

    .cal-cell-event-pill {
        font-size: 0.62rem !important;
        padding: 1px 3px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Agenda de Actividades en Móvil */
    .agenda-mini-kpis-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.4rem !important;
    }

    .agenda-mini-kpi-item {
        padding: 0.45rem 0.35rem !important;
        gap: 0.35rem !important;
    }

    .agenda-mini-kpi-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.8rem !important;
    }

    .agenda-mini-kpi-val {
        font-size: 1rem !important;
    }

    .agenda-mini-kpi-label {
        font-size: 0.62rem !important;
        letter-spacing: 0 !important;
    }

    .upcoming-event-card {
        padding: 0.85rem !important;
        gap: 0.75rem !important;
        flex-shrink: 0 !important;
        height: auto !important;
        min-height: min-content !important;
        align-items: flex-start !important;
    }

    .event-card-date-badge {
        width: 48px !important;
        min-width: 48px !important;
        height: auto !important;
        flex-shrink: 0 !important;
        padding: 0.35rem 0.25rem !important;
    }

    .date-badge-day {
        font-size: 1.25rem !important;
    }

    .upcoming-card-title {
        font-size: 0.9rem !important;
    }
}

/* 7. Módulo 5: Perfil Estudiante & NeuroEducación Móvil */
@media (max-width: 640px) {
    .student-hero-banner {
        padding: 1.25rem 1rem !important;
        gap: 1.2rem !important;
    }

    .student-hero-name {
        font-size: 1.35rem !important;
        word-break: break-word !important;
    }

    .student-hero-meta-row {
        flex-wrap: wrap !important;
        gap: 0.45rem !important;
        font-size: 0.78rem !important;
    }

    .student-hero-actions {
        width: 100% !important;
        flex-direction: column !important;
        gap: 0.55rem !important;
    }

    .btn-student-qr,
    .btn-student-aux {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
        font-size: 0.9rem !important;
    }

    .student-kpi-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .neuro-card {
        padding: 1rem 0.85rem !important;
        border-radius: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .neuro-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.45rem !important;
        margin-bottom: 0.85rem !important;
        padding-bottom: 0.65rem !important;
    }

    .neuro-card-title-group {
        width: 100% !important;
        gap: 0.5rem !important;
    }

    .neuro-card-title-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.95rem !important;
        flex-shrink: 0 !important;
    }

    .neuro-card-title {
        font-size: 0.96rem !important;
        line-height: 1.25 !important;
        word-break: break-word !important;
    }

    .neuro-badge-pill {
        font-size: 0.65rem !important;
        padding: 2px 7px !important;
        white-space: nowrap !important;
        align-self: flex-start !important;
    }

    .academic-subjects-list {
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.65rem !important;
    }

    .subject-item-card {
        padding: 0.75rem 0.8rem !important;
        gap: 0.45rem !important;
        border-radius: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .subject-item-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.45rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .subject-meta-left {
        gap: 0.5rem !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .subject-name {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }

    .subject-teacher {
        font-size: 0.70rem !important;
    }

    .subject-score-pill {
        font-size: 1rem !important;
        gap: 0.35rem !important;
        flex-shrink: 0 !important;
    }

    .subject-grade-status {
        font-size: 0.62rem !important;
        padding: 1px 5px !important;
    }

    .task-timeline-item {
        padding: 0.75rem 0.75rem !important;
        gap: 0.65rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .skills-matrix-dual {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
        width: 100% !important;
    }

    .trophies-shelf-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
        width: 100% !important;
    }
}

/* 8. Modales y Bottom Sheets Táctiles en Móvil */
@media (max-width: 640px) {
    .modal-overlay-custom,
    .action-modal-overlay,
    .custom-modal-overlay,
    .mobile-modal-overlay,
    #paymentModal {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-card-custom,
    .action-modal-card,
    .telegram-modal-card,
    .sosqr-medical-modal-card,
    .global-help-modal-card,
    .activity-modal-card,
    .crm-modal-card,
    .mobile-modal-card,
    .teacher-schedule-modal-content,
    #paymentModal > div {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
        border-bottom: none !important;
        padding: 1.4rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem !important;
        animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-sizing: border-box !important;
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-footer-custom,
    .action-modal-footer {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.6rem !important;
        padding: 1rem 0 0 0 !important;
    }

    .modal-footer-custom .btn,
    .action-modal-footer .btn {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
    }

    /* Modal Form Grids Stack to 1 column on Mobile */
    .action-modal-card form div[style*="grid-template-columns"],
    .modal-card-custom form div[style*="grid-template-columns"],
    #paymentModal div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    .action-modal-card input,
    .action-modal-card select,
    .action-modal-card textarea,
    .modal-card-custom input,
    .modal-card-custom select,
    .modal-card-custom textarea,
    #paymentModal input,
    #paymentModal select {
        min-height: 44px !important;
        font-size: 0.9rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* 9. Barra de Navegación Inferior Flotante Mejorada */
@media (max-width: 1024px) {
    .mobile-bottom-nav {
        height: 64px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        z-index: 9998;
    }

    .bottom-nav-item {
        min-height: 48px;
        padding: 4px 0;
        touch-action: manipulation;
    }

    .bottom-nav-item i {
        font-size: 1.15rem;
    }

    .bottom-nav-item span {
        font-size: 0.68rem;
        font-weight: 700;
        margin-top: 2px;
    }
}

/* ==========================================================================
   10. ASISTENTE IA EDUCATIVO & COPILOT: QʼUQʼUMATZ (ACADEMIAQR & SUTZ)
   ========================================================================== */
.ai-copilot-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99999;
    background: linear-gradient(135deg, #059669 0%, #0284c7 50%, #7c3aed 100%);
    color: #ffffff !important;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-brand), sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.45), 0 0 16px rgba(6, 182, 212, 0.35);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    animation: copilotFloat 3s infinite ease-in-out;
}

@keyframes copilotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.ai-copilot-floating-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 16px 35px rgba(5, 150, 105, 0.55), 0 0 22px rgba(6, 182, 212, 0.45);
    background: linear-gradient(135deg, #047857 0%, #0369a1 50%, #6d28d9 100%);
}

.ai-copilot-badge {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 800;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Drawer / Panel de Qʼuqʼumatz */
.ai-copilot-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 100000;
    display: flex;
    justify-content: flex-end;
    animation: fadeIn 0.2s ease-out;
}

.ai-copilot-drawer {
    width: 100%;
    max-width: 490px;
    height: 100%;
    background: #ffffff;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.ai-drawer-header {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 45%, #1e1b4b 100%);
    color: #ffffff;
    padding: 1.25rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
}

.ai-drawer-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #06b6d4, #f59e0b);
}

.ai-drawer-title-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-drawer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.ai-drawer-tools-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.ai-drawer-tools-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Chips de Prompts Rápidos */
.ai-quick-chips-bar {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: none;
}

.ai-quick-chips-bar::-webkit-scrollbar {
    display: none;
}

.ai-chip-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-heading);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ai-chip-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: #faf5ff;
}

/* Área de Mensajes del Chat */
.ai-messages-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    background: #f1f5f9;
}

.ai-msg-row {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    max-width: 92%;
}

.ai-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg-bubble {
    padding: 0.85rem 1.1rem;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

.ai-bubble-user {
    background: linear-gradient(135deg, #005a9c, #0284c7);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ai-bubble-assistant {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Tarjetas de Acción de la IA dentro del Chat */
.ai-action-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-top: 0.75rem;
}

.ai-card-event {
    border-left: 4px solid #7c3aed;
    background: #faf5ff;
}

.ai-card-material {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.ai-card-sutz {
    border-left: 4px solid #10b981;
    background: #ecfdf5;
}

/* Input y Barra de Envío */
.ai-chat-input-bar {
    padding: 0.9rem 1rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.ai-input-field {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ai-input-field:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.06);
}

/* Botón de acceso rápido Qʼuqʼumatz en Mobile Header (Desactivado según diseño) */
.mobile-copilot-btn {
    display: none !important;
}

.ai-drawer-drag-handle {
    display: none;
}

/* Optimización Responsive Móvil para Qʼuqʼumatz */
@media (max-width: 768px) {
    .ai-drawer-drag-handle {
        display: block;
        width: 44px;
        height: 5px;
        background: rgba(255, 255, 255, 0.45);
        border-radius: 4px;
        margin: 0.45rem auto 0.6rem auto;
    }

    /* En móvil, Qʼuqʼumatz está integrado de forma nativa en el Bottom Nav, ocultando el botón flotante para no estorbar */
    .ai-copilot-floating-btn {
        display: none !important;
    }

    .ai-copilot-backdrop {
        align-items: flex-end;
        background: rgba(15, 23, 42, 0.65);
    }

    .ai-copilot-drawer {
        max-width: 100%;
        width: 100%;
        height: 92vh;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }

    @keyframes slideInUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .ai-drawer-header {
        padding: 0.75rem 1.1rem 0.9rem 1.1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }

    .ai-drawer-header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .ai-quick-chips-bar {
        padding: 0.6rem 0.8rem;
        gap: 0.4rem;
        -webkit-overflow-scrolling: touch;
    }

    .ai-chip-btn {
        font-size: 0.74rem;
        padding: 0.4rem 0.75rem;
    }

    .ai-messages-thread {
        padding: 0.9rem 0.8rem;
        gap: 0.9rem;
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }

    .ai-msg-row {
        max-width: 100%;
    }

    .ai-msg-bubble {
        padding: 0.75rem 0.95rem;
        font-size: 0.85rem;
        word-break: break-word;
    }

    .ai-action-card {
        padding: 0.75rem;
        box-sizing: border-box;
        overflow: hidden;
    }

    .ai-action-card-actions {
        display: flex;
        gap: 0.45rem;
        flex-wrap: wrap;
        margin-top: 0.6rem;
    }

    .ai-action-card-actions .btn,
    .ai-action-card .btn {
        flex: 1 1 100%;
        width: 100%;
        padding: 0.45rem 0.65rem;
        font-size: 0.75rem;
        text-align: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .ai-chat-input-bar {
        padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 0.85rem;
        gap: 0.45rem;
    }

    .ai-input-field {
        padding: 0.65rem 1rem;
        font-size: 0.86rem;
    }

    .ai-send-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ==========================================================================
   11. MÓDULO 6: TAREAS, ASIGNACIONES & RETOS SUTZ (REDESIGN PREMIUM & DUAL)
   ========================================================================== */

/* 11.1 Hero Banner Contextual y Motivacional */
.tareas-hero-banner {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    color: #ffffff;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    overflow: hidden;
}

.tareas-hero-banner::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.tareas-hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.tareas-hero-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.hero-chip {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(8px);
}

.hero-chip-stem {
    background: rgba(124, 58, 237, 0.28);
    color: #e9d5ff;
    border: 1px solid rgba(192, 132, 252, 0.4);
}

.hero-chip-cycle {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.tareas-hero-title {
    font-size: 1.45rem;
    font-weight: 900;
    margin: 0 0 0.45rem 0;
    line-height: 1.25;
    color: #ffffff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.tareas-hero-subtitle {
    font-size: 0.86rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0;
}

.badge-role-tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    vertical-align: middle;
}

.badge-role-tag.student-pill {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.badge-role-tag.teacher-pill {
    background: #7c3aed;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
}

.tareas-hero-stats-pill {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-shrink: 0;
}

.hero-stats-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero-stats-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.hero-stats-val {
    display: block;
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
}

.hero-stats-lbl {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
}

.hero-stats-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

/* 11.2 Grid de KPIs Rápidos Rediseñados */
.tareas-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kpi-card-modern {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 1rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

.kpi-icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-card-total .kpi-icon-bubble {
    background: #eff6ff;
    color: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.kpi-card-sutz .kpi-icon-bubble {
    background: #faf5ff;
    color: #7c3aed;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.kpi-card-libre .kpi-icon-bubble {
    background: #ecfdf5;
    color: #059669;
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.12);
}

.kpi-card-completed .kpi-icon-bubble {
    background: #fffbeb;
    color: #d97706;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.15);
}

.kpi-data {
    flex: 1;
    overflow: hidden;
}

.kpi-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kpi-val {
    font-size: 1.45rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}

.kpi-subtag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

.subtag-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.subtag-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.subtag-green {
    background: #dcfce7;
    color: #15803d;
}

.subtag-amber {
    background: #fef3c7;
    color: #b45309;
}

/* 11.3 Barra de Filtros y Búsqueda Optimizada */
.assignments-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.9);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-tabs-group {
    display: flex;
    gap: 0.4rem;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-pill);
}

.filter-tab-btn {
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.filter-tab-btn:hover {
    color: #0f172a;
}

.filter-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.filter-tab-btn.filter-btn-libre.active {
    color: #2563eb;
}

.filter-tab-btn.filter-btn-sutz.active {
    color: #7c3aed;
}

.filter-controls-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.filter-select-wrap,
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    color: #64748b;
    transition: border-color 0.2s, background 0.2s;
}

.filter-select-wrap:focus-within,
.search-input-wrap:focus-within {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.search-input-wrap input {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    outline: none;
    width: 190px;
    color: #0f172a;
    font-weight: 500;
}

.btn-clear-search {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
}

.btn-clear-search:hover {
    color: #dc2626;
}

/* 11.4 Grid de Tarjetas de Tareas */
.assignments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1.15rem;
}

.assignment-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 15px -3px rgba(15, 23, 42, 0.05), 0 2px 6px -2px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.assignment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

.assignment-card-libre {
    border-top: 4px solid #2563eb;
}

.assignment-card-sutz {
    border-top: 4px solid #7c3aed;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 75px);
}

.assignment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.95rem 1.15rem 0.5rem 1.15rem;
    gap: 0.5rem;
}

.assignment-header-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.assignment-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.24rem 0.6rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-libre {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-sutz {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* Pastilla de Puntuación con Medalla */
.assignment-points-tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.assignment-points-tag .pts-icon {
    color: #eab308;
    font-size: 0.78rem;
}

.assignment-points-tag .pts-val {
    font-weight: 900;
    font-size: 1.05rem;
    line-height: 1;
}

.assignment-points-tag .pts-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
}

/* Chip de Tiempo Relativo */
.time-relative-chip {
    font-size: 0.66rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.chip-urgent {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.chip-soon {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.chip-normal {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.chip-overdue {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.chip-done {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Cuerpo de la Tarjeta */
.assignment-card-body {
    padding: 0.25rem 1.15rem 0.95rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.assignment-meta-top {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.assignment-subject-tag,
.assignment-grade-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.assignment-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    line-height: 1.35;
}

.assignment-desc {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ficha de Estado del Alumno */
.student-status-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.student-status-badge.badge-done {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.student-status-badge.badge-submitted {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.student-status-badge.badge-todo {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.status-badge-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-badge-info {
    flex: 1;
    overflow: hidden;
}

.status-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
}

.status-sub {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 1px;
}

/* Ficha de Guía PDF Adjunta */
.assignment-pdf-preview-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: background 0.15s, border-color 0.15s;
}

.assignment-pdf-preview-box:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pdf-icon-wrap {
    color: #ef4444;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.pdf-details {
    flex: 1;
    overflow: hidden;
}

.pdf-filename {
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-size {
    font-size: 0.66rem;
    color: #64748b;
}

.btn-pdf-download {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #2563eb;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-pdf-download:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Banner SUTZ en Ficha */
.assignment-sutz-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.sutz-badge-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    color: #fbbf24;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sutz-banner-info {
    flex: 1;
    overflow: hidden;
}

.sutz-banner-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #4c1d95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sutz-banner-sub {
    font-size: 0.66rem;
    color: #7e22ce;
    display: flex;
    gap: 0.6rem;
    margin-top: 1px;
}

/* Sección de Progreso de Entregas y Stack de Avatares */
.assignment-progress-section {
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid #f1f5f9;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.progress-track {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar.bar-libre {
    background: #2563eb;
    height: 100%;
}

.progress-bar.bar-sutz {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    height: 100%;
}

.progress-foot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.submissions-avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack-item {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    margin-left: -6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.avatar-stack-item:first-child {
    margin-left: 0;
}

.avatar-stack-item.item-libre {
    background: #2563eb;
    color: #ffffff;
}

.avatar-stack-item.item-sutz {
    background: #7c3aed;
    color: #ffffff;
}

.avatar-stack-item.item-extra {
    background: #64748b;
    color: #ffffff;
    font-size: 0.58rem;
}

.avatar-stack-empty {
    font-size: 0.68rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.min-score-hint {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}

.assignment-due-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.55rem;
}

.assignment-due-row.overdue {
    color: #dc2626;
}

/* 11.5 Acciones de la Tarjeta */
.assignment-card-actions {
    display: flex;
    gap: 0.45rem;
    padding: 0.75rem 1.15rem;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.assignment-card-actions .btn {
    min-height: 38px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.assignment-card-actions .btn:hover {
    transform: translateY(-1px);
}

.btn-sutz {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
    text-decoration: none;
}

.btn-sutz:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

.btn-sutz-sim {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #c4b5fd;
}

.btn-sutz-sim:hover {
    background: #6d28d9;
    color: #ffffff;
}

/* Dropzone PDF en Modal */
.pdf-dropzone {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-dropzone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.pdf-dropzone-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.pdf-dropzone-text {
    font-size: 0.85rem;
    color: var(--text-heading);
}

.pdf-dropzone-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.pdf-uploaded-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
}

.pdf-icon-badge {
    color: #16a34a;
    font-size: 1.4rem;
}

.pdf-info-text {
    flex: 1;
}

.pdf-info-text strong {
    display: block;
    font-size: 0.85rem;
    color: #166534;
}

.pdf-info-text span {
    font-size: 0.72rem;
    color: #15803d;
}

.btn-remove-pdf {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
}

/* Selector de Modalidad en Modal */
.modal-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mode-tab-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mode-tab-btn.active {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

#tabModeSutz.mode-tab-btn.active {
    border-color: #7c3aed;
    background: #faf5ff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
}

.tab-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tab-icon-sutz {
    background: #ede9fe;
    color: #7c3aed;
}

.tab-btn-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-heading);
}

.tab-btn-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.pane-badge-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #eff6ff;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: #1e40af;
}

.pane-badge-sutz {
    background: #faf5ff;
    border-left: 3px solid #7c3aed;
    color: #581c87;
}

/* Ficha Preview de Reto SUTZ */
.sutz-preview-card {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: var(--radius-md);
    padding: 0.95rem;
    margin-top: 0.75rem;
}

.sutz-preview-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sutz-preview-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: #7c3aed;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.sutz-preview-chips {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.chip-item {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: #f3e8ff;
    color: #6b21a8;
}

.chip-badge {
    background: #10b981;
    color: #ffffff;
}

.sutz-empty-hint {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

/* Modal Detalle de Entregas */
.modal-meta-strip {
    display: flex;
    gap: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.sutz-modal-automation-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #faf5ff;
    border: 1px solid #d8b4fe;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sutz-pulse-orb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #7c3aed;
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* Tabla de Estudiantes */
.submissions-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.table-submissions {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.table-submissions th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-weight: 800;
    color: var(--text-heading);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table-submissions td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.student-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.student-avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}

.student-meta {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
}

.badge-pending {
    background: #f1f5f9;
    color: #64748b;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.score-input {
    width: 60px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    outline: none;
}

.score-input:focus {
    border-color: var(--primary);
}

.actions-cell {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* Campana y Dropdown de Notificaciones Docente */
.topbar-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.bell-ring {
    animation: bellShake 0.7s ease;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(15deg); }
    40%, 80% { transform: rotate(-15deg); }
}

.teacher-notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
}

.notif-header-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-heading);
}

.notif-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.unread {
    background: #faf5ff;
}

.notif-icon-col {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.notif-icon-col.icon-sutz {
    background: #ede9fe;
    color: #7c3aed;
}

.notif-content-col {
    flex: 1;
}

.notif-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-heading);
}

.notif-desc {
    font-size: 0.72rem;
    color: var(--text-body);
    margin-top: 2px;
    line-height: 1.35;
}

.notif-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.notif-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.notif-empty-state i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* Toast Global */
.app-toast-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.app-toast-alert.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.app-toast-alert i {
    color: #fbbf24;
    font-size: 1.1rem;
}

/* 11.6 Optimización Responsive Web & Móvil */
@media (max-width: 1024px) {
    .tareas-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tareas-hero-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .tareas-hero-stats-pill {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .tareas-hero-banner {
        padding: 1.15rem 1.15rem;
        margin-bottom: 1rem;
        border-radius: 14px;
    }

    .tareas-hero-title {
        font-size: 1.2rem;
    }

    .tareas-hero-subtitle {
        font-size: 0.8rem;
    }

    .tareas-hero-stats-pill {
        padding: 0.65rem 0.95rem;
        gap: 0.85rem;
    }

    .hero-stats-val {
        font-size: 1rem;
    }

    .hero-stats-lbl {
        font-size: 0.62rem;
    }

    .tareas-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .kpi-card-modern {
        padding: 0.75rem 0.85rem;
        border-radius: 12px;
        gap: 0.65rem;
    }

    .kpi-icon-bubble {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
        border-radius: 10px;
    }

    .kpi-val {
        font-size: 1.15rem;
    }

    .kpi-label {
        font-size: 0.64rem;
    }

    .kpi-subtag {
        display: none;
    }

    .assignments-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.65rem 0.85rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .filter-tabs-group {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 2px;
        scrollbar-width: none;
    }

    .filter-tabs-group::-webkit-scrollbar {
        display: none;
    }

    .filter-tab-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.76rem;
    }

    .filter-controls-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-select-wrap,
    .search-input-wrap {
        width: 100%;
    }

    .search-input-wrap input {
        width: 100%;
    }

    .assignments-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .assignment-card {
        border-radius: 14px;
    }

    .modal-mode-selector {
        grid-template-columns: 1fr;
    }

    .assignment-card-actions {
        padding: 0.65rem 0.95rem;
    }
}

/* ==========================================================================
   12. SISTEMA DE ROLES (RBAC: MAESTRO vs ALUMNO) Y TOPBAR SWITCHER
   ========================================================================== */
.role-switcher-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.role-segmented-control {
    display: flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.role-btn {
    border: none;
    background: transparent;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.role-btn:hover {
    color: #0f172a;
}

.role-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.role-btn:nth-child(2).active {
    color: #7c3aed;
}

.role-btn-staff.active {
    background: #0891b2 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.35) !important;
}

.role-btn-superuser.active {
    background: #0f172a !important;
    color: #38bdf8 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.4) !important;
}

.student-select-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
}

.student-session-select {
    border: none;
    background: transparent;
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    cursor: pointer;
}

/* Badges de estado en tareas del estudiante */
.student-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.student-status-badge.badge-done {
    background: #ecfdf5;
    color: #065f46;
    border-left: 3px solid #10b981;
}

.student-status-badge.badge-submitted {
    background: #eff6ff;
    color: #1e40af;
    border-left: 3px solid #2563eb;
}

.student-status-badge.badge-todo {
    background: #fffbeb;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

/* ==========================================================================
   ESCÁNER UNIVERSAL OMNIPRESENTE & HUB DE ACCIÓN DIRECTA 360°
   ========================================================================== */

/* Botón Flotante (FAB) Desactivado para evitar duplicidad con la barra fija */
.universal-scanner-fab {
    display: none !important;
}

.live-student-result-card:hover {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    transform: translateX(2px);
}

.universal-scanner-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.55);
}

.universal-scanner-fab:active {
    transform: scale(0.95);
}

.scanner-fab-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-fab-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: scannerPulse 2s infinite;
}

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

.scanner-fab-tooltip {
    position: absolute;
    right: 70px;
    background: #0f172a;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.universal-scanner-fab:hover .scanner-fab-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Modal del Escáner Universal */
.universal-scanner-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.2s ease-out;
}

.universal-scanner-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scanner-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.scanner-card-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.scanner-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.scanner-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.scanner-card-sub {
    font-size: 0.74rem;
    color: #64748b;
    margin: 0.15rem 0 0 0;
}

.scanner-close-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}

.scanner-close-btn:hover {
    color: #0f172a;
}

/* Viewport de Cámara */
.scanner-viewport-wrap {
    position: relative;
    width: 100%;
    height: 250px;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.universal-qr-reader-box {
    width: 100% !important;
    height: 100% !important;
}

.universal-qr-reader-box video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Retícula de Enfoque */
.scanner-reticle {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 2;
}

.reticle-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #38bdf8;
    border-style: solid;
}

.reticle-corner.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 8px; }
.reticle-corner.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 8px; }
.reticle-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 8px; }
.reticle-corner.bottom-right { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 8px; }

.reticle-scan-line {
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, transparent);
    box-shadow: 0 0 8px #38bdf8;
    animation: scanAnimation 2s infinite ease-in-out;
}

@keyframes scanAnimation {
    0% { top: 10px; opacity: 0.2; }
    50% { top: 180px; opacity: 1; }
    100% { top: 10px; opacity: 0.2; }
}

.scanner-camera-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 3;
}

.btn-camera-ctrl {
    background: rgba(15, 23, 42, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

/* Entrada Manual */
.scanner-manual-input-box {
    padding: 0.8rem 1.2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.manual-input-wrap {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.2rem 0.4rem 0.2rem 0.8rem;
    transition: border-color 0.15s;
}

.manual-input-wrap:focus-within {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.manual-input-wrap .input-icon {
    color: #94a3b8;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.manual-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    padding: 0.45rem 0;
}

.btn-manual-submit {
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Chips de Simulación Rápida */
.scanner-quick-chips-wrap {
    padding: 0.9rem 1.2rem 1.2rem;
}

.chips-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    display: block;
    margin-bottom: 0.5rem;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.scanner-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.scanner-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.scanner-chip.student-chip {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.scanner-chip.teacher-chip {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   HUB DE ACCIÓN DIRECTA 360° (DIRECT ACTION DECK)
   ========================================================================== */
.action-deck-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.2s ease-out;
}

.action-deck-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    padding: 1.4rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-deck-close {
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
}

.action-deck-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
}

.deck-student-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.deck-student-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0284c7;
}

.deck-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
}

.deck-status-dot.solvente { background: #10b981; }
.deck-status-dot.mora { background: #ef4444; }

.deck-student-meta {
    flex: 1;
    min-width: 0;
}

.deck-badge-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.deck-student-id {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

.deck-student-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deck-student-sub {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0.2rem 0 0 0;
}

/* Cuadrícula de Acciones 1-Tap */
.deck-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1rem 0;
}

.deck-action-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.deck-action-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.action-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.action-btn-texts {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.action-btn-texts strong {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.action-btn-texts span {
    font-size: 0.74rem;
    color: #64748b;
}

.action-arrow {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.deck-footer-row {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f1f5f9;
}

.btn-deck-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-deck-link:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-deck-link.btn-sos-deck {
    background: #fff1f2;
    color: #be123c;
}

.btn-deck-link.btn-sos-deck:hover {
    background: #ffe4e6;
}

/* ==========================================================================
   TELEGRAM MAGIC AUTH & MODAL OTP
   ========================================================================== */

/* Toast Simulador In-App de Telegram */
.telegram-sim-toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100001;
    background: #1e293b;
    border: 1px solid #38bdf8;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    width: 330px;
    box-shadow: 0 20px 35px -5px rgba(2, 132, 199, 0.4);
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.telegram-sim-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.telegram-toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.telegram-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.telegram-brand i {
    color: #38bdf8;
    font-size: 1.6rem;
}

.telegram-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
}

.telegram-sub {
    font-size: 0.68rem;
    color: #94a3b8;
}

.telegram-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
}

.telegram-code-pill {
    background: #0f172a;
    border: 1.5px dashed #38bdf8;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
}

.telegram-code-pill:hover {
    background: #1e293b;
}

.otp-digits {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #38bdf8;
}

.copy-icon {
    color: #94a3b8;
    font-size: 0.95rem;
}

.btn-auto-fill-otp {
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

/* Modal OTP Fintech 6 Dígitos */
.telegram-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.2s ease-out;
}

.telegram-modal-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 1.8rem 1.6rem;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.telegram-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
}

.telegram-modal-badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 0.8rem;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
}

.telegram-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.3rem 0;
}

.telegram-modal-sub {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 1.4rem 0;
    line-height: 1.45;
}

/* Grid de los 6 Inputs OTP */
.otp-inputs-grid {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.otp-digit-input {
    width: 46px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Share Tech Mono', monospace;
    color: #0f172a;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    transition: all 0.15s ease;
}

.otp-digit-input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
    transform: scale(1.05);
}

.otp-inputs-grid.shake-error {
    animation: shakeAnim 0.5s ease-in-out;
}

@keyframes shakeAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

.otp-feedback-msg {
    min-height: 22px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.otp-feedback-msg.info { color: #0284c7; }
.otp-feedback-msg.success { color: #059669; }
.otp-feedback-msg.error { color: #dc2626; }

.btn-telegram-primary {
    width: 100%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-telegram-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
}

.otp-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #64748b;
}

.btn-resend-link {
    background: transparent;
    border: none;
    color: #0284c7;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* Toast Flotante Universal */
.floating-scanner-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: white;
    padding: 0.8rem 1.4rem;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    z-index: 100003;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.floating-scanner-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Botón de Cámara para Avatar Oficial del Estudiante */
.student-avatar-camera-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    z-index: 5;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.student-avatar-camera-btn:hover {
    transform: scale(1.12);
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.6);
}

.student-avatar-camera-btn:active {
    transform: scale(0.95);
}

/* Modal de Ficha Médica Oficial SOSQR (Solo Lectura) */
.sosqr-medical-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 19, 32, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.25s ease-out;
}

.sosqr-medical-modal-card {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(226, 232, 240, 0.8);
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sosqr-medical-header {
    background: linear-gradient(135deg, #0b1320 0%, #1e293b 100%);
    padding: 1.4rem 1.6rem;
    border-radius: 24px 24px 0 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom: 3px solid #ec4899;
}

.sosqr-medical-title-box {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.sosqr-medical-shield-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(236, 72, 153, 0.18);
    border: 1px solid rgba(236, 72, 153, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #f472b6;
}

.sosqr-medical-badge-readonly {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 3px;
}

.sosqr-medical-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sosqr-medical-close-btn:hover {
    background: rgba(239, 68, 68, 0.8);
}

.sosqr-medical-body {
    padding: 1.5rem 1.6rem;
}

.sosqr-medical-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

@media (max-width: 500px) {
    .sosqr-medical-grid {
        grid-template-columns: 1fr;
    }
}

.sosqr-medical-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 1.1rem;
}

.sosqr-medical-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.sosqr-medical-card-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.sosqr-blood-type-val {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ef4444;
    letter-spacing: 0.05em;
}

.sosqr-pill-alert {
    display: inline-block;
    background: #fee2e2;
    color: #b91c1c;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.sosqr-medical-instructions-box {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
}

.sosqr-contacts-box {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.2rem;
    margin-top: 1.2rem;
}

.sosqr-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    margin-top: 0.6rem;
}

.sosqr-modal-footer {
    display: flex;
    gap: 0.8rem;
    padding: 1.2rem 1.6rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 24px 24px;
}

/* Panel de Filtrado Docente (Cockpit de Aula & Evaluación) */
.teacher-filter-cockpit {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.25rem 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #ec4899;
    animation: fadeInModal 0.28s ease-out;
}

.teacher-cockpit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-cockpit-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.teacher-cockpit-title i {
    font-size: 1.2rem;
    color: #ec4899;
    background: rgba(236, 72, 153, 0.12);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teacher-cockpit-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.teacher-cockpit-title p {
    margin: 2px 0 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.teacher-cockpit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(236, 72, 153, 0.1);
    color: #be185d;
    border: 1px solid rgba(236, 72, 153, 0.3);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}

.teacher-cockpit-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.4fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .teacher-cockpit-grid {
        grid-template-columns: 1fr;
    }
}

.cockpit-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cockpit-filter-group label {
    font-size: 0.76rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cockpit-filter-group label i {
    color: #ec4899;
}

.cockpit-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.cockpit-select:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.cockpit-select-student {
    background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
    border-color: #f472b6;
    color: #831843;
}

/* ==========================================================================
   LIMPIEZA DE HEADERS (ESPACIO REDUNDANTE DE COLEGIO / ESTUDIANTE)
   ========================================================================== */
.topbar .institution-pill:not(.preserve-pill) {
    display: none !important;
}

/* ==========================================================================
   CONSOLA DE MONITOREO Y MANTENIMIENTO DEL SUPER USUARIO (DEBAJO DEL HEADER)
   ========================================================================== */
.superuser-monitor-box {
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.superuser-monitor-inner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    color: #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(56, 189, 248, 0.15);
}

.superuser-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.15rem;
}

.superuser-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.superuser-badge-role {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pulse-dot-live {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.superuser-badge-auto {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.superuser-badge-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
}

.superuser-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-superuser-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 0.42rem 0.85rem;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
}

.btn-superuser-tool:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-superuser-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.btn-superuser-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.superuser-monitor-grid {
    display: grid;
    grid-template-columns: 1.3fr 1.1fr 1.6fr;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .superuser-monitor-grid {
        grid-template-columns: 1fr;
    }
}

.superuser-cell {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.superuser-cell-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.superuser-cell-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.superuser-select-wrapper {
    position: relative;
    width: 100%;
}

.superuser-school-picker {
    width: 100%;
    background: #1e293b;
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.superuser-school-picker:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.superuser-meta-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.superuser-meta-tag code {
    background: rgba(255, 255, 255, 0.09);
    padding: 1px 5px;
    border-radius: 4px;
    color: #38bdf8;
    font-family: monospace;
}

.superuser-module-display {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.superuser-auto-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 800;
    color: #34d399;
}

.superuser-philosophy-note {
    font-size: 0.76rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
}

/* ==========================================================================
   MÓDULO 7: GESTIÓN ADMINISTRATIVA, HORARIOS & PLANIFICACIÓN ESCOLAR
   ========================================================================== */
.admin-tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.admin-tab-btn:hover {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.05);
}

.admin-tab-btn.active {
    color: #0891b2;
    border-bottom-color: #0891b2;
    background: rgba(8, 145, 178, 0.08);
}

.admin-tab-pane {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.admin-tab-pane.active {
    display: block;
}

/* Matriz Semanal de Horarios (TimeTable) */
.timetable-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.timetable-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
}

.timetable-table th {
    background: #f8fafc;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
}

.timetable-table th:first-child {
    width: 130px;
    position: sticky;
    left: 0;
    background: #f1f5f9;
    z-index: 2;
}

.timetable-table th.day-header-today {
    background: #ecfeff;
    color: #0891b2;
    border-bottom-color: #0891b2;
}

.timetable-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    vertical-align: top;
    height: 96px;
    background: #ffffff;
    transition: background 0.15s ease;
}

.timetable-table td.period-label-col {
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 2px solid var(--border-color);
}

.timetable-table tr.break-row td {
    background: #f8fafc;
    height: 48px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    border-top: 1px dashed #cbd5e1;
    border-bottom: 1px dashed #cbd5e1;
}

/* Tarjeta dentro de celda de Horario */
.timetable-slot-card {
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.65rem;
    border-left: 4px solid #0891b2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
}

.timetable-slot-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.timetable-slot-subject {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.timetable-slot-teacher {
    font-size: 0.74rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.timetable-slot-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.7rem;
    color: #64748b;
}

.timetable-slot-room {
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}

.timetable-free-slot {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: rgba(248, 250, 252, 0.5);
}

.timetable-free-slot:hover {
    border-color: #0891b2;
    color: #0891b2;
    background: rgba(8, 145, 178, 0.06);
}

/* Badges de Cursos y Áreas */
.course-area-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
}

.course-area-stem { background: #eef2ff; color: #4338ca; }
.course-area-math { background: #eff6ff; color: #1d4ed8; }
.course-area-lang { background: #fdf2f8; color: #be185d; }
.course-area-nat { background: #ecfdf5; color: #047857; }
.course-area-soc { background: #fffbeb; color: #b45309; }
.course-area-art { background: #faf5ff; color: #6d28d9; }

/* Tarjetas de Docentes & Asignaciones */
.teacher-workload-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.teacher-workload-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Timeline de Actividades Generales */
.admin-activity-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.2rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.85rem;
    transition: all 0.2s ease;
    align-items: flex-start;
}

.admin-activity-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.admin-activity-datebox {
    min-width: 64px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    flex-shrink: 0;
}

.admin-activity-day {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.admin-activity-month {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 0.2rem;
}

/* ==========================================================================
   BOTÓN DE AYUDA UNIVERSAL EN EL HEADER & MODAL DE GUÍA CONTEXTUAL
   ========================================================================== */
.btn-topbar-help {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #ffffff;
    color: #4338ca;
    border: 1px solid #e0e7ff;
    padding: 0.42rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-right: 0.4rem;
    transition: all 0.18s ease;
}

.btn-topbar-help:hover {
    background: #f5f3ff;
    border-color: #c7d2fe;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.16);
    transform: translateY(-1px);
}

.btn-topbar-help i {
    font-size: 0.95rem;
    color: #6366f1;
}

.topbar-help-label {
    letter-spacing: 0.2px;
}

.global-help-modal-card {
    max-width: 620px;
    width: 95%;
    border-radius: 18px;
    padding: 1.8rem;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.global-help-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.1rem;
    flex-shrink: 0;
}

.global-help-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.global-help-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid transparent;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.global-help-subheading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.global-help-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
}

.global-help-code {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.global-help-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}

.global-help-close-btn {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.global-help-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.global-help-body {
    overflow-y: auto;
    padding: 1.2rem 0.2rem 1.2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.global-help-purpose-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem;
    border-left: 4px solid #6366f1;
}

.global-help-section-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.global-help-purpose-text {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #1e293b;
    margin: 0;
}

.global-help-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.global-help-feature-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.global-help-feature-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.feature-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.feature-card-text strong {
    display: block;
    font-size: 0.84rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.feature-card-text p {
    font-size: 0.77rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

.global-help-roles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.help-role-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.role-item-badge {
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.role-teacher-item .role-item-badge { color: #d97706; }
.role-staff-item .role-item-badge { color: #4f46e5; }
.role-student-item .role-item-badge { color: #0284c7; }

.help-role-item p {
    font-size: 0.8rem;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

.global-help-tip-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tip-icon-circle {
    width: 32px;
    height: 32px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.tip-content {
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.45;
}

.global-help-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.btn-help-understand {
    padding: 0.55rem 1.4rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: all 0.15s ease;
    color: #ffffff;
    cursor: pointer;
}

.btn-help-understand:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* ==========================================================================
   BARRA DE CONTROLES DEL CALENDARIO & MENÚ DESPLEGABLE DE CATEGORÍAS
   ========================================================================== */
.calendar-controls-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    box-shadow: var(--shadow-sm);
}

.calendar-category-dropdown-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

.category-dropdown-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.custom-category-dropdown {
    position: relative;
    min-width: 250px;
}

.custom-category-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.95rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.18s ease;
}

.custom-category-trigger:hover {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.trigger-selected-info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
}

.category-indicator-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.trigger-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trigger-chevron {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-category-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 290px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    padding: 0.4rem;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.category-option-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.category-option-item:hover {
    background: #f8fafc;
}

.category-option-item.active {
    background: #f5f3ff;
}

.category-option-item .option-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.category-option-item .option-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.category-option-item .option-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

.category-option-item.active .option-title {
    color: #6d28d9;
}

.category-option-item .option-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-option-item .option-check-icon {
    font-size: 0.8rem;
    color: #7c3aed;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: auto;
}

.category-option-item.active .option-check-icon {
    opacity: 1;
}

/* ==========================================================================
   MODAL REDISEÑADO: NUEVA ACTIVIDAD ESCOLAR (PREMIUM & INTEGRADO)
   ========================================================================== */
.activity-modal-card {
    max-width: 620px;
    width: 95%;
    border-radius: 20px;
    padding: 1.8rem;
    background: #ffffff;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(124, 58, 237, 0.12);
    border: none;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.activity-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.activity-modal-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-modal-icon-glow {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
    flex-shrink: 0;
}

.activity-modal-tag {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.activity-modal-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}

.activity-modal-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0.2rem 0 0 0;
}

.activity-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.activity-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.activity-modal-form {
    overflow-y: auto;
    padding: 1.1rem 0.3rem 0.8rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.form-group-activity {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.activity-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.activity-required {
    color: #ef4444;
    font-weight: 800;
}

.activity-input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.activity-input-icon-wrap .input-icon {
    position: absolute;
    left: 0.85rem;
    color: #94a3b8;
    font-size: 0.88rem;
    pointer-events: none;
}

.activity-input {
    width: 100%;
    padding: 0.62rem 0.85rem 0.62rem 2.3rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.86rem;
    color: #0f172a;
    font-family: inherit;
    transition: all 0.18s ease;
}

.activity-input:focus {
    background: #ffffff;
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(124, 58, 237, 0.12);
}

.activity-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #0f172a;
    font-family: inherit;
    resize: vertical;
    transition: all 0.18s ease;
}

.activity-textarea:focus {
    background: #ffffff;
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(124, 58, 237, 0.12);
}

/* Selector Visual de Categorías */
.activity-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.activity-category-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    transition: all 0.16s ease;
}

.activity-category-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    background: #ffffff;
}

.activity-category-card.active {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
}

.category-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.category-card-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-card-desc {
    font-size: 0.66rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-check-mark {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.75rem;
    color: #7c3aed;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.activity-category-card.active .category-check-mark {
    opacity: 1;
    transform: scale(1);
}

/* Fechas y Horarios */
.activity-dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.time-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
}

.activity-checkbox-wrap input {
    cursor: pointer;
    accent-color: #7c3aed;
}

/* Audiencia */
.activity-audience-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.audience-pill-item {
    cursor: pointer;
}

.audience-pill-item .audience-checkbox {
    display: none;
}

.audience-pill-content {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.8rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    transition: all 0.15s ease;
}

.audience-pill-item .audience-checkbox:checked + .audience-pill-content {
    background: #f5f3ff;
    border-color: #7c3aed;
    color: #6d28d9;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.12);
}

/* Vista Previa */
.activity-preview-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.preview-box-label {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.preview-chip-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.preview-chip-time {
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

/* Modal Footer */
.activity-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.btn-save-activity {
    padding: 0.58rem 1.4rem;
    font-size: 0.86rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-save-activity:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.42);
}

/* Responsividad en Móvil */
@media (max-width: 640px) {
    .activity-category-grid {
        grid-template-columns: 1fr 1fr;
    }
    .activity-dates-grid {
        grid-template-columns: 1fr;
    }
    .calendar-controls-bar {
        flex-direction: row;
        align-items: center;
        padding: 0.45rem 0.65rem;
        margin-bottom: 0.75rem;
    }
    .calendar-category-dropdown-wrap {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .custom-category-dropdown {
        flex: 1;
        width: auto;
    }
    .custom-category-menu {
        width: 100%;
        min-width: 100%;
    }
    .global-help-features-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   WIDGET DE SESIÓN DE USUARIO & CONTROL DE ROLES (TOPBAR)
   ========================================================================== */
.topbar-user-session-widget {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-session-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.user-session-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.user-session-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e2e8f0;
    background: #f1f5f9;
}

.user-session-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.15;
}

.user-session-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1e293b;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-session-role {
    font-size: 0.66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
}

.user-session-arrow {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

/* Agrupador del Widget de Usuario y Botón de Apagar */
.user-session-widget-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* Botón de Apagar / Sesión en la Cabecera */
.btn-topbar-power {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1.5px solid #f87171;
    color: #dc2626;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
    flex-shrink: 0;
}

.btn-topbar-power:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: #ffffff;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-topbar-power:active {
    transform: translateY(0) scale(0.96);
}

/* Dropdown Desplegable de Sesión */
.user-session-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    z-index: 1050;
    overflow: hidden;
    animation: fadeInDown 0.18s ease-out;
}

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

.user-dropdown-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-dropdown-avatar-wrap img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-dropdown-user-details {
    flex: 1;
    overflow: hidden;
}

.user-dropdown-user-details strong {
    font-size: 0.85rem;
    color: #0f172a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.user-dropdown-close-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.user-dropdown-body {
    padding: 0.85rem 1rem 1rem 1rem;
}

.user-dropdown-school {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    padding: 6px 9px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.75rem 0;
}

.user-dropdown-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Lista de cambio de sesión: Alumnos, Maestros, Administrador */
.user-role-quick-switch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.role-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    width: 100%;
}

.role-switch-row:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.role-switch-row.active {
    background: #f0fdf4;
    border-color: #86efac;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.12);
}

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

.role-switch-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
}

.role-switch-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.role-switch-desc {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-switch-active-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #15803d;
    background: #dcfce7;
    padding: 2px 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.role-switch-arrow {
    font-size: 0.72rem;
    color: #cbd5e1;
    flex-shrink: 0;
}

.user-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-dropdown-logout-btn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.15s ease;
    width: 100%;
}

.user-dropdown-logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.user-dropdown-link {
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.user-dropdown-link:hover {
    background: #f8fafc;
}

/* Botón de Apagar / Sesión en el Menú Lateral */
.sidebar-power-section {
    margin-top: auto;
    padding: 0.6rem 0.6rem 0.2rem 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item-power {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: #fca5a5 !important;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    cursor: pointer;
}

.nav-item-power:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ffffff !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Elevación de Topbar y ocultamiento de barra inferior cuando el menú de sesión está activo */
body.user-session-dropdown-open .topbar {
    z-index: 10060 !important;
}

body.user-session-dropdown-open .mobile-bottom-nav {
    display: none !important;
}

/* Comportamiento Móvil para el Menú de Sesión */
@media (max-width: 1024px) {
    .btn-topbar-power {
        display: none !important;
    }

    .user-session-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45) !important;
        z-index: 10050 !important;
        animation: slideUpMobile 0.22s ease-out;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 15px)) !important;
    }

    @keyframes slideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .user-session-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 10040;
    }
}

