/* =====================================================================
   Asesmen Digital — sistem desain v5
   Lima tema: executive · emerald · midnight · paper · sunrise
   Semua warna/bentuk memakai token agar tema dapat diganti dari panel admin.
   ===================================================================== */

/* ---------- 1. Token dasar (tema Executive, terang) ---------- */
:root {
  --bg: #f1f4f9; --surface: #ffffff; --surface-2: #f7f9fc; --line: #e3e8f0; --line-strong: #c9d2e0;
  --ink: #0f172a; --ink-2: #475569; --ink-3: #8795ab;
  --accent: #1d4ed8; --accent-ink: #ffffff;
  --accent-strong: color-mix(in srgb, var(--accent) 80%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 30%, var(--surface));
  --ok: #15803d; --warn: #b45309; --err: #b91c1c;
  --ok-soft: color-mix(in srgb, var(--ok) 11%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 13%, var(--surface));
  --err-soft: color-mix(in srgb, var(--err) 10%, var(--surface));
  --ok-line: color-mix(in srgb, var(--ok) 30%, var(--surface));
  --warn-line: color-mix(in srgb, var(--warn) 34%, var(--surface));
  --err-line: color-mix(in srgb, var(--err) 32%, var(--surface));

  --side-bg: #0b1b3a; --side-ink: #e8eefc; --side-ink-2: #9fb0d3; --side-line: rgba(255,255,255,.09);
  --side-active: rgba(255,255,255,.12); --side-w: 252px;
  --top-bg: color-mix(in srgb, var(--surface) 88%, transparent);
  --logo-bg: var(--accent); --logo-fg: #fff;
  --hero-bg: linear-gradient(120deg, #0b1b3a, #17306a); --hero-ink: #fff; --hero-ink-2: rgba(255,255,255,.74);

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -8px rgba(15,23,42,.12);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,.35);

  --r: 12px; --r-sm: 8px; --r-lg: 18px;
  --pad: 24px; --gap: 16px; --ctl: 44px;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: var(--font-body);
  color-scheme: light;
}

/* ---------- 2. Preset tema ---------- */
/* executive: formal, biru navy */
html[data-theme="executive"] {
  --bg: #eef1f7; --line: #dfe5ef;
  --side-bg: #0b1b3a;
}
/* emerald: segar, hijau zamrud, serba putih */
html[data-theme="emerald"] {
  --bg: #f2f9f6; --surface: #ffffff; --surface-2: #f6fbf9; --line: #dcebe5; --line-strong: #bcd8cd;
  --ink: #0c2b23; --ink-2: #466259; --ink-3: #86a095;
  --side-bg: #ffffff; --side-ink: #0c2b23; --side-ink-2: #5d7a70; --side-line: #e1eee8; --side-active: var(--accent-soft);
  --hero-bg: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, #fff), color-mix(in srgb, var(--accent) 4%, #fff));
  --hero-ink: #0c2b23; --hero-ink-2: #466259;
  --shadow: 0 1px 2px rgba(6,60,45,.05), 0 10px 28px -10px rgba(6,95,70,.18);
}
/* midnight: gelap, indigo */
html[data-theme="midnight"] {
  --bg: #eef0fa; --surface: #ffffff; --surface-2: #f5f6fd; --line: #dde0f2; --line-strong: #c3c8e6;
  --ink: #161a3a; --ink-2: #4a5080; --ink-3: #8a90b8;
  --side-bg: #0d1226; --side-ink: #e8eaff; --side-ink-2: #8f97c8; --side-line: rgba(255,255,255,.07);
  --hero-bg: linear-gradient(120deg, #1b1f4d, #3b2f8f 60%, #5148c8); --hero-ink: #fff; --hero-ink-2: rgba(255,255,255,.76);
}
/* paper: editorial, kertas hangat */
html[data-theme="paper"] {
  --bg: #f6f1e7; --surface: #fffdf8; --surface-2: #faf6ec; --line: #ded5c3; --line-strong: #c8bca5;
  --ink: #1c1917; --ink-2: #57534e; --ink-3: #9a9187;
  --side-bg: #efe7d6; --side-ink: #1c1917; --side-ink-2: #6b6459; --side-line: #ddd2bc; --side-active: #e2d7bf;
  --hero-bg: transparent; --hero-ink: #1c1917; --hero-ink-2: #57534e;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 20px 50px -24px rgba(60,40,10,.35);
  --logo-bg: #1c1917;
}
/* sunrise: hangat, oranye koral, ramah */
html[data-theme="sunrise"] {
  --bg: #fff7f0; --surface: #ffffff; --surface-2: #fffaf6; --line: #f3e2d4; --line-strong: #e8cdb6;
  --ink: #2b1a10; --ink-2: #6d4e3b; --ink-3: #ad8f7b;
  --side-bg: #ffffff; --side-ink: #2b1a10; --side-ink-2: #8a6b57; --side-line: #f3e2d4; --side-active: var(--accent-soft);
  --hero-bg: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ec4899)); --hero-ink: #fff; --hero-ink-2: rgba(255,255,255,.86);
  --shadow: 0 2px 4px rgba(120,53,15,.05), 0 14px 30px -12px rgba(194,65,12,.22);
}

