/* =====================================================================
   Arta - tampilan. Warna diatur lewat variabel di :root (terang) dan
   [data-theme="dark"] (gelap).
   ===================================================================== */
:root {
  --bg: #F6F4FD;
  --card: #FFFFFF;
  --card-2: #F7F5FF;
  --text: #24213F;
  --muted: #6E6A8E;
  --line: #ECE8F8;
  --tint: #EFEBFF;
  --active: #5B4BD6;
  --accent: #7C6CF2;
  --accent-2: #FF8FB1;
  --accent-soft: #B9AFFF;
  --pos: #1E9E77;
  --pos-soft: #7FDDB9;
  --neg: #F0506E;
  --neg-soft: #FF8FA3;
  --warn: #D9822B;
  --shadow: 0 2px 6px rgba(92, 76, 190, .05), 0 12px 32px rgba(92, 76, 190, .08);
  --radius: 22px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #14122A;
  --card: #1E1B3A;
  --card-2: #252146;
  --text: #F2F0FF;
  --muted: #A9A4CC;
  --line: #322D5C;
  --tint: #2E2860;
  --active: #C4BBFF;
  --accent: #9A8CFF;
  --accent-2: #FF9EC0;
  --accent-soft: #7D70E0;
  --pos: #6FE3BE;
  --pos-soft: #3FB892;
  --neg: #FF7A93;
  --neg-soft: #FF8FA3;
  --warn: #FBBF24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--active); }
h1, h2, h3 { margin: 0; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }

/* ---------- boot & spinner ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 12px; text-align: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 64px 0; display: grid; place-content: center; }

/* ---------- auth / setup screen ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card .brand { font-size: 32px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 24px; }
.setup-card { max-width: 620px; }
.setup-card ol { padding-left: 20px; }
.setup-card li { margin: 6px 0; }
.setup-card code { background: var(--tint); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--card) 239px, var(--line) 239px 240px, transparent 240px); }
.sidebar { background: var(--card); border-right: 1px solid var(--line); align-self: start; padding: 24px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { font-size: 24px; padding: 0 12px 20px; }
.nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; text-align: left; min-height: 44px; }
.nav-btn:hover { background: var(--card-2); color: var(--text); }
.nav-btn.on { background: var(--tint); color: var(--active); font-weight: 700; }
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.sidebar .spacer { flex: 1; }
.sidebar .who { padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.sidebar .who strong { display: block; color: var(--text); font-size: 14px; }

.main { min-width: 0; padding: 28px 32px 120px; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }

.bottom-nav { display: none; }
.fab { position: fixed; right: 28px; bottom: 28px; width: 60px; height: 60px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 24px rgba(79, 70, 229, .4); cursor: pointer; display: grid; place-items: center; z-index: 20; }
.fab svg { width: 28px; height: 28px; }

.head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bell { position: relative; background: var(--card); border: 1px solid var(--line); width: 44px; height: 44px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.banner { background: var(--tint); color: var(--active); border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; }
.banner.warn { background: rgba(245, 158, 11, .15); color: var(--warn); }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kpi .value { font-family: var(--display); font-size: 25px; margin: 8px 0 4px; word-break: break-word; }
.kpi .note { font-size: 13px; color: var(--muted); }
.up { color: var(--pos); font-weight: 600; }
.down { color: var(--neg); font-weight: 600; }
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 200px; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; font-size: 14px; }

/* ---------- period navigator ---------- */
.period { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.period span { font-weight: 600; font-size: 14px; padding: 0 8px; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--card-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- legend, bars ---------- */
.legend { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span:last-child { margin-left: auto; color: var(--text); font-weight: 600; }
.bar-row { margin: 14px 0 0; }
.bar-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.bar-row .top .amt { color: var(--muted); font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.day-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 16px 4px 6px; display: flex; justify-content: space-between; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx .dot { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.tx .body { flex: 1; min-width: 0; }
.tx .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { font-weight: 700; white-space: nowrap; }
.tx .amt.in { color: var(--pos); }
.tx .amt.out { color: var(--text); }
.tx .amt.tr { color: var(--muted); }
.tx .acts { display: flex; gap: 2px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-item:last-child { border-bottom: 0; }
.row-item .body { flex: 1; min-width: 160px; }
.row-item .title { font-weight: 600; }
.row-item .meta { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 13px; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 6px; min-height: 24px; }
.chip button:hover { color: var(--text); background: var(--line); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--tint); color: var(--active); text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.tag.private { background: rgba(245, 158, 11, .15); color: var(--warn); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--card-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--neg); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); outline: none; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.field .hint { font-size: 12px; color: var(--muted); }
.amount-input { font-family: var(--display); font-size: 28px !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--active); box-shadow: var(--shadow); }

.budget-row { display: grid; grid-template-columns: 1fr 180px; gap: 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.budget-row:last-child { border-bottom: 0; }
.budget-row input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); text-align: right; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 30, .55); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: 20px; padding: 24px; box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--neg); color: #fff; }

/* ---------- theme choice ---------- */
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-pick button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; font-weight: 600; }
.theme-pick button.on { border-color: var(--accent); color: var(--active); background: var(--tint); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { display: none; }
  .main { padding: 20px 16px 120px; }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: 1 / -1; }
  .page-head h1 { font-size: 24px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 15; }
  .bottom-nav .nav-btn { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; justify-content: center; text-align: center; }
  .fab { right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  #toast { bottom: calc(160px + env(safe-area-inset-bottom)); }
  .budget-row { grid-template-columns: 1fr 140px; gap: 10px; }
}
@media (max-width: 420px) {
  .grid-4 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 22px; }
}

/* Situs di netlify.app menampilkan lencana "Powered by Netlify" di pojok kanan bawah.
   Di HP, menu bawah dinaikkan agar tidak tertutup lencana. */
@media (max-width: 860px) {
  .has-host-badge .bottom-nav { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
  .has-host-badge .fab { bottom: calc(130px + env(safe-area-inset-bottom)); }
  .has-host-badge .main { padding-bottom: 170px; }
  .has-host-badge #toast { bottom: calc(200px + env(safe-area-inset-bottom)); }
}

/* =====================================================================
   Penyegaran tampilan: pastel lembut, kartu kategori, cincin progres,
   menu bawah berbentuk pil mengambang.
   ===================================================================== */
body { background: radial-gradient(1200px 600px at 100% -10%, rgba(255, 143, 177, .10), transparent 60%), radial-gradient(900px 500px at -10% 0%, rgba(124, 108, 242, .10), transparent 60%), var(--bg); background-attachment: fixed; }
.card { border-radius: var(--radius); border-color: transparent; }
.btn { border-radius: 14px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #9B8CFF); border: 0; box-shadow: 0 6px 16px rgba(124, 108, 242, .28); }
.fab { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgba(124, 108, 242, .38); }
.seg { border-radius: 16px; }
.seg button { border-radius: 12px; }
.field input, .field select { border-radius: 14px; }
.modal-card, .modal > div { border-radius: 26px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 14px; font-weight: 700; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.section-head strong { font-size: 18px; color: var(--text); text-transform: none; letter-spacing: 0; }
.section-head strong.up { color: var(--pos); }

/* Kartu kategori */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { --tile: var(--accent); position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 14px 10px 14px; border: 0; border-radius: 20px; text-align: center; font: inherit; color: var(--text);
  background: color-mix(in srgb, var(--tile) 14%, var(--card)); }
button.tile { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
button.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--tile) 25%, transparent); }
button.tile:active { transform: scale(.97); }
.tile-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; }
.tile-amt { font-weight: 800; font-size: 15px; max-width: 100%; white-space: nowrap; color: color-mix(in srgb, var(--tile) 65%, var(--text)); }
.tile-sub { font-size: 12px; color: var(--muted); }
.tile-sub.down { color: var(--neg); }
.tile .ring { display: block; flex: none; }
.tile-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.tile input { width: 100%; min-width: 0; min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--tile) 30%, var(--line)); background: var(--card); text-align: center; font-weight: 600; }
.tile input:focus { outline: none; border-color: var(--tile); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile) 25%, transparent); }

