/* ============================================================
   SCHOOL ERP — PREMIUM UI DESIGN SYSTEM
   Author: School ERP System
   ============================================================ */

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

/* ── CSS VARIABLES ──────────────────────────────────────── */
:root {
    --primary:       #4f46e5;
    --primary-light: #818cf8;
    --primary-dark:  #3730a3;
    --secondary:     #06b6d4;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;

    --sidebar-bg:    #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active:#4f46e5;
    --sidebar-text:  #94a3b8;
    --sidebar-width: 260px;

    --topbar-bg:     #ffffff;
    --topbar-height: 64px;

    --body-bg:       #f1f5f9;
    --card-bg:       #ffffff;
    --card-border:   #e2e8f0;

    --text-primary:  #0f172a;
    --text-secondary:#64748b;
    --text-muted:    #94a3b8;

    --border-radius: 12px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-xl:     0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);

    --transition:    all .2s cubic-bezier(.4,0,.2,1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --body-bg:       #0f172a;
    --card-bg:       #1e293b;
    --card-border:   #334155;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --topbar-bg:     #1e293b;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar.collapsed { width: 68px; }

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

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79,70,229,.4);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-text .name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -.3px;
}

.sidebar-brand-text .tagline {
    font-size: 10px;
    font-weight: 500;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: .8px;
}

.sidebar.collapsed .sidebar-brand-text { display: none; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-section-title {
    padding: 6px 20px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(148,163,184,.4);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
    margin: 1px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

.nav-link .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link .nav-text { flex: 1; }
.sidebar.collapsed .nav-text { display: none; }

.nav-link .badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-weight: 600;
}

.sidebar.collapsed .badge { display: none; }

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.05);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-user:hover { background: var(--sidebar-hover); }

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-user-info .uname {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .urole {
    font-size: 11px;
    color: var(--sidebar-text);
    text-transform: capitalize;
}

.sidebar.collapsed .sidebar-user-info { display: none; }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 900;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.topbar.expanded { left: 68px; }

.topbar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
    margin-right: 12px;
}

.topbar-toggle:hover {
    background: var(--body-bg);
    color: var(--primary);
}

.topbar-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.topbar-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--primary); }
.topbar-breadcrumb .separator { margin: 0 4px; opacity: .4; }
.topbar-breadcrumb .current { color: var(--text-primary); font-weight: 600; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--body-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}

.topbar-btn:hover {
    background: var(--primary);
    color: #fff;
}

.topbar-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--topbar-bg);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 4px;
    text-decoration: none;
    color: var(--text-primary);
}

.topbar-user:hover { background: var(--body-bg); color: var(--text-primary); }

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    padding: 28px;
    transition: var(--transition);
}

