
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..800&family=Martian+Mono:wdth,wght@75..112.5,400..700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  
  --navy: #13306B;
  --navy-2: #0E2450;
  --navy-3: #1D418A;
  --on-navy: #FFFFFF;
  --on-navy-2: #C3D2EA;
  --paper: #E8EEF7;
  --sheet: #FFFFFF;
  --sheet-2: #F3F6FB;
  --sheet-3: #E3EAF4;
  --rule: #D3DDEB;
  --rule-2: #B7C5DB;
  --ink: #161B2B;
  --ink-2: #3E4759;
  --ink-3: #5A6375;
  --masuk: #17703F;
  --keluar: #B42323;
  --stamp: #C2272D;
  --amber: #8A5300;
  --violet: #5B3FA3;
  --sky: #1F4FA3;
  --hl: #FFF3C4;
  --masuk-tint: #E3F2E8;
  --keluar-tint: #FBE8E8;
  --navy-tint: #E2E9F6;
  --amber-tint: #FBEFD9;
  --violet-tint: #ECE7F7;
  --masuk-tint-2: #CFE9D8;
  --on-navy-neg: #FFC9C9;

  
  --bg: var(--paper);
  --s1: var(--sheet);
  --s2: var(--sheet-2);
  --s3: var(--sheet-3);
  --border: var(--rule);
  --border2: var(--rule-2);
  --line: var(--rule);
  --text: var(--ink);
  --muted: var(--ink-3);
  --muted2: var(--ink-2);
  --green: var(--masuk);
  --red: var(--keluar);
  --blue: var(--sky);
  --yellow: var(--amber);
  --purple: var(--violet);
  --accent: var(--navy);

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 12px;
  --r-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 48, 107, .06), 0 8px 20px -12px rgba(19, 48, 107, .22);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 64px;
}


html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-stretch: 96%;
  caret-color: var(--navy);
}
::selection { background: rgba(19, 48, 107, .18); color: var(--ink); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
button, a, input, select, label, .nav-item, .btn, .tx-item, .debt-item, .btn-edit, .pb-row { touch-action: manipulation; }
button { font-family: var(--font); }
svg { flex-shrink: 0; }
.ic { width: 14px; height: 14px; vertical-align: -2px; }


.num, .tx-amount, .kpi-val, .htx-amt, .io-val, .wcard-bal, .saldo-amount, .arus-row b, .cat-row b,
.bar-val, .home-hero-amt, .pr-val, .summary-val, .macro-value, .piutang-sisa, .piutang-log-amount,
.budget-total-display, .asset-total-display {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-stretch: 85%;
  letter-spacing: -.01em;
}


* { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }


@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tin { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mslide { from { transform: translateY(28px); } to { transform: none; } }
@keyframes pageIn { from { opacity: .4; } to { opacity: 1; } }

@keyframes pbPrint {
  from { transform: translateY(-10px); clip-path: inset(0 0 100% 0); filter: blur(1.5px); }
  to   { transform: none; clip-path: inset(0 0 0 0); filter: none; }
}
@keyframes stampIn {
  0%   { transform: rotate(-6deg) scale(1.7); opacity: 0; }
  55%  { transform: rotate(-6deg) scale(.92); opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); opacity: 1; }
}


#session-loading { position: fixed; inset: 0; background: var(--paper); display: flex; align-items: center; justify-content: center; z-index: 300; }
#session-loading::after { content: ''; width: 30px; height: 30px; border: 3px solid var(--rule); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }


#app { display: none; height: 100vh; height: 100dvh; flex-direction: column; }
.sidebar { display: contents; }


.topbar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: var(--on-navy);
  padding: calc(12px + var(--safe-t)) 16px 12px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; color: var(--on-navy); }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .02em; font-stretch: 108%; white-space: nowrap; }
