/* ================================================================
   THE SCHOLAR'S COMMONS — Faculty QA Design System
   A prestigious academic portal aesthetic:
   Forest greens, gold accents, burgundy emphasis, warm cream surfaces.
   Lora serif for headings, Source Sans 3 for body.
   ================================================================ */

/* ----------------------------------------
   0. DESIGN TOKENS
   ---------------------------------------- */
:root {
    /* Color — Primary */
    --primary: #1B4332;
    --primary-dark: #0B2B1F;
    --primary-light: #2D6A4F;
    --primary-ghost: rgba(27, 67, 50, 0.08);
    --primary-ring: rgba(27, 67, 50, 0.25);

    /* Color — Accent (Gold) */
    --accent: #B68D40;
    --accent-light: #D4A843;
    --accent-dark: #96732E;
    --accent-ghost: rgba(182, 141, 64, 0.10);

    /* Color — Burgundy */
    --burgundy: #722F37;
    --burgundy-light: #8B3A42;
    --burgundy-dark: #5C242B;
    --burgundy-ghost: rgba(114, 47, 55, 0.08);

    /* Color — Surfaces */
    --surface: #FEFCF6;
    --surface-sunken: #F5F0E8;
    --surface-raised: #FFFFFF;
    --surface-overlay: rgba(44, 24, 16, 0.45);

    /* Color — Borders */
    --border: #E2D9C8;
    --border-light: #EDE7DB;
    --border-dark: #C9BDAA;

    /* Color — Text */
    --dark: #2C1810;
    --text: #3D2B1F;
    --text-secondary: #6B5744;
    --text-muted: #8B7355;
    --text-faint: #A89880;
    --white: #FFFFFF;

    /* Semantic Colors */
    --success: #2D6A4F;
    --success-bg: #E8F5E9;
    --success-border: #C8E6C9;
    --warning: #B68D40;
    --warning-bg: #FFF8E1;
    --warning-border: #FFE082;
    --danger: #722F37;
    --danger-bg: #FCE4EC;
    --danger-border: #F8BBD0;
    --info: #1B4332;
    --info-bg: #E0F2F1;
    --info-border: #B2DFDB;

    /* Typography */
    --font-display: 'Lora', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows — warm brown tones */
    --shadow-xs: 0 1px 2px rgba(44, 24, 16, 0.05);
    --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08), 0 1px 2px rgba(44, 24, 16, 0.04);
    --shadow: 0 4px 6px rgba(44, 24, 16, 0.06), 0 2px 4px rgba(44, 24, 16, 0.04);
    --shadow-md: 0 6px 16px rgba(44, 24, 16, 0.08), 0 2px 6px rgba(44, 24, 16, 0.04);
    --shadow-lg: 0 12px 32px rgba(44, 24, 16, 0.10), 0 4px 12px rgba(44, 24, 16, 0.06);
    --shadow-xl: 0 24px 48px rgba(44, 24, 16, 0.14), 0 8px 16px rgba(44, 24, 16, 0.06);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --sidebar-width: 270px;
    --header-height: 64px;
}


/* ----------------------------------------
   1. RESET & BASE
   ---------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface-sunken);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

img {
    max-width: 100%;
    height: auto;
}

code, pre, .mono {
    font-family: var(--font-mono);
}

::selection {
    background: var(--primary);
    color: var(--white);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* ----------------------------------------
   2. LAYOUT
   ---------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.content-wrapper {
    padding: var(--sp-5);
    flex: 1;
    animation: fadeIn 0.3s ease;
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }

    .content-wrapper {
        padding: var(--sp-8);
    }
}


/* ----------------------------------------
   3. SIDEBAR
   ---------------------------------------- */
.sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(11, 43, 31, 0.3);
}

.sidebar.open {
    left: 0;
}