/* ---------- 3. Mode gelap (berlaku untuk semua tema) ---------- */
html[data-surface="dark"] {
  --bg: #0a0e1c; --surface: #131a2e; --surface-2: #19223a; --line: #263150; --line-strong: #37446b;
  --ink: #e8ecf8; --ink-2: #a4aed0; --ink-3: #6d789c;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --ok: #4ade80; --warn: #fbbf24; --err: #f87171;
  --side-bg: #0d1326; --side-ink: #e8ecf8; --side-ink-2: #8e99be; --side-line: rgba(255,255,255,.07); --side-active: rgba(255,255,255,.09);
  --hero-bg: linear-gradient(120deg, color-mix(in srgb, var(--accent) 38%, #0a0e1c), color-mix(in srgb, var(--accent) 16%, #131a2e));
  --hero-ink: #fff; --hero-ink-2: rgba(255,255,255,.74);
  --shadow-sm: none; --shadow: 0 0 0 1px rgba(255,255,255,.02), 0 12px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.8);
  --logo-bg: var(--accent);
  color-scheme: dark;
}

/* ---------- 4. Bentuk, kepadatan, huruf ---------- */
html[data-radius="round"] { --r: 20px; --r-sm: 12px; --r-lg: 28px; }
html[data-radius="soft"]  { --r: 12px; --r-sm: 8px;  --r-lg: 18px; }
html[data-radius="sharp"] { --r: 4px;  --r-sm: 3px;  --r-lg: 6px; }
html[data-density="compact"] { --pad: 16px; --gap: 12px; --ctl: 38px; }
html[data-font="inter"]   { --font-body: 'Inter', system-ui, sans-serif; --font-head: var(--font-body); }
html[data-font="jakarta"] { --font-body: 'Plus Jakarta Sans', system-ui, sans-serif; --font-head: var(--font-body); }
html[data-font="plex"]    { --font-body: 'IBM Plex Sans', system-ui, sans-serif; --font-head: var(--font-body); }
html[data-font="serif"]   { --font-body: 'Inter', system-ui, sans-serif; --font-head: 'Source Serif 4', Georgia, 'Times New Roman', serif; }
html[data-font="system"]  { --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-head: var(--font-body); }

/* ---------- 5. Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.22; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.012em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.15rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.04rem; }
p { margin: 0 0 .85em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mb-14 { margin-bottom: 14px; } .mb-16 { margin-bottom: 16px; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.logo-mark { width: 38px; height: 38px; flex: none; display: block; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }
.container.wide-admin { max-width: 1240px; }
.container.narrow, .narrow { max-width: 620px; }
.stack { display: grid; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 6. Komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); box-shadow: var(--shadow-sm); }
.card > h2:first-child, .card > h3:first-child { margin-bottom: .6em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--ctl); padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 .92rem/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.secondary { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
html[data-surface="dark"] .btn.secondary { color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(.92); }
.btn.pink { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.flag.on { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.btn.sm { min-height: calc(var(--ctl) - 10px); padding: 0 12px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn .ico { width: 1.1em; height: 1.1em; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--ink); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--ctl); padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 .95rem/1.4 var(--font-body); transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.color-input { padding: 4px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check.card { padding: 12px 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 78px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent); font: 600 .82rem var(--font-body); padding: 8px 10px; cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { background: var(--accent-soft); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip .ico { width: 1em; height: 1em; }
.chip.pink { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
html[data-surface="dark"] .chip.pink { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.chip.mint { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.chip.honey { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.chip.red { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.chip.gray { background: var(--surface-2); color: var(--ink-2); }
.chip.mint::before, .chip.honey::before, .chip.red::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--ink); font-size: .9rem; margin: 0 0 14px; }
.alert.error { background: var(--err-soft); border-color: var(--err-line); color: var(--err); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
html[data-surface="dark"] .alert.error, html[data-surface="dark"] .alert.warn, html[data-surface="dark"] .alert.ok { color: var(--ink); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty .big { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .big .ico { width: 26px; height: 26px; }
.empty p { margin: 0; }

.stat { display: flex; align-items: center; gap: 14px; padding: 18px var(--pad); }
.stat .stat-ico { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.stat .stat-ico .ico { width: 22px; height: 22px; }
.stat .num { font: 700 1.9rem/1 var(--font-head); letter-spacing: -.02em; }
.stat .muted { font-size: .84rem; }

.overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(8,12,28,.55); backdrop-filter: blur(3px); overflow-y: auto; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { max-width: 860px; }
.modal h2 { font-size: 1.2rem; margin-bottom: .7em; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 500; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--surface); font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); border-left: 4px solid var(--accent); animation: pop .2s ease-out; max-width: 360px; }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--err); }

/* ---------- 7. Header & kerangka aplikasi ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 10px clamp(16px, 3vw, 32px); min-height: 66px; background: var(--top-bg); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font: 700 1.02rem var(--font-head); letter-spacing: -.01em; }
.brand-text small { font-size: .7rem; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.top-title { font: 600 1.02rem var(--font-head); color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-title:empty { display: block; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 .78rem var(--font-body); }
.user-meta { display: grid; line-height: 1.2; }
.user-meta strong { font-size: .84rem; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: .7rem; color: var(--ink-2); }
.icon-btn .ico { width: 1.05em; height: 1.05em; }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app-main { min-width: 0; }
.sidenav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--side-line); }
.side-brand .brand-text small { color: var(--side-ink-2); }
.side-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--side-ink-2); padding: 8px 12px 4px; font-weight: 600; }
.admin-tabs { display: grid; gap: 3px; }
.tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--side-ink-2); font: 500 .92rem var(--font-body); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.tab:hover { background: var(--side-active); color: var(--side-ink); }
.tab.active { background: var(--side-active); color: var(--side-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.tab .ico { width: 19px; height: 19px; }
.side-foot { margin-top: auto; padding: 12px; border-radius: var(--r-sm); font-size: .78rem; color: var(--side-ink-2); border: 1px dashed var(--side-line); }

/* tata letak: navigasi atas */
html[data-layout="topbar"] .app { display: flex; flex-direction: column; }
html[data-layout="topbar"] .app-main { display: contents; }
html[data-layout="topbar"] #bar { order: 1; }
html[data-layout="topbar"] .sidenav { order: 2; position: sticky; top: 66px; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 8px clamp(16px, 3vw, 32px); background: var(--surface); color: var(--ink); border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
html[data-layout="topbar"] .app .container { order: 3; width: 100%; }
html[data-layout="topbar"] .side-brand, html[data-layout="topbar"] .side-label, html[data-layout="topbar"] .side-foot { display: none; }
html[data-layout="topbar"] .admin-tabs { display: flex; gap: 4px; }
html[data-layout="topbar"] .tab { width: auto; white-space: nowrap; color: var(--ink-2); padding: 8px 14px; }
html[data-layout="topbar"] .tab:hover { background: var(--surface-2); color: var(--ink); }
html[data-layout="topbar"] .tab.active { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }
html[data-surface="dark"][data-layout="topbar"] .tab.active { color: var(--ink); }
/* tata letak: ringkas (hanya ikon) */
html[data-layout="compact"] { --side-w: 76px; }
html[data-layout="compact"] .tab { justify-content: center; padding: 12px 0; }
html[data-layout="compact"] .tab span, html[data-layout="compact"] .side-label, html[data-layout="compact"] .side-foot, html[data-layout="compact"] .side-brand .brand-text { display: none; }
html[data-layout="compact"] .side-brand { justify-content: center; padding: 4px 0 16px; }
html[data-layout="compact"] .tab .ico { width: 21px; height: 21px; }
/* header admin: brand pindah ke sidebar */
html[data-page="admin"][data-layout="sidebar"] .topbar .brand, html[data-page="admin"][data-layout="compact"] .topbar .brand { display: none; }
html[data-page="admin"][data-layout="topbar"] .top-title { display: none; }

/* ---------- 8. Halaman masuk ---------- */
html[data-page="login"] body { background: var(--surface); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: clamp(32px, 5vw, 64px); background: linear-gradient(150deg, #0b1b3a 0%, #12295c 60%, #1d3f86 100%); color: #fff; }
.login-brand-panel::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 20%, #000, transparent 75%); pointer-events: none; }
.login-brand-panel::after { content: ''; position: absolute; width: 520px; height: 520px; right: -200px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(96,140,255,.45), transparent 65%); pointer-events: none; }
.login-brand-panel > * { position: relative; z-index: 1; }
.login-brand-panel .brand-text small { color: rgba(255,255,255,.65); }
.login-brand-panel .brand-text strong, .login-brand-panel h1 { color: #fff; }
.login-brand-panel .logo-mark { --logo-bg: #fff; --logo-fg: #1d4ed8; }
.brand-copy h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem); margin-bottom: 16px; max-width: 16ch; }
.brand-copy p { color: rgba(255,255,255,.78); max-width: 46ch; font-size: 1.02rem; }
.brand-copy .eyebrow { color: rgba(255,255,255,.7); }
.feature-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .f-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); flex: none; }
.feature-list b { display: block; font-weight: 600; font-size: .95rem; }
.feature-list span.t { display: block; font-size: .84rem; color: rgba(255,255,255,.7); }
.brand-footer { font-size: .78rem; color: rgba(255,255,255,.6); letter-spacing: .04em; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 64px); background: var(--surface); position: relative; }
.login-form-inner { width: 100%; max-width: 400px; margin: 0 auto; }
.login-form-inner h2 { font-size: 1.75rem; margin-bottom: 6px; }
.login-form-inner > .muted { margin-bottom: 26px; }
.mobile-brand { display: none; margin-bottom: 28px; }
.login-submit { margin-top: 6px; min-height: 48px; font-size: .98rem; }
.login-help { margin-top: 22px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; display: flex; gap: 10px; }
.login-help .ico { color: var(--accent); margin-top: 2px; }
.login-copyright { margin-top: 28px; text-align: center; font-size: .76rem; color: var(--ink-3); }

