/* ============================================================
   UjianOnline — tema bersih & profesional (biru/putih, Inter)
   Mendukung mode: terang (default), gelap, ikuti sistem.
   Data-theme pada <html>: "light" | "dark" | "system" (default).
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  color-scheme: light;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --bg: #F4F7FC;
  --ink: #0F172A;
  --muted: #64748B;
  --surface: #ffffff;        /* kartu, sidebar, topbar, modal, toast */
  --surface-2: #F8FAFC;      /* header tabel */
  --surface-3: #F1F5F9;      /* hover, seg, progress */
  --border: #E2E8F0;
  --row-border: #F1F5F9;
  --border-strong: #CBD5E1;  /* input, ghost button */
  --blue: #4F46E5;
  --blue2: #8B5CF6;
  --blue-dark: #4338CA;
  --blue2-dark: #7C3AED;
  --blue-soft: #EEF2FF;
  --blue-border: #C7D2FE;
  --red: #DC2626;
  --green: #16A34A;
  --amber: #D97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .05);
  /* alert */
  --ok-bg: #F0FDF4; --ok-bd: #BBF7D0; --ok-tx: #15803D;
  --err-bg: #FEF2F2; --err-bd: #FECACA; --err-tx: #B91C1C;
  --warn-bg: #FFFBEB; --warn-bd: #FDE68A; --warn-tx: #B45309;
  /* badge */
  --bdg-green-bg: #DCFCE7; --bdg-green-tx: #15803D;
  --bdg-amber-bg: #FEF3C7; --bdg-amber-tx: #B45309;
  --bdg-red-bg: #FEE2E2; --bdg-red-tx: #B91C1C;
  --bdg-blue-bg: var(--blue-soft); --bdg-blue-tx: var(--blue-dark);
  --bdg-gray-bg: #F1F5F9; --bdg-gray-tx: #475569;
}

/* Mode gelap otomatis (ikuti sistem) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F172A;
    --ink: #E2E8F0;
    --muted: #94A3B8;
    --surface: #1E293B;
    --surface-2: #273349;
    --surface-3: #334155;
    --border: #26324A;
    --row-border: #1E293B;
    --border-strong: #475569;
    --blue: #818CF8;
    --blue2: #A78BFA;
    --blue-dark: #A5B4FC;
    --blue2-dark: #8B5CF6;
    --blue-soft: rgba(129, 140, 248, .18);
    --blue-border: #818CF8;
    --red: #F87171;
    --green: #4ADE80;
    --amber: #FBBF24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .45);
    --ok-bg: rgba(22, 163, 74, .16); --ok-bd: rgba(22, 163, 74, .4); --ok-tx: #86EFAC;
    --err-bg: rgba(220, 38, 38, .16); --err-bd: rgba(220, 38, 38, .4); --err-tx: #FCA5A5;
    --warn-bg: rgba(217, 119, 6, .16); --warn-bd: rgba(217, 119, 6, .4); --warn-tx: #FCD34D;
    --bdg-green-bg: rgba(22, 163, 74, .16); --bdg-green-tx: #86EFAC;
    --bdg-amber-bg: rgba(217, 119, 6, .16); --bdg-amber-tx: #FCD34D;
    --bdg-red-bg: rgba(220, 38, 38, .16); --bdg-red-tx: #FCA5A5;
    --bdg-blue-bg: rgba(129, 140, 248, .18); --bdg-blue-tx: #A5B4FC;
    --bdg-gray-bg: #334155; --bdg-gray-tx: #CBD5E1;
  }
}

/* Mode gelap eksplisit (dipilih pengguna) */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F172A;
  --ink: #E2E8F0;
  --muted: #94A3B8;
  --surface: #1E293B;
  --surface-2: #273349;
  --surface-3: #334155;
  --border: #26324A;
  --row-border: #1E293B;
  --border-strong: #475569;
  --blue: #818CF8;
  --blue2: #A78BFA;
  --blue-dark: #A5B4FC;
  --blue2-dark: #8B5CF6;
  --blue-soft: rgba(129, 140, 248, .18);
  --blue-border: #818CF8;
  --red: #F87171;
  --green: #4ADE80;
  --amber: #FBBF24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .45);
  --ok-bg: rgba(22, 163, 74, .16); --ok-bd: rgba(22, 163, 74, .4); --ok-tx: #86EFAC;
  --err-bg: rgba(220, 38, 38, .16); --err-bd: rgba(220, 38, 38, .4); --err-tx: #FCA5A5;
  --warn-bg: rgba(217, 119, 6, .16); --warn-bd: rgba(217, 119, 6, .4); --warn-tx: #FCD34D;
  --bdg-green-bg: rgba(22, 163, 74, .16); --bdg-green-tx: #86EFAC;
  --bdg-amber-bg: rgba(217, 119, 6, .16); --bdg-amber-tx: #FCD34D;
  --bdg-red-bg: rgba(220, 38, 38, .16); --bdg-red-tx: #FCA5A5;
  --bdg-blue-bg: rgba(129, 140, 248, .18); --bdg-blue-tx: #A5B4FC;
  --bdg-gray-bg: #334155; --bdg-gray-tx: #CBD5E1;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 56px; }
