/* ============================================================
   OMRKu — Pemindai Lembar Jawaban & Penilai Ujian Otomatis
   Tampilan app-like Android: emerald green, kartu putih, Inter.
   ============================================================ */
@font-face { font-family: 'Inter'; src: url('../fonts/inter-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --em-800: #065f46;
  --em-700: #047857;
  --em-600: #059669;
  --em-500: #10b981;
  --em-400: #34d399;
  --em-100: #d1fae5;
  --em-50: #ecfdf5;
  --sky-600: #0284c7;
  --sky-50: #e0f2fe;
  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --amber-600: #d97706;
  --amber-50: #fffbeb;
  --rose-600: #dc2626;
  --rose-50: #fef2f2;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: rgba(15, 23, 42, .09);
  --line-soft: rgba(15, 23, 42, .055);
  --bg: #f1f5f9;
  --white: #fff;
  --r-lg: 20px;
  --r: 16px;
  --r-sm: 12px;
  --r-xs: 9px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 20px -16px rgba(15, 23, 42, .35);
  --sh: 0 2px 6px rgba(15, 23, 42, .05), 0 18px 38px -28px rgba(15, 23, 42, .42);
  --sh-lg: 0 30px 60px -34px rgba(15, 23, 42, .45);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --appbar-h: 62px;
  --brand: #059669;
  --grad-brand: linear-gradient(135deg, #047857 0%, #059669 52%, #10b981 100%);
  --grad-soft: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 55%, #eff6ff 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 0% -10%, #e6fbf3 0%, rgba(230, 251, 243, 0) 62%),
    radial-gradient(720px 460px at 104% 4%, #e8f4ff 0%, rgba(232, 244, 255, 0) 58%),
    radial-gradient(760px 520px at 50% 110%, #eef7ff 0%, rgba(238, 247, 255, 0) 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--em-700); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
code, .mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }

/* ---------------- layout ---------------- */
.app { min-height: 100vh; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 16px 15px calc(112px + var(--safe-b)); width: 100%; max-width: 1180px; margin: 0 auto; }

/* ---------------- appbar ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--grad-brand);
  box-shadow: 0 8px 24px -18px rgba(4, 120, 87, .8);
  padding-top: env(safe-area-inset-top, 0px);
}
.appbar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(320px 120px at 88% -20%, rgba(255, 255, 255, .3), transparent 70%);
}
.appbar-inner { display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-height: var(--appbar-h); max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.appbar-title { flex: 1; min-width: 0; }
.appbar-title h1 { font-size: 16.5px; line-height: 1.25; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-title p { font-size: 11.5px; color: rgba(255, 255, 255, .78); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .icon-btn { color: #fff; }
.appbar .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.appbar-user .avatar { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.appbar-school { display: none; }
.appbar-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: #fff; padding: 3px; box-shadow: 0 2px 6px rgba(6, 24, 18, .18);
}
.appbar-logo img { width: 100%; height: 100%; object-fit: contain; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--em-800); cursor: pointer; transition: background .15s, transform .12s;
}
.icon-btn:hover { background: var(--em-50); }
.icon-btn:active { transform: scale(.94); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--em-100); color: var(--em-800); font-weight: 700; font-size: 12px; letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }

/* ---------------- rail (desktop) ---------------- */
.rail { display: none; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.brand-mark {
  width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; overflow: hidden;
}
.brand-mark.sm { width: 36px; height: 36px; border-radius: 11px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line); padding: 4px; }
.rail-name { display: flex; flex-direction: column; min-width: 0; }
.rail-name strong { font-size: 14px; color: var(--ink); }
.rail-name span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-school { padding: 0 14px 8px; }
.rail-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.rail-group { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); padding: 13px 10px 5px; }
.rail-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s;
}
.rail-item .ico { color: var(--muted); }
.rail-item:hover { background: var(--em-50); }
.rail-item.active { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-sm); }
.rail-item.active .ico { color: #fff; }
.rail-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 12px; color: inherit; }
.rail-user:hover { background: var(--em-50); }
.rail-user strong { display: block; font-size: 12.5px; color: var(--ink); }
.rail-user small { font-size: 11px; color: var(--muted); }

/* ---------------- bottom nav ---------------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end;
  padding: 7px 6px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px) saturate(170%);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -10px 28px -22px rgba(15, 23, 42, .5);
  border-radius: 20px 20px 0 0;
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
  padding: 5px 2px 4px; border-radius: 13px; color: var(--muted); font-size: 10px; font-weight: 600;
  transition: color .15s, background .15s;
}
.bn-item .ico { width: 22px; height: 22px; }
.bn-item.active { color: var(--em-700); }
.bn-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; border-radius: 3px; background: var(--em-600);
}
.bn-fab { padding-top: 0; }
.bn-fab-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin-top: -22px;
  background: var(--grad-brand); color: #fff;
  box-shadow: 0 12px 24px -10px rgba(5, 150, 105, .75), 0 0 0 4px #fff;
}
.bn-fab-label { color: var(--em-700); font-weight: 700; }
.bn-fab.active .bn-fab-btn { box-shadow: 0 12px 24px -8px rgba(5, 150, 105, .9), 0 0 0 4px #fff; }

/* ---------------- drawer ---------------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(6, 24, 18, .45); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 61; width: min(86vw, 320px);
  background: #fff; display: flex; flex-direction: column;
  transform: translateX(-104%); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  box-shadow: var(--sh-lg); border-radius: 0 22px 22px 0;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--grad-brand); color: #fff; }
.drawer-head strong { display: block; font-size: 14px; }
.drawer-head small { font-size: 11.5px; opacity: .82; }
.drawer-head .icon-btn { color: #fff; }
.drawer-head .brand-mark.has-logo { background: #fff; }
.drawer-nav { flex: 1; overflow-y: auto; padding: 6px 10px 14px; }
.drawer-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.drawer-item .ico { color: var(--muted); }
.drawer-item.active { background: var(--em-50); color: var(--em-800); font-weight: 600; }
.drawer-item.active .ico { color: var(--em-700); }
.drawer-foot { padding: 12px; border-top: 1px solid var(--line-soft); }

/* ---------------- kartu & panel ---------------- */
.panel {
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); padding: 16px; margin-bottom: 16px;
}
.panel.tight { padding: 12px; }
.panel.flat { box-shadow: none; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { font-size: 15px; color: var(--ink); }
.panel-head p { font-size: 12px; color: var(--muted); }
.panel-link { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--em-700); display: inline-flex; align-items: center; gap: 4px; }
.panel-head .ico { color: var(--em-600); }
.sec-head { display: flex; align-items: center; gap: 10px; margin: 22px 2px 10px; }
.sec-head h2 { font-size: 15.5px; }
.sec-head .panel-link { margin-left: auto; }