.main-wrapper.expanded { margin-left: 68px; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

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

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body { padding: 20px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--card-border);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.danger::before  { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.info::before    { background: linear-gradient(90deg, var(--info), #60a5fa); }
.stat-card.secondary::before { background: linear-gradient(90deg, var(--secondary), #22d3ee); }

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

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

.stat-icon.primary { background: rgba(79,70,229,.12); color: var(--primary); }
.stat-icon.success { background: rgba(16,185,129,.12); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.danger  { background: rgba(239,68,68,.12);  color: var(--danger); }
.stat-icon.info    { background: rgba(59,130,246,.12); color: var(--info); }
.stat-icon.secondary { background: rgba(6,182,212,.12); color: var(--secondary); }

.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-change { font-size: 11px; font-weight: 600; margin-top: 6px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.4px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.4);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); transform: translateY(-1px); color: #fff; }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
}
.btn-warning:hover { background: linear-gradient(135deg, #d97706, #b45309); transform: translateY(-1px); color: #fff; }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); transform: translateY(-1px); color: #fff; }

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

.btn-icon { padding: 8px; border-radius: 8px; }
.btn-icon.btn-sm { padding: 5px; }

/* ── TABLES ─────────────────────────────────────────────── */
.table-responsive { border-radius: var(--border-radius); overflow: hidden; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table thead th {
    background: var(--body-bg);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid rgba(226,232,240,.5);
    transition: var(--transition);
}

.table tbody tr:hover { background: rgba(79,70,229,.025); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody td { padding: 12px 16px; vertical-align: middle; color: var(--text-primary); }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}

.badge-primary   { background: rgba(79,70,229,.12);  color: var(--primary); }
.badge-success   { background: rgba(16,185,129,.12); color: var(--success); }
.badge-warning   { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-danger    { background: rgba(239,68,68,.12);  color: var(--danger); }
.badge-info      { background: rgba(59,130,246,.12); color: var(--info); }
.badge-secondary { background: rgba(100,116,139,.12);color: var(--text-secondary); }

/* ── FORMS ──────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-control::placeholder { color: var(--text-muted); }

/* ── MODALS ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn .2s ease;
}

.modal-overlay.show { display: flex; }

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

.modal-box {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    animation: slideUp .25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    border: none; border-radius: 8px;
    background: var(--body-bg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }

/* ── AVATAR ─────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }

/* ── ALERTS / TOAST ─────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border: none;
    position: relative;
}

.alert-success { background: rgba(16,185,129,.1); color: #065f46; border-left: 3px solid var(--success); }
.alert-danger  { background: rgba(239,68,68,.1);  color: #991b1b; border-left: 3px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,.1); color: #92400e; border-left: 3px solid var(--warning); }
.alert-info    { background: rgba(59,130,246,.1); color: #1e40af; border-left: 3px solid var(--info); }

/* Toast */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-msg {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    min-width: 280px;
    border-left: 4px solid var(--success);
    animation: slideInRight .3s ease;
}

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

/* ── CHARTS ─────────────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 220px;
}

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.page-item .page-link {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.page-item .page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-item.disabled .page-link { opacity: .4; cursor: not-allowed; }

/* ── PROFILE CARD ───────────────────────────────────────── */
.profile-cover {
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    position: relative;
}

.profile-avatar {
    position: absolute;
    bottom: -36px;
    left: 24px;
    border: 4px solid var(--card-bg);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

/* ── ATTENDANCE STATUS ──────────────────────────────────── */
.attendance-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.attendance-dot.present { background: rgba(16,185,129,.15); color: var(--success); border-color: var(--success); }
.attendance-dot.absent  { background: rgba(239,68,68,.15);  color: var(--danger);  border-color: var(--danger); }
.attendance-dot.late    { background: rgba(245,158,11,.15); color: var(--warning); border-color: var(--warning); }

/* ── NOTICE CARD ────────────────────────────────────────── */
.notice-card {
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    padding: 18px;
    transition: var(--transition);
    position: relative;
}

.notice-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.notice-card.pinned { border-left: 4px solid var(--warning); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon { font-size: 64px; opacity: .3; display: block; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.empty-state-text { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress {
    height: 6px;
    background: var(--body-bg);
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width .6s ease;
}

.progress-bar.success { background: linear-gradient(90deg, var(--success), #34d399); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.danger  { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ── SEARCH INPUT ───────────────────────────────────────── */
.search-wrapper {
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.search-wrapper .form-control {
    padding-left: 36px;
}

/* ── UTILITIES ──────────────────────────────────────────── */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.ms-auto { margin-left: auto; }
.me-2 { margin-right: 8px; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: 12px; }
.w-100 { width: 100%; }

/* ── GRID ───────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .topbar { left: 0; }
    .main-wrapper { margin-left: 0; padding: 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .topbar-breadcrumb { display: none; }
    .page-header { flex-direction: column; }
}

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79,70,229,.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6,182,212,.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.auth-card {
    background: rgba(30,41,59,.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,.5);
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(79,70,229,.4);
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -.4px;
}

.auth-subtitle { font-size: 13px; color: rgba(148,163,184,.8); margin-top: 4px; }

.auth-form .form-label { color: rgba(148,163,184,.8); }

.auth-form .form-control {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.1);
    color: #f1f5f9;
}

.auth-form .form-control:focus {
    background: rgba(255,255,255,.08);
    border-color: var(--primary);
    color: #f1f5f9;
}

.auth-form .form-control::placeholder { color: rgba(148,163,184,.4); }

/* Demo accounts */
.demo-accounts {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px;
}

.demo-accounts h6 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(148,163,184,.6);
    margin-bottom: 10px;
}

.demo-account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    cursor: pointer;
    transition: var(--transition);
}

.demo-account-item:last-child { border-bottom: none; }
.demo-account-item:hover { opacity: .75; }
.demo-account-item .role-badge { font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.demo-account-item .email { font-size: 12px; color: rgba(148,163,184,.7); font-family: monospace; }

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