.wrap-narrow { max-width: 480px; margin: 0 auto; padding: 32px 20px 56px; }

/* ---------- Sidebar layout (Admin & Guru) ---------- */
.layout { min-height: 100vh; }

.sidebar {
  width: 248px; flex: none;
  background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.brand-wrap { padding: 18px 20px 16px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; font-weight: 800; font-size: 1rem; flex: none;
}

.side-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side-nav a {
  padding: 10px 14px; border-radius: 10px; color: var(--muted);
  font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 10px;
}
.side-nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }

.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sidebar-foot .user-info { }
.sidebar-foot .u-name { font-weight: 700; font-size: .9rem; color: var(--ink); }
.sidebar-foot .u-role { font-size: .78rem; color: var(--muted); }
.sidebar-foot .btn { width: 100%; }

.main { margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }

/* Top bar khusus mobile (hamburger + brand) — sticky, tidak ikut scroll */
.topbar-mobile {
  display: none;
  position: sticky; top: 0; z-index: 90;
  background: var(--surface); border-bottom: 1px solid var(--border);
  align-items: center; gap: 12px; padding: 10px 16px;
}
.burger {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); flex: none;
}
.burger:hover { background: var(--surface-3); }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 95;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 900px) {
  .topbar-mobile { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(15, 23, 42, .25); }
  .main { margin-left: 0; }
}

/* ---------- Cards & layout ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.card + .card { margin-top: 20px; }
/* Kartu di dalam grid diatur oleh gap, bukan margin-top (dashboard admin/user, Setting App, dll) */
.grid > .card + .card { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid.two { grid-template-columns: 1fr; } }

