:root {
    --exam-primary: #1a365d;
    --exam-secondary: #2d5a27;
    --exam-accent: #7c3aed;
    --exam-success: #059669;
    --exam-warning: #d97706;
    --exam-danger: #dc2626;
    --exam-bg: #f1f5f9;
    --exam-card: #ffffff;
    --exam-border: #e2e8f0;
    --exam-text: #1e293b;
    --exam-muted: #64748b;
}

body {
    background-color: var(--exam-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--exam-text);
}

body.exam-mode {
    background-color: #f8fafc;
}

.exam-nav {
    background: linear-gradient(135deg, var(--exam-primary), #2c5282);
    color: white;
    padding: 10px 0;
    border-bottom: 3px solid #0f2440;
}

.exam-nav .nav-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.exam-nav .nav-link-item {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.exam-nav .nav-link-item:hover {
    color: white;
}

.main-content {
    min-height: calc(100vh - 120px);
}

/* Landing page */
.course-card {
    background: var(--exam-card);
    border-radius: 12px;
    border: 1px solid var(--exam-border);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.course-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    margin-bottom: 12px;
}

.course-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.course-card .exam-links {
    margin-top: 12px;
}

.course-card .exam-links a {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
}

.course-card .exam-links a.exam-link-primary {
    background: var(--exam-primary);
    color: white;
}

.course-card .exam-links a.exam-link-primary:hover {
    background: #0f2440;
}

.course-card .exam-links a.exam-link-outline {
    border: 1px solid var(--exam-primary);
    color: var(--exam-primary);
}

.course-card .exam-links a.exam-link-outline:hover {
    background: var(--exam-primary);
    color: white;
}

.q-count-badge {
    font-size: 0.75rem;
    color: var(--exam-muted);
    margin-top: 8px;
}

/* Exam start page */
.exam-start-card {
    background: var(--exam-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
}

.exam-start-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.exam-start-card .exam-meta {
    color: var(--exam-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.exam-start-card .structure-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.exam-start-card .structure-table th,
.exam-start-card .structure-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--exam-border);
}

.exam-start-card .structure-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.instructions-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.instructions-list li {
    padding: 6px 0 6px 24px;
    position: relative;
    font-size: 0.95rem;
}

.instructions-list li:before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--exam-success);
    font-size: 0.8rem;
}

.credit-alert.credit-ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.credit-alert.credit-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.btn-begin-exam {
    background: linear-gradient(135deg, var(--exam-primary), #2c5282);
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-begin-exam:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4);
    color: white;
}

/* Active exam session */
.exam-toolbar {
    background: var(--exam-primary);
    color: white;
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.exam-toolbar .exam-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.exam-timer {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

.exam-timer.warning {
    color: #fbbf24;
    animation: pulse-warning 1s infinite;
}

.exam-timer.critical {
    color: #ef4444;
    animation: pulse-critical 0.5s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.exam-save-status {
    font-size: 0.8rem;
    opacity: 0.8;
}

.exam-body {
    display: flex;
    min-height: calc(100vh - 52px);
}

.exam-questions-panel {
    flex: 1;
    padding: 24px 32px;
    max-width: 900px;
    margin: 0 auto;
    overflow-y: auto;
}

.exam-navigation-panel {
    width: 260px;
    background: var(--exam-card);
    border-left: 1px solid var(--exam-border);
    padding: 16px;
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
}

.section-header {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--exam-primary);
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-header .section-meta {
    font-size: 0.85rem;
    color: var(--exam-muted);
}

.question-block {
    background: var(--exam-card);
    border-radius: 10px;
    border: 1px solid var(--exam-border);
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.question-block.active {
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.1);
}

.question-block.flagged {
    border-color: var(--exam-warning);
    background: #fffbeb;
}

.question-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.question-number .q-num {
    font-weight: 700;
    font-size: 1rem;
    color: var(--exam-primary);
}

.question-number .q-marks {
    font-size: 0.8rem;
    color: var(--exam-muted);
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
}

.question-text {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.mcq-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mcq-options li {
    padding: 10px 16px;
    margin-bottom: 6px;
    border-radius: 8px;
    border: 1px solid var(--exam-border);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: flex-start;
}

.mcq-options li:hover {
    background: #f1f5f9;
    border-color: var(--exam-primary);
}

.mcq-options li.selected {
    background: #eff6ff;
    border-color: var(--exam-primary);
    color: var(--exam-primary);
    font-weight: 500;
}

.mcq-options li .option-label {
    font-weight: 700;
    margin-right: 12px;
    min-width: 20px;
}

.answer-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--exam-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.answer-input:focus {
    outline: none;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.answer-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--exam-border);
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.flag-btn {
    background: none;
    border: none;
    color: var(--exam-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.flag-btn:hover {
    color: var(--exam-warning);
}

.flag-btn.flagged {
    color: var(--exam-warning);
}

/* Navigation panel */
.nav-section-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--exam-muted);
    margin-bottom: 8px;
    margin-top: 16px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--exam-border);
    border-radius: 6px;
    background: var(--exam-card);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    border-color: var(--exam-primary);
}

.nav-btn.answered {
    background: var(--exam-primary);
    color: white;
    border-color: var(--exam-primary);
}

.nav-btn.flagged {
    background: #fef3c7;
    border-color: var(--exam-warning);
    color: var(--exam-warning);
}

.nav-btn.current {
    box-shadow: 0 0 0 2px var(--exam-accent);
}

.nav-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    font-size: 0.85rem;
}

.nav-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.btn-submit-exam {
    width: 100%;
    background: var(--exam-danger);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
}

.btn-submit-exam:hover {
    background: #b91c1c;
}

/* Formula sheet panel */
.formula-sheet-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--exam-accent);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    z-index: 90;
    transition: all 0.2s;
}

.formula-sheet-toggle:hover {
    transform: scale(1.1);
}

.formula-sheet-panel {
    position: fixed;
    top: 52px;
    right: -450px;
    width: 440px;
    height: calc(100vh - 52px);
    background: white;
    border-left: 1px solid var(--exam-border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 95;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.formula-sheet-panel.open {
    right: 0;
}

.formula-sheet-panel .close-formula {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--exam-muted);
}

.formula-sheet-body h4 { margin: 0 0 16px 0; font-size: 1.15rem; border-bottom: 2px solid var(--exam-primary); padding-bottom: 8px; }
.formula-sheet-body h5 { margin: 14px 0 8px 0; font-size: 0.95rem; color: var(--exam-primary); }
.formula-sheet-body p { margin: 4px 0; font-size: 0.92rem; line-height: 1.7; }
.formula-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.formula-table td { padding: 5px 8px; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem; vertical-align: middle; }
.formula-table tr:last-child td { border-bottom: none; }

/* Accounting tables - Journal Entry */
.journal-table { width: 100%; border-collapse: collapse; border: 2px solid #334155; margin: 8px 0; }
.journal-table th { background: #f1f5f9; padding: 6px 10px; border: 1px solid #94a3b8; font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #475569; text-align: center; }
.journal-table th:nth-child(1) { width: 14%; text-align: left; }
.journal-table th:nth-child(2) { width: 46%; text-align: left; }
.journal-table th:nth-child(3) { width: 20%; }
.journal-table th:nth-child(4) { width: 20%; }
.journal-table td { padding: 0; border: 1px solid #cbd5e1; vertical-align: middle; }
.journal-table td input { width: 100%; border: none; padding: 6px 8px; font-size: 0.9rem; background: transparent; outline: none; }
.journal-table td input:focus { background: #eff6ff; }
.journal-table td input.text-right { text-align: right; }
.journal-table td.indent input { padding-left: 24px; }
.journal-table .narration-row td { border-bottom: 2px solid #94a3b8; }
.journal-table .narration-row input { font-style: italic; color: #64748b; font-size: 0.85rem; }
.journal-table .row-actions { width: 32px; text-align: center; padding: 0; }
.journal-table .row-actions button { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px 4px; font-size: 0.75rem; }
.journal-table .row-actions button:hover { color: #ef4444; }
.journal-add-row { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.82rem; font-weight: 500; padding: 4px 12px; border-radius: 5px; border: 1px dashed #94a3b8; background: white; color: #64748b; cursor: pointer; }
.journal-add-row:hover { border-color: var(--exam-primary); color: var(--exam-primary); background: #f5f7ff; }

/* Accounting tables - Ledger T-Account */
.ledger-container { margin: 8px 0; }
.ledger-account { margin-bottom: 12px; }
.ledger-title { text-align: center; font-weight: 700; font-size: 0.95rem; padding: 4px; border: 2px solid #334155; border-bottom: none; background: #f1f5f9; position: relative; }
.ledger-sides { display: flex; border: 2px solid #334155; border-top: none; }
.ledger-side { flex: 1; min-width: 0; }
.ledger-divider-v { width: 3px; background: #334155; flex-shrink: 0; }
.ledger-side .ledger-table { width: 100%; border-collapse: collapse; table-layout: fixed; border: none; }
.ledger-side .ledger-table th { background: #f1f5f9; padding: 5px 8px; border: 1px solid #94a3b8; border-top: 2px solid #334155; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: #475569; text-align: center; }
.ledger-side .ledger-table th:first-child { width: 22%; }
.ledger-side .ledger-table th:nth-child(2) { width: auto; }
.ledger-side .ledger-table th:nth-child(3) { width: 28%; }
.ledger-side .ledger-table th.row-actions { width: 28px; border: none; background: transparent; }
.ledger-side .ledger-table td { padding: 0; border: 1px solid #cbd5e1; vertical-align: middle; }
.ledger-side .ledger-table td input { width: 100%; border: none; padding: 5px 6px; font-size: 0.88rem; background: transparent; outline: none; box-sizing: border-box; }
.ledger-side .ledger-table td input:focus { background: #eff6ff; }
.ledger-side .ledger-table td input.text-right { text-align: right; }
.ledger-side .ledger-table .row-actions { width: 28px; text-align: center; padding: 0; border: none; }
.ledger-side .ledger-table .row-actions button { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 2px; font-size: 0.7rem; }
.ledger-side .ledger-table .row-actions button:hover { color: #ef4444; }
.ledger-side .ledger-add-row { margin: 4px 4px; }
.ledger-remove-account { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 0.8rem; padding: 2px 4px; }
.ledger-remove-account:hover { color: #ef4444; }
.ledger-add-row { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.8rem; font-weight: 500; padding: 3px 10px; border-radius: 4px; border: 1px dashed #94a3b8; background: white; color: #64748b; cursor: pointer; }
.ledger-add-row:hover { border-color: var(--exam-primary); color: var(--exam-primary); }

/* Accounting tables - Select dropdowns */
.journal-table td select.acct-select, .ledger-table td select.acct-select { width: 100%; border: none; padding: 5px 6px; font-size: 0.88rem; background: transparent; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 22px; }
.journal-table td select.acct-select:focus, .ledger-table td select.acct-select:focus { background-color: #eff6ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.journal-table td.indent select.acct-select { padding-left: 24px; }
.ledger-title select.ledger-name-select { border: none; background: transparent; text-align: center; font-weight: 700; font-size: 0.95rem; width: 80%; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; padding-right: 18px; }
.ledger-title select.ledger-name-select:focus { background-color: #eff6ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; }

/* Accounting tables - Journal totals */
.journal-table tfoot td { border-top: 2px solid #334155; font-weight: 700; font-size: 0.88rem; padding: 4px 8px; background: #f8fafc; }

/* Ledger table base styles (used by readonly detail/print views) */
.ledger-table.readonly { width: 100%; border-collapse: collapse; border: 2px solid #334155; }
.ledger-table.readonly th { background: #f1f5f9; padding: 5px 8px; border: 1px solid #94a3b8; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: #475569; text-align: center; }
.ledger-table.readonly th.ledger-divider { width: 3px; padding: 0; background: #334155; border: none; }
.ledger-table.readonly td { padding: 0; border: 1px solid #cbd5e1; vertical-align: middle; }
.ledger-table.readonly td.ledger-divider { width: 3px; padding: 0; background: #334155; border: none; }
.ledger-table.readonly td input { width: 100%; border: none; padding: 5px 6px; font-size: 0.88rem; background: transparent; outline: none; }
.ledger-table.readonly td input.text-right { text-align: right; }

/* Accounting tables - readonly (results/print) */
.journal-table.readonly td input, .ledger-table.readonly td input { pointer-events: none; background: transparent; }
.journal-table.readonly td select, .ledger-table.readonly td select { pointer-events: none; background: transparent; -webkit-appearance: none; appearance: none; background-image: none; }
.journal-table.readonly .row-actions, .ledger-table.readonly .row-actions { display: none; }

/* Results page */
.results-header {
    background: linear-gradient(135deg, var(--exam-primary), #2c5282);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.results-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 4px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
}

.score-circle .score-value {
    font-size: 2.2rem;
    font-weight: 800;
}

.score-circle .score-total {
    font-size: 0.9rem;
    opacity: 0.8;
}

.score-grade {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 8px;
}

.section-score-bar {
    background: #e2e8f0;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 6px;
}

.section-score-bar .fill {
    height: 100%;
    border-radius: 8px;
    background: var(--exam-primary);
    transition: width 0.6s ease;
}

.result-question-card {
    background: var(--exam-card);
    border-radius: 8px;
    border: 1px solid var(--exam-border);
    padding: 16px;
    margin-bottom: 12px;
}

.result-question-card.correct {
    border-left: 4px solid var(--exam-success);
}

.result-question-card.incorrect {
    border-left: 4px solid var(--exam-danger);
}

.result-question-card.pending {
    border-left: 4px solid var(--exam-warning);
}

.rubric-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.rubric-btn {
    padding: 6px 14px;
    border: 1px solid var(--exam-border);
    border-radius: 6px;
    background: var(--exam-card);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.rubric-btn:hover {
    border-color: var(--exam-primary);
}

.rubric-btn.selected {
    background: var(--exam-primary);
    color: white;
    border-color: var(--exam-primary);
}

/* History page */
.history-card {
    background: var(--exam-card);
    border-radius: 10px;
    border: 1px solid var(--exam-border);
    padding: 16px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.history-card:hover {
    border-color: var(--exam-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.analytics-card {
    background: var(--exam-card);
    border-radius: 12px;
    border: 1px solid var(--exam-border);
    padding: 20px;
    text-align: center;
}

.analytics-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--exam-primary);
}

.analytics-card .stat-label {
    font-size: 0.85rem;
    color: var(--exam-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .exam-navigation-panel {
        display: none;
    }

    .exam-questions-panel {
        max-width: 100%;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .exam-start-card {
        margin: 20px 10px;
        padding: 24px;
    }

    .exam-toolbar {
        padding: 6px 10px;
    }

    .exam-timer {
        font-size: 1.1rem;
    }

    .question-block {
        padding: 14px 16px;
    }

    .formula-sheet-panel {
        width: 100%;
        right: -100%;
    }
}

/* Submit confirmation modal */
.submit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.submit-modal-overlay.active {
    display: flex;
}

.submit-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    text-align: center;
}

.submit-modal h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.submit-modal .warning-text {
    color: var(--exam-danger);
    font-weight: 500;
    margin-bottom: 20px;
}

.submit-modal .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.submit-modal .btn-cancel {
    padding: 10px 24px;
    border: 1px solid var(--exam-border);
    border-radius: 8px;
    background: var(--exam-card);
    cursor: pointer;
    font-weight: 500;
}

.submit-modal .btn-confirm-submit {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: var(--exam-danger);
    color: white;
    cursor: pointer;
    font-weight: 600;
}

/* Reading time overlay */
.reading-time-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 54, 93, 0.95);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.reading-time-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.reading-time-content .reading-timer {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    margin: 24px 0;
}

.reading-time-content .skip-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 16px;
    transition: all 0.2s;
}

.reading-time-content .skip-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.no-access-card {
    background: var(--exam-card);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 550px;
    margin: 60px auto;
    padding: 48px;
    text-align: center;
}

.no-access-card .lock-icon {
    font-size: 3rem;
    color: var(--exam-warning);
    margin-bottom: 20px;
}

.stimulus-panel {
    background: #f8fafc;
    border: 2px solid #334155;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 16px;
    page-break-inside: avoid;
}

.stimulus-header {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--exam-text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--exam-border);
}

.question-diagram {
    margin-bottom: 14px;
}

.diagram-container {
    text-align: center;
    margin: 10px 0;
}

.diagram-container svg {
    max-width: 100%;
    height: auto;
}

.diagram-title {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 8px;
    color: var(--exam-text);
}

.diagram-source {
    font-size: 0.75rem;
    color: var(--exam-muted);
    text-align: right;
    font-style: italic;
    margin-top: 4px;
}

.diagram-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.9rem;
}

.diagram-table caption {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: left;
    margin-bottom: 6px;
    color: var(--exam-text);
}

.diagram-table th {
    background: #f1f5f9;
    font-weight: 600;
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
}

.diagram-table td {
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
}

.diagram-table tbody tr:nth-child(even) {
    background: #f8fafc;
}
