:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f0f1ed;
  --line: #dfe1db;
  --ink: #15171a;
  --ink-2: #4c5058;
  --ink-3: #7a7e86;
  --accent: #0d6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1eb;
  --s1: #2a78d6;  /* dikunjungi */
  --s2: #eb6834;  /* berminat */
  --s3: #1baf7a;  /* mendaftar */
  --track: #e8e9e4;
  --f1: #86b6ef; --f2: #5598e7; --f3: #2a78d6; --f4: #1c5cab; --f5: #104281;
  --good: #137a3a; --good-bg: #e3f4e8;
  --warn: #8a5a00; --warn-bg: #fdf1d6;
  --bad: #b3261e;  --bad-bg: #fbe5e3;
  --info: #1c5cab; --info-bg: #e2edfb;
  --mute-bg: #eceee9;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111312; --surface: #1a1c1b; --surface-2: #232625; --line: #2f3331;
    --ink: #f2f3f1; --ink-2: #c3c6c1; --ink-3: #8d918c;
    --accent: #3fb68b; --accent-ink: #06231a; --accent-soft: #173229;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --track: #2a2d2c;
    --f1: #184f95; --f2: #1c5cab; --f3: #2a78d6; --f4: #3987e5; --f5: #6da7ec;
    --good: #6fd394; --good-bg: #16301f; --warn: #f0c060; --warn-bg: #33270d;
    --bad: #ff8a80; --bad-bg: #3a1714; --info: #86b6ef; --info-bg: #15263c; --mute-bg: #262927;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111312; --surface: #1a1c1b; --surface-2: #232625; --line: #2f3331;
  --ink: #f2f3f1; --ink-2: #c3c6c1; --ink-3: #8d918c;
  --accent: #3fb68b; --accent-ink: #06231a; --accent-soft: #173229;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --track: #2a2d2c;
  --f1: #184f95; --f2: #1c5cab; --f3: #2a78d6; --f4: #3987e5; --f5: #6da7ec;
  --good: #6fd394; --good-bg: #16301f; --warn: #f0c060; --warn-bg: #33270d;
  --bad: #ff8a80; --bad-bg: #3a1714; --info: #86b6ef; --info-bg: #15263c; --mute-bg: #262927;
  --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* shell */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--accent); color: var(--accent-ink);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.top .back { background: none; border: 0; color: inherit; font-size: 22px; padding: 0 6px 0 0; cursor: pointer; line-height: 1; }
.top h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { font-size: 12px; opacity: .85; font-weight: 400; }
.top .icon { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; display: grid; place-items: center; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 96px; }
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1; text-align: center; padding: 8px 4px 9px; font-size: 11.5px; color: var(--ink-3);
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav a.on { color: var(--accent); font-weight: 600; }
.nav svg { width: 22px; height: 22px; }

/* cards */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); }
.card > h2, .card > h3 { margin-bottom: 10px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.tile .l { font-size: 12.5px; color: var(--ink-2); }
.tile .d { font-size: 12px; color: var(--ink-3); }

.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.hero .of { font-size: 18px; color: var(--ink-2); font-weight: 600; }
.bar { height: 12px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--s3); border-radius: 99px; min-width: 4px; }

