/* Numa Finance — kertas buku besar: netral hangat, satu aksen kobalt, angka mono tabular. */

:root {
  --bg: #f4f2ec;
  --surface: #fbfaf7;
  --surface-2: #eeebe3;
  --line: #d9d5ca;
  --line-2: #e6e2d8;
  --ink: #1c1f1d;
  --ink-2: #474c48;
  --ink-3: #686d68;
  --accent: #3a55e0;
  --accent-hover: #2d47cc;
  --accent-ink: #ffffff;
  --accent-soft: #e3e7fb;
  --pos: #1b7449;
  --pos-soft: #e1efe6;
  --neg: #b0342a;
  --neg-soft: #f6e3e0;
  --warn: #8a5a00;
  --warn-soft: #f5ead2;
  --focus: #3a55e0;
  --shadow: 0 1px 2px rgba(28, 31, 29, .06), 0 8px 24px rgba(28, 31, 29, .08);
  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121413; --surface: #1a1d1b; --surface-2: #232724; --line: #343935; --line-2: #2a2e2b;
    --ink: #ebe8e1; --ink-2: #bdbab2; --ink-3: #9a978f;
    --accent: #8d9dff; --accent-hover: #a3b0ff; --accent-ink: #0d1233; --accent-soft: #252b4d;
    --pos: #63c897; --pos-soft: #1b2e24; --neg: #f08c80; --neg-soft: #3a2220; --warn: #e3b55c; --warn-soft: #362c17;
    --focus: #8d9dff; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121413; --surface: #1a1d1b; --surface-2: #232724; --line: #343935; --line-2: #2a2e2b;
  --ink: #ebe8e1; --ink-2: #bdbab2; --ink-3: #9a978f;
  --accent: #8d9dff; --accent-hover: #a3b0ff; --accent-ink: #0d1233; --accent-soft: #252b4d;
  --pos: #63c897; --pos-soft: #1b2e24; --neg: #f08c80; --neg-soft: #3a2220; --warn: #e3b55c; --warn-soft: #362c17;
  --focus: #8d9dff; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
.h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 .35rem; }
.eyebrow .money { text-transform: none; letter-spacing: -0.02em; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.02em; white-space: nowrap; font-weight: 500; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num { text-align: right; }
.ic { width: 20px; height: 20px; flex: none; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--ink-3); }