.stat { padding: 18px 20px; }
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--blue-dark); line-height: 1.15; }
.stat .lbl { color: var(--muted); font-weight: 600; font-size: .86rem; margin-top: 4px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.section-title h2 { font-size: 1.15rem; color: var(--ink); }
.page-title { margin: 28px 0 18px; }
.page-title h1 { font-size: 1.5rem; letter-spacing: -.01em; color: var(--ink); }
.page-title p { color: var(--muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; font-weight: 600; font-size: .94rem;
  border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 22px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  text-decoration: none;
  min-height: 44px;
}
.btn:hover { background: linear-gradient(135deg, var(--blue-dark), var(--blue2-dark)); text-decoration: none; color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #B91C1C; }
.btn.success { background: var(--green); }
.btn.success:hover { background: #15803D; }
.btn.warn { background: var(--amber); }
.btn.warn:hover { background: #B45309; }
.btn.sm { padding: 6px 12px; font-size: .82rem; border-radius: 10px; min-height: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: .94rem; color: var(--ink); font-family: inherit; outline: none;
  transition: border .12s ease, box-shadow .12s ease;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
textarea.input { min-height: 88px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* Field password + icon mata */
.pw-field { position: relative; }
.pw-field .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 7px;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-3); }
.pw-toggle .ic-off { display: none; }
.pw-field.show .ic-off { display: block; }
.pw-field.show .ic-on { display: none; }

/* ---------- Alerts & badges ---------- */
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok-tx); border-color: var(--ok-bd); }
.alert.err { background: var(--err-bg); color: var(--err-tx); border-color: var(--err-bd); }
.alert.warn { background: var(--warn-bg); color: var(--warn-tx); border-color: var(--warn-bd); }
.alert ul { margin: 8px 0 0 18px; }
.alert li { margin: 3px 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.badge.green { background: var(--bdg-green-bg); color: var(--bdg-green-tx); }
.badge.amber { background: var(--bdg-amber-bg); color: var(--bdg-amber-tx); }
.badge.red { background: var(--bdg-red-bg); color: var(--bdg-red-tx); }
.badge.blue, .badge.indigo, .badge.sky { background: var(--bdg-blue-bg); color: var(--bdg-blue-tx); }
.badge.pink { background: var(--bdg-gray-bg); color: var(--bdg-gray-tx); }
.badge.gray { background: var(--bdg-gray-bg); color: var(--bdg-gray-tx); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; padding: 9px 12px; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--row-border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Aksi & tombol icon (edit, hapus, dll) */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--muted); cursor: pointer; position: relative;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
  padding: 0;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-3); }
.icon-btn.danger:hover { color: var(--red); border-color: var(--red); background: var(--err-bg); }
.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #0F172A; color: #fff; font-size: .72rem; font-weight: 600;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 30;
}
.icon-btn[data-tooltip]:hover::after { opacity: 1; }

/* Toolbar aksi massal (checkbox siswa) */
.mass-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.mass-toolbar .chk-all { display: flex; align-items: center; gap: 7px; font-size: .86rem; color: var(--muted); font-weight: 600; cursor: pointer; }
.mass-toolbar .pilih-info { font-size: .82rem; color: var(--muted); font-weight: 600; }
.mass-toolbar .spacer { flex: 1; }
.tbl input[type="checkbox"] { accent-color: var(--blue); width: 16px; height: 16px; cursor: pointer; }

/* ---------- Token ---------- */
.token-box {
  font-family: 'Courier New', monospace; font-weight: 800; letter-spacing: .35em; font-size: 1.8rem;
  text-align: center; padding: 16px; border-radius: var(--radius-sm);
  background: var(--blue-soft); border: 2px dashed var(--blue-border); color: var(--blue-dark);
}

/* ---------- Auth ---------- */
.auth-logo { display: flex; justify-content: center; margin: 40px 0 18px; }
.auth-theme { position: absolute; top: 14px; right: 14px; }
.seg { display: flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 18px; gap: 4px; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 9px 12px; border-radius: 7px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg input:checked + span { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 23, 42, .28);
  width: 420px; max-width: 100%; padding: 24px;
  transform: scale(.96) translateY(6px); transition: transform .18s ease;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; color: var(--ink); }
.modal-body { font-size: .94rem; color: var(--ink); margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toast (kanan atas) ---------- */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  width: 360px; max-width: calc(100vw - 32px);
}
.toast-item {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
  font-size: .9rem; color: var(--ink); font-weight: 500;
  animation: toast-in .25s ease;
}
.toast-item.ok { border-left-color: var(--green); }
.toast-item.err { border-left-color: var(--red); }
.toast-item.warn { border-left-color: var(--amber); }
.toast-item .t-msg { flex: 1; }
.toast-item .t-close {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 1.1rem; line-height: 1; padding: 0 2px; flex: none;
}
.toast-item .t-close:hover { color: var(--ink); }
.toast-item.out { opacity: 0; transform: translateX(30px); transition: all .3s ease; }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Switch tema (light / dark / system) ---------- */
.theme-switch { display: flex; align-items: center; gap: 8px; }
.theme-switch .ts-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.ts-group {
  display: inline-flex; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 2px; gap: 2px;
}
.ts-group button {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  width: 30px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ts-group button:hover { color: var(--ink); background: var(--surface); }
.ts-group button.active { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }
.sidebar-foot .theme-switch { justify-content: space-between; }

/* ---------- Gerbang layar penuh (mulai ujian) ---------- */
.fs-gate {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.fs-gate.hidden { display: none; }

/* Modal "kembali ke layar penuh" (saat fullscreen terlepas) */
.fs-reenter {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(15, 23, 42, .55);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.fs-reenter.show { display: flex; }
.fs-reenter .card { animation: toast-in .22s ease; }

/* ---------- Exam ---------- */
.exam-topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.exam-topbar .timer { font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: .03em; color: var(--ink); }
.exam-topbar .timer.low { color: var(--red); animation: pulse 1s infinite; }
.exam-topbar .vio { font-weight: 600; font-size: .92rem; color: var(--muted); }
.exam-meta { display: flex; flex-direction: column; min-width: 0; }
.exam-meta b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-meta span { font-size: .78rem; color: var(--muted); }
.exam-topbar .spacer { flex: 1; }

.q-card { padding: 24px 26px; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-head .no { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; font-weight: 700; font-size: .92rem; }
.q-text { font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; white-space: pre-wrap; }
.q-img { margin: 12px 0; border-radius: var(--radius-sm); max-height: 320px; border: 1px solid var(--border); }

.option { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 9px; cursor: pointer; transition: border .12s, background .12s; }
.option:hover { border-color: var(--blue-border); }
.option.sel { border-color: var(--blue); background: var(--blue-soft); }
.option input { margin-top: 3px; accent-color: var(--blue); width: 17px; height: 17px; flex: none; }
.option .k { font-weight: 700; color: var(--blue-dark); }
.option select { margin-top: -2px; }

.q-nav { display: flex; gap: 7px; flex-wrap: wrap; }
.q-chip { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; cursor: pointer; transition: all .12s; }
.q-chip:hover { border-color: var(--blue); }
.q-chip.done { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; border-color: transparent; }
.q-chip.current { outline: 2px solid var(--blue-border); border-color: var(--blue); }

.exam-layout { display: grid; grid-template-columns: 1fr 290px; gap: 20px; align-items: start; margin-top: 20px; }
@media (max-width: 900px) { .exam-layout { grid-template-columns: 1fr; } .exam-side { order: -1; } }
.exam-side { position: sticky; top: 76px; }
@media (max-width: 900px) { .exam-side { position: static; } }

.progress-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 14px; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(135deg, var(--blue), var(--blue2)); transition: width .2s ease; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 28px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.token-copy { cursor: pointer; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.pair-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 10px; margin-bottom: 10px; align-items: center; }
.opt-row { display: grid; grid-template-columns: 30px 1fr 40px; gap: 10px; margin-bottom: 10px; align-items: center; }
@media (max-width: 640px) { .pair-row { grid-template-columns: 1fr 1fr 34px; } }

footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 0 8px; }

/* ---------- Rich text editor (Quill) untuk soal ---------- */
.rich-wrap { width: 100%; }
.rich-wrap .ql-editor {
  min-height: 64px; font-size: .94rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.rich-wrap .ql-toolbar.ql-snow {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid var(--border-strong); border-bottom: none;
  background: var(--surface-2);
}
.rich-wrap .ql-toolbar .ql-rtl {
  font-size: .85rem; font-weight: 600;
  padding: 5px 12px; border-radius: 6px;
}
.rich-wrap .ql-toolbar .ql-rtl:hover { background: var(--surface-3); }
.rich-wrap .ql-toolbar .ql-rtl.active { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; }
.rich-wrap .ql-container.ql-snow { border: 1px solid var(--border-strong); }
.opt-row .rich-wrap .ql-editor { min-height: 40px; padding: 8px 10px; }
.pair-row .rich-wrap .ql-editor { min-height: 36px; padding: 7px 10px; }

/* arah teks per-paragraf (Quill) — dipakai di editor & layar ujian */
.ql-direction-rtl { direction: rtl; text-align: right; }
[dir="rtl"] { direction: rtl; }

/* perataan dari konten Quill */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* output konten kaya di layar ujian / daftar soal */
.rich-out { display: inline; }
.rich-out p { margin: 0 0 .35em; }
.rich-out p:last-child { margin-bottom: 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