.month-nav { display: flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 3px; }
.month-nav button {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; color: var(--on-navy);
  display: grid; place-items: center; cursor: pointer; transition: background .15s;
}
.month-nav button svg { width: 17px; height: 17px; }
.month-nav button:hover { background: rgba(255, 255, 255, .14); }
.month-nav button:focus-visible { outline-color: #fff; }
.month-label { font-family: var(--mono); font-stretch: 85%; font-size: 12.5px; font-weight: 600; min-width: 78px; text-align: center; color: var(--on-navy); }

.tabbar, .logout-sidebar { display: none; }


.pages {
  flex: 1; overflow: hidden; position: relative;
  background-color: var(--paper);
  background-image: repeating-radial-gradient(circle at 115% -30%, rgba(19, 48, 107, .045) 0 1px, transparent 1px 9px);
}
.page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 14px calc(var(--nav-h) + 30px + var(--safe-b));
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  animation: pageIn .18s var(--ease);
}
.page.refreshing { opacity: .5; pointer-events: none; transition: opacity .15s; }
body:has(.page.refreshing)::after {
  content: ''; position: fixed; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid var(--rule); border-top-color: var(--navy); border-radius: 50%;
  animation: spin .7s linear infinite; z-index: 9999; pointer-events: none;
}


.bottomnav { display: none; }

.fab { display: none; }

@media (max-width: 899px) {
  #app { max-width: 560px; margin: 0 auto; box-shadow: 0 0 0 1px var(--rule); }
  .bottomnav {
    display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: end;
    position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; z-index: 50;
    background: var(--sheet); border-top: 1px solid var(--rule);
    height: calc(var(--nav-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
    box-shadow: 0 -6px 18px -12px rgba(19, 48, 107, .25);
  }
  .bn-item {
    height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--ink-3); font-size: 11px; font-weight: 600; cursor: pointer;
    position: relative; transition: color .15s;
  }
  .bn-item svg { width: 23px; height: 23px; }
  .bn-item.active { color: var(--navy); font-weight: 800; }
  .bn-item.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy); }
  .bn-item:active { transform: scale(.94); }
  .bn-plus {
    justify-self: center; align-self: start; margin-top: -20px;
    width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--paper);
    background: var(--navy); color: var(--on-navy); display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 8px 18px -6px rgba(19, 48, 107, .55); transition: transform .12s var(--ease), background .15s;
  }
  .bn-plus svg { width: 26px; height: 26px; }
  .bn-plus:hover { background: var(--navy-3); }
  .bn-plus:active { transform: scale(.92); }
}


