/* ═══════════════════════════════════════════════════════════════
   Design System — Education-focused, clean & modern
   ═══════════════════════════════════════════════════════════════ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-soft: #eff6ff;

    --accent: #059669;
    --accent-soft: #ecfdf5;

    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --info: #0891b2;
    --info-soft: #ecfeff;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 2px 4px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 4px 6px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.04);
    --shadow-lg: 0 10px 15px rgba(15,23,42,0.08), 0 4px 6px rgba(15,23,42,0.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 15px; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.text-muted { color: var(--text-muted) !important; }

/* ═══════════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════════ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 16px;
    text-decoration: none;
    color: var(--gray-900);
}

.sidebar-brand .logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    padding: 14px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 1px;
    transition: all 0.12s;
}
.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}
.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}
.nav-item i { font-size: 16px; width: 18px; text-align: center; }
.nav-item .badge { margin-left: auto; font-size: 10px; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
}
.user-card:hover { background: var(--gray-50); }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info .role { font-size: 11px; color: var(--text-muted); }

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.wallet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.wallet-chip:hover {
    background: #dcfce7;
    color: var(--success);
}

.content-area {
    padding: 28px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════════ */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.15s, transform 0.15s;
}
.card-hover:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.card-body { padding: 20px; }
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stat card */
.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
}
.stat-card .label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 6px;
    color: var(--gray-900);
}
.stat-card .icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 10px;
}

.icon-primary { background: var(--primary-soft); color: var(--primary); }
.icon-success { background: var(--success-soft); color: var(--success); }
.icon-warning { background: var(--warning-soft); color: var(--warning); }
.icon-danger { background: var(--danger-soft); color: var(--danger); }
.icon-info { background: var(--info-soft); color: var(--info); }
.icon-gray { background: var(--gray-100); color: var(--gray-600); }

/* Olympiad card */
.olympiad-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.olympiad-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.olympiad-card-top {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--gray-50);
}
.olympiad-card-top .icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
}
.olympiad-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }

/* Badges */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #bfdbfe; }
.badge-success { background: var(--success-soft); color: var(--success); border: 1px solid #bbf7d0; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid #fde68a; }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border: 1px solid #fecaca; }
.badge-info    { background: var(--info-soft);    color: var(--info);    border: 1px solid #a5f3fc; }
.badge-gray    { background: var(--gray-100);     color: var(--gray-700); border: 1px solid var(--gray-200); }

/* ═══════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════ */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    padding: 9px 16px;
    border: 1px solid transparent;
    transition: all 0.12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover { background: #15803d; color: white; }

.btn-warning {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}
.btn-warning:hover { background: #b45309; color: white; }

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; color: white; }

.btn-outline-primary {
    background: white;
    border-color: var(--border);
    color: var(--gray-700);
}
.btn-outline-primary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-secondary {
    background: white;
    border-color: var(--border);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-50); }

/* ═══════════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════════ */
.form-control {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 14px;
    transition: all 0.12s;
    background: white;
    width: 100%;
    color: var(--gray-900);
    font-family: var(--font-sans);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-control-lg { padding: 12px 14px; font-size: 16px; }

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
    display: block;
}

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.input-group-text {
    padding: 0 14px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   Tables
   ═══════════════════════════════════════════════════════════════ */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.table-modern thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table-modern tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr:hover { background: var(--gray-50); }

/* ═══════════════════════════════════════════════════════════════
   Info rows
   ═══════════════════════════════════════════════════════════════ */
.info-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}
.info-row:last-child { border-bottom: none; }
.info-row .label {
    width: 180px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.info-row .value {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
}

/* ═══════════════════════════════════════════════════════════════
   Exam
   ═══════════════════════════════════════════════════════════════ */
.exam-layout { max-width: 800px; margin: 0 auto; }

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

.timer-box {
    padding: 8px 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    border: 1px solid #bfdbfe;
}
.timer-box.warning {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecaca;
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse { 50% { opacity: 0.7; } }

.progress-track {
    height: 4px;
    background: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-track .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s;
}

.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.question-meta {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
}
.question-title {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.12s;
    font-size: 14px;
}
.option-item:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.option-item:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.option-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}
.option-letter {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}
.option-item:has(input:checked) .option-letter {
    background: var(--primary);
    color: white;
}

.exam-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Question navigator */
.question-nav {
    background: white;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.question-nav-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.q-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--border);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    margin: 2px;
    transition: all 0.12s;
}
.q-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.q-chip.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.q-chip.answered {
    background: var(--success-soft);
    color: var(--success);
    border-color: #bbf7d0;
}

/* ═══════════════════════════════════════════════════════════════
   Result
   ═══════════════════════════════════════════════════════════════ */
.result-hero {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 20px;
}
.result-hero.passed { border-top: 4px solid var(--success); }
.result-hero.failed { border-top: 4px solid var(--warning); }

.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 14px;
}
.result-icon.passed { background: var(--success-soft); color: var(--success); }
.result-icon.failed { background: var(--warning-soft); color: var(--warning); }

.circular-progress {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    position: relative;
}
.circular-progress svg { transform: rotate(-90deg); }
.circular-progress .bg { fill: none; stroke: var(--gray-100); stroke-width: 10; }
.circular-progress .bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}
.circular-progress.passed .bar { stroke: var(--success); }
.circular-progress.failed .bar { stroke: var(--warning); }
.circular-progress .text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Transaction */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.12s;
}
.transaction-item:hover { background: var(--gray-50); }
.transaction-item:last-child { border-bottom: none; }

.tx-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.tx-topup { background: var(--success-soft); color: var(--success); }
.tx-debit { background: var(--warning-soft); color: var(--warning); }

.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-weight: 500; font-size: 14px; color: var(--gray-800); }
.tx-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tx-amount { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.tx-amount.positive { color: var(--success); }
.tx-amount.negative { color: var(--gray-700); }

/* ═══════════════════════════════════════════════════════════════
   Alerts
   ═══════════════════════════════════════════════════════════════ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
    margin-bottom: 12px;
}
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert strong { font-weight: 600; }
.alert-success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-danger, .alert-error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--info-soft); color: #155e75; border-color: #a5f3fc; }

/* ═══════════════════════════════════════════════════════════════
   Auth pages
   ═══════════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--border);
}

.auth-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin: 0 auto 16px;
}

/* ═══════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════ */
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }

.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row > [class*="col-"] { padding: 0 8px; margin-bottom: 16px; }
.g-3 > * { padding: 0 6px; margin-bottom: 12px; }
.g-4 > * { padding: 0 8px; margin-bottom: 16px; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.fw-bold { font-weight: 700; }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .content-area { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8,
    .col-lg-4, .col-lg-7, .col-lg-8 { flex: 0 0 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 40px 20px;
    overflow-y: auto;
    backdrop-filter: blur(2px);
}
.modal-overlay.open {
    display: flex;
    animation: modalFadeIn 0.15s ease-out;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 880px;
    width: 100%;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.2s ease-out;
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}
.modal-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}
.modal-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 16px;
    transition: all 0.12s;
}
.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.modal-body { padding: 24px; }
