/* ARK — BERKAS HASIL BANGUN: sumbernya di src/css/*.css (npm run bangun). Jangan edit public/css/app.css langsung. */
:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --line: #dce1ea;
  --ink: #15171a;
  --ink-2: #4c5058;
  --ink-3: #7a7e86;
  /* Branding Muhada Berdaya: Biru Tua #1B2E6E, turunan #121F4D, Biru Terang #1A6FE8. */
  --brand: #1B2E6E; --brand-ink: #ffffff;
  --accent: #1B2E6E;
  --accent-ink: #ffffff;
  --accent-soft: #e5eaf6;
  --s1: #1A6FE8;  /* dikunjungi */
  --s2: #eb6834;  /* berminat */
  --s3: #1baf7a;  /* mendaftar */
  --track: #e5e9f0;
  --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: #eaedf3;
  --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: #0e1118; --surface: #171b24; --surface-2: #1f2430; --line: #2c3342;
    --ink: #f2f3f1; --ink-2: #c3c6c1; --ink-3: #8d918c;
    --brand: #16244f; --brand-ink: #f2f4f8; --accent: #7fa6f3; --accent-ink: #0b1633; --accent-soft: #18233d;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --track: #262c38;
    --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: #232936;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1118; --surface: #171b24; --surface-2: #1f2430; --line: #2c3342;
  --ink: #f2f3f1; --ink-2: #c3c6c1; --ink-3: #8d918c;
  --brand: #16244f; --brand-ink: #f2f4f8; --accent: #7fa6f3; --accent-ink: #0b1633; --accent-soft: #18233d;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --track: #262c38;
  --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: #232936;
  --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; 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(--brand); color: var(--brand-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; overflow: hidden; text-overflow: ellipsis; }
.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; }
.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 */

.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; }

.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 */
/* --top-h = tinggi header sebenarnya (diukur di shell(); header bersubjudul lebih tinggi dari 52px). */
.search { position: sticky; top: var(--top-h, 52px); z-index: 4; background: var(--bg); padding: 8px 0; }
.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; }
a.chip { text-decoration: none; color: inherit; }

/* forms */
.f { display: grid; gap: 14px; }
/* min-width 0: kolom form boleh menyusut di layar HP (input tanggal/select tidak melebarkan kartu) */
.f > *, .f label, .row2 > * { min-width: 0; }
.f label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.f input, .f select, .f textarea {
  width: 100%; min-width: 0; max-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: repeat(2, minmax(0, 1fr)); gap: 10px; }

.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; }

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(--brand); color: var(--brand-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; }

.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; }
.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; }

/* ===== optimasi layar sentuh: panel bawah & formulir ===== */
.sheet-item, .sheet-x { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.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; }
.sheet-foot .btn { white-space: nowrap; padding-left: 12px; padding-right: 12px; }


/* layar tanpa koneksi */
.offline { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.offline-ik { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.offline-ik svg { width: 34px; height: 34px; }
.offline h1 { font-size: 19px; margin: 6px 0 0; }
.offline p { max-width: 320px; margin: 0 0 8px; line-height: 1.45; }
/* ===================== dashboard (mobile-first) ===================== */
:root { --hero-1: #1B2E6E; --hero-2: #121F4D; --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: #1d3478; --hero-2: #111c45; --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: #1d3478; --hero-2: #111c45; --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 > div:first-child { min-width: 0; }
.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(27,46,110,.28); }
.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; }

.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-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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 b { text-align: right; }
.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; }

.cols .c.ini i { background: var(--s2); }
.cols .c.ini span { color: var(--ink); font-weight: 700; }
.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; }