/* Cincin besar penggunaan budget */
.budget-ring { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.big-ring { --p: 0; --c: var(--accent); width: 140px; height: 140px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--accent) 15%, var(--card)) 0); }
.big-ring > div { width: 110px; height: 110px; border-radius: 50%; background: var(--card); display: grid; place-content: center; text-align: center; }
.big-ring strong { font-size: 26px; line-height: 1; }
.big-ring span { font-size: 12px; color: var(--muted); }
.budget-ring-info { flex: 1; min-width: 160px; display: grid; gap: 8px; }
.budget-ring-info .label { display: block; font-size: 12px; color: var(--muted); }
.budget-ring-info strong { font-size: 17px; }
.mini-warn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.mini-warn i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mini-warn span { margin-left: auto; font-weight: 700; }

.chip-growth { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--pos); background: color-mix(in srgb, var(--pos) 14%, transparent); white-space: nowrap; }
.chip-growth.down { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); }
.card-title { flex-wrap: wrap; row-gap: 6px; }

/* Baris budget lama: tetap aman bila dipakai */
.budget-row { grid-template-columns: minmax(0, 1fr) minmax(0, 160px); }
.budget-row > div { min-width: 0; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 6px; }
  .tile-amt { font-size: 13.5px; letter-spacing: -.01em; }
  .tile-sub { font-size: 11.5px; }
  .bottom-nav { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); padding: 8px 6px; border: 0; border-radius: 28px; background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 10px 30px rgba(60, 45, 150, .16); }
  .bottom-nav .nav-btn { border-radius: 20px; }
  .bottom-nav .nav-btn.on, .bottom-nav .nav-btn[aria-current] { background: var(--tint); }
  .fab { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .has-host-badge .bottom-nav { padding-bottom: 8px; bottom: calc(58px + env(safe-area-inset-bottom)); }
  .has-host-badge .fab { bottom: calc(146px + env(safe-area-inset-bottom)); }
  .budget-ring { justify-content: center; }
}
@media (max-width: 380px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Catat by Suara ---------- */
.field textarea { width: 100%; min-height: 84px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); resize: vertical; font: inherit; color: inherit; }
.field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.muted { color: var(--muted); font-size: 14px; }
.fab-mic { bottom: 100px; width: 48px; height: 48px; right: 34px; background: var(--card); color: var(--accent); box-shadow: 0 8px 22px rgba(92, 76, 190, .22); }
.fab-mic svg { width: 22px; height: 22px; }
.voice-box { display: grid; justify-items: center; gap: 10px; margin: 4px 0 18px; }
.voice-btn { width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgba(124, 108, 242, .35); }
.voice-btn svg { width: 36px; height: 36px; }
.voice-btn.on { animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 143, 177, .55); } 50% { box-shadow: 0 0 0 16px rgba(255, 143, 177, 0); } }
.voice-status { font-size: 13px; color: var(--muted); text-align: center; }
.voice-banner { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-weight: 500; }
.voice-banner svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
@media (max-width: 860px) {
  .fab-mic { right: 22px; bottom: calc(166px + env(safe-area-inset-bottom)); }
  .has-host-badge .fab-mic { bottom: calc(212px + env(safe-area-inset-bottom)); }
}
.ai-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--accent-2) 14%, var(--card)); color: var(--active); border: 1px solid color-mix(in srgb, var(--accent-2) 35%, var(--line)); font-weight: 700; min-height: 46px; }
.ai-btn svg { width: 18px; height: 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row input { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(20px); }
.vr-item { display: grid; gap: 8px; padding: 12px; margin-bottom: 10px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.vr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vr-check { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.vr-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.vr-item select, .vr-item input:not([type=checkbox]) { width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; color: inherit; font-size: 14px; }
.vr-item .vr-amt { max-width: 150px; text-align: right; font-weight: 700; }
.vr-item .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }

/* ---------- Konsultan Investasi AI ---------- */
.adv-head { display: flex; gap: 16px; align-items: center; }
.big-ring.sm { width: 84px; height: 84px; }
.big-ring.sm > div { width: 66px; height: 66px; }
.big-ring.sm strong { font-size: 22px; }
.big-ring.sm span { font-size: 11px; }
.banner svg { width: 16px; height: 16px; vertical-align: -3px; }
.adv-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.adv-asset { padding: 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); min-width: 0; }
.adv-asset p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.adv-asset-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; }
.act { padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; text-transform: capitalize; }
.act-pos { color: var(--pos); background: color-mix(in srgb, var(--pos) 15%, transparent); }
.act-neg { color: var(--neg); background: color-mix(in srgb, var(--neg) 15%, transparent); }
.act-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.act-info { color: var(--active); background: var(--tint); }
.lv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lv span { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.adv-ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
.tbl th { text-align: right; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.tbl td:nth-child(3), .tbl td:nth-child(5), .tbl th:nth-child(3), .tbl th:nth-child(5) { text-align: left; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .icon-btn { width: 32px; height: 32px; }
@media (max-width: 860px) { .adv-head { align-items: flex-start; } }

/* ---------- Logo Personal Finance ---------- */
.brand { font-family: 'Cinzel', var(--display); }
.brand-lock { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.brand-lock img { height: 46px; width: auto; flex: none; filter: drop-shadow(0 2px 4px rgba(20, 30, 60, .18)); }
.brand-words { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.brand-words span { font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: linear-gradient(180deg, #E6C978 0%, #C59A44 55%, #9A7230 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-words span:first-child { font-size: 19px; }
.brand-words span:last-child { font-size: 11.5px; letter-spacing: .32em; color: transparent; background: linear-gradient(180deg, #4F6D93, #2E4A6E); -webkit-background-clip: text; background-clip: text; }
[data-theme="dark"] .brand-words span:first-child { background-image: linear-gradient(180deg, #F6E3A6 0%, #D9B464 55%, #B48A3C 100%); }
[data-theme="dark"] .brand-words span:last-child { background-image: linear-gradient(180deg, #A9C3E6, #6F93BF); }
.sidebar .brand { font-size: inherit; padding: 0 8px 22px; }
.auth-card .brand { font-size: inherit; margin-bottom: 10px; }
.auth-card .brand-lock img { height: 64px; }
.auth-card .brand-words span:first-child { font-size: 26px; }
.auth-card .brand-words span:last-child { font-size: 14px; }
.mobile-brand { display: none; }
@media (max-width: 860px) {
  .mobile-brand { display: block; margin: -4px 0 14px; }
  .mobile-brand .brand-lock img { height: 36px; }
  .mobile-brand .brand-words span:first-child { font-size: 15px; }
  .mobile-brand .brand-words span:last-child { font-size: 9.5px; }
}

/* Suara di form portofolio */
.voice-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; min-height: 44px; font-weight: 700; color: var(--active); background: var(--tint); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); }
.voice-toggle svg { width: 18px; height: 18px; }
.voice-inline { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.voice-btn.sm { width: 52px; height: 52px; flex: none; }
.voice-btn.sm svg { width: 24px; height: 24px; }
.vi-body { flex: 1; min-width: 0; }
.vi-body textarea { width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 14px; color: inherit; resize: vertical; }
.vi-body .voice-status { text-align: left; margin: 6px 0 8px; }
.vi-act { display: flex; gap: 8px; flex-wrap: wrap; }
.vi-act .ai-btn { min-height: 34px; }

/* ---------- Cek harga saham ---------- */
.quote-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quote-form input { flex: 1; min-width: 120px; min-height: 44px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); font: inherit; color: inherit; text-transform: uppercase; }
.quote-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.quote-res { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line); }
.q-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.q-code { font-size: 20px; font-weight: 800; }
.q-price { font-size: 20px; font-weight: 800; }
.q-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 6px; }
.q-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.q-chip.up { color: var(--pos); } .q-chip.down { color: var(--neg); }
.chart-box.xs { height: 110px; }
.q-range { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.q-bar { flex: 1; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--neg), var(--warn), var(--pos)); position: relative; opacity: .8; }
.q-bar i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--text); transform: translate(-50%, -50%); }

/* ---------- Reset data ---------- */
.danger-card { border: 1px solid color-mix(in srgb, var(--neg) 25%, transparent); }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.btn.danger.block, button.btn.danger[type=submit] { background: var(--neg); color: #fff; border: 0; box-shadow: 0 6px 16px color-mix(in srgb, var(--neg) 30%, transparent); }
.btn.danger:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.reset-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card-2); cursor: pointer; }
.reset-opt:has(input:checked) { border-color: var(--neg); background: color-mix(in srgb, var(--neg) 6%, var(--card)); }
.reset-opt input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--neg); }
.reset-opt > span { display: grid; gap: 4px; font-size: 13.5px; line-height: 1.45; }
.reset-opt strong { font-size: 15px; }
.ro-line b { font-weight: 700; }
.reset-warn { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 4px 0 14px; font-size: 13px; }
button.reset-opt { width: 100%; text-align: left; font: inherit; color: inherit; }
button.reset-opt:hover { border-color: var(--neg); }
.btn.danger.solid { background: var(--neg); color: #fff; border: 0; }
.reset-ask { display: grid; gap: 8px; padding: 16px; margin-bottom: 12px; border-radius: 16px; border: 1.5px solid var(--neg); background: color-mix(in srgb, var(--neg) 6%, var(--card)); font-size: 13.5px; line-height: 1.45; }
.reset-ask strong { font-size: 16px; }
.reset-ask .btn-row { margin-top: 6px; }
.reset-ask .btn { flex: 1; }

/* ---------- Tombol + dengan menu pop-up ---------- */
.fab { transition: transform .2s ease; }
.fab.open { transform: rotate(45deg); }
.fab-menu { position: fixed; right: 28px; bottom: 100px; z-index: 21; display: grid; gap: 10px; justify-items: end; animation: fabIn .16s ease-out; }
@keyframes fabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fab-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 0; border-radius: 99px; background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 8px 24px rgba(60, 45, 150, .2); white-space: nowrap; }
.fab-item svg { width: 20px; height: 20px; padding: 6px; box-sizing: content-box; border-radius: 50%; background: var(--tint); color: var(--active); }
.fab-item:hover { background: var(--tint); }
.fab-mic { display: none !important; }

/* ---------- Duplikat transaksi ---------- */
.tx-tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tx-tools .btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.dup-bar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--accent); box-shadow: var(--shadow); }
.tx.sel { cursor: pointer; border-radius: 14px; padding-left: 8px; padding-right: 8px; }
.tx.sel input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin: 0 2px 0 0; }
.tx.sel.on { background: var(--tint); }
.acts .icon-btn svg { width: 17px; height: 17px; }

