:root {
    --primary: #ff6b35;
    --primary-dark: #e85a28;
    --sidebar-bg: #1a1d29;
    --sidebar-text: #a0aec0;
    --body-bg: #f4f6fb;
    --card-bg: #ffffff;
    --text: #1a202c;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    background: var(--body-bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

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

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

.app-sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    padding: 1.25rem 0;
}

.app-sidebar .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 1rem;
}

.app-sidebar .brand span { color: var(--primary); }

.app-sidebar .nav-link {
    color: var(--sidebar-text);
    padding: .65rem 1.5rem;
    border-left: 3px solid transparent;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,107,53,.12);
    border-left-color: var(--primary);
}

.app-main {
    margin-left: 260px;
    padding: 1.5rem 2rem;
    min-height: 100vh;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.guest-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.08);
    border: 1px solid var(--border);
}

.hero-gradient {
    background: linear-gradient(135deg, #1a1d29 0%, #2d3748 50%, #ff6b35 100%);
    min-height: 100vh;
}

.exam-palette .q-btn {
    width: 36px;
    height: 36px;
    font-size: .75rem;
    padding: 0;
}

.q-btn.answered { background: var(--success) !important; color: #fff !important; }
.q-btn.marked { background: var(--warning) !important; color: #fff !important; }
.q-btn.visited { background: #94a3b8 !important; color: #fff !important; }
.q-btn.current { outline: 3px solid var(--primary); }

.exam-timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--danger);
}

@media (max-width: 991px) {
    .app-sidebar { width: 100%; position: relative; min-height: auto; }
    .app-main { margin-left: 0; }
}

/* Admin pages */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: .2rem 0 .35rem; font-size: clamp(1.8rem, 3vw, 2.35rem); font-weight: 750; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: #718096; }
.page-kicker { color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.admin-primary-btn { padding: .72rem 1.15rem; border-radius: 10px; font-weight: 700; box-shadow: 0 8px 20px rgba(255,107,53,.18); }
.admin-table-card { padding: 1.25rem; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(26,32,44,.06); }
.admin-data-table { margin: 0 !important; }
.admin-data-table thead th { padding: .85rem .75rem; border-bottom: 1px solid #dfe4ea !important; color: #667085; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.admin-data-table tbody td { padding: 1rem .75rem; border-color: #edf0f4; color: #344054; vertical-align: middle; }
.admin-table-card .dataTables_filter input, .admin-table-card .dataTables_length select { min-height: 40px; border: 1px solid #dfe4ea; border-radius: 9px; }
.admin-table-card .dataTables_filter input { min-width: 240px; padding: .5rem .75rem; }
.admin-table-card .dataTables_info, .admin-table-card .dataTables_length { color: #667085; font-size: .86rem; }
.admin-table-card .dataTables_paginate .paginate_button { border-radius: 8px !important; }

.question-form-card { overflow: hidden; border: 1px solid #e1e6ed; border-radius: 18px; background: #fff; box-shadow: 0 10px 35px rgba(26,32,44,.06); }
.form-section { padding: 1.75rem 2rem; border-bottom: 1px solid #edf0f4; }
.form-section-heading { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1.4rem; }
.form-section-heading h2 { margin: 0 0 .2rem; font-size: 1.05rem; font-weight: 750; }
.form-section-heading p { margin: 0; color: #7b8798; font-size: .86rem; }
.section-number { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #e95823; background: #fff0e9; font-size: .72rem; font-weight: 800; }
.admin-control { min-height: 48px; border-color: #dfe4ea; border-radius: 10px; }
.admin-control:focus, .answer-input:focus { border-color: #ff8a50; box-shadow: 0 0 0 .2rem rgba(255,107,53,.11); }
.form-hint { margin-top: .4rem; color: #8a94a3; font-size: .78rem; }
.score-input { position: relative; }
.score-input input { padding-right: 4.5rem; }
.score-input span { position: absolute; right: 1rem; top: 50%; color: #8a94a3; font-size: .8rem; transform: translateY(-50%); }
.answer-list { display: grid; gap: .75rem; }
.answer-option { display: grid; grid-template-columns: 42px minmax(0,1fr) 145px; align-items: center; overflow: hidden; border: 1px solid #dfe4ea; border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s, background .2s; }
.answer-option:focus-within { border-color: #ff9970; box-shadow: 0 0 0 3px rgba(255,107,53,.08); }
.answer-option.is-selected { border-color: #ff7b45; background: #fffaf7; }
.answer-letter { display: grid; place-items: center; align-self: stretch; color: #455166; background: #f4f6f8; font-weight: 800; }
.answer-input { min-height: 52px; border: 0; border-radius: 0; box-shadow: none !important; }
.correct-choice { display: flex; align-items: center; justify-content: center; gap: .5rem; align-self: stretch; border-left: 1px solid #e5e9ef; color: #667085; background: #fafbfc; font-size: .82rem; font-weight: 650; cursor: pointer; }
.correct-choice input { width: 17px; height: 17px; accent-color: var(--primary); }
.question-form-actions { display: flex; justify-content: flex-end; gap: .75rem; padding: 1.25rem 2rem; background: #fafbfc; }

@media (max-width: 767px) {
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading .btn { width: 100%; }
    .form-section { padding: 1.3rem 1rem; }
    .answer-option { grid-template-columns: 40px minmax(0,1fr); }
    .correct-choice { grid-column: 1 / -1; min-height: 42px; border-top: 1px solid #e5e9ef; border-left: 0; }
    .question-form-actions { padding: 1rem; }
    .admin-table-card { padding: .8rem; overflow-x: auto; }
}
