/* Duitly — gaya tampilan (tanpa framework, semua aset lokal) */
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(../fonts/dm-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url(../fonts/dm-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url(../fonts/dm-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(../fonts/dm-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url(../fonts/jetbrains-mono-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url(../fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #f6ecf0; --phone-bg: #fdf5f7; --surface: #ffffff; --surface-2: #fcf1f4; --field: #eef0f4;
  --line: #e9dbe1; --text: #121a2f; --text-2: #6b7385; --accent: #8b4a5c; --accent-soft: #f6e2e8;
  --income: #a04e64; --expense: #d17a0f; --income-hero: #f4bccb; --expense-hero: #f3c57a; --hero: #2b1a1f;
  --danger: #c0392b;
}
.dark {
  --bg: #0d090b; --phone-bg: #150f12; --surface: #1e161a; --surface-2: #271d22; --field: #271d22;
  --line: #3a2c32; --text: #f7eef1; --text-2: #a8999f; --accent: #e8a0b4; --accent-soft: #3b232b;
  --income: #e590a8; --expense: #e9b25e; --hero: #34212a; --danger: #ef7d6f;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "DM Sans", system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
input[type="date"] { color-scheme: light; }
.dark input[type="date"] { color-scheme: dark; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
::selection { background: var(--accent-soft); color: var(--accent); }

/* Bingkai HP */
.stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(60% 50% at 15% 10%, rgba(232, 170, 190, .25), transparent),
    radial-gradient(50% 40% at 90% 90%, rgba(243, 197, 122, .15), transparent), var(--bg);
}
.phone { position: relative; display: flex; flex-direction: column; overflow: hidden; width: 100%; height: 100dvh; background: var(--phone-bg); color: var(--text); }
#app { display: flex; flex-direction: column; flex: 1; min-height: 0; }
@media (min-width: 640px) {
  .phone { width: 390px; height: min(860px, calc(100vh - 32px)); border-radius: 44px; border: 10px solid #141a2e; box-shadow: 0 30px 80px -20px rgba(43, 26, 31, .45); }
}
@media (max-width: 639px) {
  .phone { padding-top: env(safe-area-inset-top); }
  .bottom-nav { padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important; }
}
.scroll-area { flex: 1 1; overflow-y: auto; scrollbar-width: none; }
.scroll-area::-webkit-scrollbar { display: none; }
.page { padding: 8px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.page-title { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: -6px; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--text-2); }
.loading { padding: 40px; text-align: center; font-size: 14px; color: var(--text-2); }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.header-actions { display: flex; gap: 8px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); box-shadow: 0 2px 6px rgba(139, 74, 92, .15); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: transform .15s, background-color .15s; flex-shrink: 0; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.flat { border: 0; }
.icon-btn:disabled { opacity: .3; }

/* Kartu */
.card { background: var(--surface); border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(43, 26, 31, .04); }
.pad { padding: 16px; }
.pad-sm { padding: 6px; }
.hero { border-radius: 26px; color: #fff; padding: 20px; background: radial-gradient(90% 90% at 100% 0%, rgba(160, 78, 100, .45), transparent 60%), var(--hero); box-shadow: 0 18px 40px -18px rgba(43, 26, 31, .6); }
.hero.compact { padding: 16px; display: flex; align-items: center; justify-content: space-between; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.hero .label { color: rgba(255, 255, 255, .7); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2.tight { gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.muted { color: var(--text-2); font-size: 14px; }
.small { font-size: 12px; }
.xs { font-size: 12px; }
.center { text-align: center; }
.h2 { font-size: 16px; font-weight: 700; }
.bold { font-weight: 700; }

.hero-badge { border-radius: 999px; background: rgba(255, 255, 255, .1); padding: 4px 10px; font-size: 11px; color: rgba(255, 255, 255, .8); }
.hero-net { margin-top: 8px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.hero-stat { border-radius: 16px; background: rgba(255, 255, 255, .1); padding: 12px; }
.hero-stat-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .85); }
.hero-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: rgba(255, 255, 255, .15); }
.hero-stat-val { margin-top: 6px; font-size: 14px; font-weight: 600; }
.hero-today { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 16px; background: rgba(0, 0, 0, .25); padding: 10px 12px; font-size: 12px; }
.hero-today > span:first-child { color: rgba(255, 255, 255, .85); }
.c-inc-hero { color: var(--income-hero); } .c-exp-hero { color: var(--expense-hero); }
.hero-side { display: flex; align-items: center; gap: 8px; border-radius: 16px; background: rgba(255, 255, 255, .1); padding: 8px 12px; }

.asset-total { font-size: 18px; font-weight: 700; white-space: nowrap; }
.acc { display: flex; align-items: center; gap: 10px; border-radius: 16px; background: var(--surface-2); padding: 10px; min-width: 0; }
.acc-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.acc-label { font-size: 11px; color: var(--text-2); }
.acc-val { white-space: nowrap; font-size: 13px; font-weight: 700; }

/* Segmen, chip */
.segment { display: flex; padding: 4px; border-radius: 16px; background: var(--field); }
.segment.mini { padding: 2px; }
.seg-item { flex: 1 1; padding: 8px 6px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background-color .2s, color .2s; }
.segment.mini .seg-item { padding: 4px 12px; font-size: 12px; }
.seg-item.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.seg-item.active.expense { color: var(--expense); }
.seg-item.active.income { color: var(--income); }
.seg-item.active.transfer { color: var(--accent); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: background-color .15s, transform .15s; white-space: nowrap; flex-shrink: 0; position: relative; }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--text); color: var(--phone-bg); border-color: var(--text); }
.chip.grow { flex: 1; justify-content: center; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); transition: transform .15s; position: relative; cursor: pointer; }
.pill-btn:active { transform: scale(.95); }
.date-overlay { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* Form */
.amount-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .2s; }
.amount-box:focus-within { border-color: var(--accent); }
.amount-box .cur { font-size: 18px; font-weight: 600; color: var(--text-2); }
.amount-input { width: 100%; min-width: 0; background: transparent; border: 0; outline: none; font-size: 30px; font-weight: 700; padding: 0; }
.amount-input::placeholder { color: var(--line); }
.amount-box.sm .amount-input { font-size: 18px; }
.amount-box.sm { padding: 10px 14px; }
.field { width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--field); border: 1px solid transparent; outline: none; color: var(--text); transition: border-color .2s; font-size: 16px; }
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--text-2); opacity: .8; }
.field.sm { padding: 8px 12px; font-size: 14px; margin-top: 4px; }
textarea.field { resize: vertical; font-size: 12px; }
.flabel { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 10px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.search-wrap .field { padding-left: 40px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.opt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 16px; font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1.5px solid transparent; color: var(--text); transition: border-color .15s, background-color .15s, transform .15s; position: relative; }
.opt:active { transform: scale(.97); }
.opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1.5px solid transparent; color: var(--text-2); transition: border-color .15s, background-color .15s, transform .15s; }
.cat:active { transform: scale(.95); }
.cat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.transfer-row { display: flex; align-items: center; gap: 8px; }
.transfer-box { flex: 1; border-radius: 16px; background: var(--surface-2); padding: 12px; }
.transfer-box p:first-child { font-size: 11px; color: var(--text-2); }
.transfer-box p:last-child { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-weight: 600; }

.primary-btn { display: block; text-align: center; width: 100%; padding: 14px; border-radius: 18px; font-weight: 700; color: #fff; background: var(--accent); transition: transform .15s, opacity .2s, filter .2s; }
.primary-btn.expense { background: linear-gradient(135deg, #8b4a5c, #6e3546); }
.primary-btn:hover:not(:disabled) { filter: brightness(1.08); }
.primary-btn:active:not(:disabled) { transform: scale(.98); }
.primary-btn:disabled { opacity: .45; }
.dark .primary-btn { color: #1e161a; }
.dark .primary-btn.expense { background: var(--accent); }
.danger-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 18px; font-weight: 600; font-size: 14px; color: var(--danger); background: rgba(192, 57, 43, .08); transition: background-color .15s; }
.danger-btn:hover { background: rgba(192, 57, 43, .15); }
.ghost-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 18px; font-weight: 600; font-size: 14px; color: var(--accent); background: var(--accent-soft); transition: filter .15s, transform .15s; }
.ghost-btn:active { transform: scale(.98); }

/* Transaksi */
.tx-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; transition: background-color .15s; text-align: left; }
.tx-item:hover { background: var(--surface-2); }
.tx-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; flex-shrink: 0; }
.tx-icon.expense { background: rgba(209, 122, 15, .12); color: var(--expense); }
.tx-icon.income { background: var(--accent-soft); color: var(--income); }
.tx-icon.transfer { background: var(--field); color: var(--text-2); }
.tx-body { min-width: 0; flex: 1; }
.tx-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { flex-shrink: 0; font-size: 14px; font-weight: 700; }
.amt-income { color: var(--income); } .amt-expense { color: var(--expense); } .amt-transfer { color: var(--text-2); }
.empty { padding: 24px; text-align: center; font-size: 14px; color: var(--text-2); }
.link { font-size: 12px; font-weight: 600; color: var(--accent); }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; margin-bottom: 8px; }
.group-label { margin-bottom: 6px; padding: 0 4px; }

/* Laporan */
.stat-val { margin-top: 6px; font-size: 18px; font-weight: 700; }
.chart-box { margin-top: 12px; height: 192px; position: relative; }
.bar-track { margin-top: 6px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.bar-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.cat-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.cat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.cat-name svg { color: var(--accent); }
.capitalize { text-transform: capitalize; }

/* Navigasi bawah */
.bottom-nav { display: flex; justify-content: space-around; padding: 8px 12px 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--phone-bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 12px; border-radius: 18px; font-size: 11px; font-weight: 600; color: var(--text-2); transition: background-color .2s, color .2s; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }

/* Sheet */
.sheet-root { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 12, 16, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s ease-out; }
.sheet-panel { position: relative; max-height: 90%; overflow-y: auto; padding: 10px 16px 24px; border-radius: 28px 28px 0 0; background: var(--phone-bg); animation: up .28s cubic-bezier(.2, .8, .2, 1); scrollbar-width: none; }
.sheet-grip { margin: 0 auto 12px; height: 6px; width: 40px; border-radius: 999px; background: var(--line); }
.sheet-close { position: absolute; right: 16px; top: 16px; }
.sheet-title { padding-right: 40px; font-size: 20px; font-weight: 700; }
.sheet-body { margin-top: 20px; }

/* Login & pengaturan */
.login-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px 40px; gap: 16px; overflow-y: auto; }
.login-logo { width: 56px; height: 56px; border-radius: 18px; }
.alert { border-radius: 16px; padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--danger); background: rgba(192, 57, 43, .08); }
.notice { border-radius: 16px; padding: 12px 14px; font-size: 13px; color: var(--text); background: var(--accent-soft); }
.set-row { display: flex; align-items: center; gap: 12px; }
.set-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; border-radius: 18px; border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; position: relative; transition: border-color .15s; }
.file-drop:hover { border-color: var(--accent); color: var(--accent); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.preview-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.preview-list div { display: flex; justify-content: space-between; }
.version { font-size: 11px; color: var(--text-2); text-align: center; }

/* Fee */
.icon-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.fee-list { display: flex; flex-direction: column; gap: 6px; }
.fee-master-row { display: flex; align-items: center; gap: 8px; border-radius: 16px; background: var(--surface-2); padding: 8px 12px; }
.fee-item { border-radius: 16px; background: var(--surface-2); padding: 8px 12px; }
.fee-x { color: var(--text-2); transition: color .15s; }
.fee-x:hover { color: #c0392b; }
.fee-num { position: relative; flex: 1; }
.fee-num input { width: 100%; border: 0; border-radius: 12px; background: var(--surface); padding: 6px 20px 6px 8px; text-align: right; font-size: 14px; outline: none; }
.fee-num input:focus, .fee-note:focus { box-shadow: 0 0 0 1px var(--accent); }
.fee-num span, .fee-k span { pointer-events: none; position: absolute; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.fee-num span { right: 8px; font-size: 10px; }
.fee-k { position: relative; }
.fee-k span { right: 12px; font-size: 12px; }
.fee-k .field { padding-right: 28px; }
.fee-lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.fee-note { width: 100%; border: 0; border-radius: 12px; background: var(--surface); padding: 6px 8px; font-size: 12px; outline: none; }
.fee-field { padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.fee-add { width: 38px; height: 38px; border: 0; background: var(--accent); color: #fff; flex-shrink: 0; }
.fee-add:hover { background: var(--accent); filter: brightness(1.08); }
.fee-new { border-radius: 16px; border: 1px dashed var(--line); padding: 10px; }
.fee-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.sm { padding: 6px 10px; font-size: 12px; }
.fee-total { border-top: 1px solid var(--line); padding-top: 12px; }
.fee-add-day { border: 1.5px dashed var(--accent); background: transparent; color: var(--accent); }
.fee-copy { display: flex; align-items: center; gap: 6px; border-radius: 999px; background: #fff; padding: 8px 14px; font-size: 12px; font-weight: 700; color: #2b1a1f; transition: transform .15s; }
.fee-copy:active { transform: scale(.95); }
.fee-copy:disabled { opacity: .4; }
.fee-pre { margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; border-radius: 16px; background: rgba(0, 0, 0, .25); padding: 14px; font-size: 12.5px; line-height: 1.6; color: rgba(255, 255, 255, .95); }

/* Pasang aplikasi */
.install-banner { margin: 0 16px 8px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgba(43, 26, 31, .25); }
.install-banner img { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.install-hint { font-size: 11px; line-height: 1.35; color: var(--text-2); }
.inline-ic { display: inline-block; vertical-align: -1px; }
.inline-ic svg { display: inline; }
.install-btn { display: flex; align-items: center; gap: 4px; flex-shrink: 0; border-radius: 999px; background: var(--accent); color: #fff; padding: 8px 12px; font-size: 12px; font-weight: 700; transition: transform .15s; }
.install-btn:active { transform: scale(.95); }
.dark .install-btn { color: #1e161a; }

/* Toast */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(356px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; background: #fff; color: #121a2f; border: 1px solid #eee; box-shadow: 0 4px 12px rgba(0, 0, 0, .1); animation: toastIn .35s cubic-bezier(.2, .8, .2, 1); pointer-events: auto; transition: opacity .25s, transform .25s; }
.toast.success { background: #ecfdf3; color: #008a2e; border-color: #bffcd9; }
.toast.error { background: #fff0f0; color: #e60000; border-color: #ffe0e1; }
.toast.out { opacity: 0; transform: translateY(-8px); }

.rise { animation: up .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }
