/* =====================================================================
   DompetKu - Stylesheet
   Arah desain: e-wallet mobile dengan nuansa uang kertas Rupiah.
   Kobalt (biru uang) + kuning kunyit, motif guilloche halus pada kartu saldo.
   ===================================================================== */

:root {
    --ink: #0F1E3D;
    --ink-2: #44506B;
    --muted: #7C879E;
    --line: #E1E7F1;
    --paper: #EEF2F8;
    --desk: #DDE4F0;
    --white: #FFFFFF;

    --brand: #1B4DDB;
    --brand-600: #163FB5;
    --brand-deep: #0A2472;
    --brand-tint: #E8EEFD;
    --gold: #FFC233;

    --in: #0E9F6E;
    --in-bg: #DDF5EB;
    --out: #E5484D;
    --out-bg: #FCE8E8;

    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-num: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Motif guilloche (garis gelombang berpotongan seperti pengaman uang kertas) */
    --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='64' viewBox='0 0 180 64'%3E%3Cg fill='none' stroke='white' stroke-opacity='.13' stroke-width='.8'%3E%3Cpath d='M0 32C30 0 60 0 90 32S150 64 180 32'/%3E%3Cpath d='M0 36C30 4 60 4 90 36S150 68 180 36'/%3E%3Cpath d='M0 40C30 8 60 8 90 40S150 72 180 40'/%3E%3Cpath d='M0 44C30 12 60 12 90 44S150 76 180 44'/%3E%3Cpath d='M0 28C30 -4 60 -4 90 28S150 60 180 28'/%3E%3Cpath d='M0 32C30 64 60 64 90 32S150 0 180 32'/%3E%3Cpath d='M0 36C30 68 60 68 90 36S150 4 180 36'/%3E%3Cpath d='M0 40C30 72 60 72 90 40S150 8 180 40'/%3E%3Cpath d='M0 28C30 60 60 60 90 28S150 -4 180 28'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--desk);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ---------- Kerangka aplikasi ---------- */
.app {
    position: relative;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    background: var(--paper);
}
@media (min-width: 520px) {
    .app { box-shadow: 0 0 0 1px rgba(15, 30, 61, .06), 0 40px 120px -40px rgba(10, 36, 114, .4); }
}
.screen { padding: calc(20px + env(safe-area-inset-top)) 20px 128px; }
.screen.no-nav { padding-bottom: 28px; }

