/* Rach Private — lembut, hitam-putih (selaras logo), HP dulu */
:root {
  --bg: #F4F4F5; --card: #fff; --ink: #0A0A0A; --muted: #6E6E76; --line: #E7E7EA;
  --accent: #0A0A0A; --accent2: #9A9AA3; --tint: #EFEFF2; --tint2: #F7F7F8;
  --bad: #C73A45; --badbg: #FBECEE;
  --shadow: 0 6px 24px rgba(0, 0, 0, .07); --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070708; --card: #131315; --ink: #F3F3F4; --muted: #9B9BA3; --line: #242427;
    --accent: #F3F3F4; --accent2: #6F6F78; --tint: #1D1D20; --tint2: #0E0E10; --badbg: #3A1B21; --bad: #FF7B86;
    --shadow: 0 6px 24px rgba(0, 0, 0, .55); color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 520px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.top h1 { font-size: 24px; letter-spacing: -.3px; }
.top small { color: var(--muted); display: block; font-size: 13px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 a, .card h2 button { font-size: 13px; font-weight: 500; color: var(--accent); }
.sec-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .5px; display: flex; justify-content: space-between; align-items: center; }
.sec-title button { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 13px; }

/* hero */
.hero { background: linear-gradient(160deg, #0A0A0A 0%, #2A2A2F 100%); color: #fff; border: 1px solid rgba(255, 255, 255, .06); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero small { opacity: .8; font-size: 13px; }
.hero .big { font-size: 32px; font-weight: 700; letter-spacing: -.8px; margin: 2px 0 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.banner { display: flex; gap: 12px; align-items: center; background: var(--tint); color: var(--accent); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; text-align: left; width: 100%; }
.banner b { display: block; color: var(--ink); }
.banner span { font-size: 13px; color: var(--muted); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tile { background: var(--tint2); border-radius: 16px; padding: 10px 10px 12px; min-width: 0; }
.tile small { color: var(--muted); font-size: 12px; display: block; }
.tile b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--accent); } .dn { color: var(--ink); }
.pos { color: var(--ink); } .neg { color: var(--bad); }

/* progress */
.bar { height: 10px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 0; transition: width .4s; }
.bar.over > i { background: var(--bad); }
.bar.sm { height: 8px; }
.row-between { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.small { font-size: 13px; }

/* daftar */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.item:first-child { border-top: 0; }
.ico { width: 40px; height: 40px; border-radius: 14px; background: var(--tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .a { font-weight: 600; white-space: nowrap; text-align: right; }
.day { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 14px 4px 6px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 26px 8px; }

/* kontrol */
.btn { border-radius: 999px; padding: 11px 18px; font-weight: 600; background: var(--tint); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--badbg); color: var(--bad); }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; }
.seg { display: flex; background: var(--tint); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 999px; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .10); }
.mon { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.mon b { font-size: 16px; }
.mon button { width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--tint); color: var(--accent); white-space: nowrap; }
.badge.bad { background: var(--badbg); color: var(--bad); }
.badge.ok { background: var(--accent); color: var(--bg); }
.scroll-x { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 12px; scroll-snap-type: x mandatory; }
.scroll-x::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 74%; max-width: 280px; scroll-snap-align: start; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; text-align: left; }
.mini .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mini .head b { font-size: 15px; }

/* kartu rekening / tujuan */
.acc { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.acc .top2 { display: flex; align-items: center; gap: 12px; }
.acc .nm { flex: 1; min-width: 0; } .acc .nm b { display: block; } .acc .nm span { color: var(--muted); font-size: 13px; }
.acc .bal { font-size: 18px; font-weight: 700; text-align: right; }
.acc .foot { display: flex; gap: 8px; margin-top: 12px; }
.acc .foot .btn { flex: 1; text-align: center; padding: 9px 8px; font-size: 13px; }
.goal .meta { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.goal .meta b { color: var(--ink); font-weight: 600; }
.goal .amt { margin: 10px 0 8px; }
.goal .amt b { font-size: 20px; letter-spacing: -.3px; }

/* grafik */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 6px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .pair { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart .pair i { width: 38%; max-width: 16px; border-radius: 6px 6px 3px 3px; }
.chart .pair i.m { background: var(--accent); } .chart .pair i.k { background: var(--accent2); }
.chart small { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

/* navigasi bawah */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(calc(100% - 28px), 420px);
  background: var(--card); border-radius: 999px; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); display: flex; align-items: center; justify-content: space-around; padding: 6px 8px; z-index: 20; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--accent); }
.nav a.on svg { background: var(--tint); box-sizing: content-box; padding: 4px 14px; border-radius: 999px; margin: -2px 0 0; }
.fab { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; margin: -22px 4px 0; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); flex: none; }
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); animation: fade .15s; }
.sheet .panel { background: var(--bg); width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .2s ease-out; overscroll-behavior: contain; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 18px; margin-bottom: 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
label.f { display: block; margin: 12px 2px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.in, select.in { width: 100%; margin-top: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 16px; outline: none; appearance: none; -webkit-appearance: none; }
.in:focus { border-color: var(--accent); }
select.in { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.amount { display: flex; align-items: baseline; gap: 6px; justify-content: center; margin: 6px 0 4px; }
.amount span { font-size: 22px; color: var(--muted); font-weight: 600; }
.amount input { border: 0; background: transparent; font-size: 40px; font-weight: 700; width: 100%; max-width: 280px; text-align: left; outline: none; letter-spacing: -1px; min-width: 0; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cat { display: flex; align-items: center; gap: 6px; padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; }
.cat svg { width: 18px; height: 18px; }
.cat.on { border-color: var(--accent); background: var(--tint); color: var(--accent); }
.quick { display: flex; gap: 8px; margin-top: 8px; }
.quick button { flex: 1; padding: 9px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; }
.quick button.on { border-color: var(--accent); background: var(--tint); color: var(--accent); }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; padding: 14px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; text-align: center; background: var(--card); padding: 28px 22px 22px; border-radius: 28px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 26px; } .login-box .in { margin: 18px 0 12px; text-align: center; }
.login-box .btn { margin-top: 6px; }

.toast { position: fixed; left: 50%; transform: translate(-50%, 20px); bottom: calc(100px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
.offline { background: var(--badbg); color: var(--bad); text-align: center; padding: 8px; border-radius: 14px; margin-bottom: 12px; font-size: 13px; }

@media (min-width: 700px) { body { background: linear-gradient(180deg, var(--bg), var(--tint)); } .sheet { align-items: center; } .sheet .panel { border-radius: 28px; } }

.mini-ib { width: 34px; height: 34px; box-shadow: none; background: var(--tint); flex: none; }
.mini-ib svg { width: 18px; height: 18px; }
.btn { white-space: nowrap; }
.item.jd .t b, .item.jd .t > span { white-space: normal; overflow: visible; }

/* wordmark & monogram (satu keluarga dengan Rach Capital · Treasury) */
.wm { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; line-height: 1; }
.wm b { font-weight: 800; letter-spacing: .22em; margin-right: -.22em; }
.wm i { width: 1px; height: 17px; background: var(--muted); opacity: .55; }
.wm span { font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.login-box .wm { justify-content: center; font-size: 22px; margin: 2px 0 8px; }
.logo-img { display: block; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28)); }

/* kartu hero di mode gelap: sedikit lebih terang agar terpisah dari latar */
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(160deg, #1C1C20 0%, #35353B 100%); border-color: rgba(255, 255, 255, .10); } }

/* kontrol bawaan browser (centang, kursor, pilihan teks, isi otomatis) ikut hitam-putih, bukan biru */
:root { accent-color: var(--accent); caret-color: var(--accent); }
::selection { background: var(--tint); color: var(--ink); }
input:-webkit-autofill, input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--card) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
