/* =====================================================================
   Ujian Online Sekolah — stylesheet
   ===================================================================== */
:root {
  --navy-900: #0b1226; --navy-800: #111b35; --navy-700: #1a2647; --navy-600: #26355f;
  --indigo-600: #4f46e5; --indigo-500: #6366f1; --indigo-100: #e0e7ff; --indigo-50: #eef2ff;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-2: #eef2f7;
  --bg: #f4f6fb; --white: #fff;
  --green: #059669; --green-bg: #ecfdf5; --amber: #b45309; --amber-bg: #fffbeb;
  --red: #dc2626; --red-bg: #fef2f2; --blue: #2563eb; --blue-bg: #eff6ff; --slate-bg: #f1f5f9;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .18);
  --sidebar: 264px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Plus Jakarta Sans', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; }
a { color: var(--indigo-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, opacity .15s; background: var(--white); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--indigo-600); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }
.btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn-outline { border-color: var(--line); background: var(--white); color: var(--ink-2); }
.btn-outline:hover:not(:disabled) { border-color: #cbd5e1; background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--slate-bg); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--slate-bg); }
.icon-btn.danger:hover { color: var(--red); border-color: #fecaca; background: var(--red-bg); }
.icon-btn svg.lucide { width: 16px; height: 16px; }

/* ---------- Formulir ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field > label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field small, .hint { color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
textarea.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; }
.input:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }
.input.invalid { border-color: var(--red); }
.input-icon { position: relative; }
.input-icon > svg.lucide { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.check input { margin-top: 3px; accent-color: var(--indigo-600); width: 16px; height: 16px; }
.check b { display: block; font-size: 13.5px; }
.check small { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-error { display: none; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-bg); color: #991b1b; border: 1px solid #fecaca; margin-bottom: 14px; font-size: 13px; }
.form-error.show { display: flex; }

/* ---------- Kartu, badge, tabel ---------- */
.card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--slate-bg); color: var(--ink-2); }
.pill svg.lucide { width: 13px; height: 13px; }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-blue { background: var(--blue-bg); color: var(--blue); }
.pill-indigo { background: var(--indigo-50); color: var(--indigo-600); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #cbd5e1; }
.dot.on { background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.dot.warn { background: #f59e0b; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbff; }
td.wrap { white-space: normal; min-width: 200px; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.person { display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--indigo-50); color: var(--indigo-600); font-weight: 700; font-size: 12px; flex: none; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .empty-ic { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: var(--slate-bg); color: var(--muted); }
.empty h4 { color: var(--ink); margin-bottom: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input { height: 38px; }
.toolbar .grow { flex: 1 1 220px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--slate-bg); border-radius: 12px; overflow-x: auto; }
.tab { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.tab .count { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-bg); color: #1e3a8a; font-size: 13px; border: 1px solid #dbeafe; }
.callout.warn { background: var(--amber-bg); color: #78350f; border-color: #fde68a; }
.callout.danger { background: var(--red-bg); color: #7f1d1d; border-color: #fecaca; }
.callout.success { background: var(--green-bg); color: #064e3b; border-color: #a7f3d0; }
.callout svg.lucide { margin-top: 1px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Toast & modal ---------- */
.toast-region { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 9000; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; font-size: 13.5px; }
.toast.error { background: #7f1d1d; }
.toast.success svg.lucide { color: #6ee7b7; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 18, 38, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; z-index: 8000; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* ---------- Layout aplikasi (admin & siswa) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy-800); color: #cbd5e1; display: flex; flex-direction: column; padding: 18px 14px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; }
.brand img, .brand .mark { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; flex: none; }
.brand .mark { display: grid; place-items: center; background: var(--indigo-600); color: #fff; font: 800 18px var(--font-head); }
.brand b { display: block; color: #fff; font: 700 15px var(--font-head); line-height: 1.2; }
.brand small { color: #8a97b8; font-size: 12px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64739a; padding: 14px 12px 6px; font-weight: 700; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; gap: 11px; align-items: center; height: 42px; padding: 0 12px; border-radius: 11px; color: #b4bfd8; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: var(--navy-700); color: #fff; }
.nav a.active { background: var(--indigo-600); color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, .35); }
.nav a .badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav a.active .badge { background: #fff; color: var(--indigo-600); }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 14px; background: var(--navy-700); display: flex; gap: 10px; align-items: center; }
.sidebar-foot .avatar { background: var(--navy-600); color: #fff; }
.sidebar-foot b { color: #fff; font-size: 13px; display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot small { color: #8a97b8; font-size: 11.5px; }
.sidebar-foot button { margin-left: auto; background: transparent; border: 0; color: #b4bfd8; cursor: pointer; padding: 6px; border-radius: 8px; }
.sidebar-foot button:hover { background: var(--navy-600); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 28px; background: rgba(244, 246, 251, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.topbar h1 { font-size: 19px; }
.topbar p { margin: 0; color: var(--muted); font-size: 12.5px; }
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat-ic svg.lucide { width: 22px; height: 22px; }
.ic-indigo { background: var(--indigo-50); color: var(--indigo-600); }
.ic-green { background: var(--green-bg); color: var(--green); }
.ic-amber { background: var(--amber-bg); color: #d97706; }
.ic-red { background: var(--red-bg); color: var(--red); }
.ic-blue { background: var(--blue-bg); color: var(--blue); }
.ic-slate { background: var(--slate-bg); color: var(--ink-2); }
.stat b { display: block; font: 800 24px var(--font-head); line-height: 1.1; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stats.compact { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.stats.compact .stat { padding: 12px 14px; gap: 10px; }
.stats.compact .stat-ic { width: 36px; height: 36px; border-radius: 11px; }
.stats.compact .stat b { font-size: 20px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.list { display: grid; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.date-tile { width: 48px; height: 50px; border-radius: 12px; background: var(--indigo-50); color: var(--indigo-600); display: grid; place-content: center; text-align: center; flex: none; }
.date-tile b { font: 800 17px var(--font-head); line-height: 1; }
.date-tile span { font-size: 10.5px; text-transform: uppercase; font-weight: 700; }
.list-item .meta { min-width: 0; flex: 1; }
.list-item .meta b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta small { color: var(--muted); }

/* ---------- Wizard ujian ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--line-2); cursor: pointer; text-align: left; }
.step .num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--slate-bg); color: var(--muted); font-weight: 700; flex: none; }
.step b { display: block; font-size: 13.5px; }
.step small { color: var(--muted); font-size: 12px; }
.step.active { border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--indigo-50); }
.step.active .num, .step.done .num { background: var(--indigo-600); color: #fff; }
.q-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--white); }
.q-card.bad { border-color: #fca5a5; background: #fffafa; }
.q-card .q-head { display: flex; gap: 10px; align-items: flex-start; }
.q-num { width: 30px; height: 30px; border-radius: 9px; background: var(--indigo-50); color: var(--indigo-600); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }
.q-text { flex: 1; white-space: pre-wrap; font-weight: 500; }
.q-opts { display: grid; gap: 6px; margin: 10px 0 0 40px; }
.q-opt { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: 8px; background: #f8fafc; }
.q-opt.correct { background: var(--green-bg); color: #065f46; font-weight: 600; }
.q-opt .k { font-weight: 700; width: 18px; flex: none; }
.issues { margin: 8px 0 0 40px; display: grid; gap: 4px; }
.issues li { color: var(--red); font-size: 12.5px; }
.opt-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row label { display: grid; place-items: center; height: 42px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-weight: 700; }
.opt-row input[type=radio] { display: none; }
.opt-row input[type=radio]:checked + label { background: var(--green); color: #fff; border-color: var(--green); }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.summary-grid div { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; }
.summary-grid span { color: var(--muted); }
.summary-grid b { text-align: right; }

/* ---------- Halaman login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: radial-gradient(circle at 20% 15%, #2a3a7a 0, transparent 45%), radial-gradient(circle at 85% 80%, #3b2f86 0, transparent 45%), var(--navy-800);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.15; max-width: 520px; }
.auth-art p { color: #b4bfd8; max-width: 460px; font-size: 15px; }
.auth-feats { display: grid; gap: 12px; max-width: 460px; }
.auth-feat { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.auth-feat .stat-ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(99, 102, 241, .25); color: #c7d2fe; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: min(420px, 100%); }
.auth-box h2 { font-size: 26px; }
.auth-box > p { color: var(--muted); margin: 6px 0 22px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 13.5px; }
.ticket { font: 800 26px var(--font-head); letter-spacing: .08em; text-align: center; padding: 16px; border-radius: 14px; background: var(--indigo-50); color: var(--indigo-600); border: 1px dashed #a5b4fc; }

/* ---------- Siswa ---------- */
.exam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.exam-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.exam-card h3 { font-size: 16px; }
.exam-card .facts { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; }
.exam-card .facts div { display: flex; gap: 8px; align-items: center; }
.exam-card .facts svg.lucide { width: 15px; height: 15px; color: var(--muted); }
.exam-card .actions { margin-top: auto; }

/* ---------- Halaman ujian ---------- */
.exam-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.exam-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: var(--white); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.exam-top .title b { display: block; font: 700 15px var(--font-head); }
.exam-top .title small { color: var(--muted); }
.timer { display: flex; gap: 8px; align-items: center; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--navy-800); color: #fff; font: 700 18px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; }
.timer.warn { background: #b45309; }
.timer.danger { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.save-state { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.save-state.ok { color: var(--green); }
.save-state.pending { color: var(--amber); }
.save-state.off { color: var(--red); }
.exam-body { flex: 1; display: grid; grid-template-columns: 1fr 300px; gap: 20px; padding: 22px; max-width: 1240px; width: 100%; margin: 0 auto; }
.exam-area { user-select: none; -webkit-user-select: none; }
.q-panel { padding: 24px; }
.q-panel .q-label { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.q-panel .q-label b { font: 700 14px var(--font-head); color: var(--indigo-600); }
.q-panel .question { font-size: 16.5px; line-height: 1.7; white-space: pre-wrap; margin-bottom: 20px; }
.answers { display: grid; gap: 10px; }
.answer { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--white); transition: border-color .12s, background .12s; }
.answer:hover { border-color: #c7d2fe; background: #fafaff; }
.answer input { position: absolute; opacity: 0; pointer-events: none; }
.answer .key { width: 32px; height: 32px; border-radius: 10px; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--ink-2); }
.answer .txt { padding-top: 5px; white-space: pre-wrap; font-size: 15px; }
.answer.selected { border-color: var(--indigo-600); background: var(--indigo-50); }
.answer.selected .key { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; }
.answer:focus-within { box-shadow: 0 0 0 3px rgba(99, 102, 241, .25); }
.q-nav-btns { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; flex-wrap: wrap; }
.side-panel { padding: 18px; align-self: start; position: sticky; top: 86px; }
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.num-grid button { height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--white); font-weight: 700; cursor: pointer; }
.num-grid button.answered { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; }
.num-grid button.flagged { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.num-grid button.current { outline: 3px solid #a5b4fc; outline-offset: 1px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 4px; border: 1.5px solid var(--line); }
.legend .a { background: var(--indigo-600); border-color: var(--indigo-600); }
.legend .f { background: #f59e0b; border-color: #f59e0b; }
.lock-overlay { position: fixed; inset: 0; z-index: 9500; background: rgba(11, 18, 38, .96); display: grid; place-items: center; padding: 20px; color: #fff; text-align: center; }
.lock-overlay .box { max-width: 460px; }
.lock-overlay .big-ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: rgba(239, 68, 68, .18); color: #fca5a5; }
.lock-overlay .big-ic svg.lucide { width: 36px; height: 36px; }
.lock-overlay h2 { font-size: 24px; margin-bottom: 8px; }
.lock-overlay p { color: #cbd5e1; }
.result-score { font: 800 64px var(--font-head); letter-spacing: -.03em; line-height: 1; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--indigo-100); border-top-color: var(--indigo-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .exam-body { grid-template-columns: 1fr; }
  .side-panel { position: static; order: -1; }
  .num-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 7000; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ic { width: 38px; height: 38px; }
  .stat b { font-size: 20px; }
  .grid-2, .grid-3, .summary-grid { grid-template-columns: 1fr; }
  .exam-body { padding: 12px; }
  .q-panel { padding: 16px; }
  .exam-top { padding: 8px 12px; }
  .timer { font-size: 16px; height: 38px; }
  .modal-body { padding: 16px; }
  td, th { padding: 10px 12px; }
}
@media print {
  .sidebar, .topbar, .toast-region { display: none !important; }
  .shell { display: block; }
}