@media (min-width: 1024px) {
    .sidebar {
        left: 0;
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-6) var(--sp-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Academic crest / shield logo */
.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.sidebar-close {
    display: block;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    line-height: 1;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (min-width: 1024px) {
    .sidebar-close {
        display: none;
    }
}

.sidebar-nav {
    flex: 1;
    padding: var(--sp-4) var(--sp-3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    color: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
    margin-bottom: 2px;
    position: relative;
    font-weight: 500;
    font-size: var(--text-sm);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-left: 3px solid var(--accent);
    padding-left: calc(var(--sp-4) - 3px);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.9;
}

.sidebar-footer {
    padding: var(--sp-3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
    display: block;
    animation: fadeIn 0.25s ease;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none !important;
    }
}


/* ----------------------------------------
   4. HEADER
   ---------------------------------------- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--sp-5);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--sp-2);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--primary-ghost);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.page-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

/* Notification Bell */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: var(--sp-2);
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

.notification-bell:hover {
    background: var(--primary-ghost);
}

.bell-icon {
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--burgundy);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
    border: 2px solid var(--surface);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--sp-1);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.user-menu-toggle:hover .user-avatar {
    box-shadow: 0 0 0 3px var(--accent-ghost), 0 0 0 4px var(--accent);
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    font-family: var(--font-display);
    transition: box-shadow var(--transition);
    flex-shrink: 0;
}

.user-name {
    display: none;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text);
}

@media (min-width: 640px) {
    .user-name {
        display: block;
    }
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--sp-2);
    background: var(--surface-raised);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all var(--transition);
    z-index: 200;
    overflow: hidden;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-sunken);
}

.dropdown-header strong {
    display: block;
    font-size: var(--text-sm);
    font-family: var(--font-display);
    color: var(--dark);
}

.dropdown-header small {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    color: var(--text);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
}

.dropdown-item:hover {
    background: var(--primary-ghost);
    color: var(--primary);
    text-decoration: none;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0;
}


/* ----------------------------------------
   5. CARDS
   ---------------------------------------- */
.card {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--sp-5);
    transition: box-shadow var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.card-body {
    padding: var(--sp-5);
}

.card-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    background: var(--surface-sunken);
}


/* ----------------------------------------
   6. BUTTONS
   ---------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    min-height: 44px;
    line-height: 1.4;
    position: relative;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(27, 67, 50, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(27, 67, 50, 0.3);
    color: var(--white);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: 0 2px 4px rgba(182, 141, 64, 0.25);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(182, 141, 64, 0.35);
    color: var(--white);
}

.btn-danger {
    background: var(--burgundy);
    color: var(--white);
    border-color: var(--burgundy);
    box-shadow: 0 2px 4px rgba(114, 47, 55, 0.2);
}

.btn-danger:hover {
    background: var(--burgundy-dark);
    border-color: var(--burgundy-dark);
    box-shadow: 0 4px 12px rgba(114, 47, 55, 0.3);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
    box-shadow: 0 2px 4px rgba(45, 106, 79, 0.2);
}

.btn-success:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
    color: var(--white);
}

.btn-secondary {
    background: var(--surface-sunken);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--border-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--surface-sunken);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--primary-ghost);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
    min-height: 34px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--text-base);
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-icon {
    width: 44px;
    padding: 0;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 34px;
    min-height: 34px;
}


/* ----------------------------------------
   7. FORMS
   ---------------------------------------- */
.form-group {
    margin-bottom: var(--sp-5);
}

.form-label {
    display: block;
    margin-bottom: var(--sp-2);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 11px var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--text);
    background: var(--surface-raised);
    transition: all var(--transition);
    min-height: 44px;
    line-height: 1.5;
}

.form-control:hover {
    border-color: var(--border-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    background: var(--white);
}

.form-control.error {
    border-color: var(--burgundy);
    box-shadow: 0 0 0 3px var(--burgundy-ghost);
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--surface-sunken);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238B7355' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-error {
    color: var(--burgundy);
    font-size: var(--text-xs);
    margin-top: var(--sp-1);
    font-weight: 500;
}