@media (max-width: 860px) {
  .fab-menu { right: 18px; bottom: calc(168px + env(safe-area-inset-bottom)); }
  .has-host-badge .fab-menu { bottom: calc(214px + env(safe-area-inset-bottom)); }
  .page { padding-bottom: 170px; }
  .dup-bar { top: 4px; }
}
@media (max-width: 640px) {
  .tx:has(.acts) { flex-wrap: wrap; row-gap: 4px; }
  .tx .acts { flex-basis: 100%; justify-content: flex-end; gap: 6px; margin-top: -2px; }
  .tx .acts .icon-btn { width: 34px; height: 30px; border-radius: 10px; background: var(--card-2); }
  .tx .acts .icon-btn svg { width: 15px; height: 15px; }
}

/* ---------- Catat dari foto ---------- */
.photo-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; cursor: pointer; font-weight: 700; }
.photo-btn svg { width: 18px; height: 18px; }
.photo-prev { margin-top: 12px; border-radius: 16px; overflow: hidden; background: var(--card-2); border: 1px solid var(--line); max-height: 260px; display: grid; place-items: center; }
.photo-prev img { max-width: 100%; max-height: 260px; display: block; object-fit: contain; }
#ph-go svg { width: 16px; height: 16px; vertical-align: -3px; }

