:root {
  --bg: #f3f6f5; --card: #ffffff; --ink: #0f1f1d; --muted: #61716e; --line: #e2e9e7; --soft: #eaf2f0;
  --brand: #0f766e; --brand-2: #115e59; --brand-ink: #ffffff; --brand-soft: #d7efeb;
  --in: #15803d; --in-soft: #dcfce7; --out: #c2410c; --out-soft: #ffedd5;
  --warn: #b45309; --warn-soft: #fef3c7; --danger: #dc2626; --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 31, 29, .05), 0 6px 20px rgba(15, 31, 29, .06);
  --r: 18px; --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1514; --card: #15201f; --ink: #e8f0ee; --muted: #93a5a1; --line: #24322f; --soft: #1b2a28;
    --brand: #2dd4bf; --brand-2: #14b8a6; --brand-ink: #062b27; --brand-soft: #123a35;
    --in: #4ade80; --in-soft: #12301d; --out: #fb923c; --out-soft: #3a2010;
    --warn: #fbbf24; --warn-soft: #3a2c0b; --danger: #f87171; --danger-soft: #3b1515;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.noscroll { overflow: hidden; }
body.is-locked .app, body.is-locked .tabbar { visibility: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 20px; height: 20px; flex: none; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; display: block; margin-left: auto; margin-right: auto; }
.block { display: block; margin-top: 6px; }
.pos { color: var(--in); } .neg { color: var(--danger) !important; } .warn-t { color: var(--warn); font-weight: 600; }
.pad { padding: 4px 2px 8px; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.app { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 16px calc(var(--tab-h) + var(--safe-b) + 28px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 14px; }
.topbar-text { min-width: 0; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink); position: relative; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 12px; }
.icon-btn:disabled { opacity: .35; }
.sync-dot { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--in); border: 2px solid var(--card); }
#syncBtn[data-state="busy"] .sync-dot { background: var(--warn); animation: pulse 1s infinite; }
#syncBtn[data-state="err"] .sync-dot { background: var(--danger); }
#syncBtn[data-state="off"] .sync-dot { background: var(--muted); }
@keyframes pulse { 50% { opacity: .3; } }

/* Kartu & tata letak */
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2, details summary h2 { font-size: 15.5px; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--brand); }
.link { color: var(--brand); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; }
.link svg { width: 16px; height: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.row-between p { margin: 0; font-size: 13px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.row-gap input { flex: 1; min-width: 150px; }
.back-row { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2.mini { margin-bottom: 8px; }
.grid2.mini > div { background: var(--soft); border-radius: 12px; padding: 10px; }
.grid2.mini small { display: block; color: var(--muted); font-size: 12px; }

/* Hero */
.hero, .phero {
  background: linear-gradient(140deg, var(--brand-2), var(--brand) 60%, #14b8a6); color: #fff;
  border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: 0 10px 30px -12px rgba(15, 118, 110, .55);
}
.phero { background: linear-gradient(140deg, color-mix(in srgb, var(--c) 85%, #000), var(--c)); box-shadow: 0 10px 30px -14px var(--c); }
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(140deg, #0f4f4a, #0f766e); } }
.hero-top, .phero-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .92; }
.pill { background: rgba(255, 255, 255, .2); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.hero-amt { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 12px; word-break: break-all; }
.hero-amt.neg { color: #fecaca !important; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-grid .full { grid-column: span 2; display: flex; justify-content: space-between; align-items: center; }
.hero-grid .full b { font-size: 16px; }
.hero-grid.two { grid-template-columns: 1fr 1fr; }
.hero-grid.sub { margin-top: 8px; }
.hero-grid > div, .hero-debt button { background: rgba(255, 255, 255, .14); border-radius: 13px; padding: 9px 10px; min-width: 0; }
.hero-grid small, .hero-debt small { display: block; font-size: 11.5px; opacity: .85; }
.hero-grid b, .hero-debt b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-grid b.neg { color: #fecaca !important; }
.hero-debt { display: flex; gap: 8px; margin-top: 8px; }
.hero-debt button { flex: 1; text-align: left; color: #fff; background: rgba(0, 0, 0, .14); }
.phero .budget { background: rgba(255, 255, 255, .14); border-radius: 13px; padding: 10px; margin-top: 10px; }
.phero .budget small { color: #fff !important; opacity: .85; }
.phero .budget .bar { background: rgba(255, 255, 255, .25); }
.phero .budget .bar i { background: #fff; }
.phero .budget .bar.over i { background: #fecaca; }

/* Tombol cepat */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.quick.three { grid-template-columns: repeat(3, 1fr); }
.qbtn { background: var(--card); box-shadow: var(--shadow); border-radius: 16px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.qbtn svg { width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--soft); color: var(--brand); }
.qbtn.in svg { background: var(--in-soft); color: var(--in); }
.qbtn.out svg { background: var(--out-soft); color: var(--out); }
.fab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 6px; }
.fab-grid .qbtn { padding: 16px 6px; font-size: 14px; background: var(--soft); box-shadow: none; }
.fab-grid .qbtn svg { background: var(--card); }
.fab-grid .wide { grid-column: span 2; flex-direction: row; justify-content: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 13px; padding: 11px 16px; font-weight: 700; font-size: 14.5px; background: var(--soft); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-t { color: var(--danger); }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .45; }
.btn:active, .qbtn:active, .item:active, .pcard:active { transform: scale(.98); }

/* Segmented & chips */
.seg { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 11px; font-weight: 600; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg .cnt { font-style: normal; background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 11px; padding: 0 6px; line-height: 17px; }
.type-seg button.on.in { background: var(--in); color: #fff; }
.type-seg button.on.out { background: var(--out); color: #fff; }
.type-seg svg { width: 16px; height: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--card); border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chips.wrap .chip { background: var(--soft); border-color: transparent; color: var(--ink); padding-right: 6px; }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); }
.chip button svg { width: 13px; height: 13px; }
.pdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; margin-right: 2px; }

/* Daftar */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.list > .item:last-child { border-bottom: 0; }
.item-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.item-ic svg { width: 18px; height: 18px; }
.item-ic.in { background: var(--in-soft); color: var(--in); }
.item-ic.out { background: var(--out-soft); color: var(--out); }
.item-ic.bell { background: var(--brand-soft); color: var(--brand); }
.item-ic.bell.late { background: var(--danger-soft); color: var(--danger); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.item-main b { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-end { text-align: right; flex: none; font-weight: 700; font-size: 14px; }
.amt.in { color: var(--in); } .amt.out { color: var(--ink); }
.amt.pending { opacity: .55; }
.tag { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); margin-top: 3px; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.info { background: var(--brand-soft); color: var(--brand); }
.tag.good { background: var(--in-soft); color: var(--in); }
.item.todo.done .item-main b { text-decoration: line-through; color: var(--muted); }
.item.done { opacity: .65; }
.check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.check svg { width: 16px; height: 16px; }
.check.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.flag svg { width: 14px; height: 14px; color: var(--danger); }
.group { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 14px; margin-bottom: 12px; }
.group-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 0 4px; border-bottom: 1px solid var(--line); }
.sec { font-size: 13px; margin: 14px 2px 4px; color: var(--muted); font-weight: 700; }
.sec span { background: var(--soft); border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
.tab-body > .list, #view > .list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 2px 14px; margin-bottom: 12px; }
.sec + .list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 2px 14px; }

/* Reimburse */
.rb-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1.5px solid var(--warn-soft); }
.rb-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--warn-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.rb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rb-main small { color: var(--muted); font-size: 12px; } .rb-main b { font-size: 18px; }
.rb-go { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--brand); font-size: 13.5px; flex: none; }
.rb-go svg { width: 16px; height: 16px; }
.item.sel { cursor: pointer; }
.item.sel input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin: 0; }
.kpis.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpis.three .kpi { padding: 10px; } .kpis.three .kpi b { font-size: 13.5px; }
.rb-split { margin-top: 12px; }
.claim-sum { background: var(--brand-soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.claim-sum.paid { background: var(--in-soft); }
.claim-sum small { color: var(--muted); } .claim-sum b { font-size: 26px; font-weight: 800; }
.claim-sum em { font-size: 12.5px; color: var(--muted); }
.claim-sum .tag { align-self: flex-start; }
.claim-items { margin: 10px 0 14px; }
#printArea { display: none; }

/* Kartu project */
.plist { display: grid; gap: 10px; }
@media (min-width: 560px) { .plist { grid-template-columns: 1fr 1fr; } }
.pcard { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-left: 5px solid var(--c); border-radius: 16px; padding: 12px 14px; width: 100%; }
.card .pcard { background: var(--bg); }
#view > .plist .pcard { box-shadow: var(--shadow); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pname b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pdot { display: none; }
.pcard-nums { display: grid; grid-template-columns: 1.4fr 1fr .6fr; gap: 8px; margin-top: 8px; }
.pcard-nums small { display: block; font-size: 11.5px; color: var(--muted); }
.pcard-nums b { font-size: 14px; white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }
.bar.thin { height: 5px; margin: 8px 0 2px; }
.bar.thin i { background: var(--c); }
.bar.warn i { background: var(--warn); } .bar.over i { background: var(--danger); } .bar.good i { background: var(--in); }
.bar.in i { background: var(--in); } .bar.out i { background: var(--out); }
.budget-row { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; }
.budget small { font-size: 12px; }

/* Bulan & cari */
.mnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mnav-label { flex: 1; text-align: center; font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; }
.mnav-label small { font-weight: 500; font-size: 11px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 12px; box-shadow: var(--shadow); margin-bottom: 12px; }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; border: 0; background: transparent; padding: 12px 0; outline: none; min-width: 0; }
.sum-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.sum-strip > div, .kpi { background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.sum-strip small, .kpi small { display: block; font-size: 11.5px; color: var(--muted); }
.sum-strip b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Agenda */
.quick-todo { display: flex; gap: 8px; margin-bottom: 10px; }
.quick-todo input { flex: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 13px; padding: 11px 13px; outline: none; min-width: 0; }
.quick-todo input:focus { border-color: var(--brand); }
.quick-todo .icon-btn { background: var(--brand); color: var(--brand-ink); }
.hint { display: flex; gap: 10px; background: var(--brand-soft); border-radius: 14px; padding: 12px; margin: 10px 0 12px; }
.hint > svg { color: var(--brand); margin-top: 2px; }
.hint b { display: block; font-size: 13.5px; } .hint small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.item.rem .btn { flex: none; }

/* Laporan */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi b { font-size: 18px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.wide { grid-column: span 2; background: var(--brand-soft); }
.kpi.wide b { font-size: 24px; color: var(--brand); }
.cbars { display: flex; flex-direction: column; gap: 10px; }
.cbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.cbar-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar-top span:last-child { flex: none; color: var(--muted); } .cbar-top b { color: var(--ink); }
.cbar .bar { margin: 4px 0 0; }
.trend { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; align-items: end; height: 190px; padding-top: 6px; }
.tcol { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.tbars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.tbars i { width: 40%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 0; }
.tbars i.in { background: var(--in); } .tbars i.out { background: var(--out); }
.tnet { font-size: 9.5px; font-weight: 700; color: var(--in); white-space: nowrap; margin-top: 3px; height: 13px; }
.tlbl { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.15; height: 24px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.in { background: var(--in); } .legend i.out { background: var(--out); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td:first-child { white-space: normal; }
.tbl tfoot td { font-weight: 800; border-bottom: 0; }
.tbl.small { font-size: 12px; }
.tbl.small td { white-space: normal; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl tr.pending td { color: var(--muted); }
details summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 8px; }
details summary h2::after { content: '›'; transform: rotate(90deg); display: inline-block; color: var(--muted); margin-left: 4px; transition: transform .2s; }
details[open] summary h2::after { transform: rotate(-90deg); }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.print-head { display: none; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 8px 0 0; font-size: 13.5px; }
.info dt { color: var(--muted); } .info dd { margin: 0; font-weight: 600; text-align: right; }
.note { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; margin: 12px 0 0; }

/* Empty & welcome */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 10px; }
.empty-ic svg { width: 26px; height: 26px; }
.empty b { color: var(--ink); display: block; font-size: 15px; }
.empty p { margin: 4px 0 14px; font-size: 13.5px; }
.welcome { text-align: center; padding: 26px 18px; }
.welcome-logo { width: 72px; height: 72px; border-radius: 20px; }
.welcome h2 { margin: 12px 0 6px; font-size: 20px; }
.welcome p { margin: 0 0 14px; font-size: 14px; }

/* Formulir */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-bottom: 0; }
#view > .no-print .field { margin-bottom: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .row-gap input {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 12px; outline: none; font-size: 16px; min-width: 0;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field input:focus, .field select:focus, .field textarea:focus, .row-gap input:focus { border-color: var(--brand); }
.field input[type="date"], .field input[type="time"] { min-height: 46px; }
.field.amount input { font-size: 26px; font-weight: 800; padding: 10px 12px; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors input { display: none; }
.colors i { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.colors input:checked + i { box-shadow: 0 0 0 2.5px var(--ink); }
.payblock { border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.payblock legend { font-size: 12.5px; font-weight: 700; color: var(--brand); padding: 0 6px; }
.tbl small { color: var(--muted); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.check-line input { width: 18px; height: 18px; accent-color: var(--brand); }
.quick-dates { padding-bottom: 0; margin-top: -4px; }

/* Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 15, 14, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 620px; margin: 0 auto; background: var(--card); border-radius: 24px 24px 0 0;
  padding: 6px 18px calc(18px + var(--safe-b)); max-height: 92vh; max-height: 92dvh; overflow-y: auto; transform: translateY(100%); transition: transform .22s ease-out; overscroll-behavior: contain; }
.sheet-wrap.open .sheet { transform: none; } .sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.sheet-head .icon-btn { box-shadow: none; background: var(--soft); }
.sheet-actions { display: flex; gap: 8px; margin-top: 4px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn.primary { flex: 2; }
@media (min-width: 700px) { .sheet { bottom: 50%; transform: translateY(60%); border-radius: 24px; opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet-wrap.open .sheet { transform: translateY(50%); opacity: 1; } }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 0 6px var(--safe-b); background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; padding: 6px 0; max-width: 110px; }
.tabbar button.on { color: var(--brand); }
.tabbar svg { width: 23px; height: 23px; }
.tabbar .fab { flex: none; width: 56px; height: 56px; border-radius: 19px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-top: -26px; box-shadow: 0 10px 22px -8px var(--brand); padding: 0; }
.tabbar .fab svg { width: 26px; height: 26px; }
.tab-badge { position: absolute; top: 1px; left: calc(50% + 6px); background: var(--danger); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

/* Kunci PIN */
.lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.lock-inner { text-align: center; width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: center; }
.lock-logo img { width: 64px; height: 64px; border-radius: 18px; }
.lock h2 { margin: 12px 0 2px; font-size: 19px; }
.lock p { margin: 0 0 18px; min-height: 20px; font-size: 13.5px; }
.pin-dots { display: flex; gap: 14px; margin-bottom: 26px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots i.on { background: var(--brand); }
.lock.shake .pin-dots { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.keypad button { width: 72px; height: 72px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); font-size: 26px; font-weight: 600; }
.keypad button:active { background: var(--brand-soft); }
.keypad .blank { visibility: hidden; }
.lock-cancel { margin-top: 18px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600; z-index: 120; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.kpis.three { grid-template-columns: repeat(3, 1fr); }

/* Cetak / PDF */
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #111; --muted: #555; --line: #ddd; --soft: #f3f3f3; --brand: #0f766e; --brand-soft: #eef7f5; --shadow: none; color-scheme: light; }
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .tabbar, .no-print, .toast, .sheet-wrap, .lock, .back-row { display: none !important; }
  .app { padding: 0; max-width: none; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #0f766e; padding-bottom: 8px; margin-bottom: 14px; }
  .print-head h1 { font-size: 18px; margin: 0; } .print-head p { margin: 2px 0 0; color: #555; font-size: 11px; }
  .card, .kpi { border: 1px solid #ddd; break-inside: avoid; }
  .avoid-break { break-inside: avoid; }
  .kpis { grid-template-columns: repeat(3, 1fr); } .kpi.wide { grid-column: auto; }
  .bar, .tbars i, .legend i, .kpi { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  details summary h2::after { display: none; }
  .item { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  body.print-claim .app { display: none !important; }
  body.print-claim #printArea { display: block; }
  .claim-doc { font-size: 12px; color: #111; }
  .cd-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2.5px solid #0f766e; padding-bottom: 8px; margin-bottom: 12px; }
  .cd-head h1 { font-size: 18px; margin: 0; letter-spacing: .02em; } .cd-head p { margin: 2px 0 0; }
  .cd-no { text-align: right; display: flex; flex-direction: column; } .cd-no b { font-size: 14px; }
  .cd-meta td { padding: 2px 10px 2px 0; }
  .cd-tbl { width: 100%; border-collapse: collapse; margin: 14px 0 8px; }
  .cd-tbl th, .cd-tbl td { border: 1px solid #999; padding: 6px 7px; text-align: left; vertical-align: top; }
  .cd-tbl th { background: #eef7f5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cd-tbl .r { text-align: right; white-space: nowrap; }
  .cd-tbl tfoot td { font-weight: 800; }
  .cd-words, .cd-note { margin: 6px 0; }
  .cd-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; text-align: center; }
  .cd-sign span { display: block; } .cd-sign i { display: block; height: 64px; } .cd-sign b { font-weight: 600; }
  .cd-paid { margin-top: 24px; display: inline-block; border: 2.5px solid #15803d; color: #15803d; padding: 6px 14px; font-weight: 800; transform: rotate(-3deg); }
}