.form-hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-top: var(--sp-1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Input group — for prepend/append */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}


/* ----------------------------------------
   8. TABLES
   ---------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-raised);
}

.table th,
.table td {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table th {
    background: var(--surface-sunken);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--primary-ghost);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Bordered variant */
.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-light);
}

/* Compact variant */
.table-compact th,
.table-compact td {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-sm);
}

/* Striped variant */
.table-striped tbody tr:nth-child(even) {
    background: var(--surface);
}


/* ----------------------------------------
   9. ALERTS
   ---------------------------------------- */
.alert {
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--radius);
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    font-size: var(--text-sm);
    border-left: 4px solid transparent;
    animation: fadeInUp 0.3s ease;
    position: relative;
}

.alert-success {
    background: var(--success-bg);
    color: #1B5E20;
    border-left-color: var(--success);
    border: 1px solid var(--success-border);
    border-left: 4px solid var(--success);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--burgundy-dark);
    border-left-color: var(--burgundy);
    border: 1px solid var(--danger-border);
    border-left: 4px solid var(--burgundy);
}

.alert-warning {
    background: var(--warning-bg);
    color: #6D4C06;
    border-left-color: var(--accent);
    border: 1px solid var(--warning-border);
    border-left: 4px solid var(--accent);
}

.alert-info {
    background: var(--info-bg);
    color: var(--primary);
    border-left-color: var(--primary);
    border: 1px solid var(--info-border);
    border-left: 4px solid var(--primary);
}


/* ----------------------------------------
   10. STAT CARDS
   ---------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    margin-bottom: var(--sp-6);
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stats-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    margin-bottom: var(--sp-6);
}

@media (min-width: 768px) {
    .stats-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    margin-bottom: var(--sp-6);
}

@media (min-width: 640px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Stat card color variants */
.stat-card.stat-green::before { background: var(--primary); opacity: 1; }
.stat-card.stat-gold::before { background: var(--accent); opacity: 1; }
.stat-card.stat-burgundy::before { background: var(--burgundy); opacity: 1; }
.stat-card.stat-info::before { background: var(--primary-light); opacity: 1; }

.stat-icon {
    font-size: 28px;
    margin-bottom: var(--sp-2);
    line-height: 1;
}

.stat-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.stat-card.stat-gold .stat-value { color: var(--accent-dark); }
.stat-card.stat-burgundy .stat-value { color: var(--burgundy); }

.stat-label {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--sp-1);
    font-weight: 500;
}

.stat-trend {
    font-size: var(--text-xs);
    margin-top: var(--sp-2);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--burgundy);
}


/* ----------------------------------------
   11. BADGES
   ---------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--accent-dark);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--burgundy);
}

.badge-info {
    background: var(--info-bg);
    color: var(--primary);
}

.badge-secondary {
    background: var(--surface-sunken);
    color: var(--text-muted);
}

.badge-primary {
    background: var(--primary-ghost);
    color: var(--primary);
}

/* Solid badge variants */
.badge-solid-success {
    background: var(--success);
    color: var(--white);
}

.badge-solid-warning {
    background: var(--accent);
    color: var(--white);
}

.badge-solid-danger {
    background: var(--burgundy);
    color: var(--white);
}


/* ----------------------------------------
   12. PAGINATION
   ---------------------------------------- */
.pagination {
    display: flex;
    gap: var(--sp-1);
    justify-content: center;
    margin-top: var(--sp-6);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: 500;
    min-width: 38px;
    text-align: center;
}

.pagination a:hover {
    background: var(--primary-ghost);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}


