:root {
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --secondary: #d97706;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ca8a04;
    --info: #0891b2;
    --dark: #1f2937;
    --card: #f9fafb;
    --bg: #010105;
    --background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --sidebar-bg: #f9fafb;
    --sidebar-text: #000000;
    --sidebar-hover: #4b5563;
    --bool-bg: linear-gradient(135deg, #f1f3f4, #7d6a761f, #ce5585);
    --indicator: linear-gradient(135deg, #49e76e, #0000004a, #3d874245);
    --radius: 14px;
    --sidebar-width: 230px;
    --sidebar-collapsed: 70px;
    --header-height: 80px;
    --card-padding: 1rem;
    --gap: 0.75rem;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary: #40916c;
    --primary-light: #52b788;
    --secondary: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --info: #06b6d4;
    --dark: #f9fafb;
    --card: #374151;
    --background: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border: #4b5563;
    --sidebar-bg: #374151;
    --sidebar-text: #9ca3af;
    --sidebar-hover: #1f2937;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: "Nunito", sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.mobile-hidden {
    transform: translateX(-250px);
}

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

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 80px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .15);
}

.logo img {
    width:100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .3px;
    background: linear-gradient(135deg, #93C5FD, #3B82F6, #1D4ED8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.nav-section-title {
    padding: 0.75rem 2rem 0.5rem;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin: 0.25rem 1rem;
    width: calc(100% - 2rem);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-item:hover::before,
.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.05), rgba(64, 145, 108, 0.05));
    color: var(--primary);
    padding-left: 2rem;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.1), rgba(64, 145, 108, 0.1));
    color: var(--primary);
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 18px;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-item:hover i,
.nav-item.active i {
    opacity: 1;
    transform: scale(1.1);
    color: var(--primary);
}

.nav-text {
    white-space: nowrap;
    transition: all 0.3s;
}

.logout-item {
    color: var(--danger);
}

.logout-item::before {
    background: var(--danger);
}

.logout-item:hover {
    background: rgba(220, 38, 38, 0.05);
    color: var(--danger);
}

.logout-item:hover i {
    color: var(--danger);
}

.nav-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

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

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

/* ── HEADER ───────────────────────────────────────────────── */
.header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: var(--header-height);
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--bool-bg);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

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

.sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
}

.sidebar-toggle:hover {
    background-color: var(--card);
}

.desktop-sidebar-toggle {
    display: flex;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
}

.desktop-sidebar-toggle:hover {
    background-color: var(--card);
}

.school-info h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

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

.academic-year-indicator {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
    font-size: 20px;
}

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

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* ── USER MENU ────────────────────────────────────────────── */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    position: relative;
}

.user-menu:hover {
    background-color: var(--card);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.user-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.user-menu.active .user-arrow {
    transform: rotate(180deg);
}

/* ── PAGE CONTENT ─────────────────────────────────────────── */
.page-content {
    padding: 2rem;
}

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

.page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
    background-color: var(--card);
    border-radius: 14px;
    padding: var(--card-padding);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

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

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
    background-color: var(--card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
}

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

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .req {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

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

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-success {
    background-color: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.badge-danger {
    background-color: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.badge-warning {
    background-color: rgba(202, 138, 4, 0.12);
    color: var(--warning);
}

.badge-info {
    background-color: rgba(8, 145, 178, 0.12);
    color: var(--info);
}

.badge-secondary {
    background-color: rgba(107, 114, 128, 0.12);
    color: var(--text-secondary);
}

/* ── STATS CARDS (dashboard) ──────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--card);
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.stat-icon.secondary {
    background: linear-gradient(135deg, var(--secondary), #f59e0b);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info), #06b6d4);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success), #22c55e);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #eab308);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger), #ef4444);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* ── TABLES ───────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td,
.table th,
.table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table th,
.table th {
    background-color: var(--background);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background-color: rgba(45, 106, 79, 0.04);
}

.font-mono {
    font-family: "SF Mono", Monaco, Consolas, monospace;
}

/* ── ACTIONS BUTTONS ──────────────────────────────────────── */
.action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.action-btn.view {
    background: rgba(8, 145, 178, 0.12);
    color: var(--info);
}

.action-btn.edit {
    background: rgba(202, 138, 4, 0.12);
    color: var(--warning);
}

.action-btn.delete {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btns {
    display: flex;
    gap: 0.4rem;
}

/* ── OVERLAY ──────────────────────────────────────────────── */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay.show {
    display: block;
    opacity: 1;
}

/* ── BREADCRUMB ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0 1.5rem;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb i {
    font-size: 14px;
}

/* ── MODAL ────────────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--background);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(-10px);
        opacity: 0;
    }

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

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
}

.modal-close:hover {
    background: var(--card);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

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

/* ── ALERT FLASH ──────────────────────────────────────────── */
.flash-container {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInDown 0.3s ease;
}

.flash-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.flash-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.flash-warning {
    background: rgba(202, 138, 4, 0.1);
    color: var(--warning);
    border: 1px solid rgba(202, 138, 4, 0.2);
}

.flash-info {
    background: rgba(8, 145, 178, 0.1);
    color: var(--info);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

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

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

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 1rem;
}

.login-card {
    background: var(--background);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.4s ease;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 2rem;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ── INFO LIST ────────────────────────────────────────────── */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
.loading {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--card);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ── DATATABLES ───────────────────────────────────────────── */
.dataTables_wrapper {
    padding: 1rem;
}

.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
    margin: 0.5rem 0;
}

.dataTables_length select,
.dataTables_filter input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 14px;
}

.dataTables_filter input {
    width: 260px;
}

.dataTables_paginate .paginate_button {
    border: 1px solid var(--border) !important;
    background: var(--background) !important;
    color: var(--text-primary) !important;
    margin: 0 2px;
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--card) !important;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .desktop-sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }

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

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

    .sidebar-toggle {
        display: flex;
    }

    .header {
        padding: 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        justify-content: stretch;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .user-name,
    .academic-year-indicator {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}