/* emerald: kartu mengambang di tengah */
html[data-theme="emerald"][data-page="login"] body { background: radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--accent) 14%, transparent), var(--bg)); }
html[data-theme="emerald"] .login-shell { grid-template-columns: 1fr 1fr; max-width: 1060px; min-height: 0; margin: clamp(16px, 6vh, 64px) auto; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
html[data-theme="emerald"] .login-brand-panel { background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #064e3b)); }
html[data-theme="emerald"] .login-brand-panel::before { background-image: radial-gradient(rgba(255,255,255,.16) 1.5px, transparent 1.5px); background-size: 22px 22px; mask-image: none; }
html[data-theme="emerald"] .login-brand-panel .logo-mark { --logo-fg: var(--accent); }
html[data-theme="emerald"] .brand-copy h1 { max-width: none; }
/* midnight: tengah, bercahaya */
html[data-theme="midnight"][data-page="login"] body { background: radial-gradient(700px 420px at 50% -10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent), #080b1a; }
html[data-theme="midnight"] .login-shell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 28px 16px; }
html[data-theme="midnight"] .login-brand-panel { background: none; padding: 0; text-align: center; align-items: center; gap: 0; overflow: visible; flex: none; }
html[data-theme="midnight"] .login-brand-panel::before, html[data-theme="midnight"] .login-brand-panel::after, html[data-theme="midnight"] .brand-footer, html[data-theme="midnight"] .feature-list, html[data-theme="midnight"] .brand-copy p, html[data-theme="midnight"] .login-brand-panel .login-brand { display: none; }
html[data-theme="midnight"] .brand-copy h1 { font-size: 1.7rem; max-width: none; margin: 0 0 6px; }
html[data-theme="midnight"] .brand-copy .eyebrow { margin-bottom: 14px; }
html[data-theme="midnight"] .login-brand-panel .logo-mark { --logo-bg: var(--accent); --logo-fg: #fff; width: 52px; height: 52px; }
html[data-theme="midnight"] .login-brand { display: flex !important; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
html[data-theme="midnight"] .login-form-panel { width: 100%; max-width: 440px; border-radius: var(--r-lg); border: 1px solid rgba(255,255,255,.09); background: rgba(19,26,46,.78); backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); padding: 34px 30px; color: #e8ecf8; --ink: #e8ecf8; --ink-2: #a4aed0; --ink-3: #6d789c; --surface: #131a2e; --surface-2: #19223a; --line: #263150; --line-strong: #37446b; color-scheme: dark; }
html[data-theme="midnight"] .login-form-inner { max-width: none; }
html[data-theme="midnight"] .mobile-brand { display: none !important; }
/* paper: editorial, panel di kanan */
html[data-theme="paper"] .login-shell { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
html[data-theme="paper"] .login-form-panel { order: 1; background: var(--surface); border-right: 1px solid var(--line-strong); }
html[data-theme="paper"] .login-brand-panel { order: 2; background: var(--bg); color: var(--ink); }
html[data-theme="paper"] .login-brand-panel::before { background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(28,25,23,.07) 31px 32px); mask-image: none; }
html[data-theme="paper"] .login-brand-panel::after { display: none; }
html[data-theme="paper"] .login-brand-panel .brand-text strong, html[data-theme="paper"] .login-brand-panel h1, html[data-theme="paper"] .brand-copy p, html[data-theme="paper"] .feature-list b { color: var(--ink); }
html[data-theme="paper"] .login-brand-panel .brand-text small, html[data-theme="paper"] .brand-copy .eyebrow, html[data-theme="paper"] .feature-list span.t, html[data-theme="paper"] .brand-footer { color: var(--ink-2); }
html[data-theme="paper"] .login-brand-panel .logo-mark { --logo-bg: #1c1917; --logo-fg: #fffdf8; }
html[data-theme="paper"] .feature-list .f-ico { background: var(--surface); border-color: var(--line-strong); color: var(--accent); border-radius: 50%; }
html[data-theme="paper"] .brand-copy h1 { font-weight: 600; font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.6rem); max-width: 12ch; letter-spacing: -.02em; }
html[data-theme="paper"] .brand-copy p { font-family: var(--font-head); font-size: 1.12rem; }
html[data-theme="paper"] .login-form-inner h2 { font-weight: 600; }
/* sunrise: panel hangat berbingkai */
html[data-theme="sunrise"][data-page="login"] body { background: var(--surface); }
html[data-theme="sunrise"] .login-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; gap: 0; }
html[data-theme="sunrise"] .login-brand-panel { border-radius: calc(var(--r-lg) + 10px); background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #ec4899) 80%, #f59e0b); }
html[data-theme="sunrise"] .login-brand-panel::before { background-image: none; background: radial-gradient(circle at 85% 15%, rgba(255,255,255,.3), transparent 38%); mask-image: none; }
html[data-theme="sunrise"] .login-brand-panel::after { width: 380px; height: 380px; left: -120px; bottom: -140px; right: auto; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 65%); }
html[data-theme="sunrise"] .login-brand-panel .logo-mark { --logo-fg: var(--accent); }
html[data-theme="sunrise"] .feature-list .f-ico { border-radius: 50%; background: rgba(255,255,255,.2); }
html[data-theme="sunrise"] .brand-copy h1 { max-width: 13ch; }
html[data-theme="sunrise"] .login-submit { border-radius: 999px; }

/* ---------- 9. Dasbor siswa ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: clamp(22px, 3.5vw, 36px); margin-bottom: 20px; border-radius: var(--r-lg); background: var(--hero-bg); color: var(--hero-ink); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 66%); pointer-events: none; }
.hero h1 { color: var(--hero-ink); margin-bottom: 6px; }
.hero p { color: var(--hero-ink-2); margin: 0; max-width: 56ch; }
.hero .eyebrow { color: var(--hero-ink-2); }
.hero .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: var(--hero-ink); position: relative; z-index: 1; }
.hero .btn:hover { background: rgba(255,255,255,.24); }
html[data-theme="emerald"] .hero { border: 1px solid var(--accent-line); }
html[data-theme="emerald"] .hero .btn { background: var(--surface); border-color: var(--accent-line); color: var(--accent-strong); }
html[data-theme="paper"] .hero { padding: 8px 0 24px; border-radius: 0; border-bottom: 2px solid var(--ink); }
html[data-theme="paper"] .hero::after { display: none; }
html[data-theme="paper"] .hero .btn { background: transparent; border-color: var(--ink); color: var(--ink); }
html[data-theme="paper"] .hero h1 { font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); font-weight: 600; }
html[data-surface="dark"][data-theme="emerald"] .hero .btn { color: var(--ink); }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: 26px; }
.sum-tile { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.sum-tile .stat-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.sum-tile.ok .stat-ico { background: var(--ok-soft); color: var(--ok); }
.sum-tile.warn .stat-ico { background: var(--warn-soft); color: var(--warn); }
.sum-tile b { display: block; font: 700 1.55rem/1.05 var(--font-head); }
.sum-tile span.l { font-size: .78rem; color: var(--ink-2); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; font-size: 1.1rem; }

.exam-card { display: flex; flex-direction: column; gap: 12px; position: relative; padding: var(--pad); border-left: 4px solid var(--accent); transition: box-shadow .2s, transform .2s; }
.exam-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.exam-card h3 { margin: 0; font-size: 1.08rem; }
.exam-card .row { align-items: flex-start; flex-wrap: nowrap; gap: 12px; }
.exam-card > div:last-child { margin-top: auto; padding-top: 4px; }
.exam-card .btn { width: 100%; }
.exam-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card.empty { grid-column: 1 / -1; border-style: dashed; }
html[data-theme="paper"] .exam-card { border-left-width: 1px; border-top: 3px solid var(--ink); }
html[data-theme="paper"] .exam-card:hover { transform: none; box-shadow: none; background: var(--surface-2); }
html[data-theme="sunrise"] .exam-card { border-left-width: 1px; border-top: 5px solid var(--accent); }

/* ---------- 10. Aturan ujian ---------- */
.rules-wrap { max-width: 800px; }
.rules-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.rules-head .stat-ico { width: 52px; height: 52px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.rules-head .stat-ico .ico { width: 26px; height: 26px; }
.rules-head h1 { font-size: 1.5rem; margin-bottom: 8px; }
.rules { list-style: none; counter-reset: r; margin: 20px 0 26px; padding: 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: .92rem; }
.rules .ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--accent); display: grid; place-items: center; flex: none; }
.rules li.key { border-color: var(--warn-line); background: var(--warn-soft); }
.rules li.key .ic { color: var(--warn); border-color: var(--warn-line); }
.rules b { color: var(--ink); }
.rules-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
#tokenField input { font: 700 1.1rem var(--font-body); letter-spacing: .18em; text-transform: uppercase; text-align: center; }

/* ---------- 11. Ujian ---------- */
body.exam { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.exam textarea, body.exam input[type=text] { -webkit-user-select: text; user-select: text; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(800px 400px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
.gate .card { max-width: 560px; width: 100%; text-align: center; padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.gate .logo-mark { margin: 0 auto 18px; width: 52px; height: 52px; }
.gate h1 { font-size: 1.6rem; }
.gate .alert { text-align: left; }
.gate .row { justify-content: center; margin-top: 8px; }
.gate-checks { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; text-align: left; }
.gate-checks li { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink-2); }
.gate-checks .ico { color: var(--ok); }

.exam-top { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px clamp(14px, 3vw, 32px); min-height: 64px; background: var(--top-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.exam-top .brand-mini { display: flex; align-items: center; gap: 12px; min-width: 0; }
.exam-top .logo-mark { width: 32px; height: 32px; }
.exam-title { font: 600 .98rem var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.exam-sub { display: block; font: 500 .7rem var(--font-body); color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.hearts-label { font-size: .72rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.hearts { display: inline-flex; gap: 5px; align-items: center; }
.hearts .pip { width: 22px; height: 7px; border-radius: 99px; background: var(--ok); transition: background .2s; }
.hearts .pip.lost { background: var(--line-strong); }
.hearts.danger .pip:not(.lost) { background: var(--err); }
.save-state { font-size: .78rem; color: var(--ink-2); min-width: 92px; text-align: right; }
.save-state.ok { color: var(--ok); } .save-state.err { color: var(--err); font-weight: 600; }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--surface); font: 700 1.05rem/1 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timer.warn { background: var(--warn); color: #fff; }
.timer.danger { background: var(--err); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .72; } }
.offline-banner { background: var(--err); color: #fff; text-align: center; font-weight: 600; font-size: .86rem; padding: 8px 12px; }

.exam-wrap { max-width: 1180px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 32px) 56px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "q nav" "q fin"; gap: var(--gap); align-items: start; }
.q-card { grid-area: q; min-height: 440px; padding: clamp(20px, 3vw, 36px); }
.nav-card { grid-area: nav; position: sticky; top: 82px; padding: 20px; }
.exam-finish-card { grid-area: fin; display: grid; gap: 12px; padding: 20px; }
.nav-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.nav-heading h3 { margin: 0; font-size: 1rem; }
.nav-heading .eyebrow { margin-bottom: 2px; font-size: .66rem; }
.nav-heading p { margin: 0; font-weight: 600; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: var(--ink-2); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--surface); border: 1px solid var(--line-strong); vertical-align: -1px; }
.legend i.a { background: var(--accent); border-color: var(--accent); } .legend i.f { background: var(--warn-soft); border-color: var(--warn); }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.nav-btn { height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 600 .84rem var(--font-body); cursor: pointer; transition: all .12s; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.answered { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nav-btn.flagged { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.nav-btn.current { outline: 2px solid var(--ink); outline-offset: 2px; }
.finish-actions { display: grid; gap: 8px; }
.exam-finish-card h3 { margin: 0 0 4px; font-size: 1rem; }
.exam-finish-card p { margin: 0; font-size: .84rem; }
.exam-finish-card .eyebrow { font-size: .66rem; margin-bottom: 2px; }
.finish-actions .btn { width: 100%; }

.q-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.q-text { font: 500 1.14rem/1.75 var(--font-head); margin-bottom: 22px; white-space: pre-wrap; word-break: break-word; }
.q-head .chip:first-child { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.question-image-wrap { margin: 0 0 22px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.question-image-wrap img { display: block; max-width: 100%; max-height: 440px; object-fit: contain; margin: auto; border-radius: var(--r-sm); }
.opt-wrap { position: relative; margin-bottom: 10px; }
.opt-wrap input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
label.option { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 58px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); pointer-events: none; transition: all .14s; }
.opt-wrap:hover label.option { border-color: var(--accent-line); background: var(--accent-soft); }
.opt-wrap input:focus-visible + label.option { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-wrap input:checked + label.option { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.letter { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line-strong); font: 700 .82rem var(--font-body); color: var(--ink-2); background: var(--surface); }
.opt-wrap input:checked + label.option .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.otext { line-height: 1.5; word-break: break-word; }
.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
body.hide-q .q-card, body.hide-q .nav-card { filter: blur(16px); pointer-events: none; }

.overlay.full { z-index: 300; background: rgba(10,14,30,.9); backdrop-filter: blur(8px); }
.overlay.full .modal { max-width: 500px; text-align: center; padding: 34px 30px; }
.status-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.status-icon .ico { width: 30px; height: 30px; }
.status-icon.err { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }
.status-icon.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.countdown { font: 700 2.8rem/1 var(--font-head); color: var(--err); font-variant-numeric: tabular-nums; margin: 10px 0; }
.locked-screen { z-index: 400; background: rgba(40,6,10,.94); }
#warnHearts { justify-content: center; margin: 10px 0; }
#warnCount { margin-bottom: 6px; }

/* ---------- 12. Hasil ujian ---------- */
.result-card { padding: clamp(28px, 5vw, 48px); text-align: center; }
.result-card .stat { display: block; text-align: center; padding: 8px 0 14px; border: 0; box-shadow: none; background: none; }
.result-card .stat .num { font-size: clamp(3.4rem, 10vw, 5rem); color: var(--accent); }
.result-card .alert { text-align: left; }

/* ---------- 13. Panel admin ---------- */
.q-item { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); margin-bottom: 12px; }
.q-item .q-text { font-size: 1rem; margin: 10px 0; font-weight: 500; }
.opts { margin: 8px 0 0; padding-left: 22px; color: var(--ink-2); font-size: .9rem; }
.opts li.correct { color: var(--ok); font-weight: 600; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opt-row input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.question-admin-preview { display: block; max-width: 100%; max-height: 240px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); margin: 10px 0; background: var(--surface-2); }

/* pembuat tema */
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.theme-preset { display: grid; gap: 4px; text-align: left; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: all .15s; }
.theme-preset:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-preset.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.theme-preset strong { font-size: .92rem; padding: 6px 4px 0; } .theme-preset small { color: var(--ink-2); font-size: .78rem; line-height: 1.4; padding: 0 4px 4px; }
.theme-swatch { display: block; height: 92px; border-radius: calc(var(--r-sm) + 2px); border: 1px solid rgba(0,0,0,.08); position: relative; overflow: hidden; }
.theme-swatch::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 28%; }
.theme-swatch::after { content: ''; position: absolute; left: 36%; right: 8%; top: 16px; height: 10px; border-radius: 3px; box-shadow: 0 20px 0 -0px rgba(0,0,0,.09), 0 40px 0 -0px rgba(0,0,0,.09); }
.theme-swatch.executive { background: #eef1f7; } .theme-swatch.executive::before { background: #0b1b3a; } .theme-swatch.executive::after { background: #1d4ed8; }
.theme-swatch.emerald { background: #f2f9f6; } .theme-swatch.emerald::before { background: #fff; width: 100%; height: 22px; bottom: auto; border-bottom: 1px solid #dcebe5; } .theme-swatch.emerald::after { background: #059669; top: 36px; left: 10%; }
.theme-swatch.midnight { background: #0a0e1c; } .theme-swatch.midnight::before { background: #0d1326; } .theme-swatch.midnight::after { background: #6366f1; }
.theme-swatch.paper { background: #f6f1e7; } .theme-swatch.paper::before { background: #efe7d6; width: 14%; border-right: 1px solid #ddd2bc; } .theme-swatch.paper::after { background: #1c1917; left: 26%; }
.theme-swatch.sunrise { background: #fff7f0; } .theme-swatch.sunrise::before { background: #fff; width: 100%; height: 22px; bottom: auto; } .theme-swatch.sunrise::after { background: linear-gradient(90deg, #ea580c, #ec4899); top: 36px; left: 10%; border-radius: 99px; }

.theme-live-preview { --pv-accent: var(--preview-accent, #1d4ed8); border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: #eef1f7; color: #0f172a; font-size: .82rem; }
.theme-live-preview[data-surface="dark"] { background: #0a0e1c; color: #e8ecf8; }
.preview-head { padding: 10px 14px; font-weight: 700; font-size: .72rem; letter-spacing: .1em; background: #fff; border-bottom: 1px solid #e3e8f0; color: #475569; }
.theme-live-preview[data-surface="dark"] .preview-head { background: #131a2e; border-color: #263150; color: #a4aed0; }
.preview-layout { display: grid; grid-template-columns: 130px 1fr; min-height: 200px; }
.preview-layout.layout-topbar { grid-template-columns: 1fr; }
.preview-layout.layout-compact { grid-template-columns: 54px 1fr; }
.preview-side { display: grid; align-content: start; gap: 6px; padding: 14px 12px; background: #0b1b3a; color: #c7d3f0; }
.preview-layout.layout-compact .preview-side span, .preview-layout.layout-compact .preview-side b { font-size: 0; }
.preview-layout.layout-compact .preview-side span::before { content: ''; display: block; width: 18px; height: 18px; border-radius: 5px; background: rgba(255,255,255,.28); }
.preview-side span { padding: 6px 8px; border-radius: 6px; } .preview-side span:nth-child(2) { background: rgba(255,255,255,.14); color: #fff; }
.theme-live-preview[data-preset="emerald"] .preview-side, .theme-live-preview[data-preset="sunrise"] .preview-side { background: #fff; color: #475569; border-right: 1px solid #e3e8f0; }
.theme-live-preview[data-preset="paper"] .preview-side { background: #efe7d6; color: #57534e; }
.theme-live-preview[data-preset="paper"] { background: #f6f1e7; }
.theme-live-preview[data-preset="emerald"] { background: #f2f9f6; } .theme-live-preview[data-preset="sunrise"] { background: #fff7f0; }
.theme-live-preview[data-preset="midnight"] .preview-side { background: #0d1326; }
.preview-content { padding: 16px; } .preview-content h3 { margin: 0 0 4px; font-size: 1rem; color: inherit; } .preview-content p { margin: 0 0 12px; opacity: .7; }
.preview-card { padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid #e3e8f0; border-left: 4px solid var(--pv-accent); border-radius: 8px; color: #0f172a; }
.theme-live-preview[data-surface="dark"] .preview-card { background: #131a2e; border-color: #263150; border-left-color: var(--pv-accent); color: #e8ecf8; }

/* ---------- 14. Responsif ---------- */
@media (max-width: 1020px) {
  .exam-wrap { grid-template-columns: 1fr; grid-template-areas: "nav" "q" "fin"; }
  .nav-card { position: static; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); max-height: 150px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr !important; }
  .sidenav, html[data-layout] .sidenav { position: sticky; top: 66px; z-index: 40; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--side-line); }
  .side-brand, .side-label, .side-foot { display: none !important; }
  .admin-tabs { display: flex; gap: 4px; }
  .tab, html[data-layout="compact"] .tab { width: auto; white-space: nowrap; padding: 8px 12px; }
  html[data-layout="compact"] .tab span { display: inline; }
  html[data-page="admin"] .topbar .brand { display: flex !important; }
  .app-main { display: contents; }
  .app { display: flex; flex-direction: column; }
  #bar { order: 1; } .sidenav { order: 2; } .app .container { order: 3; }
  .login-shell, html[data-theme] .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 11px; }
  html[data-theme="emerald"] .login-shell { margin: 0; border-radius: 0; border: 0; box-shadow: none; min-height: 100vh; }
  html[data-theme="midnight"] .mobile-brand { display: none !important; }
  html[data-theme="midnight"] .login-brand-panel { display: flex; }
  html[data-theme="sunrise"] .login-shell { padding: 0; }
  html[data-theme="paper"] .login-form-panel { border-right: 0; }
  .login-form-panel { min-height: 100vh; }
  html[data-theme="midnight"] .login-form-panel { min-height: 0; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .container { padding: 18px 14px 48px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sum-tile { padding: 12px; } .sum-tile .stat-ico { width: 34px; height: 34px; }
  .user-meta, .btn-label { display: none; }
  .user-chip { padding: 3px; }
  .brand-text small { display: none; }
  .topbar { gap: 10px; }
  .exam-top { gap: 8px; padding: 8px 12px; }
  .exam-top .brand-mini .logo-mark, .hearts-label, .save-state:not(.bottom) { display: none; }
  .exam-title { max-width: 44vw; font-size: .88rem; }
  .timer { font-size: .95rem; padding: 6px 11px; }
  .hearts .pip { width: 14px; }
  .q-actions .btn { flex: 1 1 40%; padding: 0 10px; }
  .q-actions .flag { order: -1; flex-basis: 100%; }
  .rules-head { flex-direction: column; gap: 10px; }
  .rules-actions .btn { flex: 1; }
  .modal { padding: 20px; }
  .preview-layout { grid-template-columns: 1fr !important; } .preview-side { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .sidenav, .btn { display: none !important; } }

/* penyesuaian kontras mode gelap & kepala navigasi soal */
html[data-surface="dark"] .btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
html[data-surface="dark"] .timer.warn { color: #1c1300; }
.nav-heading { flex-direction: column; gap: 6px; }
.nav-heading p { white-space: normal; }
@media (max-width: 1020px) {
  .nav-card { padding: 14px 16px; }
  .nav-grid { display: flex; overflow-x: auto; max-height: none; padding: 2px 2px 8px; }
  .nav-btn { flex: 0 0 40px; }
  .nav-heading { flex-direction: row; align-items: baseline; }
  .nav-heading .eyebrow { display: none; }
}
@media (max-width: 680px) { .legend { display: none; } }
.card:not(.exam-card) > .row.between { margin-bottom: 14px; }
.card > .row.between > h2, .card > .row.between > h3 { margin-bottom: 0; }
input[type=file].input { padding: 8px 10px; line-height: 1.2; }
input[type=file].input::file-selector-button { margin-right: 12px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font: 600 .84rem var(--font-body); cursor: pointer; }