.fill-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fill-row .voice-toggle[hidden] { display: none; }
.fill-row:has(.voice-toggle[hidden]) { grid-template-columns: 1fr; }
.fill-row .voice-toggle { font-size: 13.5px; padding: 8px 10px; }
.tp-panel .vi-body { width: 100%; }
.tp-panel .photo-prev, .tp-panel .photo-prev img { max-height: 150px; }

/* Filter & kelompok aset portofolio */
.hold-filter { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.hold-filter::-webkit-scrollbar { display: none; }
.hold-filter button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 36px; }
.hold-filter button i, .hold-head i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hold-filter button span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.hold-filter button.on { background: var(--active); border-color: var(--active); color: #fff; }
.hold-filter button.on span { color: rgba(255,255,255,.8); }
.hold-group + .hold-group { margin-top: 14px; }
.hold-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-radius: 14px; background: var(--tint); color: var(--text); font: inherit; cursor: pointer; text-align: left; margin-bottom: 4px; }
.hold-head b { font-size: 14px; }
.hold-head span { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.hold-head svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.hold-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; margin-bottom: 6px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.hold-sum div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hold-sum span { font-size: 11.5px; color: var(--muted); }
.hold-sum strong { font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .hold-sum { grid-template-columns: 1fr 1fr; } }

.tile-new { cursor: pointer; justify-content: center; background: transparent !important; border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line)) !important; color: var(--active); min-height: 150px; }
.tile-new:hover { background: var(--tint) !important; }
.tile-new-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); }
.tile-new-ic svg { width: 24px; height: 24px; }

/* Perbarui NAV reksadana */
.nav-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: 2px 0 6px; border-radius: 14px; background: var(--card-2); border: 1px dashed var(--line); }
.nav-bar span { flex: 1 1 200px; font-size: 12.5px; color: var(--muted); }
.nav-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--active); }
.nav-link svg { width: 15px; height: 15px; }
.ns-item { padding: 12px 0; border-top: 1px solid var(--line); }
.ns-head { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.ns-head input { width: 20px; height: 20px; min-height: 0; flex: none; margin-top: 2px; }
.ns-head span { display: flex; flex-direction: column; min-width: 0; }
.ns-head small { color: var(--muted); font-size: 12px; }
.ns-item .tag { margin: 6px 6px 0 30px; display: inline-block; }
.ns-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 0 30px; }
.ns-row .field { margin: 0; }
.ns-row input { min-width: 0; }
.ns-meta { margin: 6px 0 0 30px; font-size: 12.5px; color: var(--muted); }
.ns-meta a { color: var(--active); font-weight: 600; }

