:root {
    /* Premium Design System */
    --bg-color: #f0f2f8;
    --bg-gradient: linear-gradient(135deg, #f0f2f8 0%, #e8eaf6 50%, #f5f0ff 100%);

    --surface-color: #ffffff;
    --surface-elevated: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.72);
    --surface-hover: rgba(255, 255, 255, 0.9);

    --primary-color: #5b4cff;
    --primary-light: #8b7dff;
    --primary-dark: #4338ca;
    --primary-gradient: linear-gradient(135deg, #5b4cff 0%, #8b5cf6 50%, #a855f7 100%);
    --primary-gradient-soft: linear-gradient(135deg, rgba(91, 76, 255, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    --primary-glow: 0 4px 24px rgba(91, 76, 255, 0.25);
    --primary-hover: #4338ca;

    --success-color: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981, #34d399);
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger-color: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444, #f87171);
    --danger-bg: rgba(239, 68, 68, 0.08);
    --warning-color: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b, #fbbf24);
    --warning-bg: rgba(245, 158, 11, 0.08);
    --purple-color: #8b5cf6;
    --purple-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --teal-color: #14b8a6;
    --teal-gradient: linear-gradient(135deg, #14b8a6, #2dd4bf);

    --text-main: #1e1b4b;
    --text-secondary: #4c4881;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border-color: #e5e7eb;
    --border-light: rgba(0, 0, 0, 0.04);

    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --orange: #f59e0b;

    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-sm: 10px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.05);
    --shadow-primary: 0 4px 20px rgba(91, 76, 255, 0.2);

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* ===================================================================== */
/* SCROLLBAR                                                             */
/* ===================================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }

/* ===================================================================== */
/* ANIMATIONS                                                            */
/* ===================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ring-pulse {
    0% { box-shadow: 0 0 0 0 rgba(91, 76, 255, 0.3); }
    70% { box-shadow: 0 0 0 12px rgba(91, 76, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(91, 76, 255, 0); }
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ===================================================================== */
/* AUTH OVERLAY — Premium Glassmorphism                                   */
/* ===================================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(91, 76, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInScale 0.6s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(91, 76, 255, 0.3), rgba(139, 92, 246, 0.1), rgba(168, 85, 247, 0.3));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.login-card:hover::before {
    opacity: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .login-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--primary-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(91, 76, 255, 0.35);
    animation: float 4s ease-in-out infinite;
}

.login-header .login-icon i {
    color: #fff;
    width: 28px;
    height: 28px;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.login-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 500;
}

.login-overlay .form-group label {
    color: rgba(255, 255, 255, 0.7);
}

.login-overlay .form-control,
.login-overlay input[type="email"],
.login-overlay input[type="password"] {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    padding: 0.85rem 1.15rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.login-overlay .form-control::placeholder,
.login-overlay input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-overlay .form-control:focus,
.login-overlay input:focus {
    border-color: rgba(91, 76, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(91, 76, 255, 0.15);
    outline: none;
}

.login-overlay .btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 0.95rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(91, 76, 255, 0.35);
    transition: all var(--transition-normal);
    letter-spacing: 0.01em;
}

.login-overlay .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(91, 76, 255, 0.45);
}

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

/* ===================================================================== */
/* LAYOUT                                                                */
/* ===================================================================== */
#app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#app-container.visible { opacity: 1; }

/* ===================================================================== */
/* SIDEBAR — Premium Dark Glass                                          */
/* ===================================================================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, #0c0a1f 0%, #151331 50%, #1a1744 100%);
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 8px 0 40px -12px rgba(12, 10, 31, 0.6);
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(91, 76, 255, 0.2) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.brand {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.brand-icon-wrapper {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(91, 76, 255, 0.4);
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }

.brand-text h2 {
    font-weight: 800;
    font-size: 17px;
    color: #f1f5f9;
    letter-spacing: -.2px;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.brand-text span {
    font-size: 9.5px;
    color: rgba(148, 163, 184, 0.6);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: none;
}

.nav-list {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(203, 213, 225, 0.7);
    transition: all var(--transition-normal);
    margin-bottom: 2px;
    position: relative;
    list-style: none;
    user-select: none;
    text-decoration: none;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: .7;
    transition: all var(--transition-normal);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item:hover i { opacity: 1; }

.nav-item.active {
    background: linear-gradient(90deg, rgba(91, 76, 255, 0.25) 0%, rgba(91, 76, 255, 0.06) 100%);
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--primary-gradient);
    box-shadow: 0 0 12px rgba(91, 76, 255, 0.5);
}

.nav-item.active i {
    opacity: 1;
    color: #a5b4fc;
}

@media (max-width: 900px) {
    .sidebar-close-btn { display: block; }
}

/* ===================================================================== */
/* MAIN CONTENT                                                          */
/* ===================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ===================================================================== */
/* TOPBAR — Premium Glass Header                                         */
/* ===================================================================== */
.topbar {
    height: 72px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: relative;
    z-index: 5;
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 76, 255, 0.1), transparent);
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

.topbar-right {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.topbar-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--primary-gradient-soft);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(91, 76, 255, 0.08);
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(91, 76, 255, 0.2);
    transition: transform var(--transition-fast);
}

.topbar-avatar:hover { transform: scale(1.05); }

/* ===================================================================== */
/* CONTENT SCROLL                                                        */
/* ===================================================================== */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 40px;
}

.view-section { display: none; }

.view-section.active {
    display: block;
    animation: fadeIn 0.45s ease;
}

/* ===================================================================== */
/* GLOBAL FILTERS — Premium Card                                         */
/* ===================================================================== */
.global-filters-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

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

.filter-group label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bg-color);
    color: var(--text-main);
    outline: none;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 76, 255, 0.08);
    background: #fff;
}