.sheet-ov { position: fixed; inset: 0; background: rgba(14, 36, 80, .42); display: none; align-items: flex-end; z-index: 60; animation: mfade .15s ease; }
.sheet-ov.show { display: flex; }
.sheet {
  background: var(--sheet); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 8px 16px calc(18px + var(--safe-b)); animation: mslide .26s var(--ease);
}
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--rule-2); margin: 2px auto 12px; }
.sheet-h { font-size: 15px; font-weight: 800; margin: 0 4px 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-item {
  background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 4px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer;
}
.sheet-item svg { width: 23px; height: 23px; color: var(--navy); }
.sheet-item:active { background: var(--sheet-3); }
.sheet-logout {
  margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: 1px solid var(--rule); border-radius: 12px; padding: 12px; color: var(--keluar); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.sheet-logout svg { width: 18px; height: 18px; }


@media (min-width: 900px) {
  #app { display: flex !important; flex-direction: row !important; height: 100vh; height: 100dvh; }
  .sidebar {
    display: flex !important; flex-direction: column; width: 236px; flex-shrink: 0;
    background: var(--navy); color: var(--on-navy); padding-bottom: 14px; overflow: hidden;
  }
  .topbar { flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 16px 16px; background: transparent; }
  .month-nav { justify-content: space-between; }
  .month-label { flex: 1; }
  
  .tabbar { display: flex !important; flex-direction: column; gap: 2px; padding: 4px 0 8px 12px; overflow-y: auto; flex: 1; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .nav-item {
    display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 10px 0 0 10px;
    color: var(--on-navy-2); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s;
  }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item:hover:not(.active) { background: rgba(255, 255, 255, .08); color: var(--on-navy); }
  .nav-item.active { background: var(--paper); color: var(--navy); font-weight: 800; }
  .nav-item:focus-visible { outline-color: #fff; outline-offset: -3px; }
  .logout-sidebar { display: block; padding: 0 16px; }
  .logout-sidebar button {
    display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-radius: 9px;
    color: var(--on-navy-2); cursor: pointer; font-size: 13.5px; font-weight: 600; padding: 10px 10px;
  }
  .logout-sidebar button svg { width: 18px; height: 18px; }
  .logout-sidebar button:hover { background: rgba(255, 255, 255, .08); color: var(--on-navy); }
  .pages { flex: 1; min-width: 0; }
  
  .page { padding: 24px 108px 56px 28px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 30px; bottom: 30px; z-index: 55;
    width: 62px; height: 62px; border-radius: 50%; border: 4px solid var(--paper);
    background: var(--navy); color: var(--on-navy); cursor: pointer;
    box-shadow: 0 12px 26px -10px rgba(19, 48, 107, .7); transition: transform .12s var(--ease), background .15s;
  }
  .fab svg { width: 26px; height: 26px; }
  .fab:hover { background: var(--navy-3); }
  .fab:active { transform: scale(.93); }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 34px; }
}
@media (min-width: 1600px) {
  .sidebar { width: 252px; }
  .page { padding: 28px 116px 64px 40px; }
}



.sec { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .09em; border-bottom: 1px solid var(--rule); background: var(--sheet);
}


.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 12px 13px; box-shadow: var(--shadow); min-width: 0; container-type: inline-size; }
.kpi-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }

.kpi-val { font-size: clamp(12px, 13.5cqi, 23px); font-weight: 600; line-height: 1.15; white-space: nowrap; color: var(--ink); }
.kpi-val .cur { font-family: var(--font); font-stretch: 92%; font-size: .64em; font-weight: 700; color: var(--ink-3); margin-right: .3em; letter-spacing: .02em; }

@container (max-width: 140px) {
  .kpi-val { font-size: clamp(11.5px, 14cqi, 15px); }
  .kpi-val .cur { display: none; }
}
.kpi-val.g { color: var(--masuk); }
.kpi-val.r { color: var(--keluar); }
.kpi-val.b { color: var(--sky); }
.kpi-val.y { color: var(--amber); }
.kpi-val.p { color: var(--violet); }


.barchart { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.bar-name { color: var(--ink-2); font-weight: 600; }
.bar-val { font-weight: 600; font-size: 12px; }
.bar-bg { background: var(--sheet-3); border-radius: 99px; height: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .6s var(--ease); }


.tx-list { display: flex; flex-direction: column; }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px dashed var(--rule); }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; background: var(--navy-tint); color: var(--navy); }
.tx-icon svg { width: 18px; height: 18px; }
.tx-info { flex: 1; min-width: 0; }
.tx-cat { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cat.tx-cat-wrap { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; overflow-wrap: anywhere; }
.tx-note-sep { color: var(--ink-3); font-weight: 500; }
.tx-sub { font-size: 12px; color: var(--ink-3); }
.tx-amount { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tx-del-btn {
  background: none; border: none; color: var(--ink-3); cursor: pointer; width: 30px; height: 30px; border-radius: 8px;
  font-size: 18px; line-height: 1; display: inline-grid; place-items: center; flex-shrink: 0;
}
.tx-del-btn:hover { background: var(--keluar-tint); color: var(--keluar); }


.form-wrap { padding: 2px 0 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.form-row.full { grid-template-columns: 1fr; }
.fgroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fgroup label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.fgroup input, .fgroup select, .fgroup textarea {
  background: var(--sheet-2); border: 1px solid var(--rule-2); color: var(--ink);
  border-radius: 10px; padding: 11px 12px; font-size: 16px; font-family: var(--font); outline: none; width: 100%;
  -webkit-appearance: none; appearance: none; min-height: 46px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.fgroup select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6375' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px;
}
.fgroup input:focus, .fgroup select:focus, .fgroup textarea:focus { border-color: var(--navy); background-color: var(--sheet); box-shadow: 0 0 0 3px rgba(19, 48, 107, .14); }
.fgroup input::placeholder { color: var(--ink-3); }
.fgroup input[readonly] { background: var(--sheet-3); color: var(--ink-3); }
.fgroup select option { background: var(--sheet); color: var(--ink); }


.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 700; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .1s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-p { background: var(--navy); color: var(--on-navy); width: 100%; min-height: 48px; font-size: 15px; }
.btn-p:hover { background: var(--navy-3); }
.btn-d { background: var(--keluar-tint); color: var(--keluar); min-height: 32px; padding: 6px 11px; font-size: 12px; }
.btn-d:hover { border-color: rgba(180, 35, 35, .35); }
.btn-g { background: var(--sheet); color: var(--ink-2); border-color: var(--rule-2); min-height: 32px; padding: 6px 11px; font-size: 12px; }
.btn-g:hover { border-color: var(--navy); color: var(--navy); }
.btn-csv { background: var(--navy-tint); color: var(--navy); border: 1px dashed var(--rule-2); }
.btn-edit {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--sheet); border: 1px solid var(--rule-2); color: var(--ink-2);
  min-width: 30px; height: 30px; padding: 0 9px; font-size: 12px; font-weight: 700; border-radius: 8px; cursor: pointer; font-family: var(--font); flex-shrink: 0;
}
.btn-edit:hover { border-color: var(--navy); color: var(--navy); }


.import-zone { border: 1.5px dashed var(--rule-2); border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; margin-bottom: 10px; background: var(--sheet-2); }
.import-zone input { display: none; }
.import-preview { background: var(--sheet-2); border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--ink-2); max-height: 120px; overflow-y: auto; margin-bottom: 10px; }


.debt-item { padding: 14px 16px; border-bottom: 1px dashed var(--rule); }
.debt-item:last-child { border-bottom: none; }
.debt-bar-bg { background: var(--sheet-3); border-radius: 99px; height: 6px; overflow: hidden; margin: 7px 0 5px; }
.debt-bar { height: 100%; border-radius: 99px; background: var(--masuk); }


.modal-overlay {
  position: fixed; inset: 0; background: rgba(14, 36, 80, .45); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center; animation: mfade .15s ease;
}
.modal {
  background: var(--sheet); border-radius: 20px 20px 0 0; width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto;
  padding: 8px 18px calc(18px + var(--safe-b)); animation: mslide .28s var(--ease); box-shadow: 0 -10px 30px -12px rgba(14, 36, 80, .4);
}
.modal::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--rule-2); margin: 2px auto 10px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; position: sticky; top: -8px; background: var(--sheet); padding: 4px 0 8px; z-index: 1; }
.modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule); background: var(--sheet-2); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; font-size: 20px; line-height: 1; flex-shrink: 0;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--ink); border-color: var(--rule-2); }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn-p { flex: 1; }
.modal-del {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 16px;
  border-radius: 10px; border: 1px solid rgba(180, 35, 35, .3); background: var(--sheet); color: var(--keluar); font-size: 14px; font-weight: 700; cursor: pointer;
}
.modal-del svg { width: 17px; height: 17px; }
.modal-del:hover { background: var(--keluar-tint); }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 18px; max-height: 88dvh; padding: 18px 22px 22px; }
  .modal::before { display: none; }
  .modal-head { top: -18px; }
}