/* ---------- Kerangka ---------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-2);
}
.topbar .brand-switch { flex: 1; min-width: 0; }
.main { padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; outline: none; }

.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; }
.logo span { font-size: 1.05rem; }
.logo em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.logo:hover { text-decoration: none; }
.logo-sm svg { width: 32px; height: 32px; }

.brand-switch select {
  width: 100%; min-height: 44px; padding: 8px 36px 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  appearance: none; font-weight: 600; text-overflow: ellipsis;
}

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-h); color: var(--ink-3); font-size: .72rem; font-weight: 600;
}
.bottomnav a:hover { text-decoration: none; color: var(--ink); }
.bottomnav a.active { color: var(--ink); }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
.bottomnav .ic { width: 22px; height: 22px; }
.fab, .fab-gap { justify-self: center; align-self: center; }
.fab {
  width: 54px; height: 54px; border-radius: 16px; border: 0; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transform: translateY(-10px);
}
.fab .ic { width: 26px; height: 26px; }
.fab:active { transform: translateY(-9px) scale(.97); }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--neg); color: #fff; font-size: .72rem; font-weight: 700; margin-left: auto; font-style: normal; }
.badge-dot { position: absolute; top: 12px; left: calc(50% + 8px); min-width: 9px; width: 9px; height: 9px; padding: 0; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .topbar, .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 22px 16px; border-right: 1px solid var(--line-2); background: var(--surface);
  }
  .main { padding: 32px 40px 64px; width: 100%; }
  .desk-only { display: inline-flex !important; }
}
.desk-only { display: none !important; }

.side-catat { display: grid; gap: 6px; }
.side-catat-btn {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); color: var(--ink); font-weight: 600; background: var(--bg);
}
.side-catat-btn:first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.side-catat-btn:hover { text-decoration: none; border-color: var(--ink-3); }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500;
}
.side-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.side-nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.side-nav a.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.who { display: grid; padding: 0 12px 8px; }
.who strong { font-size: .92rem; }
.who span { font-size: .8rem; color: var(--ink-3); }
.ghost-btn {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; background: none;
  color: var(--ink-2); border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Kepala halaman & seksi ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head h1 { margin-right: auto; }
.back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; color: var(--ink); }
.back:hover { background: var(--surface-2); }
.home-head { align-items: flex-end; }
.home-head > div:first-child { margin-right: auto; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.quick .btn { flex: 1 1 0; }
@media (min-width: 640px) { .quick { width: auto; } .quick .btn { flex: none; } }

section { margin-bottom: 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sec-total { font-size: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; }
.card .h3 { margin-bottom: 8px; }

/* ---------- Tombol & input ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--neg-soft); border-color: transparent; color: var(--neg); }
.btn-danger:hover { border-color: var(--neg); }
.btn-danger-ghost { color: var(--neg); }
.btn-in { color: var(--pos); }
.btn-out { color: var(--neg); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: .9rem; }
.btn-lg { min-height: 52px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--accent); cursor: pointer; font-weight: 600; text-align: left; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
.field > label, .field legend, .label { font-size: .88rem; font-weight: 600; color: var(--ink-2); padding: 0; }
.field-narrow { max-width: 260px; }
.hint { font-size: .8rem; color: var(--ink-3); }
.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--ink-2); }
select.input { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
textarea.input { resize: vertical; min-height: 64px; }
input[type="date"].input, input[type="month"].input { min-width: 0; }
.input-color { padding: 4px; height: 44px; cursor: pointer; }
.input-code { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--neg-soft); color: var(--neg); font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

/* Chip radio: input tetap fokusabel, tampilan di span */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: .92rem; color: var(--ink-2); transition: all .12s;
}
.chip input:hover + span { border-color: var(--ink-3); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip-brand span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--b); margin-right: 8px; }
.chip-sm span { min-height: 38px; padding: 0 12px; font-size: .85rem; }

.toggle { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.toggle-ui { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle-text { font-weight: 600; display: grid; }
.toggle-text small { font-weight: 400; color: var(--ink-3); font-size: .8rem; }

.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--surface-2); border-radius: var(--radius); max-width: 640px; }
.seg a { flex: 1 1 0; min-width: 0; display: grid; place-items: center; min-height: 44px; padding: 0 6px; text-align: center; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; display: grid; place-items: center; min-height: 44px; padding: 0 14px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); }

