/* =========================================================
   Kas Properti Behomy: palet & tipografi mengikuti behomy.id
   ========================================================= */
:root {
  --navy: #112250;
  --navy-2: #3c507d;
  --navy-soft: #e7ecf6;
  --cream: #dcd0be;
  --cream-soft: #f3eee6;
  --bg: #f2f8fe;
  --card: #ffffff;
  --text: #2a2b29;
  --muted: #868b94;
  --line: #e3e9f2;
  --ok: #1f7a4d;
  --ok-soft: #e2f3ea;
  --warn: #8a5a12;
  --warn-soft: #fbf1dc;
  --bad: #b4441a;
  --bad-soft: #fbeae2;
  --info: #2a4a8a;
  --info-soft: #e6eefb;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(17, 34, 80, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--navy-2); }
h1 { font-size: 22px; font-weight: 600; color: var(--navy); margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; color: var(--navy-2); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
h2 i { color: var(--navy); font-size: 14px; }
h4 { font-size: 13px; font-weight: 600; color: var(--navy-2); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.big { font-size: 18px; }
.nowrap { white-space: nowrap; }

/* ---------- Header & navigasi ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-fallback { font-weight: 600; letter-spacing: 0.3em; font-size: 20px; }
.brand-divider { width: 1px; height: 32px; background: rgba(255, 255, 255, 0.3); }
.brand-app { display: flex; flex-direction: column; font-weight: 600; font-size: 16px; line-height: 1.2; }
.brand-app small { font-weight: 400; font-size: 11px; opacity: 0.75; letter-spacing: 0.04em; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.user-box { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, 0.85); }
.user-box .icon-btn { color: #fff; }
.user-box .icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.user-email { margin: 0 4px; }
.sync { padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 11px; }
.sync.error { background: var(--bad); color: #fff; }
@media (max-width: 700px) { .user-email, .sync { display: none; } }

/* Layar login Tokopedia (robot di server) */
.remote { display: flex; flex-direction: column; gap: 10px; }
.remote .hint { margin: 0; }
.remote-screen { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f4f4f4; min-height: 240px; }
.remote-screen img { display: block; width: 100%; height: auto; cursor: crosshair; }
.remote-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.remote-type { display: flex; gap: 6px; align-items: center; }
.remote-type input { flex: 1; }
.remote-keys { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.remote-keys .grow { flex: 1; }
.remote-steps { margin: 0; padding-left: 20px; color: var(--navy-2); font-size: 13px; line-height: 1.6; }
.remote-screen { outline: none; }
.remote-screen:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(17, 34, 80, 0.18); }
.remote-focus { position: absolute; top: 8px; right: 8px; display: none; padding: 3px 10px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 11px; }
.remote-screen:focus .remote-focus { display: inline-flex; gap: 6px; align-items: center; }
.remote-alt summary { cursor: pointer; color: var(--navy-2); font-size: 12px; }
.remote-alt .remote-type { margin-top: 6px; }
.modal:has(.remote) { width: min(980px, 96vw); }
.remote[data-view="qr"] .screen-login, .remote[data-view="screen"] .qr-login { display: none; }
.modal:has(.remote[data-view="qr"]) { width: min(760px, 96vw); }
.screen-login { display: flex; flex-direction: column; gap: 10px; }
.qr-login { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; }
.qr-box { position: relative; width: 300px; height: 300px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img { max-width: 92%; max-height: 92%; object-fit: contain; image-rendering: pixelated; }
.qr-box img:not([src]) { display: none; }
.qr-box .remote-wait { background: #fff; }
.qr-box .remote-wait.hidden { display: none; }
.qr-info { min-width: 0; }
.qr-info .btn { white-space: normal; text-align: left; height: auto; line-height: 1.4; padding-top: 6px; padding-bottom: 6px; }
.qr-info h3 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.qr-steps { margin: 0 0 10px; padding-left: 20px; color: var(--navy-2); font-size: 14px; line-height: 1.7; }
.qr-stage { margin: 0 0 4px; font-weight: 500; color: var(--navy); font-size: 13px; }
@media (max-width: 720px) {
  .qr-login { grid-template-columns: 1fr; justify-items: center; }
  .qr-box { width: min(300px, 80vw); height: min(300px, 80vw); }
}

/* Halaman login */
.login-page { background: var(--navy); min-height: 100vh; }
.login-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 18px; }
.login-brand { text-align: center; color: #fff; }
.login-brand .brand-logo { height: 64px; margin: 0 auto 8px; }
.login-brand p { margin: 0; color: var(--cream); font-size: 13px; }
.login-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.login-card h1 { margin: 0; }
.login-card p { margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; color: var(--navy-2); font-size: 13px; font-weight: 500; }
.login-card .btn { justify-content: center; padding: 11px 18px; }
.login-card .notice { margin: 0; }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 42px; }
.pw-field .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.login-foot { text-align: center; color: rgba(255, 255, 255, 0.6); }

.hours { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.85); }
.hours b { padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.hours b.open { background: var(--cream); color: var(--navy); }
.hours b.closed { background: rgba(255, 255, 255, 0.15); color: #fff; }

.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; padding: 0 20px; overflow-x: auto;
  background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px; white-space: nowrap;
  color: var(--navy-2); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent;
}
.nav a i { font-size: 13px; opacity: 0.8; }
.nav a:hover { color: var(--navy); background: var(--bg); }
.nav a.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--cream); color: var(--navy); font-size: 11px; font-weight: 700;
}

.view { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

@media (max-width: 700px) {
  .topbar { padding: 10px 16px; }
  .brand-logo { height: 34px; }
  .brand-app small, .hours span { display: none; }
  .nav { padding: 0 8px; }
  .nav a { padding: 12px 10px 10px; }
  .nav a span { display: none; }
  .nav a.active span { display: inline; }
  .view { padding: 16px; gap: 16px; }
}

/* ---------- Kepala halaman ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); max-width: 720px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions input { width: auto; }

/* ---------- Kartu & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin-bottom: 2px; }
.card-head p { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat > i { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--cream); color: var(--navy); font-size: 17px; }
.stat div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 20px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }
.stat.bad > i { background: var(--bad-soft); color: var(--bad); }
.stat.bad strong { color: var(--bad); }
.stat.warn > i { background: var(--warn-soft); color: var(--warn); }

/* ---------- Form ---------- */
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d5dde9; border-radius: 8px;
  background: #fff; color: var(--text); font: inherit; font-size: 14px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-2); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label, .inline-grid label, .toolbar label, .field {
  display: flex; flex-direction: column; gap: 6px; color: var(--navy-2); font-size: 13px; font-weight: 500;
}
.field .label { color: var(--navy-2); font-size: 13px; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; margin: 6px 0 12px; }
label .hint { margin: 0; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.inline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.inline-grid .full { grid-column: 1 / -1; }

.checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks legend { padding: 0 6px; color: var(--navy-2); font-weight: 600; font-size: 13px; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 400; color: var(--text); font-size: 14px; cursor: pointer; }

/* Rincian Kategori | Nominal */
.lines-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; padding: 8px 12px; background: var(--bg); color: var(--navy-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.lines td { padding: 6px 8px 6px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.lines td:first-child { width: 55%; }
.lines td:last-child { width: 44px; padding-left: 0; text-align: center; }
.lines input[name=line_amt] { text-align: right; font-variant-numeric: tabular-nums; }
.lines tfoot td { background: var(--bg); padding: 10px 8px 10px 12px; }
.lines tfoot b { color: var(--navy); font-size: 16px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.lines-view { margin: 0; }
.lines-view td { padding: 4px 0 !important; border: none !important; background: none !important; }
.lines-view tfoot td { border-top: 1px solid var(--line) !important; padding-top: 6px !important; }
.chips { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* Status properti */
select.prop-status { width: 140px; font-weight: 600; border-radius: 999px; }
select.prop-status.st-aktif { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft); }
select.prop-status.st-segera { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft); }
select.prop-status.st-nonaktif { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-soft); }

.table-wrap.scroll-y { max-height: 440px; overflow-y: auto; }
.table-wrap.scroll-y thead th { position: sticky; top: 0; z-index: 2; }

/* ---------- Buku Kas (format sheet) ---------- */
.sheet-card { padding: 0; overflow: hidden; }
.sheet-card .table-wrap { margin: 0; padding: 0; }
.bk { border-collapse: collapse; width: 100%; min-width: 1180px; font-size: 13px; }
.bk th {
  position: sticky; top: 0; z-index: 2; padding: 9px 6px; text-align: center; white-space: nowrap;
  background: var(--navy-soft); color: var(--navy); font-weight: 600; border: 1px solid #d3dbe8;
}
.bk td { border: 1px solid #e1e6ee; padding: 0; height: 34px; vertical-align: middle; background: #fff; }
.bk td input, .bk td select { border: none; border-radius: 0; background: transparent; padding: 6px 8px; font-size: 13px; width: 100%; height: 33px; }
.bk td input:focus, .bk td select:focus { outline: 2px solid var(--navy-2); outline-offset: -2px; background: #fff; }
.bk tbody tr:hover td { filter: brightness(0.985); }
.bk .col-no { width: 42px; text-align: center; color: var(--muted); }
.bk .col-date { width: 140px; }
.bk .col-date input { font-weight: 600; color: var(--navy); }
.bk .col-prop { width: 170px; }
.bk .col-desc { min-width: 300px; }
.bk .col-num { width: 120px; }
.bk .col-bukti { width: 62px; text-align: center; }
.bk .col-act { width: 72px; text-align: center; white-space: nowrap; }
.bk-num { text-align: right; font-variant-numeric: tabular-nums; }
.bk td.saldo { padding: 0 8px; text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk td.saldo.bad { color: var(--bad); }
.bk-open td { background: var(--bg) !important; padding: 0 8px; color: var(--muted); font-style: italic; }
.bk-add td { padding: 10px 12px; border: none; background: #fff; }
.bk-add .hint { margin-left: 10px; }

/* Warna sel Keterangan, seperti highlight di sheet */
.bk td.hl-biru, .bk td.hl-biru input { background: #c9f3fb; }
.bk td.hl-hijau, .bk td.hl-hijau input { background: #cdf3c5; }
.bk td.hl-abu, .bk td.hl-abu input { background: #e5e5e5; }
.bk td.hl-kuning, .bk td.hl-kuning input { background: #fff1b8; }
.bk td.hl-merah, .bk td.hl-merah input { background: #fbd3d3; }

/* Chip dropdown Property */
.bk select.bk-chip { margin: 4px 6px; width: calc(100% - 12px); height: 25px; padding: 0 6px 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; }
.c-prop, .c-abu { background: #e8eaed !important; color: #3c4043; }
.c-biru { background: #c6dbef !important; color: #0b3a6e; }
.c-oranye { background: #f9cfb3 !important; color: #7a3510; }
.c-hitam { background: #2a2b29 !important; color: #fff; }
.c-hijau { background: #ccebd4 !important; color: #1f5f33; }
.c-ungu { background: #e3d7f3 !important; color: #4a2b7a; }
.c-none { background: #fff !important; color: var(--muted); border: 1px dashed #c4cddb !important; }
.bk select.bk-chip option, .bk select.bk-chip optgroup { background: #fff; color: var(--text); }
.bk-chip-view { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* Kotak Bukti 1–4 */
.bk-slot { width: 40px; height: 26px; border: 1px dashed #c4cddb; border-radius: 6px; background: #fff; color: #b8c1cf; cursor: pointer; font-size: 11px; }
.bk-slot:hover, .bk-slot:focus { border-color: var(--navy-2); color: var(--navy); outline: none; box-shadow: 0 0 0 2px var(--navy-soft); }
.thumb.sm { width: 40px; height: 28px; border-radius: 4px; }
.bk-photo { position: relative; display: inline-block; vertical-align: middle; }
.bk-x { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; padding: 0; border: none; border-radius: 50%; background: var(--bad); color: #fff; font-size: 11px; line-height: 16px; cursor: pointer; display: none; }
.bk-photo:hover .bk-x, .bk-photo:focus-within .bk-x { display: block; }

.bk-sum { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.bk-sum div { display: flex; flex-direction: column; }
.bk-sum span { color: var(--muted); font-size: 12px; }
.bk-sum b { color: var(--navy); font-size: 16px; font-variant-numeric: tabular-nums; }
.bk-sum b.ok { color: var(--ok); } .bk-sum b.bad { color: var(--bad); }

/* ---------- Token listrik ---------- */
.chip.tk-habis { background: var(--bad); color: #fff; }
.chip.tk-kritis { background: var(--bad-soft); color: var(--bad); }
.chip.tk-segera { background: var(--warn-soft); color: var(--warn); }
.chip.tk-aman { background: var(--ok-soft); color: var(--ok); }
.chip.tk-baru { background: var(--bg); color: var(--muted); }
.meter-no, .mono, .token-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.02em; }
.meter-no { font-size: 13px; color: var(--navy); }
textarea.mono { font-size: 12px; white-space: pre; }
.token-code { width: 230px; }
.tk-table tr.selected td { background: #f4f7fd; }
.tk-table td b.bad { color: var(--bad); }
.table td.bad { color: var(--bad); font-weight: 600; }
.denoms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.chip-btn { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--navy-2); }
.chip-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.calc b:has(.icon-btn) { display: inline-flex; align-items: center; gap: 2px; }
.calc b .icon-btn { padding: 2px 6px; }
/* Pilih properti -> kotak kamar */
.prop-acc { display: flex; flex-direction: column; gap: 10px; }
.prop-acc-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.prop-acc-item.open { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.prop-acc-head {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: none; background: #fff;
  font: inherit; text-align: left; cursor: pointer; color: var(--navy);
}
.prop-acc-head:hover { background: var(--bg); }
.prop-acc-head .prop { font-weight: 600; font-size: 15px; }
.prop-acc-meta { margin-left: auto; color: var(--muted); font-size: 13px; }
.prop-acc-meta b.ok { color: var(--ok); }
.prop-acc-head > i { color: var(--navy-2); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.room-tile { position: relative; border: 2px solid #c9d3e2; border-radius: 10px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.room-tile:hover { border-color: var(--navy); box-shadow: 0 4px 12px rgba(17, 34, 80, 0.12); }
.room-tile.done { border-color: #9fd2b4; background: #f5fbf7; }
.room-tile.selected { border-color: var(--navy); background: var(--navy-soft); box-shadow: 0 0 0 2px var(--navy); }
.room-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 10px; border: none; background: none; font: inherit; cursor: pointer; color: var(--navy); }
.room-name { font-size: 22px; font-weight: 700; line-height: 1.1; word-break: break-word; text-align: center; }
.room-nom { font-size: 12px; font-weight: 600; color: var(--navy-2); background: var(--cream-soft); border-radius: 999px; padding: 1px 8px; }
.room-when { font-size: 11px; color: var(--muted); }
.room-check { position: absolute; top: 7px; left: 8px; font-size: 14px; color: var(--ok); }
.room-tile.selected .room-check, .room-tile .room-check.fa-square, .room-tile .room-check.fa-check-square { color: var(--navy); }
.room-more { position: absolute; top: 4px; right: 4px; border: none; background: none; color: var(--muted); padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.room-more:hover { background: var(--bg); color: var(--navy); }
.room-tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 92px; border-style: dashed; color: var(--muted); font: inherit; cursor: pointer; }
.tk-select-bar { flex-direction: row !important; align-items: center; gap: 10px; }

/* Beli langsung: nomor VA & kode token */
.va-box, .token-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; margin-bottom: 14px; border-radius: 12px; background: var(--navy); color: #fff; text-align: center; }
.va-box span, .token-box span { font-size: 13px; color: var(--cream); letter-spacing: 0.04em; }
.va-number, .token-big { font-family: ui-monospace, Consolas, monospace; font-size: 30px; letter-spacing: 0.06em; word-break: break-all; }
.token-box { background: var(--ok); }
.token-box span { color: #e2f3ea; }
.token-box small { color: #e2f3ea; }
.order-status { display: flex; align-items: center; gap: 10px; color: var(--navy-2); font-weight: 500; }
@media (max-width: 600px) { .va-number, .token-big { font-size: 22px; } }

.step-title { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); margin-top: 4px; }
.step-title b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; }
.tk-fill .step-title:not(:first-of-type) { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.paste-zone { border: 2px dashed #c4cddb; border-radius: 10px; padding: 14px; text-align: center; color: var(--navy-2); font-weight: 400; cursor: pointer; background: var(--bg); }
.paste-zone:focus { outline: none; border-color: var(--navy); background: #fff; }
.queue-pos { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--cream); color: var(--navy); font-size: 12px; }
.inline-label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--navy-2); font-weight: 500; font-size: 13px; }
.inline-label input { width: auto; }

/* Laporan per kategori per bulan */
.report th small { display: block; font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.report td, .report th { white-space: nowrap; }
.report td.zero { color: #c3cad6; font-weight: 400; }
.report td.share { color: var(--muted); font-weight: 400; }
.report tbody td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
.report tbody tr:hover td:first-child { background: #f8fbff; }
.cat-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--navy); }
.cat-cell i { width: 16px; text-align: center; color: var(--navy-2); font-size: 12px; }
.chg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.chg i { font-size: 10px; }
.chg.up { color: var(--bad); }
.chg.down { color: var(--ok); }
textarea[name=text] { font-family: ui-monospace, Consolas, monospace; font-size: 12px; white-space: pre; }

/* Daftar kategori di Pengaturan */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cat-icon { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--cream-soft); color: var(--navy); font-size: 13px; }
.cat-name { flex: 1; min-width: 0; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }
.cat-name small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }

.cell-input { padding: 5px 8px; font-size: 13px; width: 150px; }
.cell-input.num { text-align: right; width: 130px; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border: 1px solid var(--navy); border-radius: 999px;
  background: var(--navy); color: #fff; font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.sm { padding: 5px 12px; font-size: 13px; gap: 6px; }
.btn.cream { background: var(--cream); border-color: var(--cream); color: var(--navy); }
.btn.outline { background: transparent; color: var(--navy); }
.btn.outline:hover { background: var(--navy); color: #fff; }
.btn.outline.danger { color: var(--bad); border-color: #e7b9a4; }
.btn.outline.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }

.icon-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 6px; font: inherit; }
.icon-btn:hover { color: var(--navy); background: var(--bg); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }

.segmented { display: inline-flex; border: 1px solid var(--navy); border-radius: 999px; overflow: hidden; }
.segmented button { border: none; background: transparent; color: var(--navy); padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.segmented button.active { background: var(--navy); color: #fff; }

.rk {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  border: 1px dashed #c4cddb; background: #fff; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.rk:hover { border-color: var(--navy-2); color: var(--navy-2); }
.rk.on { border: 1px solid var(--ok-soft); background: var(--ok-soft); color: var(--ok); }

/* ---------- Tab & toolbar ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--navy-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.tab:hover { border-color: var(--navy-2); }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab .count { background: var(--bg); color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.tab.active .count { background: var(--cream); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar label { width: 220px; max-width: 100%; }
.toolbar-total { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.toolbar-total span { color: var(--muted); font-size: 12px; }
.toolbar-total b { color: var(--navy); font-size: 18px; font-variant-numeric: tabular-nums; }

.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--navy-2); }
.flow span { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; }
.flow b { width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 11px; }
.flow > i { color: #b8c2d3; font-size: 10px; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--navy-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg); white-space: nowrap; }
.table tbody tr:hover { background: #f8fbff; }
.table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.table td small.bad { color: var(--bad); }
.table td.note { min-width: 160px; max-width: 320px; }
.table tfoot td { font-weight: 600; color: var(--navy); border-bottom: none; background: var(--bg); }
.table.compact th, .table.compact td { padding: 7px 8px; font-size: 13px; }
.table tr.inactive td { opacity: 0.5; }
.table tr.unmatched td { background: #fffdf6; }
.table tr.muted-row td { color: var(--muted); font-style: italic; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num { font-weight: 500; color: var(--navy); }
td.num.ok { color: var(--ok); }
td.num.bad { color: var(--bad); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { vertical-align: middle; }
.journal tr.j-debit td { border-bottom: none; padding-bottom: 2px; }
.journal tr.j-credit td { padding-top: 2px; }
.journal td.indent { padding-left: 32px; color: var(--navy-2); }

.prop { display: inline-flex; align-items: baseline; gap: 6px; }
.code { display: inline-block; font-size: 11px; font-weight: 700; color: var(--navy); background: var(--navy-soft); border-radius: 4px; padding: 1px 6px; letter-spacing: 0.03em; }

/* ---------- Chip & badge ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.cat { background: var(--cream-soft); color: var(--navy); }
.chip.st-terjadwal { background: var(--navy-soft); color: var(--navy-2); }
.chip.st-diajukan, .chip.tu-diajukan { background: var(--warn-soft); color: var(--warn); }
.chip.st-dikembalikan { background: var(--bad-soft); color: var(--bad); }
.chip.st-dicek, .chip.tu-disetujui { background: var(--info-soft); color: var(--info); }
.chip.st-lunas, .chip.tu-selesai { background: var(--ok-soft); color: var(--ok); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.direct { color: var(--bad); }
.badge.plan { color: var(--navy-2); }

/* ---------- Notifikasi dalam halaman ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.notice > i { margin-top: 2px; }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.muted { background: var(--bg); color: var(--navy-2); }
.form-grid .notice { margin-bottom: 0; }

.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.empty > i { font-size: 26px; color: #c9d2e0; }
.empty p { margin: 8px 0 0; }

/* ---------- Beranda ---------- */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.todo li > i { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: #fff; }
.todo li > div { flex: 1; }
.todo li.bad { background: var(--bad-soft); } .todo li.bad > i { color: var(--bad); }
.todo li.warn { background: var(--warn-soft); } .todo li.warn > i { color: var(--warn); }
.todo li.info { background: var(--info-soft); } .todo li.info > i { color: var(--info); }
.todo li.muted > i { color: var(--navy-2); }

.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.due-list li:last-child { border-bottom: none; }
.due-date { width: 46px; flex: none; text-align: center; border-radius: 8px; background: var(--navy-soft); color: var(--navy); padding: 4px 0; line-height: 1.1; }
.due-date b { display: block; font-size: 17px; }
.due-date span { font-size: 11px; text-transform: uppercase; }
.due-date.late { background: var(--bad-soft); color: var(--bad); }
.due-info { flex: 1; min-width: 0; }
.due-info small { display: block; color: var(--muted); font-size: 12px; }
.due-amount { color: var(--navy); font-variant-numeric: tabular-nums; }

.steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps.compact { gap: 6px; }
.setup p { color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 200px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { background: var(--cream-soft); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--navy); height: 100%; border-radius: 999px; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 500; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Rincian hitungan ---------- */
.calc { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.calc > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.calc > div:last-child { border-bottom: none; }
.calc span { color: var(--navy-2); display: flex; flex-direction: column; }
.calc span small { color: var(--muted); font-size: 11px; }
.calc b { font-variant-numeric: tabular-nums; color: var(--navy); white-space: nowrap; }
.calc b.ok { color: var(--ok); } .calc b.bad { color: var(--bad); }
.calc .sub { background: var(--bg); }
.calc .total { background: var(--navy); }
.calc .total span, .calc .total b { color: #fff; font-weight: 600; }
.calc .total b.bad { color: #ffb9a0; }

/* ---------- Dialog ---------- */
.modal { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: none; border-radius: 16px; box-shadow: 0 20px 60px rgba(17, 34, 80, 0.3); color: var(--text); }
.modal.wide { width: min(820px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(17, 34, 80, 0.45); }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: var(--navy); color: #fff; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.modal-head .icon-btn { color: #fff; }
.modal-head .icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.modal-body { padding: 20px; }
.modal-body > .form-actions { margin-top: 18px; }

.summary { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0 0 18px; padding: 14px 16px; background: var(--bg); border-radius: 10px; }
.summary dt { color: var(--muted); font-size: 13px; }
.summary dd { margin: 0; }
@media (max-width: 600px) { .summary { grid-template-columns: 1fr; gap: 2px; } .summary dd { margin-bottom: 8px; } }

.log { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.log li { position: relative; padding: 4px 0 8px 16px; font-size: 13px; }
.log li::before { content: ""; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--cream); border: 2px solid #fff; }
.log li span { display: block; color: var(--muted); font-size: 11px; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.thumb { width: 84px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.missing { cursor: default; }
.thumb.missing::after { content: "Foto tidak ada"; font-size: 10px; color: var(--muted); }

.lightbox { padding: 0; border: none; background: transparent; max-width: 92vw; max-height: 92vh; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(10, 18, 40, 0.85); }
.lightbox img { display: block; max-width: 92vw; max-height: 90vh; border-radius: 8px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; gap: 10px; align-items: center; max-width: 380px; padding: 12px 16px; border-radius: 10px;
  background: var(--navy); color: #fff; box-shadow: 0 8px 24px rgba(17, 34, 80, 0.3); font-size: 13px;
  animation: toast-in 0.2s ease-out; transition: opacity 0.3s, transform 0.3s;
}
.toast.ok i { color: var(--cream); }
.toast.err { background: var(--bad); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; bottom: 16px; } .toast { max-width: none; width: 100%; } }