.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--sh-xs); padding: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
/* Item grid/flex WAJIB boleh menyusut: tanpa min-width:0, judul ujian yang panjang
   (nowrap + ellipsis) memaksa lebar dokumen lebih besar dari layar → seluruh halaman
   ikut menyusut/bergulir ke samping di HP. */
.grid > *, .stack > *, .list-item, .panel, .card, .row > .grow, .cell-main { min-width: 0; }
.list-item .grow > strong, .list-item .grow > small { min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------------- statistik ---------------- */
.stat {
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r);
  box-shadow: var(--sh-xs); padding: 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ic {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--em-50); color: var(--em-700);
}
.stat-ic.sky { background: var(--sky-50); color: var(--sky-600); }
.stat-ic.amber { background: var(--amber-50); color: var(--amber-600); }
.stat-ic.rose { background: var(--rose-50); color: var(--rose-600); }
.stat-ic.blue { background: var(--blue-50); color: var(--blue-600); }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-sub { font-size: 11px; color: var(--muted-2); }

.hero-dash {
  position: relative; overflow: hidden; border-radius: 22px; padding: 18px;
  background: var(--grad-brand); color: #fff; margin-bottom: 16px;
  box-shadow: 0 22px 44px -28px rgba(4, 120, 87, .85);
}
.hero-dash::after {
  content: ''; position: absolute; right: -34px; top: -46px; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 68%);
}
.hero-dash h2 { font-size: 18px; line-height: 1.3; }
.hero-dash p { font-size: 12.5px; color: rgba(255, 255, 255, .82); margin-top: 2px; }
.hero-kpi { display: flex; gap: 18px; margin-top: 14px; position: relative; z-index: 1; }
.hero-kpi div { min-width: 0; }
.hero-kpi strong { font-size: 20px; font-weight: 700; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-kpi span { font-size: 10.5px; color: rgba(255, 255, 255, .78); }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-actions .btn { background: rgba(255, 255, 255, .96); color: var(--em-800); box-shadow: none; }
.hero-actions .btn.ghost-w { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

/* ---------------- tombol ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; border-radius: 12px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; line-height: 1.2; cursor: pointer;
  background: var(--em-600); color: #fff; box-shadow: 0 8px 18px -14px rgba(5, 150, 105, .9);
  transition: transform .12s, background .15s, box-shadow .15s; text-align: center;
}
.btn:hover { background: var(--em-700); }
.btn:active { transform: scale(.985); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: 14px; }
.btn-outline { background: #fff; color: var(--em-800); border-color: rgba(5, 150, 105, .28); box-shadow: none; }
.btn-outline:hover { background: var(--em-50); }
.btn-ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); color: var(--ink); }
.btn-danger { background: var(--rose-600); color: #fff; box-shadow: 0 8px 18px -14px rgba(220, 38, 38, .8); }
.btn-danger:hover { background: #b91c1c; }
.btn-warn { background: var(--amber-600); color: #fff; box-shadow: none; }
.btn-warn:hover { background: #b45309; }
.btn-sky { background: var(--sky-600); color: #fff; box-shadow: none; }
.btn-sky:hover { background: #0369a1; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-ico { padding: 7px; width: 34px; height: 34px; border-radius: 10px; }

/* ---------------- chip / badge ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #f1f5f9; color: var(--muted); white-space: nowrap;
}
.chip-ok { background: var(--em-50); color: var(--em-700); }
.chip-warn { background: var(--amber-50); color: var(--amber-600); }
.chip-bad { background: var(--rose-50); color: var(--rose-600); }
.chip-info { background: var(--sky-50); color: var(--sky-600); }
.chip-blue { background: var(--blue-50); color: var(--blue-600); }
.chip-line { background: #fff; border: 1px solid var(--line); }
.chip-lg { font-size: 12px; padding: 5px 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--em-500); flex: none; }
.dot-warn { background: var(--amber-600); }
.dot-bad { background: var(--rose-600); }
.dot-muted { background: var(--muted-2); }

/* ---------------- form ---------------- */
.form-grid { display: grid; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.label small { font-weight: 500; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid rgba(15, 23, 42, .14);
  background: #fff; color: var(--ink); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--em-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); }
.input::placeholder { color: var(--muted-2); }
.textarea { min-height: 92px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.select-sm { padding: 7px 28px 7px 10px; font-size: 12.5px; border-radius: 10px; }
.hint { font-size: 11.5px; color: var(--muted); }
.hint-warn { color: var(--amber-600); }
.input-ico { position: relative; }
.input-ico .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-ico .input { padding-left: 38px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--ink-2); }
.check input[type="checkbox"], .check input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--em-600); flex: none; }
.switch { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.switch input { display: none; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .18s; flex: none; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .18s; }
.switch input:checked + .switch-track { background: var(--em-600); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.file-drop {
  border: 1.5px dashed rgba(5, 150, 105, .38); border-radius: 14px; background: var(--em-50);
  padding: 16px; text-align: center; color: var(--em-800); font-size: 13px; cursor: pointer; transition: background .15s;
}
.file-drop:hover { background: #dcfce7; }
.file-drop .ico { margin: 0 auto 6px; color: var(--em-600); width: 26px; height: 26px; }
.file-drop input { display: none; }
/* input berkas di dalam label tombol (mis. "Pilih berkas") — input asli
   punya lebar intrinsik besar dan pernah membuat halaman menggulir ke samping di 390px */
.btn input[type="file"], .scan-drop input[type="file"] { display: none; }
.file-name { font-size: 12px; color: var(--em-700); font-weight: 600; margin-top: 6px; word-break: break-all; }

/* ---------------- tabel ---------------- */
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: #fafcfb; }
.tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-center { text-align: center; }
.tbl-aksi { text-align: right; white-space: nowrap; }
.tbl-aksi .btn { margin-left: 4px; }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-main strong { font-size: 13px; color: var(--ink); display: block; }
.cell-main small { font-size: 11px; color: var(--muted); display: block; }
.tbl-panel td { background: #f8fafc; padding: 0 !important; }
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 12px 0 4px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line);
}
.pager .active { background: var(--em-600); border-color: var(--em-600); color: #fff; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

/* ---------------- alert / empty ---------------- */
.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 13px;
  font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; line-height: 1.45;
}
.alert .ico { margin-top: 1px; }
.alert span { flex: 1; min-width: 0; }
.alert-ok { background: var(--em-50); color: var(--em-800); border-color: rgba(5, 150, 105, .2); }
.alert-err { background: var(--rose-50); color: #991b1b; border-color: rgba(220, 38, 38, .18); }
.alert-info { background: var(--sky-50); color: #075985; border-color: rgba(2, 132, 199, .18); }
.alert-warn { background: var(--amber-50); color: #92400e; border-color: rgba(217, 119, 6, .2); }
.alert-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 12px; padding: 2px 4px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--muted-2); }
.empty strong { display: block; color: var(--ink-2); font-size: 14.5px; margin-bottom: 4px; }
.empty p { font-size: 12.5px; max-width: 340px; margin: 0 auto 12px; }

/* ---------------- tab ---------------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: 14px; box-shadow: var(--sh-xs); }
.tab {
  padding: 9px 13px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab .ico { width: 17px; height: 17px; }
.tab.active { background: var(--em-50); color: var(--em-800); }

/* ---------------- progres & grafik ---------------- */
.prog { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }
.prog.warn > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.prog.bad > i { background: linear-gradient(90deg, #f87171, #dc2626); }
.dist { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 8px; }
.dist .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.dist .bar i { display: block; width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--em-400), var(--em-600)); min-height: 3px; transition: height .3s; }
.dist .bar.danger i { background: linear-gradient(180deg, #fca5a5, #dc2626); }
.dist .bar span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.dist .bar b { font-size: 10.5px; color: var(--ink-2); font-weight: 700; }
.mini-chart { display: flex; align-items: flex-end; gap: 5px; height: 64px; }
.mini-chart .mb { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--em-100); min-height: 3px; position: relative; }
.mini-chart .mb.on { background: linear-gradient(180deg, var(--em-400), var(--em-600)); }
.mini-chart-labels { display: flex; gap: 5px; margin-top: 5px; }
.mini-chart-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--muted-2); }

/* ---------------- daftar ---------------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--em-50); color: var(--em-700); flex: none; }
.list-item strong { display: block; font-size: 13px; color: var(--ink); }
.list-item small { font-size: 11.5px; color: var(--muted); }
.kv { display: flex; gap: 10px; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { color: var(--ink); font-weight: 600; text-align: right; }

/* ---------------- jawaban OMR ---------------- */
.ans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.ans {
  border: 1px solid var(--line); border-radius: 11px; padding: 7px 6px; background: #fff; text-align: center;
  display: flex; flex-direction: column; gap: 1px;
}
.ans .no { font-size: 10px; color: var(--muted); font-weight: 600; }
.ans .val { font-size: 15px; font-weight: 700; color: var(--ink); }
.ans .key { font-size: 10px; color: var(--muted-2); }
.ans.benar { background: var(--em-50); border-color: rgba(5, 150, 105, .3); }
.ans.benar .val { color: var(--em-700); }
.ans.salah { background: var(--rose-50); border-color: rgba(220, 38, 38, .24); }
.ans.salah .val { color: var(--rose-600); }
.ans.ganda { background: var(--amber-50); border-color: rgba(217, 119, 6, .3); }
.ans.ganda .val { color: var(--amber-600); }
.ans.kosong .val { color: var(--muted-2); }

/* ---------------- pratinjau lembar (halaman validasi) ---------------- */
.shot-preview { position: relative; border-radius: 16px; overflow: hidden; background: #0b1220; }
.shot-preview img { width: 100%; display: block; }

/* ---------------- lembar & template ---------------- */
.sheet-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.sheet-box img { width: 100%; display: block; }
.tpl-card { display: flex; flex-direction: column; gap: 10px; }
.tpl-thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f8fafc; }
.tpl-thumb img { width: 100%; display: block; }
.omr-swatch { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); }
.omr-swatch i { width: 26px; height: 12px; border-radius: 4px; background: var(--em-600); display: inline-block; }

/* ---------------- misc ---------------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 13px;
  background: rgba(15, 23, 42, .93); color: #fff; font-size: 13px; box-shadow: var(--sh);
  animation: toastIn .22s ease-out; backdrop-filter: blur(6px);
}
.toast.ok { background: rgba(6, 95, 70, .95); }
.toast.err { background: rgba(153, 27, 27, .95); }
.toast .ico { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.splash {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--grad-brand); color: #fff; gap: 10px; transition: opacity .35s;
}
.splash-mark { width: 84px; height: 84px; display: grid; place-items: center; }
.splash-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: 22px; padding: 8px; }
.splash-mark svg { animation: pulseMark 1.6s ease-in-out infinite; }
@keyframes pulseMark { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.splash-name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.splash-sub { font-size: 12px; opacity: .82; text-align: center; max-width: 80%; }
.splash-dots { display: flex; gap: 5px; margin-top: 12px; }
.splash-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .8); animation: dotPulse 1.1s infinite; }
.splash-dots i:nth-child(2) { animation-delay: .15s; }
.splash-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.splash.hide { opacity: 0; pointer-events: none; }
.install-bar {
  position: fixed; left: 10px; right: 10px; bottom: calc(88px + var(--safe-b)); z-index: 70;
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px;
  background: #fff; box-shadow: var(--sh); border: 1px solid var(--line-soft);
}
.install-bar .ib-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--em-50); color: var(--em-700); flex: none; }
.install-bar strong { display: block; font-size: 12.5px; }
.install-bar small { font-size: 11px; color: var(--muted); }
.install-bar .ib-x { background: none; border: 0; color: var(--muted-2); font-size: 13px; cursor: pointer; padding: 4px; }
.ptr { position: fixed; top: 4px; left: 50%; transform: translate(-50%, -60px); z-index: 55; width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); display: grid; place-items: center; color: var(--em-700); transition: transform .18s; }
.ptr.show { transform: translate(-50%, 12px); }
.ptr.spin .ptr-ic { animation: spin .8s linear infinite; }
[data-no-ptr] .ptr { display: none; }

/* ---------------- auth ---------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px 40px; position: relative; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.auth-orb.a1 { width: 320px; height: 320px; background: #a7f3d0; top: -110px; left: -90px; }
.auth-orb.a2 { width: 340px; height: 340px; background: #bfdbfe; bottom: -140px; right: -110px; }
.auth-grid { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.auth-main { position: relative; z-index: 1; width: 100%; max-width: 430px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo {
  width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center;
  background: #fff; box-shadow: 0 18px 36px -22px rgba(4, 120, 87, .8), 0 0 0 6px rgba(255, 255, 255, .45);
}
.auth-logo.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 22px; padding: 6px; }
.auth-title { font-size: 30px; font-weight: 700; letter-spacing: -.03em; color: var(--em-800); }
.auth-title span { color: var(--em-500); }
.auth-tagline { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.auth-card {
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px; padding: 20px; box-shadow: var(--sh);
}
.auth-card h2 { font-size: 17px; margin-bottom: 3px; }
.auth-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.auth-switch { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.auth-switch a { font-weight: 600; }
.auth-foot { text-align: center; font-size: 11px; color: var(--muted-2); margin-top: 18px; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 7px; border-radius: 8px; }
.pw-toggle:hover { background: rgba(15, 23, 42, .05); }
.demo-box { margin-top: 16px; border: 1px dashed rgba(5, 150, 105, .4); border-radius: 14px; padding: 12px; background: var(--em-50); }
.demo-box h3 { font-size: 12px; color: var(--em-800); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.demo-akun { display: grid; gap: 6px; }
.demo-akun button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(5, 150, 105, .22); background: #fff; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.demo-akun button:hover { background: #f0fdf4; }
.demo-akun b { font-weight: 600; }
.demo-akun small { color: var(--muted); margin-left: auto; font-size: 11px; }


/* ============================================================
   PEMINDAI OTOMATIS (layar penuh) — kamera aktif langsung,
   deteksi terus-menerus, hasil muncul sendiri.
   ============================================================ */
body.scan-live-body { background: #06130f; overflow: hidden; }
.scan-pilih {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s;
}
.scan-pilih:has(input:checked) { border-color: rgba(5, 150, 105, .55); background: #f0fdf4; box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
.scan-pilih input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--em-600); flex: none; }
.scan-pilih .sp-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--em-50); color: var(--em-700); flex: none; }
.scan-pilih strong { display: block; font-size: 13px; }
.scan-pilih small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.scan-pilih .chip { font-size: 10px; padding: 2px 7px; vertical-align: middle; }

.scan-live {
  position: fixed; inset: 0; z-index: 90; background: #06130f; overflow: hidden;
  display: flex; flex-direction: column; color: #fff;
}
.scan-live video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #06130f;
}
.scan-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 32%, rgba(6, 19, 15, 0) 42%, rgba(6, 19, 15, .55) 78%, rgba(6, 19, 15, .85) 100%);
}
/* Smart Auto Frame: bingkai & penanda yang terdeteksi digambar langsung di atas kamera */
.scan-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.scan-zoom {
  display: inline-flex; align-items: center; gap: 4px; flex: none; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 10.5px; font-weight: 700;
}
.scan-zoom[aria-pressed='true'] { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
}
.scan-mark-count.ok { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count.warn { background: rgba(251, 191, 36, .9); color: #3b2a05; border-color: transparent; }
.scan-guide {
  position: absolute; left: 4%; right: 4%; top: 50%; transform: translateY(-52%);
  aspect-ratio: 210 / 297; max-height: 66%; border-radius: 20px;
  pointer-events: none; box-shadow: 0 0 0 9999px rgba(6, 19, 15, .28);
}
/* lembar kompak (A5 mendatar) → bingkai lebar-pendek, sesuai bentuk lembar sebenarnya */
.scan-live[data-sheet='a5'] /* Smart Auto Frame: bingkai & penanda yang terdeteksi digambar langsung di atas kamera */
.scan-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.scan-zoom {
  display: inline-flex; align-items: center; gap: 4px; flex: none; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 10.5px; font-weight: 700;
}
.scan-zoom[aria-pressed='true'] { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
}
.scan-mark-count.ok { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count.warn { background: rgba(251, 191, 36, .9); color: #3b2a05; border-color: transparent; }
.scan-guide { aspect-ratio: 210 / 148; left: 3%; right: 3%; max-height: 56%; }
.scan-guide::before, .scan-guide::after, .scan-guide i::before, .scan-guide i::after {
  content: ''; position: absolute; width: 34px; height: 34px; border: 3px solid rgba(52, 211, 153, .95); border-radius: 8px;
  transition: border-color .25s;
}
.scan-guide::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.scan-guide::after { top: -3px; right: -3px; border-left: 0; border-bottom: 0; }
.scan-guide i::before { bottom: -3px; left: -3px; border-right: 0; border-top: 0; }
.scan-guide i::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.scan-live[data-state='ok'] .scan-guide::before,
.scan-live[data-state='ok'] .scan-guide::after,
.scan-live[data-state='ok'] .scan-guide i::before,
.scan-live[data-state='ok'] .scan-guide i::after { border-color: #6ee7b7; }

.scan-top {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
}
.scan-x, .scan-ic {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); border: 0; color: #fff; cursor: pointer;
  backdrop-filter: blur(8px);
}
.scan-ic.on { background: rgba(52, 211, 153, .9); color: #06130f; }
.scan-title { flex: 1; min-width: 0; }
.scan-title strong { display: block; font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-title small { font-size: 11px; color: rgba(255, 255, 255, .72); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.resume-scan {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  background: linear-gradient(135deg, #ecfdf5, #f0f9ff); border-color: rgba(5, 150, 105, .28);
  box-shadow: 0 14px 30px -24px rgba(5, 150, 105, .8);
}
.resume-scan .rs-ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--em-600); color: #fff;
}
.resume-scan strong { display: block; font-size: 13.5px; }
.resume-scan small { display: block; font-size: 11.5px; color: var(--muted); }

.scan-status {
  position: relative; z-index: 3; align-self: center; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(6, 19, 15, .62); border: 1px solid rgba(255, 255, 255, .14);
  font-size: 12px; font-weight: 600; backdrop-filter: blur(10px); max-width: 92%;
}
.scan-status span[data-status-text] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; flex: none; box-shadow: 0 0 0 4px rgba(251, 191, 36, .18); }
.scan-status.ok .dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.scan-status.warn .dot { background: #fbbf24; }
.scan-status.bad .dot { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .2); }

.scan-idle {
  position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(86vw, 340px); text-align: center; padding: 22px 18px; border-radius: 20px;
  background: rgba(8, 26, 20, .86); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(12px);
}
.scan-idle .ico { width: 40px; height: 40px; margin: 0 auto 10px; color: rgba(255, 255, 255, .62); }
.scan-idle strong { display: block; font-size: 15px; margin-bottom: 4px; }
.scan-idle p { font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-bottom: 14px; }

.scan-bottom {
  position: relative; z-index: 3; margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}
.scan-upload {
  width: 62px; height: 52px; flex: none; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .12); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(8px);
}
.scan-upload input[type="file"] { display: none; }
.scan-upload:active { transform: scale(.97); }
.scan-mode {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 15px; background: rgba(6, 19, 15, .62);
  border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px);
}
.scan-mode strong { display: block; font-size: 12.5px; }
.scan-mode small { display: block; font-size: 10.5px; color: rgba(255, 255, 255, .68); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; flex: none; animation: scanPulse 1.6s ease-in-out infinite; }
@keyframes scanPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 50% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }


/* kartu hasil pemindaian (di atas kamera) */
.scan-result {
  position: absolute; z-index: 6; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .98); color: var(--ink); border-radius: 20px; padding: 14px;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .7); animation: srIn .24s ease-out;
}
@keyframes srIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sr-head { display: flex; align-items: center; gap: 10px; }
.sr-badge {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--em-50); color: var(--em-700);
}
.sr-badge.warn { background: var(--amber-50); color: var(--amber-600); }
.sr-head strong { display: block; font-size: 14px; line-height: 1.25; }
.sr-head small { display: block; font-size: 11.5px; color: var(--muted); }
.sr-score { font-size: 28px; font-weight: 700; color: var(--em-700); line-height: 1; font-variant-numeric: tabular-nums; }
.sr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.sr-grid > div { background: #f8fafc; border-radius: 10px; padding: 7px 6px; text-align: center; }
.sr-grid span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sr-grid b { font-size: 15px; font-variant-numeric: tabular-nums; }
.sr-note { margin-top: 10px; font-size: 11.5px; color: var(--amber-600); background: var(--amber-50); border-radius: 10px; padding: 7px 10px; }
.sr-actions { display: flex; gap: 8px; margin-top: 12px; }
.sr-actions .btn { flex: 1; }
.scan-toast {
  position: absolute; z-index: 7; left: 50%; transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom, 0px)); max-width: 88%; text-align: center;
  background: rgba(6, 19, 15, .9); color: #fff; font-size: 12px; padding: 9px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
}
.scan-live.is-result /* Smart Auto Frame: bingkai & penanda yang terdeteksi digambar langsung di atas kamera */
.scan-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.scan-zoom {
  display: inline-flex; align-items: center; gap: 4px; flex: none; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 10.5px; font-weight: 700;
}
.scan-zoom[aria-pressed='true'] { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
}
.scan-mark-count.ok { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count.warn { background: rgba(251, 191, 36, .9); color: #3b2a05; border-color: transparent; }
.scan-guide { opacity: .25; }
.scan-live.is-perfect .scan-guide { box-shadow: 0 0 0 9999px rgba(6, 19, 15, .22), 0 0 0 3px rgba(52, 211, 153, .55) inset; }
.scan-live.is-perfect .scan-guide::before, .scan-live.is-perfect .scan-guide::after,
.scan-live.is-perfect .scan-guide i::before, .scan-live.is-perfect .scan-guide i::after { border-color: #6ee7b7; }
.scan-live.look-3 .scan-guide::before, .scan-live.look-3 .scan-guide::after,
.scan-live.look-3 .scan-guide i::before, .scan-live.look-3 .scan-guide i::after { border-color: #fbbf24; }

@media (min-width: 900px) {
  .scan-live { position: fixed; inset: 0; }
  /* Smart Auto Frame: bingkai & penanda yang terdeteksi digambar langsung di atas kamera */
.scan-frame {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.scan-zoom {
  display: inline-flex; align-items: center; gap: 4px; flex: none; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 10.5px; font-weight: 700;
}
.scan-zoom[aria-pressed='true'] { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count {
  margin-left: auto; flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22);
}
.scan-mark-count.ok { background: rgba(52, 211, 153, .9); color: #052e21; border-color: transparent; }
.scan-mark-count.warn { background: rgba(251, 191, 36, .9); color: #3b2a05; border-color: transparent; }
.scan-guide { left: 26%; right: 26%; top: 12%; bottom: 22%; }
  .scan-result { left: 50%; right: auto; transform: translateX(-50%); width: 420px; bottom: 96px; }
  .scan-toast { width: 380px; }
}

/* ---------------- cetak ---------------- */
@media print {
  .no-print, .rail, .appbar, .bottomnav, .drawer, .drawer-scrim, .install-bar, .splash, .ptr, .toast-wrap { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .panel { box-shadow: none; border: 0; }
}

/* ---------------- responsif ---------------- */
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .content { padding: 20px 20px 110px; }
  .dist { height: 150px; }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .appbar-school { display: block; }
  .appbar-school .select { min-width: 160px; background-color: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .3); }
  .appbar-school .select option { color: var(--ink); }
  .bottomnav { display: none; }
  .content { padding: 24px 26px 48px; }
  .drawer, .drawer-scrim { display: none !important; }
  .toast-wrap { bottom: 24px; }
  .install-bar { left: auto; right: 24px; width: 340px; bottom: 24px; }
  .hero-kpi strong { font-size: 24px; }
}
@media (min-width: 1024px) {
  .rail {
    display: flex; flex-direction: column; width: 258px; flex: none;
    background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px);
    border-right: 1px solid var(--line-soft); height: 100vh; position: sticky; top: 0;
  }
  .appbar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px) saturate(160%); box-shadow: none; border-bottom: 1px solid var(--line-soft); }
  .appbar::after { display: none; }
  .appbar-title h1 { color: var(--ink); font-size: 17px; }
  .appbar-title p { color: var(--muted); }
  .appbar .icon-btn { color: var(--em-800); }
  .appbar .icon-btn:hover { background: var(--em-50); }
  .appbar-user .avatar { background: var(--em-100); color: var(--em-800); box-shadow: none; }
  .appbar-school .select { background-color: #fff; color: var(--ink); border-color: var(--line); }
  .appbar > .appbar-inner > .icon-btn[data-drawer-open] { display: none; }
  .content { padding: 26px 30px 60px; }
  .hero-dash { padding: 22px 24px; }
  .splash-mark { width: 96px; height: 96px; }
}
@media (max-width: 380px) {
  .stat-value { font-size: 19px; }
  .appbar-title h1 { font-size: 15px; }
  .bn-item span { font-size: 9.5px; }
  .ans-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