.filter-group select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ===================================================================== */
/* PREMIUM CARDS                                                         */
/* ===================================================================== */
.card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

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

/* ===================================================================== */
/* DASHBOARD VIEW — Premium KPI + Charts                                 */
/* ===================================================================== */
.dashboard-hero {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: 32px 36px;
    margin-bottom: 28px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(91, 76, 255, 0.25);
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-left h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.hero-left p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.hero-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-date-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 14px;
    transition: all var(--transition-fast);
}

.hero-date-picker:hover {
    background: rgba(255, 255, 255, 0.22);
}

.hero-date-picker label {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.hero-date-picker input[type="date"] {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.hero-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* KPI Stat Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--surface-color);
    border-radius: var(--radius);
    padding: 22px 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

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

.kpi-card.kpi-attendance::before { background: var(--success-gradient); }
.kpi-card.kpi-syllabus::before { background: var(--purple-gradient); }
.kpi-card.kpi-lectures::before { background: var(--primary-gradient); }
.kpi-card.kpi-departments::before { background: var(--teal-gradient); }

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-card.kpi-attendance .kpi-icon {
    background: var(--success-bg);
    color: var(--success-color);
}

.kpi-card.kpi-syllabus .kpi-icon {
    background: rgba(139, 92, 246, 0.08);
    color: var(--purple-color);
}

.kpi-card.kpi-lectures .kpi-icon {
    background: var(--primary-gradient-soft);
    color: var(--primary-color);
}

.kpi-card.kpi-departments .kpi-icon {
    background: rgba(20, 184, 166, 0.08);
    color: var(--teal-color);
}

.kpi-info { flex: 1; min-width: 0; }

.kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.kpi-card.kpi-attendance .kpi-value { color: var(--success-color); }
.kpi-card.kpi-syllabus .kpi-value { color: var(--purple-color); }
.kpi-card.kpi-lectures .kpi-value { color: var(--primary-color); }
.kpi-card.kpi-departments .kpi-value { color: var(--teal-color); }

/* Chart Cards */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
}

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