/* ----------------------------------------
   13. MODALS
   ---------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    padding: var(--sp-4);
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--sp-1);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: var(--surface-sunken);
    color: var(--text);
}

.modal-body {
    padding: var(--sp-5);
}

.modal-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--sp-3);
    justify-content: flex-end;
    background: var(--surface-sunken);
}


/* ----------------------------------------
   14. GRID SYSTEM
   ---------------------------------------- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--sp-2));
}

.row > [class*="col-"] {
    padding: 0 var(--sp-2);
    margin-bottom: var(--sp-4);
}

.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }
.col-8 { width: 66.667%; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
    .col-md-2 { width: 16.667%; }
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; }
    .col-md-5 { width: 41.667%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.667%; }
    .col-md-12 { width: 100%; }
}

@media (max-width: 767px) {
    .row > [class*="col-md-"] {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333%; }
    .col-lg-6 { width: 50%; }
    .col-lg-8 { width: 66.667%; }
}


/* ----------------------------------------
   15. PROGRESS BARS
   ---------------------------------------- */
.progress {
    height: 8px;
    background: var(--surface-sunken);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.progress-lg {
    height: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-bar-gold {
    background: linear-gradient(90deg, var(--accent-dark) 0%, var(--accent) 100%);
}

.progress-bar-burgundy {
    background: linear-gradient(90deg, var(--burgundy-dark) 0%, var(--burgundy) 100%);
}

.progress-bar-success {
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
}

.progress-text {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-top: var(--sp-1);
}


/* ----------------------------------------
   16. TOASTS
   ---------------------------------------- */
.toast {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    padding: var(--sp-4) var(--sp-5);
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    transform: translateX(calc(100% + var(--sp-5)));
    opacity: 0;
    transition: all var(--transition);
    z-index: 3000;
    font-size: var(--text-sm);
    font-weight: 500;
    max-width: 360px;
    border-left: 4px solid var(--accent);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: var(--primary);
    border-left-color: var(--accent);
}

.toast-error {
    background: var(--burgundy);
    border-left-color: var(--accent);
}

.toast-warning {
    background: var(--accent-dark);
    border-left-color: var(--white);
}


/* ----------------------------------------
   17. EMPTY STATE
   ---------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--sp-12) var(--sp-6);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: var(--sp-4);
    opacity: 0.6;
}

.empty-state h3 {
    font-family: var(--font-display);
    color: var(--dark);
    margin-bottom: var(--sp-2);
    font-size: var(--text-xl);
}

.empty-state p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 360px;
    margin: 0 auto var(--sp-5);
}


/* ----------------------------------------
   18. SPINNER
   ---------------------------------------- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ----------------------------------------
   19. UTILITIES
   ---------------------------------------- */

/* Text Colors */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-burgundy { color: var(--burgundy) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-dark { color: var(--dark) !important; }
.text-white { color: var(--white) !important; }

/* Text Alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Font */
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-lg { font-size: var(--text-lg); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05em; }

/* Spacing — Margin Top */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--sp-2); }
.mt-2 { margin-top: var(--sp-4); }
.mt-3 { margin-top: var(--sp-6); }
.mt-4 { margin-top: var(--sp-8); }
.mt-5 { margin-top: var(--sp-12); }

/* Spacing — Margin Bottom */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-2); }
.mb-2 { margin-bottom: var(--sp-4); }
.mb-3 { margin-bottom: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-8); }
.mb-5 { margin-bottom: var(--sp-12); }

/* Spacing — Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--sp-4); }
.p-3 { padding: var(--sp-6); }
.p-4 { padding: var(--sp-8); }

/* Flexbox */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.d-grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; }

/* Gaps */
.gap-1 { gap: var(--sp-2); }
.gap-2 { gap: var(--sp-4); }
.gap-3 { gap: var(--sp-6); }
.gap-4 { gap: var(--sp-8); }

/* Alignment */
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

