/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLE DEFINITIONS
   ========================================================================== */
:root {
    /* Color Palette */
    --primary: #6366f1;          /* Indigo Electric */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --secondary: #06b6d4;        /* Vibrant Cyan */
    --secondary-hover: #0891b2;
    --secondary-light: rgba(6, 182, 212, 0.12);
    
    --success: #10b981;          /* Emerald Green */
    --success-light: rgba(16, 185, 129, 0.12);
    
    --warning: #f59e0b;          /* Amber Warning */
    --warning-light: rgba(245, 158, 11, 0.12);
    
    --danger: #ef4444;           /* Crimson Red */
    --danger-light: rgba(239, 68, 68, 0.12);
    
    /* Neutral / Dark Colors */
    --bg-dark: #08090d;
    --bg-card: rgba(18, 20, 30, 0.65);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f8fafc;     /* Slate 50 */
    --text-secondary: #94a3b8;   /* Slate 400 */
    --text-muted: #64748b;       /* Slate 500 */
    
    /* Decorative Colors */
    --purple-grad: #a855f7;
    --blue-grad: #3b82f6;
    
    /* Layout & Styling */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font stacks */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   LIGHT THEME OVERRIDES
   ========================================================================== */
body.light-theme {
    --bg-dark: #f0f4f8;          /* Light grayish blue background */
    --bg-card: rgba(255, 255, 255, 0.85); /* Light glass background */
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --text-primary: #1e293b;     /* Dark slate for main text */
    --text-secondary: #475569;   /* Medium slate for secondary text */
    --text-muted: #64748b;       /* Lighter slate for muted text */
    
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
}

body.light-theme ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}
body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}
body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Styled Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   AESTHETIC DECORATIVE BACKGROUND MESH
   ========================================================================== */
.bg-gradient-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.mesh-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.sphere-1 {
    top: -10%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: var(--primary);
    animation: pulseSpheres 15s infinite alternate;
}

.sphere-2 {
    bottom: 10%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: var(--secondary);
    animation: pulseSpheres 20s infinite alternate-reverse;
}

.sphere-3 {
    top: 40%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--purple-grad);
    opacity: 0.08;
}

@keyframes pulseSpheres {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.15); }
}

/* ==========================================================================
   GLASSMORPHISM BASE CLASS
   ========================================================================== */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   LAYOUT STRUCTURES
   ========================================================================== */
.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Transitions helper classes */
.hidden {
    display: none !important;
}

/* ==========================================================================
   SECTION 1: UPLOAD SCREEN STYLES
   ========================================================================== */
.upload-screen {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.upload-card {
    width: 100%;
    max-width: 640px;
    padding: 48px;
    text-align: center;
    border-radius: var(--radius-xl);
}

.upload-icon-container {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--text-primary);
}

.upload-card h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.file-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    transition: transform var(--transition-normal), color var(--transition-normal);
}

.drop-zone:hover .file-icon, .drop-zone.dragover .file-icon {
    transform: translateY(-5px);
    color: var(--primary);
}

.drop-text {
    font-size: 15px;
    color: var(--text-secondary);
}