.loader { text-align: center; padding: 44px 16px; color: var(--ink-3); font-size: 13px; }
.loader::after { content: ''; display: block; width: 26px; height: 26px; border: 3px solid var(--rule); border-top-color: var(--navy); border-radius: 50%; margin: 12px auto 0; animation: spin .7s linear infinite; }


.toast {
  position: fixed; bottom: calc(var(--nav-h) + 26px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--on-navy); padding: 11px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  z-index: 9999; max-width: calc(100vw - 32px); box-shadow: 0 10px 24px -10px rgba(14, 36, 80, .6); animation: tin .22s var(--ease);
}
.toast.g { background: var(--masuk); }
.toast.r { background: var(--keluar); }

.logout-btn { display: none; }


.pb {
  container: pb / inline-size;
  background: var(--sheet);
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 12px;
}
.pb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px 9px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .09em;
}
.pb-head-r { display: flex; align-items: center; gap: 8px; }
.pb-stamp {
  display: inline-block; transform: rotate(-6deg); border: 2px solid var(--stamp); color: var(--stamp); border-radius: 6px;
  padding: 2px 7px 1px; font-family: var(--mono); font-stretch: 80%; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.pb-stamp.just { animation: stampIn .5s .25s var(--ease) both; }
.pb-cols, .pb-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; }
.pb-cols {
  padding: 8px 14px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: rgba(232, 238, 247, .6);
}
.pb-cols > span:last-child, .pb-cols > .pc-m { text-align: right; }
.pb-cols i { font-style: normal; }
.pb-row {
  width: 100%; padding: 11px 14px; align-items: start; text-align: left; font: inherit; color: inherit;
  background: transparent; border: none; border-bottom: 1px dashed var(--rule); cursor: pointer; transition: background .15s;
}
.pb-row:last-child { border-bottom: none; }
.pb-row:hover { background: rgba(232, 238, 247, .55); }
.pb-row:focus-visible { outline-offset: -2px; border-radius: 0; }
.pb-row.new { background: var(--hl); }
.pb-row.just { animation: pbPrint .6s var(--ease) both; }
.pb-d { font-family: var(--mono); font-stretch: 85%; font-size: 11.5px; color: var(--ink-3); padding-top: 2px; }
.pb-k { font-size: 14px; font-weight: 600; line-height: 1.32; overflow-wrap: anywhere; min-width: 0; }
.pb-k small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.pb-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--navy); background: var(--navy-tint); border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 1px; letter-spacing: .01em; }
.pb-tag.tf { color: var(--sky); }
.pb-tag.tg-modal { color: var(--violet); background: var(--violet-tint); }
.pb-tag.tg-pdpt { color: var(--masuk); background: var(--masuk-tint); }
.pb-m { text-align: right; font-family: var(--mono); font-stretch: 85%; font-size: 13px; white-space: nowrap; line-height: 1.32; }
.pb-m .in { color: var(--masuk); font-weight: 600; }
.pb-m .out { color: var(--keluar); font-weight: 600; }
.pb-m .sal { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 3px; }

