/* Palette mirrors apps/admin-dashboard (navy shell, orange accent); muted tones darkened for AA. */
:root {
  color-scheme: light dark;
  --bg: #f5f7fa; --panel: #fff; --panel-2: #f8fafc; --ink: #162538; --muted: #56657a; --line: #e3e8ef; --line-soft: #edf0f4;
  --navy: #0b1726; --navy-2: #1d2c3e; --nav-text: #b4c1d1;
  --accent: #c84920; --accent-ink: #fff; --focus: #155eef;
  --good: #1c7341; --good-bg: #e8f6ed; --warn: #8a5a00; --warn-bg: #fff6df;
  --bad: #a8323a; --bad-bg: #ffebed; --info: #245a96; --info-bg: #e7f0fb; --neutral: #4f5d70; --neutral-bg: #edf1f5;
  --sandbox: #f5a524; --sandbox-ink: #231500;
  --sk: #e7ebf0; --sk-hi: #f3f5f8;
  --radius: 11px; --shadow: 0 1px 2px #0b17260d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1522; --panel: #13202f; --panel-2: #172637; --ink: #e6edf5; --muted: #a3b2c4; --line: #26384d; --line-soft: #1f3044;
    --navy: #08111c; --navy-2: #182739; --nav-text: #a9b8ca;
    --accent: #f0835f; --accent-ink: #1a0b05; --focus: #7aa7ff;
    --good: #74dca0; --good-bg: #143524; --warn: #f3c56b; --warn-bg: #3a2c0c;
    --bad: #ff9ea6; --bad-bg: #43191e; --info: #93c1f7; --info-bg: #15304f; --neutral: #bac6d4; --neutral-bg: #233447;
    --sk: #1c2c3e; --sk-hi: #24384d; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 50; background: var(--panel); color: var(--ink); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { top: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Environment banner */
.env-banner { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 6px 16px; font-size: 13px; color: var(--sandbox-ink);
  background: repeating-linear-gradient(-45deg, var(--sandbox) 0 14px, #f7b440 14px 28px); text-align: center; }
.env-banner strong { letter-spacing: .12em; }
.sub { display: block; font-size: 12px; color: var(--muted); }
.h1-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; letter-spacing: 0; word-break: break-all; }
.env-banner[hidden] { display: none; }

/* Shell. Mobile: one brand row with the account button (scrolls away), then a
   sticky tab bar (~46px). Desktop: a sticky sidebar — brand, nav, account. */
.shell { min-height: 100vh; position: relative; }
.side { display: contents; }
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; min-height: 52px; padding: 8px 64px 8px 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #c84920; color: #fff; font-weight: 800; }
.brand-text strong { display: block; font-size: 15px; white-space: nowrap; }
.brand-text small { display: none; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--nav-text); }
.side :focus-visible { outline-color: #9cc0ff; }

.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; padding: 0 8px; background: var(--navy); border-top: 1px solid #ffffff14; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs[hidden] { display: none; }
.tabs a { flex: 1 0 auto; display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; color: var(--nav-text); text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; border-radius: 0; }
.tabs a:hover { background: var(--navy-2); color: #fff; }
.tabs a.active { color: #fff; box-shadow: inset 0 -3px #f0835f; }
.nav-ico { display: none; width: 18px; text-align: center; }

.account { position: absolute; top: 8px; right: 12px; z-index: 30; }
.account[hidden] { display: none; }
.account-btn { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; text-align: left; }
.account-btn:hover .avatar, .account-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px #f0835f; }
.account-text, .account-caret { display: none; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #27405a; color: #fff; font-size: 13px; font-weight: 800; }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; width: min(300px, calc(100vw - 24px)); padding: 14px; border-radius: var(--radius); background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px #0b172633; display: grid; gap: 10px; }
.account-menu[hidden] { display: none; }
.account-email { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.account-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.account-facts dt { color: var(--muted); }
.account-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.account-menu .btn { width: 100%; }
@media (max-width: 380px) { .brand .badge-env { display: none; } }

main { padding: 20px 16px 48px; max-width: 1180px; margin: 0 auto; }
main:focus { outline: none; }

@media (min-width: 900px) {
  body { --banner-h: 32px; }
  body.no-banner { --banner-h: 0px; }
  .env-banner { position: sticky; top: 0; z-index: 20; height: var(--banner-h); flex-wrap: nowrap; padding-block: 0; }
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .side { position: sticky; top: var(--banner-h); z-index: 10; height: calc(100vh - var(--banner-h)); display: flex; flex-direction: column; padding: 24px 14px 18px; background: var(--navy); color: #fff; }
  .topbar { background: none; min-height: 0; padding: 0; }
  .brand { flex-wrap: wrap; }
  .brand-text small { display: block; }
  .brand .badge-env { margin-left: 40px; }
  .tabs { position: static; flex-direction: column; gap: 4px; margin: 36px 0 0; padding: 0; background: none; border: 0; overflow: visible; }
  .tabs a { flex: none; justify-content: flex-start; min-height: 40px; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
  .tabs a.active { background: var(--navy-2); box-shadow: inset 3px 0 #f0835f; }
  .nav-ico { display: inline-block; }
  .account { position: relative; top: auto; right: auto; margin-top: auto; padding-top: 14px; border-top: 1px solid #ffffff14; }
  .account-btn { width: 100%; padding: 6px; border-radius: 9px; }
  .account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--navy-2); }
  .account-btn:hover .avatar, .account-btn[aria-expanded="true"] .avatar { box-shadow: none; }
  .avatar { width: 32px; height: 32px; font-size: 12px; }
  .account-text { display: block; min-width: 0; flex: 1; }
  .account-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .account-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--nav-text); }
  .account-caret { display: block; color: var(--nav-text); font-size: 11px; }
  .account-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; width: auto; }
  main { padding: 32px 40px 60px; width: 100%; }
}

/* Typography & page header */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.eyebrow { font-size: 11px; letter-spacing: .14em; font-weight: 800; color: var(--accent); text-transform: uppercase; }
h1 { font-size: 24px; letter-spacing: -.03em; margin: 4px 0 0; }
h1:focus { outline: none; }
h2 { font-size: 15px; margin: 0; }
.head-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.stack { display: grid; gap: 16px; }
/* Grid children may shrink below their longest word (order IDs), so nothing pushes the page wider. */
.stack > *, .split > *, .kpis > *, .detail-grid > * { min-width: 0; }

/* Buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.btn-copy { min-height: 28px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.btn-copy.done { color: var(--good); border-color: currentColor; }
input, select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
input::placeholder { color: var(--muted); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 6px 12px; border-radius: 7px; min-height: 34px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Login */
.login { max-width: 420px; margin: 8vh auto 0; }
.login h1 { margin-bottom: 8px; }
.login p { color: var(--muted); margin: 0 0 20px; }
.login label { display: block; font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.login .btn { width: 100%; margin-top: 14px; }
.error { color: var(--bad); }
.alert { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; margin-top: 12px; font-size: 13px; }
.alert:empty { display: none; }

/* KPI */
.kpis { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 340px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: flex; flex-direction: column; gap: 4px; min-height: 150px; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.spark { margin-top: auto; width: 100%; height: 44px; display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--accent); opacity: .12; }
.spark-dot { fill: var(--accent); }
@media (max-width: 559px) {
  .kpis { gap: 10px; }
  .kpi { min-height: 0; padding: 12px; }
  .kpi-value { font-size: 19px; }
  .kpi-sub, .spark-cap { font-size: 11px; }
  .spark-cap { flex-wrap: wrap; gap: 0 6px; }
}
.spark-base { stroke: var(--line); stroke-width: 1; }
.spark-cap { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.split { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 720px) { .split { grid-template-columns: 1fr 1fr; } }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar-fill.good { background: var(--good); } .bar-fill.warn { background: var(--warn); } .bar-fill.bad { background: var(--bad); } .bar-fill.muted { background: var(--neutral); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .01em; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-env { background: var(--sandbox); color: var(--sandbox-ink); }
.badge-env::before { display: none; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
/* Muted: ended without a result (EXPIRED, CANCELLED) — not an error. */
.badge-muted { background: var(--neutral-bg); color: var(--neutral); }
.badge-muted::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
/* Raw API code next to its human label, for support. */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; overflow-wrap: anywhere; }
.code-only { color: inherit; font-size: 12px; }
.method { display: inline-block; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--ink); background: var(--panel-2); }

/* Filters (Pendapatan date range) */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.filters label, .pay-filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters .actions, .filter-panel .actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.filters .actions .btn, .filter-panel .actions .btn { flex: 1; }
@media (min-width: 720px) { .filters { align-items: end; } .filters .actions { grid-column: auto; } }

/* Transaksi filters: search + "Filter" toggle; the panel folds away on phones. */
.pay-filters { display: grid; gap: 10px; margin-bottom: 14px; }
.filter-bar { display: flex; gap: 8px; align-items: end; }
.filter-bar .f-search { flex: 1; min-width: 0; }
.filter-toggle { flex: none; gap: 8px; }
.filter-toggle .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.filter-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.pay-filters:not(.open) .filter-panel { display: none; }
.pay-filters .chips { margin: 0; }
@media (min-width: 720px) {
  .filter-toggle { display: none; }
  .filter-bar .f-search { max-width: 520px; }
  .pay-filters:not(.open) .filter-panel, .filter-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; padding: 0; border: 0; background: none; }
  .filter-panel .actions { grid-column: auto; }
  .pay-filters .chips { order: 3; }
}
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid transparent; cursor: pointer; }
.chip-x:hover { border-color: currentColor; }
.chip-x span { font-size: 10px; opacity: .8; }
.chip-clear { border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 12px; min-height: 30px; cursor: pointer; text-decoration: underline; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--info-bg); color: var(--info); font-weight: 600; }

/* Responsive table: cards on small screens */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
th.r, td.r { text-align: right; white-space: nowrap; }
td .mono { word-break: normal; overflow-wrap: anywhere; }
.row-link { font-weight: 700; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.wrap-err { max-width: 280px; color: var(--bad); font-size: 12px; }
@media (max-width: 719px) {
  .table-wrap { background: transparent; border: 0; box-shadow: none; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody { display: block; }
  .rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
  .rtable td { padding: 0; border: 0; min-width: 0; }
  .rtable td::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .rtable td.r { text-align: left; }
  .rtable td.full { grid-column: 1 / -1; }
  .rtable td.lead { grid-column: 1 / -1; font-size: 15px; }
  .rtable td.lead::before { display: none; }
  .rtable td.empty-cell::before { display: none; }
  .wrap-err { max-width: none; }
}

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; }
.pager-btns { display: flex; gap: 8px; }

/* Empty, error */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-ico { font-size: 28px; display: block; margin-bottom: 6px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.error-state { border: 1px solid var(--bad); background: var(--bad-bg); color: var(--bad); border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; justify-items: start; }

/* Skeleton */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--sk) 25%, var(--sk-hi) 50%, var(--sk) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-line { height: 12px; margin: 8px 0; }
.sk-big { height: 28px; width: 60%; margin: 10px 0; }
.sk-spark { height: 44px; margin-top: auto; }
.sk-row { height: 52px; margin-bottom: 8px; border-radius: var(--radius); }
.w40 { width: 40%; } .w70 { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition: none !important; } }

/* Detail */
.detail-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.kv { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ledger-sum { display: grid; gap: 10px; }
.ledger-line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.ledger-line.net { border-top: 1px dashed var(--line); padding-top: 10px; font-weight: 800; font-size: 17px; }
.ledger-line .neg { color: var(--bad); }
.entries { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.entries li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.wh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wh-item { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; display: grid; gap: 4px; }
.wh-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.wh-meta .sep { opacity: .6; }
.wh-head { color: var(--ink); font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--panel); background: var(--neutral); box-shadow: 0 0 0 1px var(--line); }
.tl-dot.good { background: var(--good); } .tl-dot.warn { background: var(--warn); } .tl-dot.bad { background: var(--bad); } .tl-dot.info { background: var(--info); } .tl-dot.muted { background: var(--neutral); }
.tl-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.tl-meta { font-size: 12px; color: var(--muted); }
.back { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; margin-bottom: 10px; min-height: 32px; }

/* Pendapatan */
.callout { margin: 0 0 14px; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--info); background: var(--info-bg); color: var(--info); font-size: 13px; }
.callout-warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); margin: 0; }
.rev-filters { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .rev-filters { grid-template-columns: 180px 180px auto; justify-content: start; } }
.kpi-flat { min-height: 0; }
.kpi-accent .kpi-value { color: var(--accent); }
.kpi-negative .kpi-value { color: var(--bad); }
.rev-chart { display: block; width: 100%; height: 180px; }
.cb-hit { fill: transparent; }
.cb-net { fill: var(--accent); }
.cb-fee { fill: var(--info); }
.cb-pend { fill: var(--neutral); opacity: .45; }
g:hover > .cb-hit { fill: var(--line-soft); }
.chart-y { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.fee-strip { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.fee-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fee-head span { display: inline-flex; align-items: center; gap: 6px; }
.fee-chart { display: block; width: 100%; height: 40px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-net { background: var(--accent); } .lg-fee { background: var(--info); } .lg-pend { background: var(--neutral); opacity: .45; }
.data-details summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.data-details[open] summary { margin-bottom: 12px; }
.data-details .table-wrap { box-shadow: none; }
.export { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.export-msg { font-size: 12px; color: var(--muted); max-width: 280px; text-align: right; }
.export-msg.warn { color: var(--warn); } .export-msg.bad { color: var(--bad); }
@media (max-width: 719px) { .export { width: 100%; flex-direction: row; align-items: center; gap: 10px; } .export .btn { flex: none; } .export-msg { text-align: left; max-width: none; } }

/* Email + OTP login */
.login form { display: block; }
.otp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 24px; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.login-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 14px; }
.login .login-actions .btn { width: auto; margin-top: 0; }
.login .note { margin-top: 10px; }
.login-tips { margin: 16px 0 0; padding: 12px 14px 12px 30px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; display: grid; gap: 6px; }

/* Tim */
.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 9px; font-size: 13px; }
.flash:empty { display: none; }
.flash.good { background: var(--good-bg); color: var(--good); border: 1px solid var(--good); }
.flash.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.invite { margin-bottom: 14px; }
.invite[hidden] { display: none; }
.invite-grid { display: grid; gap: 10px; }
.invite-grid label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
@media (min-width: 720px) { .invite-grid { grid-template-columns: 2fr 1fr; } }
.invite .actions { display: flex; gap: 8px; margin-top: 10px; }
.chip-self { margin-left: 8px; font-size: 11px; }
.btn-danger { color: var(--bad); border-color: var(--bad); }
.rtable td select { width: auto; min-width: 130px; }

/* Compact transaction rows: Beranda "Transaksi terbaru" and Transaksi on mobile */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx { position: relative; display: grid; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.tx:first-child { padding-top: 0; }
.tx:last-child { border-bottom: 0; padding-bottom: 0; }
.tx-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tx-id { min-width: 0; }
.tx .row-link::after { content: ""; position: absolute; inset: 0; }
.tx-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-meta { font-size: 12px; color: var(--muted); }
.tx-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Middle ellipsis: the head shrinks, the last characters stay visible. */
.tx .oid { display: inline-flex; max-width: 100%; min-width: 0; vertical-align: bottom; }
.tx .oid-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .oid-tail { flex: none; white-space: nowrap; }

/* Transaksi table: as is on desktop; on phones each row is two lines —
   order ID + amount, then method · date · status — and the whole row opens the detail. */
@media (max-width: 719px) {
  .pay-table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .rtable.pay-table tr { position: relative; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "id id amt" "meth when stat"; gap: 3px 6px; align-items: center;
    margin: 0; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; }
  .rtable.pay-table tr:last-child { border-bottom: 0; }
  .rtable.pay-table td::before { content: none; }
  .pay-table td.c-id { grid-area: id; min-width: 0; }
  .pay-table td.c-amount { grid-area: amt; font-weight: 700; }
  .pay-table td.c-method { grid-area: meth; }
  .pay-table td.c-when { grid-area: when; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
  .rtable.pay-table td.c-when::before { content: "· "; display: inline; margin: 0; font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
  .pay-table td.c-status { grid-area: stat; justify-self: end; }
  .pay-table td.empty-cell { grid-area: auto; grid-column: 1 / -1; }
  .pay-table .method { padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
  .pay-table .sub { display: none; }
  .pay-table .row-link { display: block; min-width: 0; }
  .pay-table .row-link::after { content: ""; position: absolute; inset: 0; }
  .pay-table .oid { display: flex; min-width: 0; }
  .pay-table .oid-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pay-table .oid-tail { flex: none; white-space: nowrap; }
}

/* Pengembang */
.dev-intro { margin: -6px 0 16px; max-width: 760px; }
.panel-head.flat { flex-wrap: wrap; margin-bottom: 0; }
.panel h3, .guide h3 { font-size: 13px; margin: 0 0 8px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.plain-list li { min-width: 0; }
.plain-list .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.kv-tight { gap: 4px 12px; margin-top: 8px; font-size: 13px; }
.dev-split { margin-top: 0; align-items: start; }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ep-item { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.ep-url { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.ep-url .mono { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.wh-health { border: 1px solid var(--line-soft); border-radius: 9px; padding: 12px; background: var(--panel-2); min-width: 0; }
.wh-health .panel-head { margin-bottom: 10px; }
.wh-health .callout-warn { margin-top: 10px; }
.seg-wrap { flex-wrap: wrap; max-width: 100%; }
.seg-wrap button { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.resend { display: grid; gap: 4px; justify-items: start; }
.resend-msg { font-size: 12px; }
.resend-msg:empty { display: none; }
.resend-msg.good { color: var(--good); } .resend-msg.bad { color: var(--bad); }
.dl-table td { vertical-align: top; }
@media (min-width: 720px) { .dl-table .wrap-err { max-width: 240px; } }

/* Panduan integrasi */
.guide-sec { padding: 0; }
.guide-sec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 12px 16px; font-weight: 700; }
.guide-sec > summary::-webkit-details-marker { display: none; }
.guide-sec > summary::after { content: "+"; font-size: 18px; color: var(--muted); }
.guide-sec[open] > summary::after { content: "−"; }
.guide-body { display: grid; gap: 12px; padding: 0 16px 16px; min-width: 0; }
.guide-body > * { min-width: 0; }
.guide-body p { margin: 0; }
.guide-body .table-wrap { box-shadow: none; }
.guide-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding-left: 26px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 4px; }
.env-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .env-cards { grid-template-columns: 1fr 1fr; } }
.env-card { border: 1px solid var(--line-soft); border-radius: 9px; padding: 12px; display: grid; gap: 6px; min-width: 0; }
.code-block { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; min-width: 0; background: var(--panel-2); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.code-block pre { margin: 0; padding: 12px; overflow: auto; max-height: 420px; font-size: 12px; line-height: 1.5; }
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; color: var(--ink); }
.code-tabs { display: grid; gap: 8px; min-width: 0; }
.code-tabs > * { min-width: 0; }
.code-tabs .seg { justify-self: start; }

/* Refund on the payment detail (v1.0.3) */
.refund-list { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 10px; }
.refund-list li { border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; display: grid; gap: 4px; }
td .sub .badge { margin-top: 4px; }

/* Saldo (v1.0.3): balance, bank account, payouts, movements */
.bank-form, .withdraw { display: grid; gap: 10px; margin-top: 12px; }
.bank-form[hidden] { display: none; }
.bank-form { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.bank-form label, .withdraw > label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bank-form .invite-grid[hidden] { display: none; }
.bank-form .note, .withdraw .note, .withdraw .callout { margin: 0; }
.bank-form .actions, .withdraw .actions { display: flex; gap: 8px; }
.bank-pending { margin: 12px 0 0; }
.withdraw-row { display: flex; gap: 8px; align-items: center; }
.withdraw-row input { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; }
.withdraw-row .btn { flex: none; }
.preview { color: var(--ink); font-weight: 700; }
.preview:empty { display: none; }
.amt-in { color: var(--good); font-weight: 800; white-space: nowrap; }
.amt-out { color: var(--bad); font-weight: 800; white-space: nowrap; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); }
.steps li { display: flex; gap: 4px; align-items: baseline; }
.steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; align-self: center; box-shadow: inset 0 0 0 1.5px var(--line); }
.steps li.done::before { background: var(--info); box-shadow: none; }
.steps li.done.good::before { background: var(--good); }
.steps li.done.bad::before { background: var(--bad); }
.steps li.done.muted::before { background: var(--neutral); }
.steps b { color: var(--ink); font-weight: 600; }
.steps li.todo b { color: var(--muted); font-weight: 400; }
.btn-solid-bad { background: var(--bad); color: var(--panel); }

/* Confirmation dialog (native <dialog>) */
.modal { width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 64px #0b172659; }
.modal::backdrop { background: #0b1726a6; }
.modal h2 { font-size: 18px; margin: 0 0 12px; padding-right: 8px; }
.modal-kv { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.modal-kv dd { font-weight: 700; overflow-wrap: anywhere; }
.modal-text { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 559px) {
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1; }
}
@media (max-width: 719px) {
  .po-table td:empty { display: none; }
  .mv-table td:last-child { grid-column: 1 / -1; }
}

/* v1.0.4 onboarding: Daftar (sandbox signup), Ajukan Live, Tarif */
.login.signup { max-width: 520px; margin-top: 4vh; }
.signup-form label { display: grid; gap: 4px; margin-bottom: 12px; }
.signup-form label .sub, .live-form label .sub { font-weight: 400; color: var(--muted); font-size: 12px; }
.signup-form input, .signup-form select { width: 100%; }
.check-row { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 13px !important; line-height: 1.45; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.signup-link { margin: 16px 0 0 !important; font-size: 13px; text-align: center; }
.captcha { min-height: 0; margin: 4px 0; color: var(--muted); font-size: 12px; }
.signup-done .secret-kv { margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.signup-done .secret-kv dd .mono { font-size: 13px; overflow-wrap: anywhere; }
.signup-done .key-warning { margin: 0 0 14px; }
.signup-done .btn + .btn { margin-top: 8px; }
.live-form h3 { margin: 10px 0 0; font-size: 14px; }
.live-form textarea { width: 100%; resize: vertical; font: inherit; }
.fee-card .fee-example { margin-top: 8px; }
.signup-done .btn-copy { width: auto; margin-top: 0; }
.signup-done .secret-kv dd { align-items: center; }
.live-actions { margin-top: 12px; }

/* Language switch (Bahasa Indonesia / English): login, signup, account menu. */
.login-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.login-top .eyebrow { margin: 0; }
.lang-switch button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.menu-lang .lang-switch { display: flex; }
.menu-lang .lang-switch button { flex: 1; }
.check-row a { font-weight: 700; }
.guide-lang a { font-weight: 700; }