/* Fase 8: jenis aset buatan, kupon */
.opt-cards { display: grid; gap: 8px; }
.opt-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-weight: 500; }
.opt-card:has(input:checked) { border-color: var(--active); background: var(--tint); }
.opt-card input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--active); }
.opt-card span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.cpn-box { padding: 12px; margin: 0 0 14px; border-radius: 16px; background: var(--card-2); border: 1px dashed var(--line); }
.cpn-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-weight: 700; font-size: 14px; }
.cpn-title svg { width: 16px; height: 16px; color: var(--active); }
.cpn-meta { color: color-mix(in srgb, var(--pos, #10B981) 70%, var(--text)); }
.type-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* Pilihan rentang grafik pemasukan vs pengeluaran */
.flow-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg.seg-sm { margin: 0; padding: 3px; min-height: 0; width: auto; }
.seg.seg-sm button { padding: 6px 12px; font-size: 12.5px; min-height: 32px; }

/* Grafik donat porsi kategori */
.donut-wrap { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: center; }
.donut-box { position: relative; height: 280px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 70px; }
.donut-center span { font-size: 12.5px; color: var(--muted); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-center strong { font-size: 22px; font-weight: 800; margin: 2px 0; }
.donut-center small { font-size: 12px; color: var(--muted); }
.dn-legend { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dn-item { display: grid; grid-template-columns: 12px minmax(0, 38%) minmax(40px, 1fr) 84px 52px; gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dn-item:hover, .dn-item.hi { background: var(--tint); }
.dn-item i { width: 12px; height: 12px; border-radius: 4px; }
.dn-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-name small { color: var(--muted); font-size: 14px; }
.dn-bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.dn-bar b { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.dn-amt { font-weight: 700; font-size: 13px; white-space: nowrap; text-align: right; }
.dn-pc { font-size: 12.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.dn-hint { font-size: 12px; margin: 10px 0 0; }
.donut-card .card-title .btn.sm { padding: 4px 8px; min-height: 30px; vertical-align: middle; }
@media (max-width: 760px) {
  .donut-wrap { grid-template-columns: 1fr; gap: 12px; }
  .donut-box { height: 240px; }
  .dn-item { grid-template-columns: 12px minmax(0, 1fr) 84px 48px; }
  .dn-bar { display: none; }
}

/* =====================================================================
   FASE 9: desain baru (ungu dominan, latar dengan hint warna, kartu kaca,
   menu bawah melayang + blur, lembar input, infografis)
   ===================================================================== */
:root {
  --bg: #F5F3FF;
  --bg2: #FFFFFF;
  --card: rgba(255, 255, 255, .78);
  --card-solid: #FFFFFF;
  --card-2: rgba(238, 234, 255, .85);
  --text: #1D1838;
  --muted: #625E86;
  --line: rgba(108, 76, 241, .13);
  --tint: #ECE6FF;
  --active: #4B2FD0;
  --accent: #6C4CF1;
  --accent-2: #9A7BFF;
  --pos: #16A06A;
  --neg: #E8476A;
  --pos-bg: #DDF7EB;
  --neg-bg: #FFE1E8;
  --display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 10px 30px -12px rgba(76, 52, 190, .28);
}
[data-theme="dark"] {
  --bg: #1A1636;
  --bg2: #221D45;
  --card: rgba(52, 44, 110, .42);
  --card-solid: #2A2456;
  --card-2: rgba(255, 255, 255, .07);
  --text: #F3F0FF;
  --muted: #B4AEDA;
  --line: rgba(255, 255, 255, .10);
  --tint: #2E2558;
  --active: #C2B3FF;
  --accent: #8E6CFF;
  --accent-2: #B49BFF;
  --pos: #4ADE9B;
  --neg: #FF7D97;
  --pos-bg: #143A2B;
  --neg-bg: #43202B;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
}
html { background: var(--bg); }
body { background: transparent; overflow-x: clip; }
/* Hint warna latar, tetap di tempat saat digulir */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(130% 62% at 50% -12%, rgba(140, 105, 255, .70) 0, rgba(160, 130, 255, .32) 40%, transparent 76%),
    radial-gradient(75% 48% at 106% 22%, rgba(100, 145, 255, .52) 0, transparent 70%),
    radial-gradient(75% 48% at -8% 48%, rgba(185, 130, 255, .42) 0, transparent 70%),
    radial-gradient(95% 48% at 50% 112%, rgba(255, 160, 210, .50) 0, transparent 70%),
    linear-gradient(180deg, #E6DEFF 0%, #EFEBFF 40%, #EFEAFF 100%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(130% 62% at 50% -12%, rgba(140, 110, 255, 1) 0, rgba(110, 84, 240, .58) 40%, transparent 76%),
    radial-gradient(75% 48% at 106% 22%, rgba(75, 125, 255, .55) 0, transparent 70%),
    radial-gradient(75% 48% at -8% 48%, rgba(155, 92, 255, .42) 0, transparent 70%),
    radial-gradient(95% 48% at 50% 112%, rgba(125, 82, 255, .50) 0, transparent 70%),
    linear-gradient(180deg, #43349A 0%, #2A2266 40%, #201A52 100%);
}
@media (min-width: 861px) {
  body::before { background-attachment: fixed; }
}
.display { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; }
.kpi .value { font-family: var(--display); font-weight: 800; }
.card, .period, .bell, .sidebar, .bottom-nav, .fab-item, .btn:not(.primary):not(.danger) {
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}
.card { box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(76, 52, 190, .35); }
[data-theme="dark"] .card { box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(0, 0, 0, .5); }
.shell { background: none; }
.sidebar { background: var(--card); }
.modal { background: var(--bg2); }
.btn.primary { background: linear-gradient(135deg, #5B3BE6, #8E6CFF); }
.fab { background: linear-gradient(135deg, #5B3BE6, #9A7BFF); box-shadow: 0 12px 24px -8px rgba(91, 59, 230, .7); }
.chip-growth { background: var(--pos-bg); }
.chip-growth.down { background: var(--neg-bg); }
.up { color: var(--pos); } .down { color: var(--neg); }

/* transisi antar halaman tanpa muat ulang */
.page.enter { animation: pgIn .28s ease; }
.page.enter-back { animation: pgBack .28s ease; }
@keyframes pgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pgBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.page.busy { opacity: .55; transition: opacity .2s; }
.top-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, #5B3BE6, #9A7BFF); transition: width .6s ease, opacity .3s; opacity: 0; }
.top-progress.on { width: 70%; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .page.enter, .page.enter-back { animation: none; } }

/* kepala atas di HP */
.mobile-top { display: none; }
@media (max-width: 860px) {
  .mobile-brand { display: none !important; }
  .main { padding: 0 16px 130px; }
  .mobile-top { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 12; padding: calc(10px + env(safe-area-inset-top)) 0 10px; margin-bottom: 6px; }
  .mobile-top::before { content: ""; position: absolute; inset: 0 -16px -14px; z-index: -1; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
  .mobile-top .brand-lock { flex: 1; }
  .mobile-top .brand-lock img { height: 34px; width: 34px; }
  .mobile-top .brand-words span:first-child { font-size: 15px; }
  .mobile-top .brand-words span:last-child { font-size: 9.5px; }
  .ibtn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .ibtn svg { width: 20px; height: 20px; }

}

/* menu bawah melayang + tombol catat di tengah */
@media (max-width: 860px) {
  .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(448px, calc(100% - 24px)); bottom: max(12px, env(safe-area-inset-bottom)); grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 26px; background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); box-shadow: var(--shadow); z-index: 20; }
  [data-theme="dark"] .bottom-nav { background: rgba(30, 26, 53, .72); }
  .bottom-nav .nav-btn { min-height: 50px; border-radius: 18px; font-weight: 700; color: var(--muted); }
  .bottom-nav .nav-btn.on, .bottom-nav .nav-btn[aria-current] { background: var(--tint); color: var(--active); }
  .bottom-nav .nav-fab { width: 56px; height: 56px; border-radius: 20px; margin: -26px auto 0; border: 0; background: linear-gradient(135deg, #5B3BE6, #9A7BFF); color: #fff; box-shadow: 0 12px 24px -8px rgba(91, 59, 230, .7); display: grid; place-items: center; cursor: pointer; transition: transform .2s ease; }
  .bottom-nav .nav-fab svg { width: 26px; height: 26px; }
  .bottom-nav .nav-fab.open { transform: rotate(45deg); }
  .fab { display: none !important; }
  .fab-menu { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); justify-items: center; }
  .has-host-badge .bottom-nav { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 6px; }
  .has-host-badge .fab-menu { bottom: calc(142px + env(safe-area-inset-bottom)); }
  .bfade { position: fixed; left: 0; right: 0; bottom: 0; height: 104px; z-index: 15; pointer-events: none; }
  .has-host-badge .bfade { height: 150px; }
  .bfade i { position: absolute; inset: 0; display: block; }
  .bfade i:nth-child(1) { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-mask-image: linear-gradient(to top, #000 60%, transparent 100%); mask-image: linear-gradient(to top, #000 60%, transparent 100%); }
  .bfade i:nth-child(2) { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); -webkit-mask-image: linear-gradient(to top, #000 50%, transparent 85%); mask-image: linear-gradient(to top, #000 50%, transparent 85%); }
  .bfade i:nth-child(3) { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask-image: linear-gradient(to top, #000 40%, transparent 70%); mask-image: linear-gradient(to top, #000 40%, transparent 70%); }
  .bfade i:nth-child(4) { background: linear-gradient(to top, color-mix(in srgb, var(--bg) 70%, transparent) 0%, color-mix(in srgb, var(--bg) 30%, transparent) 40%, transparent 75%); }
}
@media (min-width: 861px) { .bfade, .nav-fab { display: none; } }

/* modal jadi lembar dari bawah di HP */
@media (max-width: 860px) {
  .modal-back { align-items: end; padding: 0; }
  .modal { max-width: 100%; border-radius: 28px 28px 0 0; max-height: 94vh; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheetUp .32s cubic-bezier(.2, .8, .2, 1); }
  .modal::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 10px; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* geser dari kiri untuk kembali */
.swipe-ind { position: fixed; left: -30px; top: 50%; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card-solid); color: var(--active); border: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; transform: translate(0, -50%) scale(.8); transition: opacity .2s, transform .2s, background .2s; z-index: 70; pointer-events: none; }
.swipe-ind svg { width: 20px; height: 20px; }
.swipe-ind.ready { background: var(--accent); color: #fff; }

/* ---------- login ---------- */
.auth2 { min-height: 100vh; display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 18px 32px; }
.auth2 .auth-top { display: flex; justify-content: flex-end; }
.auth2 .seg { margin: 0; display: inline-flex; }
.auth2 .seg button { display: flex; align-items: center; gap: 6px; padding: 0 14px; }
.auth2 .seg svg { width: 16px; height: 16px; }
.logo-big { width: 84px; height: 84px; border-radius: 26px; overflow: hidden; margin: 26px auto 14px; background: #13213F; box-shadow: 0 18px 40px -16px rgba(91, 59, 230, .8), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.logo-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-title { text-align: center; }
.auth-title .brandname { font-family: Cinzel, serif; font-weight: 700; letter-spacing: .04em; color: var(--active); font-size: 13px; margin: 0 0 6px; }
.auth-title h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.auth-title p { color: var(--muted); margin: 6px 0 0; }
.auth2 .card { margin-top: 22px; padding: 18px; }
.auth2 .field input { background: var(--card-2); }
.pw { position: relative; }
.pw input { padding-right: 52px !important; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw button svg { width: 20px; height: 20px; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.lnk { border: 0; background: none; color: var(--active); font-weight: 700; padding: 8px 2px; min-height: 40px; cursor: pointer; }

/* ---------- Beranda: kartu utama ungu ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hero { border-radius: 26px; padding: 18px 18px 14px; color: #fff; background: linear-gradient(135deg, #5B3BE6 0%, #7C5CFF 55%, #A68BFF 100%); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero small { opacity: .88; font-size: 12.5px; font-weight: 600; }
.hero-big { font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.hero-spark { height: 46px; margin-top: 6px; }
svg.sp { display: block; width: 100%; height: 100%; }
.gchip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(36, 18, 110, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.gchip.g-up { color: #A6F7CD; } .gchip.g-flat { color: #FFE68F; } .gchip.g-down { color: #FFB8C6; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.trio div { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.trio span { display: block; font-size: 11.5px; opacity: .85; }
.trio b { font-size: 13.5px; white-space: nowrap; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.quick button { border: 1px solid var(--line); border-radius: 18px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; min-height: 44px; cursor: pointer; transition: transform .15s; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.quick button:active { transform: scale(.96); }
.quick i { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; }
.quick i svg { width: 20px; height: 20px; }
.quick .q1 { background: #F1ECFF; border-color: #E2D9FF; color: var(--text); } .quick .q1 i { background: #DCD0FF; color: #5B3BE6; }
.quick .q2 { background: #E9F8F2; border-color: #D3F0E3; color: var(--text); } .quick .q2 i { background: #C9EEDD; color: #0F8A5F; }
.quick .q3 { background: #FFF1E8; border-color: #FFE1CF; color: var(--text); } .quick .q3 i { background: #FFDCC6; color: #D9622B; }
.quick .q4 { background: #EAF3FF; border-color: #D5E6FF; color: var(--text); } .quick .q4 i { background: #CFE2FF; color: #2F6FDB; }
[data-theme="dark"] .quick .q1 { background: #2A2350; border-color: #3A3170; } [data-theme="dark"] .quick .q1 i { background: #41378A; color: #D6CCFF; }
[data-theme="dark"] .quick .q2 { background: #173229; border-color: #22473A; } [data-theme="dark"] .quick .q2 i { background: #245442; color: #8FE3BE; }
[data-theme="dark"] .quick .q3 { background: #3A2619; border-color: #553624; } [data-theme="dark"] .quick .q3 i { background: #5E3B27; color: #FFC09A; }
[data-theme="dark"] .quick .q4 { background: #1A2742; border-color: #26395F; } [data-theme="dark"] .quick .q4 i { background: #2A4270; color: #A9C8FF; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip.up { background: var(--pos-bg); color: var(--pos); } .chip.down { background: var(--neg-bg); color: var(--neg); }
.month-card .card-title { font-size: 16px; }
.flowbar { height: 12px; border-radius: 99px; background: var(--neg-bg); overflow: hidden; margin: 12px 0 10px; display: flex; }
.flowbar b { background: var(--pos); border-radius: 99px; transition: width .5s; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv div { background: var(--card-2); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.kv span { font-size: 11.5px; color: var(--muted); display: block; }
.kv b { font-size: 14px; white-space: nowrap; }
.kv-note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.kv-note b { font-weight: 700; }
@media (max-width: 860px) {
  .dash-top { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dash-top .month-card { margin-top: 14px; }
}

/* ---------- lembar catat transaksi ---------- */
.tx-sheet { max-width: 480px; }
.tx-sheet:focus { outline: none; }
.tx-sheet .modal-head { margin-bottom: 8px; }
.tx-sheet .modal-head h2 { font-size: 17px; }
.seg.seg-full { display: flex; margin: 0 0 12px; }
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; padding: 4px 0 10px; }
.cbtn { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 2px; border-radius: 16px; min-height: 44px; cursor: pointer; min-width: 0; }
.cbtn > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; }
.ico svg { width: 20px; height: 20px; }
.cbtn .ico { width: 54px; height: 54px; border-radius: 18px; box-shadow: 0 8px 16px -10px currentColor; transition: transform .15s; }
.cbtn .ico svg { width: 24px; height: 24px; }
.cbtn:active .ico { transform: scale(.94); }
.cbtn.add .ico { background: var(--card-2); color: var(--active); border: 2px dashed var(--accent-2); box-shadow: none; }
.ts-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.amt { text-align: center; padding: 4px 0 4px; }
.amt-cat { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: var(--card-2); border-radius: 99px; padding: 5px 10px 5px 5px; border: 0; min-height: 40px; cursor: pointer; color: var(--text); }
.amt-cat .ico { width: 30px; height: 30px; border-radius: 10px; }
.amt-cat .ico svg { width: 16px; height: 16px; }
.amt-cat > svg { width: 16px; height: 16px; color: var(--muted); }
.amt-num { font-size: clamp(32px, 10vw, 44px); font-weight: 800; letter-spacing: -.02em; margin: 6px 0 0; font-variant-numeric: tabular-nums; word-break: break-all; }
.amt-num.expense { color: var(--neg); } .amt-num.income { color: var(--pos); }
.bud { margin: 8px 0 10px; border-radius: 16px; padding: 10px 12px; transition: background .3s; }
.bud.ok { background: var(--pos-bg); } .bud.over { background: var(--neg-bg); }
.bud-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bud-row b { font-size: 14px; } .bud-row small { font-size: 12px; color: var(--muted); }
.bud-bar { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .18); overflow: hidden; margin-top: 6px; }
.bud-bar b { display: block; height: 100%; border-radius: 99px; transition: width .3s, background .3s; }
.bud.ok .bud-bar b { background: var(--pos); } .bud.over .bud-bar b { background: var(--neg); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 0 10px; }
.opt { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 0 12px; min-height: 44px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--text); min-width: 0; }
.opt svg { width: 18px; height: 18px; flex: none; }
.opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt.set { background: var(--tint); border-color: transparent; color: var(--active); }
.opt.open { box-shadow: inset 0 0 0 2px var(--accent-2); }
.panel { background: var(--card-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-bottom: 10px; animation: pgIn .2s ease; }
.panel > b { display: block; margin-bottom: 8px; }
.panel input, .panel select, .inline-add input, .inline-add select { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 16px var(--font); }
.inline-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-add input { flex: 1 1 160px; }
.inline-add select { flex: 0 1 140px; width: auto; }
.inline-add .btn { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 99px; padding: 0 14px; min-height: 38px; font-weight: 600; font-size: 13px; cursor: pointer; }
.chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips button.new { border-style: dashed; color: var(--active); background: none; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colors button.on { border-color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.keys button { border: 0; background: var(--card-2); color: var(--text); border-radius: 16px; min-height: 54px; font-size: 20px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.keys button:active { transform: scale(.97); }
.keys .zero { grid-column: span 2; }
.keys .ok { background: linear-gradient(135deg, #5B3BE6, #8E6CFF); color: #fff; grid-row: span 3; }
.keys .ok svg { width: 28px; height: 28px; }
.keys .del { color: var(--muted); }
.keys .del svg { width: 22px; height: 22px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; }
.mini-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; margin-top: 8px; }
.mini-cal span { font-size: 11px; color: var(--muted); font-weight: 700; }
.mini-cal button { border: 0; background: none; color: var(--text); border-radius: 12px; min-height: 38px; font-weight: 600; cursor: pointer; }
.mini-cal button.sel { background: var(--accent); color: #fff; }
.mini-cal button.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.mini-cal button:disabled { opacity: .3; cursor: default; }
@media (min-width: 861px) { .keys button { min-height: 48px; } }

/* ---------- Transaksi: Grafik | Kalender | Kategori ---------- */
.sum3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.sum3 span { font-size: 12px; color: var(--muted); display: block; }
.sum3 b { font-size: 16px; white-space: nowrap; }
.sum-note { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.modes { position: sticky; top: 0; z-index: 6; display: flex; gap: 8px; padding: 4px 0; }
@media (max-width: 860px) { .modes { top: calc(62px + env(safe-area-inset-top)); } }
.modes button { flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 14px; min-height: 44px; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: all .2s; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.modes button svg { width: 18px; height: 18px; }
.modes button.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow); }
.mode-body { display: flex; flex-direction: column; gap: 20px; animation: pgIn .25s ease; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal .h { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal button { border: 0; background: var(--card-2); color: var(--text); border-radius: 12px; min-height: 54px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 700; font-size: 13px; cursor: pointer; min-width: 0; }
.cal button small { font-size: 9.5px; font-weight: 700; line-height: 1.1; max-width: 100%; overflow: hidden; }
.cal button.sel { background: var(--accent); color: #fff; } .cal button.sel small { color: #fff; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.rank-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.rank-head h2, .rank-title h2 { font-size: 16px; }
.rank-head .sub, .rank-title .sub { color: var(--muted); font-size: 13px; margin: 0; }
.rank-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--tint); color: var(--active); border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 13px; min-height: 40px; cursor: pointer; }
.back-btn svg { width: 16px; height: 16px; }
.rank { display: flex; flex-direction: column; gap: 8px; }
.rk { position: relative; border: 0; border-radius: 16px; background: var(--card-2); color: var(--text); min-height: 50px; padding: 0 14px; display: flex; align-items: center; gap: 10px; overflow: hidden; width: 100%; text-align: left; font: inherit; }
button.rk { cursor: pointer; }
.rk em { position: absolute; inset: 0 auto 0 0; border-radius: 16px; opacity: .38; transition: width .5s; }
.rk span, .rk b, .rk small, .rk svg { position: relative; }
.rk span { flex: 1; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk small { font-size: 12px; color: var(--muted); font-weight: 600; }
.rk svg { width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 860px) { #toast { top: calc(12px + env(safe-area-inset-top)) !important; bottom: auto !important; } }

/* ---------- Insight AI infografis ---------- */
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .ai-grid { grid-template-columns: minmax(0, 1fr); } }
.score { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 6px; }
.score-h { font-size: 17px; margin-top: 6px !important; }
.score .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.gauge { width: 132px; height: 132px; position: relative; }
.gauge svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.gauge div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge b { font-size: 34px; line-height: 1; font-weight: 800; }
.gauge small { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip.warn { background: color-mix(in srgb, #F59E0B 18%, transparent); color: #B76E00; }
[data-theme="dark"] .chip.warn { color: #FFD27A; }
.meter { margin-top: 10px; }
.meter-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.meter-bar { height: 8px; border-radius: 99px; background: var(--card-2); margin-top: 4px; overflow: hidden; }
.meter-bar b { display: block; height: 100%; border-radius: 99px; transition: width .6s; }
.ai-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile2 { border-radius: 18px; padding: 12px; background: var(--card); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); min-width: 0; }
.tile2 span { font-size: 12px; color: var(--muted); font-weight: 600; display: block; }
.tile2 b { font-size: 19px; display: block; margin: 2px 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile2 small { font-size: 11.5px; color: var(--muted); }
.find { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.find + .find { border-top: 1px solid var(--line); }
.find .ico { width: 36px; height: 36px; border-radius: 12px; }
.find .ico svg { width: 18px; height: 18px; }
.find p { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; cursor: pointer; }
.todo input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.todo input:checked + span { text-decoration: line-through; color: var(--muted); }

/* ---------- Portofolio infografis ---------- */
.pf-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-top > div > .card + .acls, .pf-top .acls { margin-top: 14px; }
@media (max-width: 860px) { .pf-top { grid-template-columns: minmax(0, 1fr); } }
.pf-big { font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.alloc { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 4px 0 10px; }
.alloc b { display: block; height: 100%; transition: width .5s; }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.alloc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.acls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acl { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 20px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 44px; cursor: pointer; font: inherit; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); min-width: 0; transition: transform .15s; }
.acl:active { transform: scale(.98); }
.acl-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.acl .ico { width: 36px; height: 36px; border-radius: 12px; }
.acl b { font-size: 16px; font-weight: 800; }
.acl .nm { font-size: 12.5px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acl svg.sp { width: 100%; height: 30px; }
.seg button.on { background: var(--card-solid); }
.ns-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ns-thumb { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--card-2); color: var(--muted); }
.ns-thumb.ok { background: var(--pos-bg); color: var(--pos); } .ns-thumb.none { background: var(--neg-bg); color: var(--neg); }
.ns-thumb.wait { animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }
/* duplikat untuk N bulan */
.dup-bar { flex-wrap: wrap; }
.dup-months { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 600; }
.dup-banner .dup-months { margin: 8px 0 2px; }
.dup-chips { gap: 6px; }
.dup-chips button { min-height: 36px; padding: 0 12px; }
.dup-custom { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line); border-radius: 99px; padding: 0 10px; min-height: 36px; font-size: 13px; color: var(--muted); }
.dup-custom.on { border-style: solid; border-color: var(--accent); color: var(--active); }
.dup-custom input { width: 44px; border: 0; background: transparent; color: var(--text); font: 600 15px var(--font); text-align: center; padding: 4px 0; }
#rep-hint { display: block; color: var(--active); font-weight: 600; }
/* Konsultan AI: kartu per aset */
.pf-tabs { margin-bottom: 2px; }
.adv-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.adv-sum .chip:not(.up):not(.down) { background: var(--card-2); color: var(--muted); }
.adv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.adv-card { border: 1px solid var(--line); background: var(--card-2); border-radius: 18px; padding: 12px; min-width: 0; }
.adv-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.adv-name { min-width: 0; }
.adv-name b { font-size: 15.5px; }
.adv-name small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adv-price { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.adv-price b { font-size: 16px; font-variant-numeric: tabular-nums; }
.adv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.adv-tags .chip:not(.up):not(.down) { background: var(--bg2); color: var(--text); }
.rsi-bar { position: relative; height: 6px; border-radius: 99px; margin: 10px 2px 2px; background: linear-gradient(90deg, var(--pos) 0 30%, color-mix(in srgb, var(--muted) 35%, transparent) 30% 70%, var(--neg) 70% 100%); opacity: .8; }
.rsi-bar i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--card-solid); border: 3px solid var(--accent); transform: translate(-50%, -50%); }
.adv-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.adv-kv div { background: var(--bg2); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.adv-kv span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.adv-kv b { font-size: 13px; white-space: nowrap; }
.adv-edit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; }
.adv-edit svg { width: 15px; height: 15px; }
.tbl th:first-child, .tbl td:first-child { background: var(--card-solid); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* sinyal Strong Buy … Strong Sell */
.sig { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.sig-sb { background: #0F9D6B; color: #fff; }
.sig-b { background: var(--pos-bg); color: var(--pos); }
.sig-h { background: color-mix(in srgb, #F59E0B 18%, transparent); color: #B76E00; }
[data-theme="dark"] .sig-h { color: #FFD27A; }
.sig-s { background: var(--neg-bg); color: var(--neg); }
.sig-ss { background: #D33A5C; color: #fff; }
.sig-n { background: var(--card-2); color: var(--muted); }
.adv-sum { gap: 6px; }
.adv-card[data-act] { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.adv-card[data-act]:hover { box-shadow: 0 0 0 2px var(--accent-2); }
.adv-card[data-act]:active { transform: scale(.99); }
.adv-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.adv-sigrow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.adv-open { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--active); }
.adv-open svg { width: 14px; height: 14px; }
.sig-head { display: flex; align-items: center; gap: 12px; }
.sig-head .sig { font-size: 15px; padding: 8px 14px; }
.sig-head b { font-size: 20px; display: block; }
.sig-head small { color: var(--muted); font-size: 12.5px; }
.why { display: flex; flex-direction: column; gap: 6px; }
.why-row { display: flex; gap: 10px; align-items: flex-start; background: var(--card-2); border-radius: 12px; padding: 8px 10px; font-size: 13.5px; }
.why-row small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.why-v { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; background: var(--bg2); }
.modal .adv-kv div { background: var(--card-2); }
/* ---------- Dashboard dividen ---------- */
.dvhero { border-radius: 26px; padding: 18px 18px 14px; color: #fff; background: linear-gradient(135deg, #0F9D6B 0%, #22B884 55%, #7BDDB5 100%); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.dvhero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .13); pointer-events: none; }
.dvhero > * { position: relative; z-index: 1; }
.dvhero small { opacity: .9; font-size: 12.5px; font-weight: 600; }
.dvhero .gchip { background: rgba(0, 60, 40, .28); }
.dvhero .gchip.g-up { color: #D6FFEC; }
.dv-note { margin: 0; font-size: 12px; opacity: .88; }
.dv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .dv-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.tgt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.dring { width: 104px; height: 104px; position: relative; flex: none; }
.dring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.dring div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dring b { font-size: 24px; font-weight: 800; line-height: 1; }
.dring small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tgt-in { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.tgt-in input { width: 130px; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); padding: 0 10px; font: 700 15px var(--font); }
.evs { display: flex; flex-direction: column; gap: 8px; }
.ev { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--card-2); border-radius: 16px; padding: 10px 12px; }
.ev.soon { box-shadow: inset 0 0 0 2px #F59E0B; }
.ev-date { width: 46px; text-align: center; border-radius: 12px; background: var(--tint); color: var(--active); padding: 6px 0; line-height: 1.1; }
.ev-date b { display: block; font-size: 18px; } .ev-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.ev-body { min-width: 0; } .ev-body b { font-size: 14.5px; } .ev-body p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ev-amt { text-align: right; font-weight: 800; font-size: 14px; color: var(--pos); white-space: nowrap; }
.ev-amt small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.dv-warn { display: flex; gap: 10px; align-items: flex-start; border-radius: 16px; padding: 10px 12px; background: color-mix(in srgb, #F59E0B 16%, transparent); font-size: 13px; margin-top: 12px; }
.dv-warn svg { width: 20px; height: 20px; color: #B76E00; flex: none; }
.drip-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drip-f label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
.drip-f input { width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); padding: 0 10px; font: 600 16px var(--font); }
.drip-f input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.drip-out { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.drip-out div { background: var(--card-2); border-radius: 14px; padding: 10px; min-width: 0; }
.drip-out span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; } .drip-out b { font-size: 16px; }