.pb-cols .pc-w, .pb-x, .pb-k .sh-w, .pc-wi { display: none; }

@container pb (min-width: 760px) {
  .pb-head, .pb-cols, .pb-row { padding-left: 18px; padding-right: 18px; }
  .pb-cols, .pb-row { grid-template-columns: 62px minmax(0, 1fr) 132px 132px 140px; column-gap: 18px; }
  .pb-cols .pc-m { display: none; }
  .pb-cols .pc-w { display: block; text-align: right; }
  .pb-row { padding-top: 12px; padding-bottom: 12px; }
  .pb-row > * { grid-row: 1; }
  .pb-d { grid-column: 1; font-size: 12.5px; }
  .pb-k { grid-column: 2; }
  .pb-m { display: contents; }
  .pb-m .in { grid-column: 3; text-align: right; }
  .pb-m .out { grid-column: 4; text-align: right; }
  .pb-m .sal { grid-column: 5; text-align: right; margin-top: 0; font-size: 13px; color: var(--ink-2); }
  
  .pb-sh .pb-cols, .pb-sh .pb-row { grid-template-columns: 62px minmax(0, 1.35fr) minmax(0, 1fr) 104px 118px 132px; }
  .pb-sh .pb-x { display: block; min-width: 0; }
  .pb-sh .pb-row .pb-x { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; padding-top: 1px; }
  .pb-sh .pb-m { display: block; text-align: right; }
  .pb-sh .pb-k .sh-n, .pb-sh .pc-n { display: none; }
  .pb-sh .pb-k .sh-w { display: block; }
  .pb-sh .pc-wi { display: inline; }
}

