:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7ebf0;
  --brand: #0d9488;      /* teal — kalem, bukan ungu */
  --brand-2: #14b8a6;
  --brand-soft: #e6f7f4;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --red: #e11d48;
  --red-soft: #fdeaef;
  --amber: #d97706;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --radius: 16px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 96px; }

/* Header */
header.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; box-shadow: var(--shadow); }
.logo svg { width: 22px; height: 22px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.2px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.spacer { flex: 1; }
.pill { font-size: 12px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pill.warn { background: var(--red-soft); color: var(--red); }
.pill.ok { background: var(--green-soft); color: var(--green); }

/* Layout */
.grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; letter-spacing: -.1px; display: flex; align-items: center; gap: 8px; }
.card h3 .ic { font-size: 16px; }

/* Summary cards */
.summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 480px) { .summary { grid-template-columns: 1fr 1fr; } }
.scard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); animation: rise .4s ease both; }
.scard .lab { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.scard .val { font-size: 20px; font-weight: 700; margin-top: 4px; letter-spacing: -.4px; }
.scard .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.val.green { color: var(--green); } .val.red { color: var(--red); } .val.brand { color: var(--brand); }

/* Forms */
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface-2); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button { cursor: pointer; font: inherit; border: none; border-radius: var(--radius-sm); }
.btn { background: var(--brand); color: #fff; font-weight: 600; padding: 11px 16px; width: 100%; margin-top: 14px; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.05); } .btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.sm { width: auto; padding: 7px 12px; font-size: 13px; margin: 0; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button { flex: 1; background: transparent; color: var(--muted); padding: 8px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* Budget */
.budget-row { display: flex; align-items: center; gap: 10px; }
.budget-row input { flex: 1; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 12px; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.progress.over > span { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.budget-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Accounts */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.acct { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); animation: rise .4s ease both; }
.acct .dot { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.acct .name { font-weight: 600; font-size: 13px; }
.acct .bal { font-weight: 700; font-size: 14px; }
.acct .mini { font-size: 11px; color: var(--muted); }

/* Table */
.tx-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tx-tools input, .tx-tools select { width: auto; flex: 1; min-width: 120px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
td.amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.amt.exp { color: var(--red); } .amt.inc { color: var(--green); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; }
.tag .dotc { width: 8px; height: 8px; border-radius: 50%; }
.rowact { display: flex; gap: 6px; justify-content: flex-end; }
.iconbtn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.iconbtn:hover { border-color: var(--brand); }

/* Charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .charts { grid-template-columns: 1fr; } }
.chart-box { height: 220px; position: relative; }

/* Empty state */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .em { font-size: 44px; }
.empty p { margin: 10px 0 16px; }

/* FAB */
.fab { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 26px; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(13,148,136,.4); z-index: 50; transition: transform .1s; }
.fab:active { transform: scale(.94); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal-bg.show { display: flex; animation: fade .2s ease; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 420px; padding: 20px; box-shadow: var(--shadow); animation: pop .22s ease; }
.modal h3 { margin-top: 0; }
.modal .close { float: right; background: none; font-size: 20px; color: var(--muted); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