/* Sizing */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Visibility */
.hidden { display: none !important; }
.visible { display: block !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Borders & Radius */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

/* Shadows */
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Misc */
.rounded-pill { border-radius: var(--radius-full) !important; }
.border-left-primary { border-left: 4px solid var(--primary) !important; }
.border-left-accent { border-left: 4px solid var(--accent) !important; }
.border-left-burgundy { border-left: 4px solid var(--burgundy) !important; }
.letter-spacing-1 { letter-spacing: 1px; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ----------------------------------------
   20. WELCOME BANNER
   ---------------------------------------- */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    margin-bottom: var(--sp-6);
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(182, 141, 64, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--sp-2);
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-base);
    position: relative;
    z-index: 1;
    margin: 0;
}

.welcome-banner .welcome-subtitle {
    color: var(--accent-light);
    font-family: var(--font-display);
    font-weight: 500;
    font-style: italic;
}


/* ----------------------------------------
   21. QUICK ACTIONS
   ---------------------------------------- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.quick-action-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--sp-5);
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
}

.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--primary);
}

.quick-action-card .action-icon {
    font-size: 28px;
    margin-bottom: var(--sp-1);
}

.quick-action-card .action-label {
    font-weight: 600;
    font-size: var(--text-sm);
}

.quick-action-card .action-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
}


/* ----------------------------------------
   22. NOTIFICATION LIST
   ---------------------------------------- */
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--primary-ghost);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: var(--accent-ghost);
    border-left: 3px solid var(--accent);
}

.notification-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-ghost);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.notification-item .notif-content {
    flex: 1;
    min-width: 0;
}

.notification-item .notif-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--dark);
    margin-bottom: 2px;
}

.notification-item .notif-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.notification-item .notif-time {
    font-size: var(--text-xs);
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Notification dropdown panel */
.notification-panel {
    position: absolute;
    top: 100%;
    right: -60px;
    margin-top: var(--sp-2);
    background: var(--surface-raised);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 200;
}

.notification-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-sunken);
}

.notification-panel-header h4 {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    margin: 0;
}

.notification-panel-footer {
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.notification-panel-footer a {
    font-size: var(--text-xs);
    font-weight: 600;
}


/* ----------------------------------------
   23. AVATAR
   ---------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 20px;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

.avatar-green {
    background: var(--primary);
    color: var(--white);
}

.avatar-gold {
    background: var(--accent);
    color: var(--white);
}

.avatar-burgundy {
    background: var(--burgundy);
    color: var(--white);
}

.avatar-muted {
    background: var(--surface-sunken);
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* ----------------------------------------
   24. FILTER BAR
   ---------------------------------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
    padding: var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: var(--sp-5);
}

.filter-bar .form-control {
    min-height: 38px;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-sm);
    max-width: 220px;
}

.filter-bar .btn {
    min-height: 38px;
    padding: var(--sp-2) var(--sp-4);
}

.filter-bar label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}


/* ----------------------------------------
   25. TIMELINE
   ---------------------------------------- */
.timeline {
    position: relative;
    padding-left: var(--sp-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border-light);
}

.timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--sp-8) + 8px);
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-raised);
    border: 3px solid var(--primary);
    z-index: 1;
}

.timeline-item.active::before {
    background: var(--accent);
    border-color: var(--accent);
}

.timeline-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-title {
    font-family: var(--font-display);
    font-weight: 600;
    margin: var(--sp-1) 0;
    color: var(--dark);
}

.timeline-content {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}


/* ----------------------------------------
   26. UPLOAD / DRAG & DROP
   ---------------------------------------- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
    background: var(--surface);
    transition: all var(--transition);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-ghost);
}

.upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: var(--sp-3);
    opacity: 0.6;
}

.upload-area h4 {
    font-family: var(--font-display);
    margin-bottom: var(--sp-2);
    color: var(--dark);
}

.upload-area p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.upload-area .upload-btn {
    display: inline-block;
    margin-top: var(--sp-3);
    padding: var(--sp-2) var(--sp-5);
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: background var(--transition-fast);
}

.upload-area .upload-btn:hover {
    background: var(--primary-dark);
}


/* ----------------------------------------
   27. DAY HEADERS & TIMETABLE
   ---------------------------------------- */