.st-chip { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--sheet-3); color: var(--ink-2); white-space: nowrap; }
.st-chip.lunas { background: var(--masuk-tint); color: var(--masuk); }
.st-chip.dp { background: var(--amber-tint); color: var(--amber); }
.st-chip.extend { background: var(--navy-tint); color: var(--sky); }
.st-chip.booking { background: var(--violet-tint); color: var(--violet); }
.st-chip.refund { background: var(--keluar-tint); color: var(--keluar); }
.pb-empty { padding: 30px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.pb-foot { display: flex; justify-content: center; padding: 10px; border-top: 1px solid var(--rule); }
.pb-more { background: none; border: none; color: var(--navy); font-weight: 700; font-size: 13.5px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.pb-more:hover { background: var(--navy-tint); }


.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--sheet);
  color: var(--ink-2); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }


.cover {
  position: relative; overflow: hidden; background: var(--navy); color: var(--on-navy);
  margin: -14px -14px 14px; padding: 4px 18px 20px;
}
.cover::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-radial-gradient(circle at 108% -20%, rgba(255, 255, 255, .07) 0 1px, transparent 1px 8px);
}
.cover > * { position: relative; }
.cover-label { font-size: 13px; color: var(--on-navy-2); font-weight: 600; }
.cover-total { font-family: var(--mono); font-stretch: 82%; font-size: clamp(27px, 8.4vw, 36px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cover-total.neg { color: var(--on-navy-neg); }
.cover-io { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--on-navy-2); }
.cover-io b { font-family: var(--mono); font-stretch: 82%; font-weight: 600; color: var(--on-navy); margin-left: 4px; }
.cover-net { margin-top: 12px; padding-top: 11px; border-top: 1px dashed rgba(255, 255, 255, .25); display: flex; justify-content: space-between; font-size: 12.5px; color: var(--on-navy-2); }
.cover-net b { font-family: var(--mono); font-stretch: 82%; font-weight: 600; color: var(--on-navy); }

.wtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.wtile:last-child:nth-child(odd) { grid-column: 1 / -1; } 
.wtile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; text-align: left;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px 13px; box-shadow: var(--shadow);
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, transform .12s var(--ease);
}
.wtile:hover { border-color: var(--rule-2); }
.wtile:active { transform: scale(.98); }
.wtile-n { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.wtile-v { font-family: var(--mono); font-stretch: 82%; font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wtile-v.neg { color: var(--keluar); }

.spark { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px 8px; margin-bottom: 12px; box-shadow: var(--shadow); }
.spark-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.spark-t { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.spark-d { font-family: var(--mono); font-stretch: 82%; font-size: 12.5px; font-weight: 600; }
.spark-d.up { color: var(--masuk); }
.spark-d.down { color: var(--keluar); }
.spark svg { display: block; width: 100%; height: 60px; overflow: visible; }
.spark-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-stretch: 82%; font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 2px 8px; }
.sec-title h2 { font-size: 16px; font-weight: 800; }
.sec-title a, .sec-title button { color: var(--navy); font-size: 13.5px; font-weight: 700; text-decoration: none; background: none; border: none; cursor: pointer; }

.home-cats { display: none; }
@media (min-width: 900px) {
  .cover { margin: 0 0 14px; border-radius: 16px; padding: 20px 22px 20px; box-shadow: var(--shadow); }
  .home-grid { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
  .home-main > .sec-title:first-child { margin-top: 0; }
  .home-cats { display: block; }
}
@media (min-width: 1500px) {
  .home-grid { grid-template-columns: 440px minmax(0, 1fr); gap: 28px; }
}


@media (min-width: 1200px) {
  
  #p-budget { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-content: start; align-items: start; }
  #p-budget > :not(.sec) { grid-column: 1 / -1; }
  
  .debt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); margin: 0 -1px -1px 0; }
  .debt-grid > .debt-item { border-right: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); }
  
  #p-assets { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); column-gap: 18px; align-content: start; align-items: start; }
  #p-assets > * { grid-column: 1 / -1; }
  #p-assets > .a-alloc { grid-column: 1; }
  #p-assets > .a-list { grid-column: 2; }
  
  #analisis-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  #analisis-content > * { margin-bottom: 0; }
  #analisis-content > .loader, #analisis-content > p, #analisis-content > .macro-grid { grid-column: 1 / -1; }
  #analisis-content > .macro-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  
  .payroll-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
  .payroll-section > :not(.worker-card) { grid-column: 1 / -1; }
  .payroll-section > .worker-card { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 -1px -1px 0; }
  
  
  #p-subscription .tx-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 -1px -1px 0; }
  #p-subscription .tx-item { border-right: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); }
}
@media (min-width: 1100px) {
  
  #p-piutang { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-content: start; align-items: start; }
  #p-piutang > * { margin: 0; }
  #p-piutang > :not(.piutang-card) { grid-column: 1 / -1; }
}