/* ---------- Beranda ---------- */
.pending-strip {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 24px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.pending-strip:hover { text-decoration: none; border-color: var(--warn); }
.pending-strip .ic { color: var(--warn); }
.pending-strip span { flex: 1; }
.chev { width: 18px; height: 18px; color: var(--ink-3); margin-left: auto; }

/* HP: baris label kiri, angka kanan (tak pernah terpotong). Lebar: tiga kolom. */
.kpis { display: grid; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.kpi { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 12px 16px; background: var(--surface); min-width: 0; }
.kpi-label { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.kpi-val { font-size: 1.05rem; }
.kpi-net { display: grid; gap: 2px; padding: 14px 16px; }
.kpi-net .kpi-val { font-size: clamp(1.5rem, 7vw, 2rem); font-weight: 600; letter-spacing: -0.04em; }
@media (min-width: 720px) {
  .kpis { grid-template-columns: 1fr 1fr 1.3fr; }
  .kpi { display: grid; align-content: start; gap: 4px; padding: 14px 16px; }
  .kpi-val { font-size: 1.3rem; }
  .kpi-net .kpi-val { font-size: 1.7rem; }
}

.cash-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cash-card {
  display: grid; gap: 2px; padding: 14px 16px 12px; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-top: 3px solid var(--ink); min-width: 0;
}
.cash-card:hover { text-decoration: none; border-color: var(--line); border-top-color: var(--accent); }
.cash-kind { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.cash-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-bal { font-size: 1.35rem; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; }
.cash-pend { font-size: .78rem; color: var(--ink-3); }
.cash-pend .money { font-size: .78rem; }

.brand-strip { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.brand-strip li { display: grid; grid-template-columns: 96px 1fr auto; grid-template-areas: "code bars net" "code sub sub"; gap: 4px 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.brand-strip li:first-child { border-top: 0; }
.bs-code { grid-area: code; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.bs-code::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--b); flex: none; }
.bs-bars { grid-area: bars; display: grid; gap: 3px; }
.bs-bars i { display: block; height: 5px; border-radius: 3px; }
.bar-in { background: var(--pos); opacity: .75; }
.bar-out { background: var(--neg); opacity: .6; }
.bs-net { grid-area: net; font-size: 1.02rem; text-align: right; }
.bs-sub { grid-area: sub; font-size: .78rem; color: var(--ink-3); }
.bs-sub .money { font-size: .78rem; }
@media (max-width: 480px) {
  .brand-strip li { grid-template-columns: 1fr auto; grid-template-areas: "code net" "bars bars" "sub sub"; }
}

.setup-card { padding: 24px; border-radius: var(--radius); border: 1px dashed var(--line); background: var(--surface); max-width: 560px; }
.setup-card h2 { font-size: 1.3rem; margin-bottom: 8px; }

.brand-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border-radius: 4px; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.brand-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--b, var(--ink-3)); }

/* ---------- Form transaksi ---------- */
.tx-form { max-width: 640px; }
.field-amount { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); }
.amount-wrap { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--line); }
.amount-wrap:focus-within { border-color: var(--accent); }
.amount-rp { font-family: var(--mono); font-size: 1.3rem; color: var(--ink-3); }
.input-amount {
  border: 0; background: transparent; padding: 6px 0 8px; min-height: 56px; width: 100%; min-width: 0;
  font-family: var(--mono); font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.input-amount:focus, .input-amount:focus-visible { outline: none; box-shadow: none; }
.tx-in .amount-wrap:focus-within { border-color: var(--pos); }
.tx-out .amount-wrap:focus-within { border-color: var(--neg); }
.tax { padding: 6px 16px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2) !important; }
.tax legend { padding: 10px 0 0; }
.net { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 12px; margin-top: 4px; border-top: 1px dashed var(--line); font-weight: 600; }
.net strong { font-size: 1.25rem; }
.splits { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.split-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.split-in { display: flex; align-items: center; gap: 6px; width: 130px; }
.split-in .input { text-align: right; font-family: var(--mono); }
.split-sum { margin: 4px 0 0; font-weight: 600; color: var(--warn); font-size: .9rem; }
.split-sum.ok { color: var(--pos); }
.uploader { display: flex; gap: 8px; flex-wrap: wrap; }
.upl-btn { cursor: pointer; }
.upl-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumbs { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img, .thumb a { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-pdf { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; font-weight: 700; font-size: .8rem; color: var(--ink-2); }
.thumb-state { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: .7rem; background: rgba(0,0,0,.6); color: #fff; }
.thumb-state:empty { display: none; }
.thumb-err { border-color: var(--neg); }
.thumb-err .thumb-state { background: var(--neg); }
.thumb-x { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumb-x .ic { width: 16px; height: 16px; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; padding-top: 8px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }

.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.combo-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 5px; cursor: pointer; }
.combo-list li small { font-family: var(--mono); color: var(--ink-3); font-size: .78rem; }
.combo-list li:hover, .combo-list li.active { background: var(--surface-2); }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list .combo-none { color: var(--ink-3); cursor: default; }

/* ---------- Daftar transaksi ---------- */
.filters { display: grid; gap: 10px; margin-bottom: 18px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); }
.filters-inline { grid-template-columns: 1fr; }
@media (min-width: 640px) { .filters-inline { grid-template-columns: 1fr 200px; } }
.presets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px; padding: 2px; }
.presets .chip { flex: none; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--ink-3); min-width: 0; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filter-grid select.input { font-size: .9rem; padding-left: 10px; padding-right: 28px; background-position: right 8px center; }
@media (min-width: 900px) { .filter-grid { grid-template-columns: repeat(4, 1fr); } }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 12px; top: 12px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 40px; }

.period { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); border-top: 3px solid var(--ink); margin-bottom: 20px; }
.period-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.period-nums div { display: grid; gap: 2px; min-width: 0; }
.period-nums div:last-child { grid-column: 1 / -1; padding-top: 8px; border-top: 1px dashed var(--line); }
.period-nums span { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.period-nums strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; }
.period-nums div:last-child strong { font-size: 1.35rem; }
@media (min-width: 640px) {
  .period-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .period-nums div:last-child { grid-column: auto; padding-top: 0; border-top: 0; }
  .period-nums strong, .period-nums div:last-child strong { font-size: 1.3rem; }
}

.day { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 2px 8px; border-bottom: 1px solid var(--line); }
.day-date { display: flex; align-items: baseline; gap: 8px; }
.day-date small { color: var(--ink-3); font-size: .8rem; }
.day-sum { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; font-size: .82rem; }
.day-net { color: var(--ink-2); }
.gap { margin: 4px 0 18px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--line); color: var(--ink-3); font-size: .82rem; text-align: center; }
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li + li { border-top: 1px solid var(--line-2); }
.tx-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 4px; color: var(--ink); }
.tx-row:hover { text-decoration: none; background: var(--surface); }
.tx-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.tx-ic .ic { width: 18px; height: 18px; }
.k-in .tx-ic { background: var(--pos-soft); color: var(--pos); }
.k-out .tx-ic { background: var(--neg-soft); color: var(--neg); }
.tx-main { display: grid; gap: 2px; min-width: 0; }
.tx-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: .84rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.tx-amt { font-size: .98rem; padding-top: 1px; }
.k-in .tx-amt { color: var(--pos); }
.s-pending .tx-amt { opacity: .75; }
.s-rejected .tx-amt, .s-void .tx-amt { text-decoration: line-through; color: var(--ink-3); }
.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .72rem; font-weight: 700; vertical-align: 2px; white-space: nowrap; }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-posted { background: var(--pos-soft); color: var(--pos); }
.st-rejected, .st-void { background: var(--neg-soft); color: var(--neg); }
.more { display: flex; justify-content: center; padding: 12px 0; }