/* ---------- halaman Menu: tile (2026-10-18) */
.mn-prof { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--r); color: #fff; background: linear-gradient(135deg, var(--brand), #121F4D); box-shadow: var(--shadow); }
.mn-av { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.16); font-weight: 700; font-size: 18px; }
.mn-prof-t { min-width: 0; display: grid; gap: 2px; }
.mn-prof-t b { font-size: 17px; line-height: 1.25; }
.mn-prof-t > span { font-size: 12.5px; opacity: .8; }
.mn-peran { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mn-peran span { padding: 2px 9px; border-radius: 99px; background: rgba(255,255,255,.16); font-size: 11.5px; font-weight: 600; }
.mn-ring { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; padding: 11px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.mn-ring svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--good); }
.mn-ring.warn { background: var(--warn-bg); border-color: transparent; }
.mn-ring.warn svg { color: var(--warn); }
.mn-ring span { display: grid; min-width: 0; }
.mn-ring b { font-size: 14px; }
.mn-ring small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-cari { margin: 12px 0 0; }
.mn-grup .b-h { margin: 20px 2px 10px; line-height: 1.3; }
.mn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .mn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mn-t { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 14px 6px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; text-align: center; transition: transform .12s, border-color .12s; }
.mn-t[hidden] { display: none; }
.mn-t:active { transform: scale(.96); }
@media (hover: hover) { .mn-t:hover { border-color: var(--accent); } }
.mn-t.perlu { border-color: var(--warn); }
.mn-ik { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.mn-t.perlu .mn-ik { background: var(--warn-bg); color: var(--warn); }
.mn-ik svg { width: 22px; height: 22px; }
.mn-n { position: absolute; top: -6px; right: -9px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--s1); border: 2px solid var(--surface); }
.mn-n.warn { background: var(--bad); }
.mn-t b { font-size: 13px; line-height: 1.2; }
.mn-t small { font-size: 11px; line-height: 1.3; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mn-keluar { margin-top: 20px; color: var(--bad); }
.mn-keluar svg { width: 18px; height: 18px; }
.mn-app { margin-top: 4px; }
.mn-luar { position: absolute; top: 6px; right: 9px; font-style: normal; font-size: 12px; color: var(--ink-3); }

/* logo Muhada Berdaya putih di header beranda & halaman masuk */
.top h1.top-logo { display: flex; align-items: center; padding: 6px 0; }
.top-logo img { display: block; height: 22px; width: auto; }
.login-hero { display: grid; justify-items: center; gap: 12px; padding: calc(44px + env(safe-area-inset-top, 0px)) 16px 40px; color: #fff; text-align: center;
  background: linear-gradient(160deg, var(--brand), #121F4D); border-radius: 0 0 28px 28px; }
.login-hero img { display: block; height: 40px; width: auto; }
.login-hero p { margin: 0; font-size: 13px; opacity: .8; }
.login-hero + .login { padding-top: 26px; }
/* ===================== ARK: buku kas, dasbor, laporan ===================== */
.top-logo { gap: 10px; }
.top-app { font-size: 14px; font-weight: 700; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.35); white-space: nowrap; }
.hero.k-hero { grid-template-columns: 1fr; margin-bottom: 12px; }
.k-hero .hero-angka b { font-size: 34px; }
.minus { color: var(--bad) !important; }
.k-in { color: var(--good); }
.k-out { color: var(--ink); }
.k-h { font-size: 13px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-3); margin: 18px 2px 8px; }
.k-h:first-child { margin-top: 2px; }

/* .t & .s di dalam .main berupa <span>: tampil per baris dan boleh terpotong (tanpa melebarkan halaman) */
.li .main > span { display: block; min-width: 0; }

/* daftar rekening per kelompok */
.k-grup { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 14px 2px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.card .k-grup:first-of-type { margin-top: 2px; }
.k-grup-luar { margin-top: 18px; }
.k-list .li { padding: 10px 12px; }
.k-kode { flex: none; min-width: 42px; text-align: center; padding: 4px 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.k-saldo { flex: none; font-size: 14px; }
.k-list .tag { margin-left: 4px; vertical-align: 1px; }

/* buku kas */
.k-alat { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.k-alat .btn { flex: 1 1 auto; padding: 10px 12px; font-size: 14px; }
.k-alat .btn svg { width: 18px; height: 18px; }
.k-alat select.btn { flex: 0 1 auto; }
.k-trx .li { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; align-items: flex-start; padding: 10px 12px; }
.k-trx .li:first-child { border-top: 0; }
.k-tgl { flex: none; width: 34px; display: grid; justify-items: center; line-height: 1.1; font-size: 11px; color: var(--ink-3); padding-top: 1px; }
.k-tgl b { font-size: 17px; color: var(--ink); }
.k-trx .main .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; font-size: 14.5px; }
.li.k-baris .main .s { white-space: normal; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; margin-top: 2px; }
.k-kd { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--info-bg); color: var(--info); font-variant-numeric: tabular-nums; }
.k-nom { flex: none; display: grid; justify-items: end; gap: 3px; font-size: 14.5px; }
.k-nom small { font-size: 11.5px; color: var(--ink-3); }
.k-nom .badge { font-size: 11px; }
.k-arah { margin-bottom: 14px; }
.k-arah button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
.k-arah svg { width: 18px; height: 18px; }
.k-cek { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 600; }
.k-cek input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.k-cek .hint { display: block; }
.fsheet .row2 { margin-bottom: 0; }
.fsheet input, .fsheet textarea { width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 400; }
.fsheet textarea { min-height: 90px; }
.fsheet .hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.fsheet .seg { margin-bottom: 14px; }

/* dasbor: anggaran RAB */
.k-rab { display: block; text-decoration: none; color: inherit; }
.k-rab-angka { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.k-rab-angka div { display: grid; gap: 2px; }
.k-rab-angka span, .k-rab-kaki span { font-size: 12.5px; color: var(--ink-2); }
.k-rab-angka b { font-size: 17px; }
.k-rab-kaki { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.k-rab-kaki b { color: var(--ink); }

/* grafik masuk & keluar per bulan (masuk biru --s1, keluar oranye --s2; lolos validasi CVD) */
.g-leg { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.g-leg span { display: inline-flex; align-items: center; gap: 6px; }
.g-leg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.g-m { background: var(--s1); }
.g-k { background: var(--s2); }
.g-cols { display: flex; align-items: stretch; gap: 4px; height: 150px; border-bottom: 1px solid var(--line); }
.g-c { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.g-c:focus-visible { outline: 2px solid var(--accent); }
.g-c.on { background: var(--surface-2); }
.g-p { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.g-p i { display: block; flex: 0 1 11px; min-width: 4px; border-radius: 4px 4px 0 0; }
.g-l { font-size: 10.5px; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.g-c.ini .g-l { color: var(--ink); font-weight: 700; }
.g-info { margin: 8px 0 0; color: var(--ink-2); min-height: 20px; }
.g-tabel summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 6px; }

/* realisasi & kegiatan */
.k-real .main { display: grid; gap: 4px; }
.k-real .t { white-space: normal; }
.k-bar { display: block; height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.k-bar i { display: block; height: 100%; background: var(--s3); border-radius: 99px; }
.k-pct { flex: none; width: 46px; text-align: right; font-weight: 700; font-size: 14px; }
.k-rc { grid-template-columns: minmax(110px, 46%) 1fr 58px; }
.k-rabt tr.k-klik { cursor: pointer; }
.k-rabt tr.k-klik:active td { background: var(--surface-2); }
.k-status-semua { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.k-pos { display: grid; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.k-pos div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.k-pos span { color: var(--ink-2); }
.k-akses .main { display: grid; gap: 2px; }
.k-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.k-chips .chip { font-size: 12px; padding: 5px 9px; }
.li .danger { color: var(--bad); }
button.li { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; }
.list > button.li:first-child { border-top: 0; }
input[type="month"].chip { padding: 5px 8px; }

/* ===================== dokumen (pratinjau di layar & cetak A4) ===================== */
.pratinjau { background: var(--surface-2); border-radius: var(--r); padding: 10px; overflow-x: auto; margin-bottom: 12px; }
.pratinjau .dok { background: #fff; color: #000; min-width: 560px; padding: 14mm 12mm; box-shadow: var(--shadow); border-radius: 4px; }
.dok { font-family: "Times New Roman", Times, serif; font-size: 11pt; line-height: 1.35; color: #000; }
.dok-kop2 { display: grid; justify-items: center; gap: 1mm; text-align: center; margin-bottom: 6mm; }
.dok-kop2 b { font-size: 13pt; }
.dok-kop2 span { font-size: 11pt; font-weight: 700; }
.dok-kop { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 2mm; margin-bottom: 5mm; }
.dok-judul { text-align: center; font-size: 14pt; margin: 2mm 0 1mm; letter-spacing: 1px; }
.dok-no { text-align: center; margin-bottom: 6mm; }
.dok-kv { border-collapse: collapse; margin-bottom: 5mm; }
.dok-kv td { padding: 1mm 3mm 1mm 0; vertical-align: top; }
.dok-kv td:first-child { white-space: nowrap; width: 42mm; }
.dok-t { width: 100%; border-collapse: collapse; margin-bottom: 5mm; font-size: 10pt; }
.dok-t th, .dok-t td { border: 1px solid #000; padding: 1.2mm 2mm; text-align: left; vertical-align: top; }
.dok-t th { background: #eee; font-weight: 700; }
.dok-t .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dok-total td { font-weight: 700; }
.dok-2kol { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.dok-2kol h3 { font-size: 11pt; margin: 0 0 2mm; }
.dok-jumlah { display: inline-block; border: 1.5px solid #000; padding: 2mm 6mm; font-size: 14pt; font-weight: 700; margin: 2mm 0 8mm; }
.dok-terbilang { margin: 0 0 6mm; }
.dok-ttd, .dok-ttd3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 10mm; break-inside: avoid; }
.dok-ttd3 { grid-template-columns: 1fr 1fr 1fr; gap: 6mm; }
.dok-ttd div, .dok-ttd3 div { display: grid; text-align: center; }
.dok-ttd b, .dok-ttd3 b { margin-top: 20mm; text-decoration: underline; font-weight: 700; }
#cetak { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.mode-cetak > *:not(#cetak) { display: none !important; }
  body.mode-cetak { background: #fff; }
  body.mode-cetak #cetak { display: block; }
  body.mode-cetak .dok-t tr { break-inside: avoid; }
}

/* ikon di tombol & pratinjau dokumen di layar HP */
.btn svg { width: 18px; height: 18px; flex: none; }
@media screen and (max-width: 600px) {
  .pratinjau { padding: 6px; }
  .pratinjau .dok { min-width: 0; padding: 6mm 4mm; font-size: 9.5pt; }
  .pratinjau .dok-t { font-size: 8.5pt; }
  .pratinjau .dok-kv td:first-child { width: auto; }
  .pratinjau .dok-ttd3 { gap: 3mm; }
  .pratinjau .dok-judul { font-size: 12pt; }
}

/* tutup bulan */
.k-tb { align-items: center; flex-wrap: wrap; cursor: default; }
.k-tb .main .t { display: flex; align-items: center; gap: 8px; }
.k-tb .main .s b { color: var(--ink); }
.k-tb-aksi { display: flex; gap: 6px; flex: none; }
.k-tb-aksi .btn { padding: 8px 12px; font-size: 13.5px; }
@media (max-width: 559px) { .k-tb-aksi { width: 100%; } .k-tb-aksi .btn { flex: 1; } }
.k-tb .main .s { white-space: normal; }

/* kotak centang di panel form: ukuran tetap, tidak ikut gaya kotak isian (sebelumnya melebar penuh & menjepit teks) */
.fsheet input[type="checkbox"], .f input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; min-width: 20px; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.fsheet .k-cek, .f .k-cek { display: flex !important; align-items: flex-start; gap: 10px; }
.k-cek > span, .k-cek .hint { flex: 1; min-width: 0; }

/* pilih banyak transaksi (beri kode sekaligus) */
.k-pilih { position: sticky; top: calc(var(--top-h, 52px) + 52px); z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 12px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent); }
.k-pilih .k-cek { flex: 1 1 200px; margin: 0; font-size: 14px; }
.k-pilih-n { font-size: 14px; color: var(--ink-2); }
.k-pilih .btn { padding: 9px 14px; font-size: 14px; }
.k-cekbox { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ink-3); background: var(--surface); display: inline-grid; place-items: center; margin-top: 2px; }
.k-cekbox.on { background: var(--accent); border-color: var(--accent); }
.k-cekbox.on::after { content: ""; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.k-cekbox.mati { opacity: .25; border-style: dashed; }
.k-baris.dipilih, .k-tabel tr.dipilih td { background: var(--accent-soft); }
.k-rincian summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 4px 0 8px; }
.k-rincian .list { max-height: 260px; overflow-y: auto; }
.k-pilih .hint { font-weight: 400; }

/* kotak tanggal/bulan di Safari (iPad/iPhone): punya lebar minimum & teks rata tengah bawaan sehingga meluber ke
   kolom sebelah. Samakan dengan kotak isian lain. */
.fsheet input[type="date"], .f input[type="date"], .fsheet input[type="month"], .f input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%;
  height: 48px; text-align: left; line-height: 26px;
}
input[type="date"]::-webkit-date-and-time-value, input[type="month"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.fsheet .row2 > label, .f .row2 > label { min-width: 0; overflow: hidden; }
/* ===================== ritme spasi =====================
   Satu jarak antarbagian untuk semua halaman: tiap blok langsung di dalam <main> berjarak --jarak (HP 12 px, komputer 16 px).
   Kartu, hero, kpi, tombol tidak membawa margin sendiri; jarak di dalam kartu memakai --jarak-dalam. */
:root { --jarak: 12px; --jarak-dalam: 10px; }
main > * { margin-top: 0; margin-bottom: 0; }
main > * + * { margin-top: var(--jarak); }
main > .search { margin-top: 4px; padding: 6px 0; }
main > .chips { margin-top: 4px; padding: 4px 0 2px; }
main > .search + .chips { margin-top: 0; }
main > .k-h { margin-top: calc(var(--jarak) + 10px); margin-bottom: calc(-1 * var(--jarak) + 8px); }
main > .k-h:first-child { margin-top: 0; }
main > .k-grup { margin: calc(var(--jarak) + 6px) 2px calc(-1 * var(--jarak) + 6px); }
main > .k-grup:first-child { margin-top: 2px; }
.card { margin-bottom: 0; }
.dash > .card, .dash > * { margin: 0; }
.dash { gap: var(--jarak); }
.kpi { gap: var(--jarak); }

/* kepala kartu: judul di kiri, tautan/tombol di kanan, sejajar */
.card-head, .dash .card-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--jarak-dalam); }
.card-head h2 { min-width: 0; }
.card-head > a.small, .card-head > .small { flex: none; white-space: nowrap; }
.card-head .btn { padding: 8px 12px; font-size: 14px; }
.card > h2 { margin-bottom: var(--jarak-dalam); }

/* keterangan di bawah/atas daftar */
.k-ket { margin: 0 2px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.card .k-ket-kartu { margin: -4px 0 var(--jarak-dalam); }
.k-hapus { display: block; margin-top: 16px; }
.k-cocok { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); }

/* deret tombol: HP = tombol utama selebar penuh, sisanya berbagi baris; tablet/komputer = sebaris seukuran isi */
.k-alat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.k-alat > .btn.pri { grid-column: 1 / -1; }
.k-alat .btn { width: 100%; padding: 11px 12px; font-size: 14px; }
.btns { gap: 8px; }
.btns .btn { min-width: 0; padding: 11px 12px; font-size: 14px; }

/* formulir dua kolom: kolom isian sejajar walau panjang labelnya berbeda */
.f.row2, .row2 { align-items: end; }
.f.row2 > label, .row2 > label { align-content: end; }
.f > .row2 { margin: 0; }

/* tabel ringkas di HP: huruf & jarak lebih kecil, angka tidak terpotong ke baris baru */
table.t-padat th, table.t-padat td { padding: 8px 8px; }
table.t-padat td.n { white-space: nowrap; }
.k-tabel table.t tr:last-child td { border-bottom: 0; }
.k-tabel table.t th:first-child, .k-tabel table.t td:first-child { padding-left: 14px; }
.k-tabel table.t th:last-child, .k-tabel table.t td:last-child { padding-right: 14px; }
.k-nama-rek { max-width: 84px; font-size: 10.5px; line-height: 1.3; text-transform: lowercase; }
.k-nama-rek::first-letter { text-transform: uppercase; }
@media (max-width: 480px) {
  table.t-padat { font-size: 12px; }
  table.t-padat tfoot td { font-size: 11.5px; }
  table.t-padat th, table.t-padat td { padding: 7px 4px; }
  .k-tabel table.t-padat th:first-child, .k-tabel table.t-padat td:first-child { padding-left: 10px; }
  .k-tabel table.t-padat th:last-child, .k-tabel table.t-padat td:last-child { padding-right: 10px; }
}

/* hasil proyeksi: angka tidak pecah baris */
.k-pos div { align-items: baseline; }
.k-pos b { white-space: nowrap; }

@media (min-width: 720px) {
  .k-alat { display: flex; flex-wrap: wrap; }
  .k-alat .btn, .btns .btn { width: auto; flex: 0 0 auto; padding: 10px 16px; }
  .btns { justify-content: flex-start; }
  .k-nama-rek { max-width: none; }
}
@media (min-width: 1024px) {
  :root { --jarak: 16px; --jarak-dalam: 12px; }
  .card { padding: 18px; }
  .k-tabel { padding: 0; }
}

/* tombol tunggal setelah tombol utama: selebar penuh, tidak menyendiri setengah baris */
.k-alat > .btn.pri + :last-child { grid-column: 1 / -1; }
/* kolom yang hanya muat di layar lebar; di HP isinya pindah ke baris kecil (.k-hp) */
.k-hp { display: none; }
@media (max-width: 559px) {
  .k-lebar { display: none; }
  .k-hp { display: block; font-size: 11px; }
}
@media (max-width: 400px) {
  table.t-padat { font-size: 11.5px; }
  table.t-padat tfoot td { font-size: 11px; }
}

/* isi formulir yang berupa beberapa kartu (mis. Proyeksi) tetap berjarak */
main > form > * + * { margin-top: var(--jarak); }
main > form > .card { margin-bottom: 0; }
/* halaman sederhana (rekap, pengaturan, formulir): lebar baca maks. 880 px di layar lebar */
@media (min-width: 1024px) { main.sempit > * { max-width: 880px; } }
/* tombol terakhir yang tersisa sendirian di barisnya: selebar penuh (dengan atau tanpa tombol utama di atas) */
.k-alat > .btn.pri ~ :last-child:nth-child(even),
.k-alat > :first-child:not(.pri) ~ :last-child:nth-child(odd) { grid-column: 1 / -1; }
/* ===================== tablet & komputer =====================
   HP (<720 px): satu kolom, menu bawah (gaya MBS).
   Tablet (720–1023 px): konten lebih lebar, panel form di tengah, dasbor berpetak.
   Komputer (≥1024 px): menu di panel kiri yang menyatu dengan header (tinggi sama), konten maks. 1200 px di tengah,
   buku kas berbentuk tabel. */
.nav-merek, .nav-akun, .top-judul { display: none; }
.k-blok + .k-blok .k-grup { margin-top: 14px; }
.card .k-blok:first-child .k-grup { margin-top: 2px; }
.k-tabel { padding: 0; overflow-x: auto; }
.k-tabel table.t th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.k-tabel table.t th, .k-tabel table.t td { padding: 9px 10px; }
.k-tabel tbody tr { cursor: pointer; }
.k-tabel tbody tr:hover td { background: var(--surface-2); }
.k-tabel td .tag { margin-left: 4px; }
.k-nw { white-space: nowrap; }

@media (min-width: 720px) {
  main { max-width: 1000px; padding: 20px 24px 104px; }
  .top .top-row { max-width: 1000px; margin: 0 auto; }
  .k-hero .hero-angka b { font-size: 40px; }
  .mn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .k-alat .btn { flex: 0 1 auto; }
  /* dasbor tablet: ringkasan → saldo (dua kolom di dalam kartu) → RAB & grafik berdampingan → transaksi terbaru */
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "hero hero" "kpi kpi" "saldo saldo" "rab grafik" "terbaru terbaru"; align-items: stretch; }
  .d-hero { grid-area: hero; } .d-kpi { grid-area: kpi; } .d-saldo { grid-area: saldo; } .d-rab { grid-area: rab; }
  .d-grafik { grid-area: grafik; } .d-terbaru { grid-area: terbaru; }
  .d-saldo-isi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
  .d-saldo-isi .k-blok .k-grup { margin-top: 2px; }
  .d-saldo-isi .k-blok:nth-child(n+3) .k-grup { margin-top: 14px; }
  .d-terbaru .k-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-terbaru .k-list .li:nth-child(2) { border-top: 0; }
  .d-terbaru .k-list .li:nth-child(even) { border-left: 1px solid var(--line); }
  /* panel form: dialog di tengah layar, bukan dari bawah */
  dialog.sheet { margin: auto; max-width: 560px; max-height: 86vh; border-radius: 20px; }
  dialog.sheet[open] { animation: fadeIn .15s ease; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 14px; }
  .pratinjau .dok { max-width: 210mm; margin: 0 auto; }
}

@media (min-width: 1024px) {
  :root { --nav-w: 256px; --kepala: 64px; --isi: 1200px; }
  /* header: tinggi tetap, sejajar dengan blok logo di panel kiri */
  .top { margin-left: var(--nav-w); min-height: var(--kepala); padding: 0 32px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
  .top .top-row { width: 100%; max-width: var(--isi); }
  .top h1 { font-size: 18px; }
  .top-logo img, .top-app { display: none; }
  .top-judul { display: block; min-width: 0; }
  .top-judul .sub { display: block; }

  .nav { top: 0; right: auto; width: var(--nav-w); flex-direction: column; align-items: stretch; gap: 2px; padding: 0 14px 16px;
    border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; }
  .nav-merek { display: flex; align-items: center; gap: 12px; height: var(--kepala); flex: none; margin: 0 -14px 14px; padding: 0 20px;
    background: var(--brand); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-merek img { display: block; height: 20px; width: auto; flex: none; }
  .nav-merek span { font-size: 13px; font-weight: 700; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); white-space: nowrap; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; color: var(--ink-2); }
  .nav a:hover { background: var(--surface-2); }
  .nav a.on { background: var(--accent-soft); color: var(--accent); }
  .nav svg { width: 20px; height: 20px; flex: none; }
  .nav-akun { display: grid; gap: 2px; margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
  .nav-akun span { color: var(--ink-3); font-size: 12px; }

  main { margin-left: var(--nav-w); max-width: none; padding: 24px 32px 48px; }
  main > * { max-width: var(--isi); margin-left: auto; margin-right: auto; }
  .search { top: var(--kepala); }
  .mn-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  #toast { bottom: 28px; left: calc(50% + var(--nav-w) / 2); }
  .savebar { bottom: 0; }
  .k-trx .main .t { -webkit-line-clamp: 1; }

  /* dasbor komputer: saldo total + 4 angka sebaris; saldo rekening di kiri; RAB, grafik & terbaru di kanan */
  .dash { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "hero kpi" "saldo rab" "saldo grafik" "saldo terbaru"; grid-template-rows: auto auto auto 1fr; gap: 16px; }
  .d-hero { display: flex; flex-direction: column; justify-content: center; }
  .d-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-kpi .kpi-i { min-height: 0; }
  .d-saldo-isi { display: block; }
  .d-saldo-isi .k-blok:nth-child(n+2) .k-grup { margin-top: 14px; }
  .d-terbaru .k-list { display: block; }
  .d-terbaru .k-list .li:nth-child(even) { border-left: 0; }
  .d-terbaru .k-list .li:nth-child(2) { border-top: 1px solid var(--line); }
}

@media (min-width: 1440px) {
  .d-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