.cover.band { padding-bottom: 18px; }
.band-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; }
.cover.band .cover-total { font-size: clamp(25px, 7.4vw, 33px); margin-top: 2px; }
.cover.band .cover-io { margin-top: 10px; }
.band-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 9px; cursor: pointer;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: var(--on-navy); font: inherit; font-size: 12.5px; font-weight: 700;
}
.band-btn:hover { background: rgba(255, 255, 255, .18); }
.band-btn:focus-visible { outline-color: #fff; }
.band-btn.del { color: var(--on-navy-neg); }
.band-acts { display: flex; gap: 6px; }


.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--sheet-3); border-radius: 12px; }
.seg-b {
  min-height: 42px; border: none; border-radius: 9px; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.seg-b:hover:not(.on) { background: rgba(255, 255, 255, .6); }
.seg-b.on { background: var(--navy); color: var(--on-navy); box-shadow: 0 2px 6px -2px rgba(19, 48, 107, .45); }
.seg-b.on[data-v="Keluar"] { background: var(--keluar); }
.seg-b.on[data-v="Masuk"] { background: var(--masuk); }
.seg-b:focus-visible { outline-offset: 1px; }


.pb-mini { margin-top: 10px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.pb-mini-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; background: var(--sheet-2); }
.pb-mini-h b { font-family: var(--mono); font-stretch: 82%; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.pb-mini .pb-cols, .pb-mini .pb-row { grid-template-columns: 60px minmax(0, 1fr) auto; padding-left: 12px; padding-right: 12px; }
.pb-mini .pb-cols { padding-top: 6px; padding-bottom: 6px; font-size: 11px; border-top: none; }
.pb-mini .pb-row { padding-top: 8px; padding-bottom: 8px; }
.pb-mini .pb-k { font-size: 13px; }
.pb-mini .pb-m { font-size: 12.5px; }
.pb-mini.has-act .pb-cols, .pb-mini.has-act .pb-row { grid-template-columns: 60px minmax(0, 1fr) auto auto; }
.pb-act { display: flex; gap: 2px; align-items: flex-start; }
.pb-row.ro { cursor: default; }
.pb-row.ro:hover { background: transparent; }


.tx-del-btn svg { width: 16px; height: 16px; }
.btn-edit svg { width: 14px; height: 14px; }


.set-wrap { max-width: 760px; padding-bottom: 40px; }
.set-h { font-size: 18px; font-weight: 800; margin: 4px 0 16px; }
.set-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
@media (min-width: 1200px) {
  .set-wrap { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: 18px; align-items: start; }
  .set-h { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