/* stacked bars per kategori */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sb { display: grid; gap: 10px; }
.sb .item { cursor: pointer; }
.sb .lbl { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; font-size: 13px; margin-bottom: 3px; }
.sb .lbl b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb .lbl span { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb .trk { display: flex; height: 12px; background: var(--track); border-radius: 4px; overflow: hidden; gap: 2px; }
.sb .trk i { display: block; height: 100%; }
.sb .trk i:last-of-type { border-radius: 0 4px 4px 0; }

.cols { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 16px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.cols .c i { display: block; width: 100%; max-width: 34px; background: var(--s1); border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .c span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.cols .c b { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* list */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.li:first-child { border-top: 0; }
.li:active { background: var(--surface-2); }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.more { display: block; width: 100%; padding: 12px; border: 0; background: var(--surface-2); color: var(--accent); font-weight: 600; cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; flex: none; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-belum { background: var(--mute-bg); color: var(--ink-2); }
.b-tugas { background: var(--warn-bg); color: var(--warn); }
.b-kunjung { background: var(--info-bg); color: var(--info); }
.b-ragu { background: var(--info-bg); color: var(--info); }
.b-minat { background: #fde9df; color: #a8431a; }
:root[data-theme="dark"] .b-minat { background: #3a2116; color: #ffb08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-minat { background: #3a2116; color: #ffb08a; } }
.b-lain { background: var(--bad-bg); color: var(--bad); }
.b-daftar { background: var(--good-bg); color: var(--good); }

/* filter */
.search { position: sticky; top: 52px; z-index: 4; background: var(--bg); padding: 4px 0 8px; }
.search input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips select, .chip {
  flex: none; padding: 7px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; max-width: 190px; cursor: pointer;
}
.chip.on, .chips select.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.count { font-size: 12.5px; color: var(--ink-3); margin: 6px 2px 8px; display: flex; justify-content: space-between; gap: 8px; }

/* forms */
.f { display: grid; gap: 14px; }
.f label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.f input, .f select, .f textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 400; color: var(--ink);
}
.f textarea { min-height: 84px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.f .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13.5px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns .btn { flex: 1; min-width: 140px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foto-prev { max-width: 100%; max-height: 220px; border-radius: 10px; display: block; margin-top: 6px; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-word; }

/* kartu laporan turbah */
.laps { display: grid; gap: 10px; }
.lap { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 6px; border-left: 3px solid var(--s1); }
.card .lap { box-shadow: none; border: 1px solid var(--line); border-left: 3px solid var(--s1); padding: 10px 12px; }
.lap-top { display: flex; align-items: baseline; gap: 10px; }
.lap-nama { font-weight: 700; color: var(--ink); text-decoration: none; flex: 1; min-width: 0; overflow-wrap: anywhere; }
a.lap-nama:hover { color: var(--accent); }
.lap-tgl { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; flex: none; }
.lap-sub { font-size: 12.5px; color: var(--ink-3); margin-top: -4px; }
.lap-tag { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--mute-bg); color: var(--ink-2); }
.tag-minat { background: #fde9df; color: #a8431a; }
:root[data-theme="dark"] .tag-minat { background: #3a2116; color: #ffb08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-minat { background: #3a2116; color: #ffb08a; } }
.tag-rekan { background: var(--info-bg); color: var(--info); }
.lap-hasil { margin: 0; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.lap-cat { margin: 0; font-size: 13px; white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; color: var(--ink-2); }
.lap-cat b { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.lap-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--ink-3); }
.lap-meta b { color: var(--ink-2); font-weight: 600; }
.lap-aksi { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.lap-sp { flex: 1; }
.lap-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); cursor: pointer; text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
.lap-btn.bahaya { color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  transition: .2s; pointer-events: none; z-index: 20; max-width: calc(100% - 32px);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--bad); color: #fff; }
#busy { position: fixed; inset: 0; z-index: 40; background: rgba(10, 14, 12, .28); display: grid; place-items: center; animation: fadeIn .15s ease; }
#busy[hidden] { display: none; }
.busy-box { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px 22px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); max-width: calc(100% - 48px); font-weight: 600; }
.busy-box .spin { width: 26px; height: 26px; flex: none; }
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; }
.busy-bar i { position: absolute; top: 0; height: 100%; width: 40%; background: var(--s2); animation: busyBar 1.1s ease-in-out infinite; }
@keyframes busyBar { from { left: -40%; } to { left: 100%; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .busy-bar i, .spin { animation-duration: 2.5s; } }
dialog { border: 0; border-radius: 16px; padding: 18px; width: min(420px, calc(100% - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }

.splash { min-height: 70vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--ink-3); }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.login { max-width: 380px; margin: 0 auto; padding: 40px 16px; }
.login .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 20px; margin-bottom: 14px; }
.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.menu .li svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.pre { white-space: pre-line; }
@media (min-width: 640px) {
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}

.savebar { position: sticky; bottom: 66px; z-index: 5; display: flex; gap: 10px; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.savebar .btn { flex: 1; }
.f .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }
.danger { color: var(--bad) !important; border-color: var(--bad) !important; }
tr.grp td { background: var(--surface-2); font-weight: 600; }
/* header: baris judul + toolbar (kolom cari ikut menempel bersama header) */
.top { display: block; }
.top .top-row { display: flex; align-items: center; gap: 10px; }
.top.with-bar { padding-bottom: 12px; }
.toolbar { margin-top: 10px; }
.toolbar .srow { display: flex; gap: 8px; }
.toolbar .srow input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 0; background: var(--surface); color: var(--ink); font-size: 15px; }
.toolbar .srow input:focus { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.toolbar .fbtn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: var(--accent-ink); }
.toolbar .fbtn.on { background: var(--surface); border-color: var(--surface); color: var(--accent); }

/* ===== optimasi layar sentuh: toolbar, panel bawah, bar pilihan ===== */
.toolbar .srow input { font-size: 16px; min-height: 46px; }
.toolbar .fbtn { min-height: 46px; }
.mbtn { width: 46px; min-height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); color: var(--accent-ink); }
.mbtn svg { width: 22px; height: 22px; }
.fbtn, .mbtn, .achip, .sheet-item, .sheet-x, .sel-x, .sel-semua { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.fbtn:active, .mbtn:active { transform: scale(.96); }
@media (max-width: 359px) { .toolbar .fbtn span { display: none; } .toolbar .fbtn { padding: 0 12px; } }
.achip { min-height: 38px; padding: 8px 12px; font-size: 13.5px; }
.f input, .f select, .f textarea { font-size: 16px; }

dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; padding: 0; border-radius: 22px 22px 0 0;
  overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetNaik .22s ease-out; }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
@keyframes sheetNaik { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } }
@media (min-width: 640px) { dialog.sheet { max-width: 520px; margin: auto auto 0; } }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 12px 8px 20px; flex: none; }
.sheet-head h2 { font-size: 18px; }
.sheet-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 18px; cursor: pointer; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 16px; flex: 1; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.sheet-foot .btn { flex: 1; min-height: 50px; font-size: 15.5px; }
.sheet-foot .btn.pri { flex: 1.6; }
.sheet-menu { padding: 0 8px calc(14px + env(safe-area-inset-bottom)); }
.sheet-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; padding: 12px; border: 0; border-radius: 14px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 16px; }
.sheet-item + .sheet-item { margin-top: 2px; }
.sheet-item:active { background: var(--surface-2); }
.sheet-item:disabled { opacity: .45; cursor: default; }
.sheet-item svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.sheet-item b { display: block; font-weight: 650; }
.sheet-item small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.fsheet label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.fsheet select { width: 100%; min-height: 50px; padding: 10px 12px; font-size: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 400; }
.fsheet select.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.selbar.selbar3 { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; }
.sel-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: inherit; font-size: 18px; cursor: pointer; }
.sel-info { display: grid; line-height: 1.25; min-width: 0; }
.sel-info b { font-size: 17px; }
.sel-semua { background: none; border: 0; padding: 4px 0; color: inherit; text-decoration: underline; font-size: 13px; text-align: left; cursor: pointer; opacity: .9; }
.selbar3 #btnAtur { min-height: 46px; padding: 10px 16px; }
.li.li2 input[type=checkbox] { width: 24px; height: 24px; }
.sheet-foot .btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }

/* ===================== dashboard (mobile-first) ===================== */
:root { --hero-1: #0d6b4f; --hero-2: #0a4f3b; --hero-ink: #ffffff; --hero-mute: rgba(255,255,255,.78); --hero-trk: rgba(255,255,255,.22); --hero-chip: rgba(255,255,255,.18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hero-1: #17604a; --hero-2: #0f3d30; --hero-ink: #f2f3f1; --hero-mute: rgba(242,243,241,.75); --hero-trk: rgba(255,255,255,.16); --hero-chip: rgba(255,255,255,.14); } }
:root[data-theme="dark"] { --hero-1: #17604a; --hero-2: #0f3d30; --hero-ink: #f2f3f1; --hero-mute: rgba(242,243,241,.75); --hero-trk: rgba(255,255,255,.16); --hero-chip: rgba(255,255,255,.14); }

.dash { display: grid; gap: 12px; }
.dash > .card { margin-bottom: 0; }
.sapa { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.sapa-hai { font-size: 20px; font-weight: 750; letter-spacing: -.2px; }
.sapa > div:first-child { min-width: 0; }
.sapa-hai { line-height: 1.25; overflow-wrap: anywhere; }
.sapa .badge { flex: none; }

.hero.hero2 { margin: 0; border: 0; color: var(--hero-ink); background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 4px 16px; padding: 18px; box-shadow: 0 6px 20px rgba(13,107,79,.22); }
.cincin { width: 104px; height: 104px; }
.cincin .cc-trk { fill: none; stroke: var(--hero-trk); stroke-width: 10; }
.cincin .cc-isi { fill: none; stroke: var(--hero-ink); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.cincin .cc-tx { fill: var(--hero-ink); font-size: 20px; font-weight: 800; text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.hero-isi { display: grid; gap: 2px; min-width: 0; }
.hero-lbl { font-size: 13px; color: var(--hero-mute); }
.hero-angka { display: flex; align-items: baseline; gap: 6px; }
.hero-angka b { font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -1px; }
.hero-angka span { font-size: 17px; font-weight: 600; color: var(--hero-mute); }
.hero-sub { font-size: 14px; }
.hero-chip { justify-self: start; margin-top: 4px; background: var(--hero-chip); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.hero-kaki { grid-column: 1 / -1; font-size: 12px; color: var(--hero-mute); border-top: 1px solid var(--hero-trk); padding-top: 10px; margin-top: 8px; }

.untuk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; box-shadow: var(--shadow); }
.untuk-judul { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px 4px; }
.untuk-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 56px; }
.untuk-item:active { background: var(--surface-2); }
.untuk-item + .untuk-item { border-top: 1px solid var(--line); }
.untuk-item svg { width: 26px; height: 26px; flex: none; padding: 7px; box-sizing: content-box; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.untuk-item.warn svg { background: var(--warn-bg); color: var(--warn); }
.untuk-item.info svg { background: var(--info-bg); color: var(--info); }
.untuk-item.ok svg { background: var(--good-bg); color: var(--good); }
.untuk-item > span { display: grid; gap: 2px; min-width: 0; }
.untuk-item .u-t { font-size: 15px; line-height: 1.3; }
.untuk-item small { color: var(--accent); font-weight: 600; font-size: 13px; }

.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .kpi { grid-template-columns: repeat(4, 1fr); } }
.kpi-i { display: grid; align-content: start; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-height: 104px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
div.kpi-i:not(.tile) { cursor: default; }
a.kpi-i:active, .kpi-i.tile:active { transform: scale(.98); }
.kpi-i b { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.kpi-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.kpi-i small { font-size: 12px; color: var(--ink-3); }
.kpi-i .warn-t { color: var(--warn); font-weight: 700; }
.kpi-bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin: 2px 0; }
.kpi-bar i { display: block; height: 100%; background: var(--s1); border-radius: 99px; }
.naik { color: var(--good); font-weight: 700; }
.turun { color: var(--bad); font-weight: 700; }

.tahap { display: grid; gap: 12px; }
.tahap-atas { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.tahap-atas b { font-size: 15px; }
.tahap-atas small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.tahap-trk { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.tahap-trk i { display: block; height: 100%; border-radius: 99px; }

.rc { display: grid; gap: 9px; }
.rc-i { display: grid; grid-template-columns: minmax(84px, 34%) 1fr 34px; align-items: center; gap: 10px; font-size: 13.5px; }
.rc-i.minat { cursor: pointer; }
.rc-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-i.minat .rc-n { font-weight: 700; }
.rc-trk { height: 12px; background: var(--track); border-radius: 4px; overflow: hidden; }
.rc-trk i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.rc-i.minat .rc-trk i { background: var(--s2); }
.rc-i b { text-align: right; }

.akt { display: grid; }
.akt-i { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.akt-i:first-child { border-top: 0; padding-top: 2px; }
.akt-i:active { background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 13.5px; flex: none; }
.akt-isi { display: grid; gap: 2px; min-width: 0; }
.akt-t { font-size: 14px; line-height: 1.35; }
.akt-t b { font-weight: 650; }
.akt-s { font-size: 12.5px; color: var(--ink-3); }
.akt-h { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.akt-w { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; padding-top: 2px; }

.cols .c.ini i { background: var(--s2); }
.cols .c.ini span { color: var(--ink); font-weight: 700; }

.garap { display: grid; }
.garap-i { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.garap-i:first-child { border-top: 0; padding-top: 2px; }
.garap-n { font-weight: 600; font-size: 14.5px; }
.garap-v { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.garap-v b { color: var(--warn); font-size: 14px; }
.garap-trk { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.garap-trk i { display: block; height: 100%; background: var(--s1); border-radius: 99px; }

.lb { display: grid; gap: 4px; }
.lb-i { display: grid; grid-template-columns: 26px 38px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.lb-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.lb-no.r1 { background: #f5c542; color: #4a3500; }
.lb-no.r2 { background: #cfd4da; color: #2f3439; }
.lb-no.r3 { background: #e0a26f; color: #47250a; }
.lb-n { font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-i b { font-size: 16px; }
.lb-klik { width: 100%; grid-template-columns: 26px 38px 1fr auto 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; padding: 6px 4px; }
.lb-klik:hover { background: var(--surface-2); }
.lb-klik .chev { color: var(--ink-3); }
.untuk { overflow: hidden; }
.untuk-item { border-radius: 0; }
.untuk-item + .untuk-item { border-top: 1px solid var(--line); }
.dash .card-head { flex-direction: column; align-items: flex-start; gap: 2px; }


/* ======================= Lapor Muhada ======================= */
.nav a { position: relative; }
.nbadge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; line-height: 1; }

.b-baru { background: var(--warn-bg); color: var(--warn); }
.b-ok { background: var(--good-bg); color: var(--good); }
.b-mute { background: var(--mute-bg); color: var(--ink-2); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-bad { background: var(--bad-bg); color: var(--bad); }

/* jadwal hari ini (akun kelas) */
.jams { display: grid; gap: 8px; }
.jam { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); text-align: left; width: 100%; font: inherit; }
button.jam { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button.jam:active { transform: scale(.99); background: var(--surface-2); }
.jam-no { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; line-height: 1.05; text-align: center; }
.jam-no b { font-size: 18px; font-weight: 800; display: block; }
.jam-no small { font-size: 10px; font-weight: 600; }
.jam-isi { min-width: 0; display: grid; gap: 1px; }
.jam-isi .t { font-weight: 650; overflow-wrap: anywhere; }
.jam-isi .s { font-size: 12.5px; color: var(--ink-3); }
.jam-aksi { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.jam.nanti { opacity: .55; box-shadow: none; }
.jam.nanti .jam-no { background: var(--surface-2); color: var(--ink-3); }
.jam.lapor { border-color: var(--warn); }
.jam.lapor .jam-no { background: var(--warn-bg); color: var(--warn); }
.jam.selesai { border-color: var(--good); }
.jam.selesai .jam-no { background: var(--good-bg); color: var(--good); }
.jam.kini { outline: 2px solid var(--accent); outline-offset: 1px; }

.ringkas { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.cek-jam { display: grid; gap: 6px; }
.cek-jam label { display: flex !important; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; }
.cek-jam input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.cek-jam label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.seg.v { display: grid; }
.seg.v button { text-align: left; border-radius: 12px; padding: 10px 14px; }
.seg.v button small { display: block; font-weight: 400; font-size: 12.5px; opacity: .85; }
.fsheet textarea, .fsheet input:not([type=checkbox]) { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; }
.fsheet textarea { min-height: 84px; resize: vertical; }
.fsheet .hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 12px; }
.quick button { padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; cursor: pointer; color: var(--ink); }

/* filter tanggal */
.tglbar { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; margin-bottom: 8px; }
.tglbar button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 20px; cursor: pointer; color: var(--ink); min-height: 46px; }
.tglbar input { width: 100%; min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; text-align: center; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters select { flex: none; max-width: 200px; padding: 7px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; }
.lap.st-baru { border-left-color: var(--warn); }
.lap.st-ditangani { border-left-color: var(--good); }
.lap.st-ditolak { border-left-color: var(--line); opacity: .8; }

/* kotak saran */
.saran-note { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.saran-note svg { width: 20px; height: 20px; flex: none; }
.balas { margin: 0; font-size: 13.5px; white-space: pre-wrap; background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.balas b { display: block; font-size: 11.5px; color: var(--accent); font-weight: 700; }
.tile .v.warn-t { color: var(--warn); }

/* jadwal mingguan */
.seg.hari { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.seg.hari::-webkit-scrollbar { display: none; }
.seg.hari button { flex: none; }

/* kartu login untuk dicetak */
#cetak { display: none; }
@media print {
  body.mode-cetak > *:not(#cetak) { display: none !important; }
  body.mode-cetak #cetak { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; padding: 0; }
  body.mode-cetak { background: #fff; }
  @page { size: A4; margin: 10mm; }
}
.kartu { border: 1.5px dashed #555; border-radius: 4mm; padding: 5mm 6mm; break-inside: avoid; color: #000; font-size: 11pt; display: grid; gap: 1.5mm; }
.kartu .k-sek { font-size: 9pt; color: #333; }
.kartu .k-kelas { font-size: 16pt; font-weight: 800; }
.kartu .k-baris { display: flex; justify-content: space-between; border-top: 1px solid #ccc; padding-top: 1.5mm; }
.kartu .k-baris b { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14pt; letter-spacing: 1px; }
.kartu .k-url { font-size: 9pt; color: #333; }
.pinbox { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 12px 0; }
.pinbox b { display: block; font-size: 30px; letter-spacing: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.hasil-impor { display: grid; gap: 6px; }
details.jam-hari { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
details.jam-hari summary { font-weight: 600; cursor: pointer; }
details.jam-hari textarea { margin-top: 8px; }
.fsheet .cek-jam label { margin-bottom: 0; }