.day-header {
    background: var(--surface-sunken);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-3);
    border-left: 4px solid var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.timetable-grid {
    display: grid;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.timetable-slot {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    transition: all var(--transition-fast);
}

.timetable-slot:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.timetable-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 100px;
}

.timetable-course {
    font-weight: 600;
    font-size: var(--text-sm);
}

.timetable-venue {
    font-size: var(--text-xs);
    color: var(--text-muted);
}


/* ----------------------------------------
   28. LECTURE CARDS
   ---------------------------------------- */
.lecture-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border-left: 4px solid var(--border);
    transition: all var(--transition);
}

.lecture-card:hover {
    box-shadow: var(--shadow-sm);
}

.lecture-card.lecture-held {
    border-left-color: var(--success);
}

.lecture-card.lecture-pending {
    border-left-color: var(--accent);
}

.lecture-card.lecture-missed {
    border-left-color: var(--burgundy);
}

.lecture-card.lecture-postponed {
    border-left-color: var(--text-muted);
}

.lecture-card .lecture-course {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--dark);
    margin-bottom: var(--sp-1);
}

.lecture-card .lecture-code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 600;
}

.lecture-card .lecture-meta {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--sp-2);
}

.lecture-card .lecture-actions {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

/* Status option cards (for attendance marking) */
.status-option {
    flex: 1;
    background: var(--surface-raised);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.status-option:hover {
    border-color: var(--primary);
    background: var(--primary-ghost);
}

.status-option.selected {
    border-color: var(--primary);
    background: var(--primary-ghost);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.status-option .status-icon {
    font-size: 28px;
    margin-bottom: var(--sp-2);
}

.status-option .status-label {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--dark);
}

.status-option input[type="radio"] {
    display: none;
}

/* Held variant */
.status-option.status-held.selected {
    border-color: var(--success);
    background: var(--success-bg);
}

/* Missed variant */
.status-option.status-missed.selected {
    border-color: var(--burgundy);
    background: var(--danger-bg);
}

/* Postponed variant */
.status-option.status-postponed.selected {
    border-color: var(--accent);
    background: var(--warning-bg);
}


/* ----------------------------------------
   29. MISCELLANEOUS COMPONENTS
   ---------------------------------------- */

/* Footer */
.footer {
    padding: var(--sp-4) var(--sp-5);
    text-align: center;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* Section header (used in dashboards) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: var(--sp-5) 0;
}

/* Action hover effect (for cards) */
.action-hover {
    transition: transform var(--transition), box-shadow var(--transition);
}

.action-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Hover background */
.hover-bg-light:hover {
    background-color: var(--surface-sunken) !important;
}

/* Topic items */
.topic-item:last-child {
    border-bottom: none !important;
}

.topic-card {
    transition: transform var(--transition), box-shadow var(--transition);
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Transition utility */
.transition-all {
    transition: all var(--transition);
}

/* Info row for detail views */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--dark);
}

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
    padding: var(--sp-4);
}

/* Tabs (simple) */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--sp-5);
}

.tab {
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.tab:hover {
    color: var(--text);
    text-decoration: none;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Week navigation */
.week-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.week-nav .week-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--dark);
}

.week-nav .btn {
    min-height: 36px;
    padding: var(--sp-2) var(--sp-3);
}

/* Role badge in tables */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--surface-sunken);
    color: var(--text-secondary);
}

/* Count bubble */
.count-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
}


/* ----------------------------------------
   30. CSS ANIMATIONS
   ---------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideInLeft 0.4s ease forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.4s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* Staggered animation delays */
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }
.stagger-6 { animation-delay: 0.3s; opacity: 0; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--border-light) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--sp-2);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--sp-3);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}