/* Detail */
.detail { max-width: 680px; }
.detail-hero { display: grid; justify-items: start; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); margin-bottom: 16px; }
.detail-amt { font-size: 2rem; font-weight: 600; letter-spacing: -0.04em; }
.k-in .detail-amt { color: var(--pos); }
.kv { margin: 0 0 20px; display: grid; }
.kv > div { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
.kv dt { color: var(--ink-3); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kv dd.money { justify-content: flex-end; }
.kv-total dt, .kv-total dd { font-weight: 600; color: var(--ink); }
.journal { margin: 8px 0 20px; }
.journal summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--ink-2); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); margin-bottom: 16px; }
.notice-err { background: var(--neg-soft); color: var(--neg); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; background: var(--surface); }
.table .num { text-align: right; }
.table tr.rev td { color: var(--ink-3); font-style: italic; }

/* Persetujuan */
.approve-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.approve-card { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.approve-main { display: grid; gap: 3px; padding: 14px 16px; color: var(--ink); }
.approve-main:hover { text-decoration: none; background: var(--surface-2); }
.approve-top { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.approve-top strong { font-size: 1.1rem; color: var(--ink); }
.k-in .approve-top strong { color: var(--pos); }
.approve-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 14px; }

/* ---------- Rekening, kontak, daftar baris ---------- */
.acct-list, .contact-list, .menu-list, .row-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); }
.acct-list li + li, .contact-list li + li, .menu-list li + li, .row-list li + li { border-top: 1px solid var(--line-2); }
.acct a, .contact, .menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; color: var(--ink);
  background: none; border: 0; text-align: left; cursor: pointer; font-weight: 500;
}
.acct a:hover, .contact:hover, .menu-list a:hover, .menu-list button:hover { text-decoration: none; background: var(--surface-2); }
.acct-main, .contact-main, .row-main { display: grid; gap: 1px; min-width: 0; flex: 1; }
.acct-main small, .contact-main small, .row-main small { color: var(--ink-3); font-size: .82rem; overflow-wrap: anywhere; }
.acct-bal { display: grid; justify-items: end; text-align: right; }
.acct-bal small { font-size: .76rem; color: var(--ink-3); }
.acct-bal small .money { font-size: .76rem; }
.inactive { opacity: .6; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); font-weight: 700; color: var(--ink-2); flex: none; }
.row-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.row-list-tight li { padding: 8px 16px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; padding-left: 48px; }
@media (min-width: 720px) { .row-actions { width: auto; padding-left: 0; } }
.swatch { width: 14px; height: 36px; border-radius: 3px; background: var(--b); flex: none; }
.coa { margin-bottom: 18px; }
.coa-code { width: 64px; color: var(--ink-3); font-size: .88rem; }
.who-card { display: grid; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); }
.who-card span { font-size: .85rem; color: var(--ink-3); overflow-wrap: anywhere; }
.menu-list .badge { margin-left: auto; }
.menu-list .badge:not([hidden]) + .chev { margin-left: 8px; }