.chart-card-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-card-title h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.chart-card-title p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-card-body {
    padding: 16px 24px 24px;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.chart-empty i {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.2;
}

.chart-empty p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===================================================================== */
/* STATS GRID — Premium Metric Cards                                     */
/* ===================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===================================================================== */
/* BUTTONS — Premium                                                     */
/* ===================================================================== */
.btn {
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    transition: all var(--transition-normal);
    letter-spacing: 0.01em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(91, 76, 255, 0.35);
}

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

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    background: rgba(91, 76, 255, 0.06);
    color: var(--primary-color);
}

/* ===================================================================== */
/* FORMS                                                                 */
/* ===================================================================== */
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea {
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-main);
    font-weight: 500;
    transition: all var(--transition-fast);
    outline: none;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91, 76, 255, 0.08);
}

/* ===================================================================== */
/* TABLE — Premium                                                       */
/* ===================================================================== */
.table-container {
    background: var(--surface-color);
    border-radius: var(--radius);
    overflow: auto;
    max-height: 65vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    height: 44px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    transition: background var(--transition-fast);
}

tbody tr:hover { background: #f8fafc; }

td {
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: #475569;
    font-weight: 500;
    vertical-align: middle;
}

.td-left { text-align: left; font-weight: 600; white-space: nowrap; }
.td-sub { color: var(--text-muted); font-size: 12px; }
.td-good { color: var(--success-color); font-weight: 700; }
.td-bad { color: var(--danger-color); font-weight: 700; }
.td-overall { background: #fffbeb; font-weight: 700; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ===================================================================== */
/* TOAST                                                                 */
/* ===================================================================== */
.toast {
    background: var(--surface-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-main);
    font-weight: 600;
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards, fadeOut 0.3s forwards 4s;
}

.toast.success { border-color: var(--success-color); }
.toast.error, .toast.danger { border-color: var(--danger-color); }
.toast.success i { color: var(--success-color); }
.toast.error i, .toast.danger i { color: var(--danger-color); }

/* ===================================================================== */
/* SKELETON LOADER                                                       */
/* ===================================================================== */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-row {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, var(--surface-color) 4%, #f1f5f9 25%, var(--surface-color) 36%);
    background-size: 1000px 100%;
}

.skeleton-cell {
    height: 20px;
    border-radius: 6px;
    background: #e2e8f0;
    margin: 8px 0;
}

/* ===================================================================== */
/* EMPTY STATE                                                           */
/* ===================================================================== */
.empty-state {
    padding: 5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state i {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-state h3 {
    color: var(--text-main);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

/* ===================================================================== */
/* MODAL PANEL                                                           */
/* ===================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active { display: flex; opacity: 1; }

.modal-panel {
    background: var(--surface-color);
    width: 100%;
    max-width: 600px;
    height: 100%;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-panel { transform: translateX(0); }

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

.modal-title { font-size: 1.25rem; font-weight: 700; }

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover { background: #f1f5f9; color: var(--danger-color); }

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

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

.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea { width: 100%; }

.form-group textarea { min-height: 120px; resize: vertical; }

.helper-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===================================================================== */
/* DEPARTMENT ATTENDANCE CARDS (Daily)                                    */
/* ===================================================================== */
.report-dept-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 28px;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.4s ease both;
}

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

.report-dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(91, 76, 255, 0.08);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.report-dept-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-dept-title-icon {
    background: var(--primary-gradient-soft);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 12px;
    display: flex;
}

.report-total-badge {
    display: flex;
    gap: 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.report-total-badge span {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-total-p { color: var(--success-color); }
.report-total-a { color: var(--danger-color); }

.report-class-section {
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.report-class-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.report-class-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-class-stats {
    display: flex;
    gap: 14px;
    font-size: 13px;
}

.report-table-wrapper { overflow-x: auto; }

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.report-table th {
    background: #fff;
    padding: 14px 20px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
}

.report-table td {
    padding: 14px 20px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f8fafc;
    color: #475569;
    vertical-align: middle;
}

.report-table tbody tr:last-child td { border-bottom: none; }
.report-table tbody tr:hover { background: #fafbff; }

.report-td-teacher { font-weight: 600; color: var(--text-main) !important; }
.report-td-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.badge-count {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}

.badge-count-p {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-count-a {
    background: var(--danger-bg);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ===================================================================== */
/* LECTURE HISTORY CARDS                                                 */
/* ===================================================================== */
.lecture-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

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

/* ===================================================================== */
/* MOBILE CONTROLS                                                       */
/* ===================================================================== */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: #eef2ff;
    color: var(--primary-color);
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    margin-left: auto;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    color: var(--danger-color);
    background: #fee2e2;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.hidden { display: none !important; }

/* ===================================================================== */
/* RESPONSIVE                                                            */
/* ===================================================================== */
@media (max-width: 1024px) {
    html, body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
        height: 100% !important;
    }

    #app-container {
        flex-direction: row !important;
        height: 100vh !important;
        width: 100vw !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .mobile-menu-btn { display: inline-flex !important; }
    .sidebar-close-btn { display: inline-flex !important; }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 88vw !important;
        z-index: 10000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.25) !important;
        overflow-y: auto !important;
    }

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

    .brand {
        justify-content: space-between !important;
        padding: 1.25rem !important;
    }

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

    .topbar {
        padding: 0 1rem !important;
        height: 60px !important;
    }

    .topbar-title {
        font-size: 1rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .content-scroll { padding: 16px !important; }
    .filter-grid { grid-template-columns: 1fr !important; }

    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .chart-grid {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .card { padding: 16px !important; }

    .dashboard-hero { padding: 24px 20px !important; }
    .hero-left h1 { font-size: 1.3rem !important; }

    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table { min-width: 600px !important; }

    .login-card {
        padding: 2rem 1.5rem !important;
        margin: 1rem !important;
        max-width: 95vw !important;
    }

    .toast-container {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
    }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr !important; }
    .topbar-title { font-size: 0.9rem !important; }
    .content-scroll { padding: 12px !important; }
    .card { padding: 12px !important; }
    .dashboard-hero { padding: 20px 16px !important; }
    .hero-content { flex-direction: column !important; align-items: flex-start !important; }
}

/* ===================================================================== */
/* STICKY COLUMNS                                                        */
/* ===================================================================== */
.sticky-col-1 {
    position: sticky !important;
    left: 0;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    z-index: 2 !important;
    background-color: var(--surface-color, #fff) !important;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.08);
}

.sticky-col-2 {
    position: sticky !important;
    left: 80px;
    z-index: 2 !important;
    background-color: var(--surface-color, #fff) !important;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.08);
}

thead .sticky-col-1, thead .sticky-col-2 {
    z-index: 11 !important;
    background-color: #f1f5f9 !important;
}

/* ===================================================================== */
/* PRINT                                                                 */
/* ===================================================================== */
@media print {
    body { background: white !important; color: black !important; margin: 0 !important; padding: 0 !important; }
    .sidebar, .topbar, #global-filters, .mobile-menu-btn, button { display: none !important; }
    #app-container, .main-content, .content-scroll {
        height: auto !important; width: 100% !important; overflow: visible !important; display: block !important; padding: 0 !important; margin: 0 !important;
    }
    .view-section { display: none !important; }
    .view-section.active { display: block !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid !important; margin-bottom: 20px !important; }
    table { page-break-inside: auto !important; width: 100% !important; }
    tr { page-break-inside: avoid !important; page-break-after: auto !important; }
    thead { display: table-header-group !important; }
    tfoot { display: table-footer-group !important; }
    .apexcharts-canvas { page-break-inside: avoid !important; }
}