/* ----------------------------------------
   31. MOBILE OPTIMIZATIONS
   ---------------------------------------- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 1050;
        width: 82%;
        max-width: 300px;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar.open,
    .sidebar.active {
        left: 0;
        box-shadow: 8px 0 32px rgba(11, 43, 31, 0.3);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--surface-overlay);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.open,
    .sidebar-overlay.active {
        display: block;
        animation: fadeIn 0.25s ease;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: var(--header-height);
    }

    .content-wrapper {
        padding: var(--sp-4);
    }

    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Larger touch targets */
    .btn,
    .nav-item,
    .dropdown-item {
        min-height: 44px;
    }

    /* Stacked form groups */
    .form-row {
        grid-template-columns: 1fr;
    }

    .row > [class*="col-md-"] {
        width: 100%;
    }

    /* Fixed header on mobile */
    .header {
        padding: 0 var(--sp-4);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        box-shadow: var(--shadow-sm);
    }

    .page-title {
        font-size: var(--text-base);
    }

    .header-right {
        gap: var(--sp-2);
    }

    /* Welcome banner compact */
    .welcome-banner {
        padding: var(--sp-5) var(--sp-4);
    }

    .welcome-banner h2 {
        font-size: var(--text-xl);
    }

    /* Quick actions compact */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stats compact */
    .stats-grid,
    .stats-grid-3,
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-3);
    }

    .stat-card {
        padding: var(--sp-4);
    }

    .stat-value {
        font-size: var(--text-2xl);
    }

    /* Lecture cards */
    .lecture-card .lecture-meta {
        flex-direction: column;
        gap: var(--sp-1);
    }

    /* Status option cards */
    .status-option {
        padding: var(--sp-3);
    }

    .status-option .status-icon {
        font-size: 22px;
    }

    /* Notification panel */
    .notification-panel {
        width: calc(100vw - var(--sp-8));
        right: calc(-1 * (100vw - var(--sp-8) - 100%));
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .stats-grid-3,
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}


/* ----------------------------------------
   32. REPORT STAT CARDS
   ---------------------------------------- */
.stat-card-visual {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.stat-card-visual:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-visual.accent-primary { border-left-color: var(--primary); }
.stat-card-visual.accent-success { border-left-color: var(--success); }
.stat-card-visual.accent-warning { border-left-color: var(--warning); }
.stat-card-visual.accent-danger { border-left-color: var(--danger); }
.stat-card-visual.accent-info { border-left-color: var(--info); }
.stat-card-visual.accent-secondary { border-left-color: var(--text-muted); }

.stat-card-visual .stat-content {
    flex: 1;
}

.stat-card-visual .stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--dark);
    margin: 0 0 4px 0;
}

.stat-card-visual .stat-content p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.stat-card-visual .stat-content .stat-subtext {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.stat-card-visual .stat-icon-large {
    font-size: 48px;
    opacity: 0.2;
}

.stat-progress {
    margin-top: 12px;
    width: 100%;
}

.stat-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.stat-progress-bar .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stat-progress-bar .fill.success { background: var(--success); }
.stat-progress-bar .fill.warning { background: var(--warning); }
.stat-progress-bar .fill.danger { background: var(--danger); }

/* ----------------------------------------
   33. LECTURE STATUS PANEL (Reports)
   ---------------------------------------- */
.lecture-status-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .lecture-status-panel {
        grid-template-columns: 1fr;
    }
}

.lecture-status-item {
    text-align: center;
}

.lecture-status-item h4 {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-display);
    margin: 0 0 8px 0;
    color: var(--text);
}

.lecture-status-item .big-number {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--font-display);
    margin: 0 0 12px 0;
}

.lecture-status-item .big-number.success { color: var(--success); }
.lecture-status-item .big-number.danger { color: var(--danger); }

.report-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 24px;
}

/* ----------------------------------------
   34. PRINT STYLES
   ---------------------------------------- */
@media print {
    .sidebar,
    .sidebar-overlay,
    .header,
    .footer,
    .btn,
    .notification-bell,
    .user-menu,
    .menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0 !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }

    .table th {
        background: #f0f0f0 !important;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}