.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line-2); }
.perm-table th:first-child { text-align: left; }
.perm-table thead th { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.perm-table input { width: 22px; height: 22px; accent-color: var(--accent); }
.perm-table td { height: 44px; }
.link-box { display: flex; gap: 8px; margin-bottom: 12px; }
.link-box .input { font-family: var(--mono); font-size: .8rem; }

.rules { display: grid; gap: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.rules-head, .rules-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; }
.rules-head { display: none; }
.rules-row + .rules-row { border-top: 1px solid var(--line-2); }
.rule-cell { display: grid; gap: 6px; }
.rule-cell::before { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.rules-row .rule-cell:nth-of-type(1)::before { content: 'Uang masuk'; }
.rules-row .rule-cell:nth-of-type(2)::before { content: 'Uang keluar'; }
.amount-mini { display: flex; align-items: center; gap: 6px; }
.amount-mini span { font-family: var(--mono); color: var(--ink-3); }
.amount-mini .input { font-family: var(--mono); text-align: right; }
@media (min-width: 720px) {
  .rules-head, .rules-row { grid-template-columns: 180px 1fr 1fr; align-items: start; }
  .rules-head { display: grid; background: var(--surface-2); font-size: .78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
  .rule-cell::before { display: none; }
  .rules-row strong { padding-top: 10px; }
}
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.inline-form .field { flex: 1 1 180px; }
.inline-form .form-error { width: 100%; }

/* Saldo awal */
.ob-head { display: none; }
.ob-row { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "acc acc" "brand amt"; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.ob-row label:nth-child(1) { grid-area: acc; }
.ob-row label:nth-child(2) { grid-area: brand; }
.ob-amt { grid-area: amt; }
.ob-amt .input { text-align: right; }
.ob-row .icon-btn { grid-column: 2; justify-self: end; margin-top: -4px; }
@media (min-width: 720px) {
  .ob-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) 44px; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
  .ob-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) 44px; grid-template-areas: none; align-items: center; }
  .ob-row label:nth-child(n), .ob-amt { grid-area: auto; }
  .ob-row .icon-btn { grid-column: auto; margin: 0; }
}
.ob-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 600; flex-wrap: wrap; }