.btn-browse {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.drop-zone:hover .btn-browse {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-status {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#status-message {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.feature-item svg {
    width: 16px;
    height: 16px;
    color: var(--success);
}

/* ==========================================================================
   SECTION 2: DASHBOARD SCREEN STYLES
   ========================================================================== */
.dashboard-screen {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn var(--transition-normal);
}

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

/* APP HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--primary);
}

.app-logo h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.file-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    margin-top: 2px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
    padding: 8px 14px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
}

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

/* FILTERS PANEL */
.filters-panel {
    padding: 20px 24px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label svg {
    width: 14px;
    height: 14px;
}

.filter-select, .filter-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    width: 100%;
    outline: none;
    transition: all var(--transition-fast);
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-group {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.clear-search:hover {
    color: var(--text-primary);
}

.filters-actions {
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-filters-pill {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* KPI CARDS GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.kpi-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.kpi-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.kpi-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

/* KPI Theme Colors */
.kpi-icon-wrapper.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }
.kpi-icon-wrapper.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.2); }
.kpi-icon-wrapper.teal { background: rgba(6, 182, 212, 0.12); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.2); }
.kpi-icon-wrapper.red { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

.kpi-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-sub-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.purple-bg { background: #a855f7; }
.teal-bg { background: #06b6d4; }

.kpi-subtext {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   CHARTS SECTION
   ========================================================================== */
.charts-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .charts-section-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

/* ==========================================================================
   TABLES & GRIDS (DASHBOARD DETAILS)
   ========================================================================== */
.table-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-card-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

.header-table-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rows-count-text {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 14px;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

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

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

.data-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
}

/* Super header and Sub header styles */
.header-super th {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 2px solid var(--border-color) !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-sub th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.bg-parcial-1 { background: rgba(99, 102, 241, 0.03) !important; color: #818cf8 !important; }
.bg-parcial-2 { background: rgba(168, 85, 247, 0.03) !important; color: #c084fc !important; }
.bg-parcial-3 { background: rgba(244, 63, 94, 0.03) !important; color: #fb7185 !important; }
.bg-total { background: rgba(6, 182, 212, 0.03) !important; color: #22d3ee !important; }

.divider-right {
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr.row-expanded-detail:hover {
    background-color: transparent; /* Don't hover the subtable container */
}

/* Sorting indicators */
.sortable {
    cursor: pointer;
}
.sortable:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}
.sort-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    margin-left: 2px;
    color: var(--text-muted);
}
.sortable.active-sort {
    color: var(--primary) !important;
}
.sortable.active-sort svg {
    color: var(--primary);
}

/* Specific styling for alignment & values */
.text-center { text-align: center; }
.text-right { text-align: right; }

.badge-grade {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    min-width: 36px;
}

.badge-grade.pass { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-grade.fail { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-grade.empty { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }

.badge-attendance {
    font-weight: 500;
}
.badge-attendance.good { color: #34d399; }
.badge-attendance.warning { color: #fbbf24; }
.badge-attendance.danger { color: #f87171; }

.badge-reprobadas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 11px;
}
.badge-reprobadas.safe { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); }
.badge-reprobadas.failed-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ROW EXPANSION & SUBTABLES */
.col-expand-trigger {
    width: 40px;
    text-align: center;
    cursor: pointer;
}

.btn-expand {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

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

.btn-expand.expanded {
    transform: rotate(90deg);
    color: var(--primary);
}

.row-expanded-detail td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border-color);
}

.detail-panel {
    background: rgba(99, 102, 241, 0.02);
    border-left: 3px solid var(--primary);
    padding: 20px 24px;
    overflow-x: auto;
}

.detail-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-title svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.detail-table th, .detail-table td {
    padding: 8px 14px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* PAGINATION (Hidden as per single-view continuous list requirement) */
.pagination-container {
    display: none !important;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-num:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

/* ==========================================================================
   ANIMATION TRANSITION UTILITIES
   ========================================================================== */
.animate-up {
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* ==========================================================================
   DYNAMIC COLUMN HIDING & COMPACT TOGGLE SWITCH
   ========================================================================== */
.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
    user-select: none;
}

.toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.toggle-container:hover .toggle-label {
    color: var(--text-primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: var(--primary);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Hide Parcial 1 and Parcial 2 Columns Rule */
.hide-parciales .col-parcial {
    display: none !important;
}

/* ==========================================================================
   SECTION 0: PREMIUM LOGIN SCREEN STYLES
   ========================================================================== */
.login-screen {
    width: 100%;
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    animation: fadeIn var(--transition-normal);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

/* Efecto de borde brillante dinámico */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--purple-grad));
}

.login-logo-container {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.2);
    transition: transform var(--transition-normal);
}

.login-card:hover .login-logo-container {
    transform: translateY(-3px) rotate(5deg);
    border-color: var(--primary);
}

.login-logo-icon {
    width: 30px;
    height: 30px;
    color: var(--primary);
}

.login-card h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-form {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: all var(--transition-normal);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Botón ocultar/mostrar contraseña */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

.btn-toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Botón Login Premium */
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.2px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.4);
    margin-top: 10px;
    transition: all var(--transition-normal);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(99, 102, 241, 0.6);
    filter: brightness(1.05);
}

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

.btn-login svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.btn-login:hover svg {
    transform: translateX(4px);
}

/* Mensajes de error en Login */
.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn var(--transition-fast);
}

.login-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Animación Shake (Error de Login) */
.shake {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ==========================================================================
   USER PROFILE IN HEADER
   ========================================================================== */
.user-profile-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 4px 6px 4px 12px;
    border-radius: 30px;
    margin-right: 10px;
    transition: all var(--transition-fast);
}

.user-profile-container:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.user-avatar svg {
    width: 12px;
    height: 12px;
    color: var(--primary);
}

.user-display-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    width: 26px;
    height: 26px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted) !important;
    border-color: transparent !important;
    background: transparent !important;
    transition: all var(--transition-fast) !important;
}

.btn-logout:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

.btn-logout svg {
    width: 14px;
    height: 14px;
}