/* ---------- Header halaman ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.topbar h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.who b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.avatar {
    width: 46px; height: 46px; border-radius: 16px; flex: 0 0 46px;
    display: grid; place-items: center;
    background: var(--brand-deep); color: var(--gold);
    font-family: var(--font-num); font-weight: 700; font-size: 20px;
}
.icon-btn {
    width: 44px; height: 44px; border-radius: 14px; flex: 0 0 44px;
    display: grid; place-items: center; font-size: 19px;
    background: var(--white); border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--brand-tint); }
.icon-btn.danger { color: var(--out); }

/* ---------- Kartu saldo ---------- */
.balance-card {
    position: relative; overflow: hidden; color: #fff;
    border-radius: 28px; padding: 22px 22px 18px;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(120, 160, 255, .38), transparent 60%),
        var(--guilloche) 0 0 / 180px 64px,
        linear-gradient(150deg, #0A2472 0%, #123DB5 64%, #1B4DDB 100%);
    box-shadow: 0 26px 40px -22px rgba(10, 36, 114, .8);
}
/* benang pengaman ala uang kertas */
.balance-card::after {
    content: ""; position: absolute; top: 0; bottom: 0; right: 58px; width: 3px;
    background: linear-gradient(180deg, transparent, var(--gold) 22%, var(--gold) 78%, transparent);
    opacity: .85; pointer-events: none;
}
.balance-card > * { position: relative; z-index: 1; }
.bc-top { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.ghost-btn { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; }
.bc-amount { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 38px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin: 6px 0 2px; }
.bc-amount.neg { color: #FFB3B5; }
.bc-sub { font-size: 12.5px; color: rgba(255, 255, 255, .66); }
.bc-pills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.pill { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px; border-radius: 16px; background: rgba(6, 22, 76, .34); backdrop-filter: blur(4px); }
.pill i { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; flex: 0 0 26px; }
.pill > div { min-width: 0; }
.pill.in i { background: rgba(94, 234, 176, .22); color: #6EF0BC; }
.pill.out i { background: rgba(255, 138, 142, .22); color: #FF9CA0; }
.pill small { display: block; white-space: nowrap; font-size: 11px; color: rgba(255, 255, 255, .7); font-weight: 500; }
.pill b { display: block; font-family: var(--font-num); font-size: 14px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }

/* ---------- Aksi cepat ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0 8px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.quick .qi {
    width: 56px; height: 56px; border-radius: 19px; display: grid; place-items: center; font-size: 22px;
    background: var(--white); border: 1px solid var(--line); transition: transform .15s, background .2s;
}
.quick a:active .qi { transform: scale(.94); }
.quick .qi.in { color: var(--in); }
.quick .qi.out { color: var(--out); }
.quick .qi.br { color: var(--brand); }
.quick .qi.gd { color: #B27F00; }

/* ---------- Judul seksi ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.sec-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.015em; }
.sec-head a, .link { font-size: 13px; font-weight: 700; color: var(--brand); }

/* ---------- Tiket dompet ---------- */
.tickets { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.tickets::-webkit-scrollbar { display: none; }
.ticket {
    flex: 0 0 160px; scroll-snap-align: start; position: relative; overflow: hidden;
    min-height: 106px; padding: 14px; border-radius: 18px; color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    background: var(--guilloche) 0 0 / 130px 46px, linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .24)), var(--wc);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
}
.ticket .t-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.ticket .t-top i { font-size: 16px; opacity: .9; }
.ticket .t-bal { font-family: var(--font-num); font-size: 18px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.ticket.add { background: transparent; border: 1.5px dashed #B9C4DA; color: var(--ink-2); text-shadow: none; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 13px; }
.ticket.add i { font-size: 22px; color: var(--brand); }

/* ---------- Panel & strip ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; font-weight: 800; }
.panel-head small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: 20px; }
.strip > div { padding: 14px 14px 13px; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.strip b { display: block; font-family: var(--font-num); font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; white-space: nowrap; }
.strip b.good { color: var(--in); }
.strip b.bad { color: var(--out); }
.strip .sub { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }

/* ---------- Tab kecil ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: #E1E8F4; }
.seg > label, .seg > a { position: relative; text-align: center; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.seg span, .seg > a {
    display: block; padding: 10px 10px; border-radius: 12px;
    font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: background .2s, color .2s;
}
.seg input:checked + span, .seg > a.on { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(15, 30, 61, .1); }
.seg input[value="income"]:checked + span { color: var(--in); }
.seg input[value="expense"]:checked + span { color: var(--out); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg.sm { display: inline-grid; padding: 3px; border-radius: 13px; }
.seg.sm > a, .seg.sm > button { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; font-weight: 700; color: var(--ink-2); }
.seg.sm > button.on { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(15, 30, 61, .1); }

/* ---------- Grafik ---------- */
.chart-box { position: relative; height: 210px; }
.chart-box.tall { height: 240px; }
.chart-box.short { height: 170px; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; flex: 0 0 148px; width: 148px; height: 148px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-center small { font-size: 11px; color: var(--muted); font-weight: 600; }
.donut-center b { font-family: var(--font-num); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.donut-legend { flex: 1; min-width: 0; display: grid; gap: 9px; }
.lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.lg i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: 0 0 9px; }
.lg span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg em { font-style: normal; color: var(--muted); font-weight: 700; }

.rank { display: grid; gap: 14px; margin-top: 18px; }
.rank-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; }
.rank-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; color: var(--c); background: var(--cb); }
.rank-main b { display: block; font-size: 13.5px; font-weight: 700; }
.bar { height: 6px; border-radius: 99px; background: #EBEFF7; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.rank-amt { text-align: right; }
.rank-amt b { display: block; font-family: var(--font-num); font-size: 14px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.rank-amt small { color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* ---------- Daftar transaksi ---------- */
.day { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.day span:last-child { font-family: var(--font-num); font-weight: 600; color: var(--muted); }
.trx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trx:last-child { border-bottom: 0; }
.trx-ico { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; display: grid; place-items: center; font-size: 20px; color: var(--c); background: var(--cb); }
.trx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trx-body b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-body small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.tag { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #E4EAF5; color: var(--ink-2); }
.trx-amt { font-family: var(--font-num); font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.trx-amt.is-in { color: var(--in); }

.summary3 { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 0; background: var(--brand-deep); color: #fff; border-radius: 20px; overflow: hidden; }
.summary3 > div { padding: 13px 11px; min-width: 0; }
.summary3 > div + div { border-left: 1px solid rgba(255, 255, 255, .12); }
.summary3 small { display: block; font-size: 11.5px; color: rgba(255, 255, 255, .68); font-weight: 600; }
.summary3 b { display: block; margin-top: 4px; font-family: var(--font-num); font-size: 14px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.summary3 b.in { color: #6EF0BC; }
.summary3 b.out { color: #FF9CA0; }

.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.month-switch b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.month-switch .icon-btn { width: 40px; height: 40px; flex-basis: 40px; font-size: 16px; }
.month-switch .icon-btn.off { opacity: .35; pointer-events: none; }

.search { position: relative; margin-bottom: 12px; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 46px; padding: 0 14px 0 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 77, 219, .12); }

.empty { text-align: center; padding: 34px 24px; }
.empty .e-ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; font-size: 28px; color: var(--brand); background: var(--brand-tint); }
.empty h3 { font-size: 16px; font-weight: 800; }
.empty p { margin: 6px auto 16px; max-width: 260px; color: var(--muted); font-size: 13.5px; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 700; font-size: 15px;
    transition: transform .12s, background .2s; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 14px 22px -14px rgba(27, 77, 219, .9); }
.btn-primary:hover { background: var(--brand-600); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ghost { background: var(--white); border: 1px solid var(--line); }
.btn-danger { background: var(--out-bg); color: var(--out); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 16px; font-size: 13.5px; border-radius: 13px; }
.row-btns { display: flex; gap: 10px; }
.row-btns > * { flex: 1; }

/* ---------- Dialog konfirmasi dalam aplikasi ---------- */
.confirm-backdrop {
    position: fixed; inset: 0; z-index: 90; background: rgba(9, 20, 52, .55);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .22s, visibility 0s .22s;
    padding: 16px; backdrop-filter: blur(2px);
}
.confirm-backdrop.open { opacity: 1; visibility: visible; transition: opacity .22s, visibility 0s; }
.confirm-card {
    width: 100%; max-width: 360px; background: var(--white); border-radius: 26px 26px 22px 22px;
    padding: 26px 24px 22px; text-align: center; box-shadow: 0 30px 70px -20px rgba(10, 20, 50, .45);
    transform: translateY(24px) scale(.98); transition: transform .28s cubic-bezier(.2, .85, .25, 1);
}
.confirm-backdrop.open .confirm-card { transform: translateY(0) scale(1); }
.confirm-ico {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px;
    display: grid; place-items: center; font-size: 25px;
    background: var(--out-bg); color: var(--out);
}
.confirm-backdrop[data-tone="warn"] .confirm-ico { background: rgba(255, 194, 51, .18); color: #B7791F; }
.confirm-backdrop[data-tone="brand"] .confirm-ico { background: rgba(27, 77, 219, .12); color: var(--brand); }
.confirm-msg { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.45; margin: 0 2px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 22px; }
.confirm-actions .btn { flex: 1; height: 50px; }
.confirm-actions .btn-danger { background: var(--out); color: #fff; box-shadow: 0 14px 22px -14px rgba(229, 72, 77, .85); }
.confirm-actions .btn-danger:active { transform: scale(.98); }
.confirm-backdrop[data-tone="warn"] .confirm-actions .btn-danger { background: var(--gold); color: var(--ink); box-shadow: 0 14px 22px -14px rgba(255, 194, 51, .8); }
.confirm-backdrop[data-tone="brand"] .confirm-actions .btn-danger { background: var(--brand); color: #fff; box-shadow: 0 14px 22px -14px rgba(27, 77, 219, .9); }

@media (min-width: 900px) {
    .confirm-backdrop { align-items: center; }
    .confirm-card { transform: translateY(0) scale(.94); }
    .confirm-backdrop.open .confirm-card { transform: translateY(0) scale(1); }
}

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.input, .select {
    width: 100%; height: 52px; padding: 0 14px; border-radius: 15px;
    border: 1.5px solid var(--line); background: var(--white); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237C879E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(27, 77, 219, .12); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.input-icon .input { padding-left: 44px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; }
.alert i { margin-top: 2px; }
.alert.err { background: var(--out-bg); color: #B42328; }
.alert ul { padding-left: 16px; }
.field-error { color: var(--out); font-size: 12.5px; font-weight: 600; margin-top: 8px; }

/* Nominal besar pada form transaksi */
.amount-box { padding: 22px 4px 8px; }
.amount-box > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.amount-line { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; padding-bottom: 6px; border-bottom: 2px solid var(--line); transition: border-color .2s; }
.amount-line:focus-within { border-color: var(--ink); }
.amount-line .rp { font-family: var(--font-num); font-size: 24px; font-weight: 600; color: var(--muted); }
.amount-line input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; padding: 0; font-family: var(--font-num); font-size: 44px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.amount-line input:focus { outline: none; }
.amount-line input::placeholder { color: #C5CDDC; }
.is-income .amount-line input { color: var(--in); }
.is-expense .amount-line input { color: var(--out); }

/* Pilihan kategori / jenis (grid) */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-chip { position: relative; }
.cat-chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.cat-chip .box {
    display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%;
    padding: 12px 4px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--white);
    font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.2; transition: border-color .15s, background .15s;
}
.cat-chip .ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: var(--c); background: var(--cb); }
.cat-chip input:checked + .box { border-color: var(--ink); background: var(--white); box-shadow: inset 0 0 0 1px var(--ink); }
.cat-chip input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.cat-grid.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.wallet-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scrollbar-width: none; }
.wallet-chips::-webkit-scrollbar { display: none; }
.w-chip { position: relative; flex: 0 0 auto; }
.w-chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.w-chip .box { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--white); font-size: 13px; font-weight: 700; transition: border-color .15s; }
.w-chip .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--c); font-size: 14px; }
.w-chip small { display: block; font-family: var(--font-num); font-weight: 600; font-size: 11.5px; color: var(--muted); letter-spacing: -.01em; }
.w-chip input:checked + .box { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.w-chip input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }

.picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.picker label { position: relative; }
.picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.picker span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; font-size: 18px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink-2); }
.picker input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.picker input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px transparent; transition: box-shadow .15s; }
.swatches input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatches input:focus-visible + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }

.action-bar { position: sticky; bottom: 0; margin: 26px -20px -28px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(238, 242, 248, 0), var(--paper) 34%); }

/* ---------- Daftar dompet / kategori ---------- */
.list { background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.list > * { border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; text-align: left; }
.li:hover { background: #F6F8FC; }
.li-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center; font-size: 19px; color: #fff; background: var(--c); }
.li-ico.soft { color: var(--c); background: var(--cb); }
.li-body { flex: 1; min-width: 0; }
.li-body b { display: block; font-size: 14.5px; font-weight: 700; }
.li-body small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.li-val { font-family: var(--font-num); font-weight: 700; font-size: 15.5px; letter-spacing: -.02em; white-space: nowrap; }
.li-val.neg { color: var(--out); }
.li .chev { color: #B4BDCF; }
.li-del { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--muted); }
.li-del:hover { background: var(--out-bg); color: var(--out); }

.total-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px; border-radius: 22px; color: #fff; background: var(--guilloche) 0 0 / 180px 64px, linear-gradient(150deg, #0A2472, #1B4DDB); }
.total-card small { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .72); font-weight: 600; }
.total-card b { display: block; font-family: var(--font-num); font-size: 30px; letter-spacing: -.03em; font-weight: 700; line-height: 1.15; }

.menu-group { margin-top: 18px; }
.menu-group > h4 { margin: 0 4px 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .avatar { width: 68px; height: 68px; flex-basis: 68px; border-radius: 22px; font-size: 30px; }
.profile-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.profile-head p { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; }
.stats > div { padding: 14px; text-align: left; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-family: var(--font-num); font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.stats small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(9, 20, 52, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
body.sheet-open { overflow: hidden; }
.sheet {
    position: fixed; left: 50%; bottom: 0; z-index: 70; width: 100%; max-width: 480px;
    max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
    background: var(--white); border-radius: 28px 28px 0 0;
    transform: translate(-50%, 105%); visibility: hidden;
    transition: transform .34s cubic-bezier(.2, .85, .25, 1), visibility 0s .34s;
}
.sheet.open { transform: translate(-50%, 0); visibility: visible; transition: transform .34s cubic-bezier(.2, .85, .25, 1), visibility 0s; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: #D3DBE9; margin: 0 auto 14px; }
.sheet h3 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; margin-bottom: 16px; }
.sheet [data-only-edit] { display: none; }
.sheet.is-edit [data-only-edit] { display: inline-flex; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100; width: min(456px, calc(100% - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 16px 30px -14px rgba(15, 30, 61, .6); animation: toast-in .35s cubic-bezier(.2, .9, .3, 1); transition: opacity .4s, transform .4s; }
.toast i { font-size: 18px; }
.toast-success i { color: #4ADE9C; }
.toast-error i { color: #FF8A8E; }
.toast.hide { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } }

/* ---------- Navigasi bawah ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 50;
    width: 100%; max-width: 480px;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s; }
.nav-item i { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--brand); }
.nav-fab { display: flex; justify-content: center; }
.fab {
    width: 58px; height: 58px; margin-top: -32px; border-radius: 50%;
    display: grid; place-items: center; font-size: 26px; color: var(--ink); background: var(--gold);
    box-shadow: 0 0 0 6px #fff, 0 14px 22px -8px rgba(178, 127, 0, .7);
    transition: transform .15s;
}
.fab:active { transform: scale(.93); }

/* ---------- Halaman masuk / daftar ---------- */
.auth .app { background: var(--brand-deep); }
.auth .screen { padding: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: calc(44px + env(safe-area-inset-top)) 28px 76px;
    background: radial-gradient(80% 90% at 100% 0%, rgba(120, 160, 255, .35), transparent 60%), var(--guilloche) 0 0 / 180px 64px, linear-gradient(160deg, #0A2472, #123DB5);
}
.auth-hero::after { content: ""; position: absolute; top: 0; bottom: 0; right: 44px; width: 3px; background: linear-gradient(180deg, transparent, var(--gold) 25%, var(--gold) 75%, transparent); opacity: .85; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-num); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-size: 19px; }
.auth-hero h1 { margin-top: 38px; max-width: 300px; font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; word-spacing: .06em; }
.auth-hero p { margin-top: 10px; max-width: 300px; color: rgba(255, 255, 255, .75); font-size: 14px; }
.auth-card { flex: 1; margin-top: -34px; padding: 30px 24px 36px; background: var(--paper); border-radius: 32px 32px 0 0; position: relative; }
.auth-card h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--ink-2); }
.auth-foot a { color: var(--brand); font-weight: 700; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border-radius: 12px; color: var(--muted); font-size: 18px; }

/* ---------- Kecil-kecil ---------- */
.muted { color: var(--muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.center { text-align: center; }

@media (max-width: 360px) {
    .bc-amount { font-size: 32px; }
    .pill i { display: none; }
    .summary3 b { font-size: 12.5px; }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .picker { grid-template-columns: repeat(6, 1fr); }
    .donut { flex-basis: 124px; width: 124px; height: 124px; }
}

/* ---------- Tampilan desktop / layar lebar ---------- */
.side-nav { display: none; }

@media (min-width: 900px) {
    body:not(.auth) { background: var(--desk); }
    .shell {
        display: flex; align-items: flex-start; justify-content: center; gap: 28px;
        max-width: 1440px; margin: 0 auto;
        padding: 32px 40px calc(32px + env(safe-area-inset-bottom));
        min-height: 100vh; min-height: 100dvh;
    }
    body.auth .shell { display: block; max-width: none; padding: 0; min-height: 0; }

    .side-nav {
        display: flex;
        position: sticky; top: 32px; flex: 0 0 224px; width: 224px;
        flex-direction: column; gap: 2px;
        background: var(--white); border-radius: 26px; padding: 18px 12px;
        box-shadow: 0 0 0 1px rgba(15, 30, 61, .06), 0 30px 80px -42px rgba(10, 36, 114, .35);
    }
    .side-brand {
        display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px;
        font-family: var(--font-num); font-weight: 800; font-size: 17px; letter-spacing: -.02em;
    }
    .side-brand i {
        width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px;
        display: grid; place-items: center; font-size: 16px; background: var(--gold); color: var(--ink);
    }
    .side-item {
        display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
        font-weight: 600; font-size: 14px; color: var(--muted); transition: background .15s, color .15s;
    }
    .side-item i { font-size: 18px; width: 20px; text-align: center; flex: 0 0 20px; }
    .side-item:hover { background: var(--desk); color: var(--ink); }
    .side-item.active { background: rgba(27, 77, 219, .1); color: var(--brand); }
    .side-add { margin-top: 12px; background: var(--gold); color: var(--ink); justify-content: center; }
    .side-add:hover { background: var(--gold); filter: brightness(.96); }

    .bottom-nav { display: none; }
    .nav-fab { display: none; }

    body:not(.auth) .app {
        max-width: none; flex: 1 1 auto; min-width: 0;
        min-height: 0; border-radius: 28px; overflow: hidden;
    }
    body:not(.auth) .screen { padding: 32px 36px 44px; max-width: 1180px; margin: 0 auto; }
    body:not(.auth) .screen.no-nav { padding: 32px 36px; max-width: 680px; }

    /* Kartu depan (ringkasan) tetap terbaca, tidak melebar penuh di layar sangat besar */
    .balance-card { padding: 26px 28px; }

    /* Grid dashboard: kolom utama lebih lebar, kolom sisi untuk info ringkas */
    .dash-grid {
        display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px 26px;
        grid-template-areas:
            "balance balance"
            "quick   quick"
            "wallets wallets"
            "health  health"
            "chart   cats"
            "recent  recent";
    }
    .gd-balance { grid-area: balance; }
    .gd-quick   { grid-area: quick; }
    .gd-wallets { grid-area: wallets; }
    .gd-health  { grid-area: health; }
    .gd-chart   { grid-area: chart; margin-top: 0; display: flex; flex-direction: column; }
    .gd-chart .chart-box { flex: 1; height: auto; min-height: 300px; }
    .gd-cats    { grid-area: cats; }
    .gd-recent  { grid-area: recent; }

    .quick { grid-template-columns: repeat(4, minmax(0, 160px)); justify-content: start; gap: 16px; }
    .tickets { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 2px; }
    .ticket { flex: 1 1 200px; max-width: 240px; }

    /* modal terpusat, bukan lembar geser dari bawah */
    .sheet {
        left: 50%; top: 50%; bottom: auto; right: auto;
        width: calc(100% - 48px); max-width: 440px;
        max-height: 86vh; max-height: 86dvh;
        border-radius: 24px; padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
        transform: translate(-50%, -50%) scale(.96); opacity: 0;
        transition: transform .26s cubic-bezier(.2, .85, .25, 1), opacity .22s, visibility 0s .26s;
    }
    .sheet.open {
        transform: translate(-50%, -50%) scale(1); opacity: 1;
        transition: transform .26s cubic-bezier(.2, .85, .25, 1), opacity .22s, visibility 0s;
    }
    .sheet .grab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