/* ---------- Sheet / dialog ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh;
  border-radius: 16px 16px 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(10, 12, 11, .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 4px 20px; }
.sheet-head h2 { font-size: 1.1rem; }
.sheet-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.lead { font-size: 1.02rem; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; max-width: 520px; border-radius: 14px; max-height: 86vh; }
  dialog.sheet-wide { max-width: 640px; }
}
.catat-grid { display: grid; gap: 10px; }
.catat-opt { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); }
.catat-opt:hover { text-decoration: none; border-color: var(--ink-3); background: var(--bg); }
.catat-opt .ic { width: 28px; height: 28px; padding: 5px; border-radius: 8px; box-sizing: content-box; }
.catat-opt span { display: grid; }
.catat-opt small { color: var(--ink-3); }
.catat-in .ic { background: var(--pos-soft); color: var(--pos); }
.catat-out .ic { background: var(--neg-soft); color: var(--neg); }
.catat-tr .ic { background: var(--surface-2); color: var(--ink-2); }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { left: auto; right: 24px; bottom: 24px; justify-items: end; } }
.toast {
  max-width: 420px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
  border-left: 4px solid var(--pos);
}
.toast.in { opacity: 1; transform: none; }
.toast-warn { border-left-color: #e0a526; }
.toast-err { border-left-color: var(--neg); }

/* ---------- Kosong & memuat ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-title { font-weight: 600; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.empty .btn { margin-top: 8px; }
.loading { display: flex; justify-content: center; gap: 6px; padding: 40px 0; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: pulse 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Masuk & aktivasi ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 28px 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .muted { margin: 0; }
.auth-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 1.1rem; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.auth-mark svg { width: 32px; height: 32px; }
.auth-mark em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-foot { font-size: .8rem; color: var(--ink-3); margin: 0; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { flex: 1; font-size: .72rem; font-weight: 600; color: var(--ink-3); padding-top: 8px; border-top: 3px solid var(--line); counter-increment: s; }
.steps li::before { content: counter(s) '. '; }
.steps li.done { border-color: var(--pos); color: var(--ink-2); }
.steps li.now { border-color: var(--accent); color: var(--ink); }
.qr { width: 220px; max-width: 100%; margin: 4px auto; padding: 8px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.qr svg { width: 100%; height: auto; }
.secret summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent); }
.secret code { display: block; padding: 10px 12px; margin-bottom: 4px; border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--mono); font-size: .95rem; letter-spacing: .06em; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 14px; list-style: none; border: 1px dashed var(--line); border-radius: var(--radius-sm); counter-reset: c; }
.codes li { counter-increment: c; display: flex; gap: 6px; align-items: baseline; }
.codes li::before { content: counter(c); font-size: .7rem; color: var(--ink-3); width: 14px; }
.codes code { font-family: var(--mono); font-size: 1rem; font-weight: 500; }

/* ---------- Laporan ---------- */
.report-actions { display: flex; gap: 8px; }
.report-table tr.r-head th { background: var(--surface-2); color: var(--ink-2); font-size: .78rem; }
.report-table tr.r-total td { font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); }
.report-table td.num { white-space: nowrap; }
.balanced { margin: 0 0 12px; font-weight: 600; }
.balanced.ok { color: var(--pos); }
.span-2 { grid-column: 1 / -1; }
.print-only { display: none; }

/* Impor */
.map-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 16px; }
.map-grid label { display: grid; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.imp-sum { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.imp-sum strong { font-family: var(--mono); }
.err-list { max-height: 320px; overflow: auto; }

/* ---------- Cetak (PDF): A4 tegak, selalu terang, tanpa navigasi ---------- */
@page { size: A4 portrait; margin: 16mm 14mm 18mm; @bottom-right { content: "Halaman " counter(page); font: 9pt sans-serif; color: #666; } }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f1f1f1; --line: #bbb; --line-2: #ddd; --ink: #000; --ink-2: #222; --ink-3: #555; --pos: #000; --neg: #a00; color-scheme: light; }
  body { background: #fff; font-size: 10.5pt; }
  .sidebar, .topbar, .bottomnav, .toasts, .no-print, .skip, .page-head, .balanced { display: none !important; }
  .shell, .main { display: block !important; padding: 0 !important; margin: 0 !important; }
  .print-only { display: grid; }
  .letterhead { gap: 2px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #000; }
  .letterhead h2 { font-size: 14pt; margin-top: 8px; }
  .letterhead small { color: #555; }
  .table-wrap { overflow: visible; border: 0; }
  .report-table tr { break-inside: avoid; }
  .report-table thead { display: table-header-group; }
}
