/* ===== Keuangan Keluarga — glass ala Apple, tanpa ungu ===== */
:root {
  --bg: #eef2f7; --text: #1d1d1f; --muted: #6e6e73;
  --line: rgba(60, 60, 67, .14); --line-s: rgba(60, 60, 67, .26);
  --glass: rgba(255, 255, 255, .62); --glass-s: rgba(255, 255, 255, .86); --gb: rgba(255, 255, 255, .72);
  --th: rgba(238, 242, 248, .9); --input: rgba(255, 255, 255, .8); --seg-on: #fff;
  --blue: #0a84ff; --green: #1f8a3d; --red: #d70015; --orange: #b45309;
  --green-b: #34c759; --red-b: #ff3b30; --orange-b: #ff9f0a;
  --shadow: 0 10px 30px rgba(20, 30, 60, .08);
  --smoke: rgba(110, 155, 215, .55);
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="terang"]) {
    --bg: #0b0c0f; --text: #f5f5f7; --muted: #9a9aa2;
    --line: rgba(255, 255, 255, .11); --line-s: rgba(255, 255, 255, .2);
    --glass: rgba(30, 32, 38, .6); --glass-s: rgba(34, 36, 44, .9); --gb: rgba(255, 255, 255, .1);
    --th: rgba(255, 255, 255, .06); --input: rgba(255, 255, 255, .07); --seg-on: rgba(255, 255, 255, .16);
    --green: #30d158; --red: #ff6961; --orange: #ffb340;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --smoke: rgba(90, 140, 210, .45);
    color-scheme: dark;
  }
}
:root[data-tema="gelap"] {
  --bg: #0b0c0f; --text: #f5f5f7; --muted: #9a9aa2;
  --line: rgba(255, 255, 255, .11); --line-s: rgba(255, 255, 255, .2);
  --glass: rgba(30, 32, 38, .6); --glass-s: rgba(34, 36, 44, .9); --gb: rgba(255, 255, 255, .1);
  --th: rgba(255, 255, 255, .06); --input: rgba(255, 255, 255, .07); --seg-on: rgba(255, 255, 255, .16);
  --green: #30d158; --red: #ff6961; --orange: #ffb340;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --smoke: rgba(90, 140, 210, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background-color: var(--bg);
  background-image: radial-gradient(1200px 700px at 12% -10%, rgba(10, 132, 255, .10), transparent 60%), radial-gradient(900px 600px at 100% 8%, rgba(48, 176, 199, .10), transparent 55%);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
#smoke { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#root { position: relative; z-index: 1; }
h1, h2, h3 { margin: 0; }
a { color: var(--blue); }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.block { display: block; }
.center { text-align: center; }
.hide { display: none !important; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.ic { flex: none; vertical-align: middle; }

/* ===== Kaca ===== */
.glass, .glass-strong { border: 1px solid var(--gb); border-radius: var(--r); }
.glass { background: var(--glass); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); }
.glass-strong { background: var(--glass-s); box-shadow: 0 30px 80px rgba(10, 20, 40, .28); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.card { padding: 18px; margin-bottom: 16px; }
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* ===== Tata letak ===== */
.side { position: fixed; top: 14px; left: 14px; bottom: 14px; width: 244px; z-index: 20; display: flex; flex-direction: column; padding: 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--blue); }
.brand b { display: block; color: var(--text); font-size: 15px; }
.brand small { color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow: auto; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s, transform .15s; }
.nav-i:hover { background: rgba(10, 132, 255, .09); }
.nav-i:active { transform: scale(.98); }
.nav-i.on { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(10, 132, 255, .32); }
.side-f { display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 2px; border-top: 1px solid var(--line); }
.side-f small { color: var(--muted); word-break: break-all; }
.main { margin-left: 270px; padding: 14px 26px 48px; }
.view { max-width: 1180px; }
.top { position: sticky; top: 12px; z-index: 30; display: flex; justify-content: flex-end; align-items: center; padding: 8px 12px; border-radius: 18px; margin-bottom: 14px; }
.top-brand { display: none; align-items: center; gap: 8px; color: var(--blue); margin-right: auto; }
.top-brand b { color: var(--text); }
.top-r { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bdot { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red-b); color: #fff; font: 700 10px/16px -apple-system, sans-serif; font-style: normal; text-align: center; display: none; }
.bdot.on { display: block; }
.bottom { display: none; }
.pv { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 3000; padding: 6px 14px; border-radius: 99px; background: var(--orange-b); color: #1d1d1f; font: 700 12px/1.2 -apple-system, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }

.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 2px 16px; }
.ph h1 { font-size: 28px; letter-spacing: -.02em; }
.ph.sm { margin: 22px 2px 10px; }
.sub { margin: 2px 0 0; color: var(--muted); }
.ph-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-act input[type=month] { width: auto; }
h2.sec { margin: 22px 2px 10px; font-size: 18px; }

.grid { display: grid; gap: 14px; margin-bottom: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.two > .card, .two > .kpi { margin-bottom: 0; }
.grid > .smoke-in:nth-child(2) { animation-delay: .06s; }
.grid > .smoke-in:nth-child(3) { animation-delay: .12s; }
.grid > .smoke-in:nth-child(4) { animation-delay: .18s; }
.grid > .smoke-in:nth-child(5) { animation-delay: .24s; }
.grid > .smoke-in:nth-child(6) { animation-delay: .3s; }

.kpi { padding: 16px 18px; }
.kpi.wide { margin-bottom: 16px; }
.kpi-h { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-ic.blue { background: var(--blue); } .kpi-ic.green { background: var(--green-b); }
.kpi-ic.red { background: var(--red-b); } .kpi-ic.orange { background: var(--orange-b); }
.kpi-v { font-size: 26px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ===== Tombol & input ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; min-height: 40px; border-radius: 12px; border: 1px solid var(--line-s); background: var(--glass-s); color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 30, 60, .12); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, #3aa0ff, var(--blue)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(10, 132, 255, .35); }
.btn-danger { background: var(--red-b); border-color: transparent; color: #fff; }
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.ic-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; font-size: 20px; transition: background .2s, color .2s; }
.ic-btn:hover { background: rgba(10, 132, 255, .12); color: var(--blue); }
.ic-btn.dng:hover { background: rgba(255, 59, 48, .14); color: var(--red-b); }

input, select, textarea { font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--line-s); border-radius: 12px; padding: 10px 12px; min-height: 42px; width: 100%; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10, 132, 255, .2); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input[type=color] { padding: 3px; height: 42px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fld.grow { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.seg, .tabs { display: flex; background: var(--th); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.tabs { display: inline-flex; margin-bottom: 14px; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .tabs button { display: block; text-align: center; padding: 9px 12px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border: 0; background: none; transition: background .25s, color .25s, box-shadow .25s; }
.seg input:checked + span, .tabs button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); }
.seg.sm span { font-size: 12.5px; padding: 7px 8px; }
.note { padding: 10px 12px; border-radius: 12px; background: rgba(10, 132, 255, .1); margin: 0 0 12px; font-size: 13.5px; }
.note.okk { background: rgba(52, 199, 89, .15); }
.note-s { font-size: 12.5px; margin: 10px 2px; }
.konf { margin: 0; line-height: 1.55; }
.err { color: var(--red); min-height: 20px; font-size: 13px; margin: 4px 0 2px; }

.bd { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(120, 120, 128, .15); color: var(--muted); white-space: nowrap; }
.bd.ok { background: rgba(52, 199, 89, .17); color: var(--green); }
.bd.warn { background: rgba(255, 159, 10, .2); color: var(--orange); }
.bd.bad { background: rgba(255, 59, 48, .15); color: var(--red); }
.bd.info { background: rgba(10, 132, 255, .14); color: var(--blue); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.g { background: var(--green-b); } .dot.r { background: var(--red-b); }

.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--blue); transform-origin: left; animation: fillbar .9s cubic-bezier(.2, .7, .2, 1) both; }
.bar.o i { background: var(--orange-b); } .bar.r i { background: var(--red-b); }

/* ===== Tabel berbingkai (desktop) ===== */
.tblwrap { overflow-x: auto; border: 1px solid var(--line-s); border-radius: 16px; background: var(--glass-s); margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl thead th { background: var(--th); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tbl tfoot td { background: var(--th); }
.tbl tr > *:first-child { border-left: 0; } .tbl tr > *:last-child { border-right: 0; }
.tbl thead tr:first-child > * { border-top: 0; } .tbl tbody tr:last-child > *, .tbl tfoot tr > * { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(10, 132, 255, .05); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.off { opacity: .55; }
.tbl .aksi { white-space: nowrap; text-align: right; }
.tbl small.block { margin-top: 2px; }
.sumbar { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 600; font-size: 13.5px; margin: 4px 2px 10px; color: var(--muted); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 14px; }
.filters .fld { margin: 0; min-width: 150px; } .filters .grow { min-width: 200px; }

/* ===== Daftar ===== */
.list { list-style: none; margin: 0; padding: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list > li:last-child > .li, .list > .li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; border-radius: 12px; padding: 10px 8px; transition: background .2s; }
.li.click:hover { background: rgba(10, 132, 255, .07); }
.li-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(10, 132, 255, .12); color: var(--blue); flex: none; }
.li-ic.g { background: rgba(52, 199, 89, .16); color: var(--green); } .li-ic.r { background: rgba(255, 59, 48, .14); color: var(--red); }
.li-m { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li-m b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-m small { color: var(--muted); }
.li-r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
.lam-list { margin-top: 6px; }
.lam-list .li { padding: 8px 4px; } .lam-list .li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty.small { padding: 18px; }

/* ===== Grafik ===== */
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .lbl, .donut .lbl { fill: var(--muted); font-size: 12px; }
.bar-in, .bar-out { transform-box: fill-box; transform-origin: bottom; animation: grow .8s cubic-bezier(.2, .7, .2, 1) both; }
.bar-in { fill: var(--green-b); } .bar-out { fill: var(--red-b); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 180px; flex: none; }
.donut .dtot { font-size: 15px; font-weight: 700; fill: var(--text); }
.arc { animation: fadein .9s both; }
.legend-l { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: grid; gap: 7px; font-size: 13.5px; }
.legend-l li { display: flex; align-items: center; gap: 8px; } .legend-l b { margin-left: auto; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Kartu kredit ===== */
.kartu-list { display: grid; gap: 16px; margin-bottom: 8px; }
.kartu-blok { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; padding: 18px; }
.kartu-blok.off { opacity: .62; }
.cc { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; color: #fff; min-height: 196px; background: linear-gradient(135deg, #2c313d, #12141a 72%); box-shadow: 0 18px 40px rgba(10, 20, 40, .3); }
.cc::before { content: ""; position: absolute; top: -40%; right: -20%; width: 270px; height: 270px; border-radius: 50%; background: radial-gradient(circle, rgba(10, 132, 255, .55), transparent 65%); }
.cc > *:not(.cc-smoke) { position: relative; }
.cc-smoke { position: absolute; inset: 0; background: radial-gradient(circle at 20% 115%, rgba(255, 255, 255, .26), transparent 55%), radial-gradient(circle at 85% 90%, rgba(150, 190, 255, .2), transparent 50%); animation: drift 9s ease-in-out infinite alternate; pointer-events: none; }
.cc-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.cc-top span { opacity: .75; font-size: 13px; }
.cc-no { font-size: 19px; letter-spacing: .14em; margin: 26px 0 18px; font-variant-numeric: tabular-nums; }
.cc-row { display: flex; justify-content: space-between; gap: 12px; }
.cc-row small { display: block; color: rgba(255, 255, 255, .65); }
.cc .bar { background: rgba(255, 255, 255, .22); margin-top: 14px; } .cc .bar i { background: #fff; }
.cc .bar.o i { background: #ffb340; } .cc .bar.r i { background: #ff6961; }
.cc-pct { opacity: .72; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 12px; }
.stat small { display: block; color: var(--muted); }
.stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.aksi-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

/* ===== Modal ===== */
.ov { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 20, 30, .34); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fadein .25s both; }
.ov.out { animation: fadeout .26s both; }
.ov.out .sheet { animation: smokeOut .26s both; }
.sheet { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { font-size: 17px; }
.sheet-b { padding: 18px 22px; overflow: auto; }
.sheet-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-i { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px; background: var(--th); color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 600; text-align: center; }
.more-i svg { color: var(--blue); }

/* ===== Toast, puff, login, skeleton ===== */
#toasts { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { width: 100%; padding: 12px 16px; border-radius: 16px; background: var(--glass-s); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--gb); box-shadow: 0 12px 30px rgba(10, 20, 40, .22); font-weight: 600; font-size: 14px; }
.toast.ok { border-left: 4px solid var(--green-b); } .toast.err { border-left: 4px solid var(--red-b); }
.toast.out { animation: smokeOut .6s both; }
.puff { position: fixed; z-index: 99999; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .9), var(--smoke) 45%, transparent 70%); filter: blur(6px); animation: puff 1s ease-out both; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); padding: 32px 28px; border-radius: 30px; text-align: center; }
.login-card .fld { text-align: left; }
.login-card h1 { font-size: 26px; letter-spacing: -.02em; }
.login-card .sub { margin-bottom: 20px; }
.login-brand { width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #46a6ff, var(--blue)); box-shadow: 0 12px 30px rgba(10, 132, 255, .4); }
.sk { border-radius: 10px; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%), var(--line); background-size: 200% 100%; animation: mist 1.4s linear infinite; }
.sk.h1 { height: 14px; width: 50%; } .sk.h2 { height: 28px; width: 80%; margin-top: 12px; } .sk.h3 { height: 220px; }

/* ===== Animasi smoke ===== */
.smoke-in { animation: smokeIn .7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes smokeIn { 0% { opacity: 0; filter: blur(16px); transform: translateY(14px) scale(.985); } 60% { opacity: .92; filter: blur(3px); } 100% { opacity: 1; filter: blur(0); transform: none; } }
@keyframes smokeOut { to { opacity: 0; filter: blur(14px); transform: translateY(-16px) scale(1.03); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes puff { 0% { opacity: .9; transform: translate(0, 0) scale(.3); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.9); } }
@keyframes mist { to { background-position: -200% 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes fillbar { from { transform: scaleX(0); } }
@keyframes drift { from { transform: translate(-3%, 2%) scale(1); } to { transform: translate(3%, -3%) scale(1.08); } }
body.smoke-lite .smoke-in { animation-duration: .4s; }
body.smoke-off #smoke { display: none; }
body.smoke-off .smoke-in, body.smoke-off .cc-smoke, body.smoke-off .bar-in, body.smoke-off .bar-out, body.smoke-off .arc, body.smoke-off .bar i { animation: none; }
body.smoke-off .toast.out { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== Responsif ===== */
@media (max-width: 900px) {
  .side { display: none; }
  .main { margin-left: 0; padding: calc(10px + env(safe-area-inset-top)) 14px 130px; }
  .top { top: calc(8px + env(safe-area-inset-top)); }
  .top-brand { display: flex; } .top-add { display: none; }
  .ph h1 { font-size: 24px; }
  .bottom { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; justify-content: space-around; padding: 8px 6px; border-radius: 28px; }
  .bn-i { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; padding: 6px 8px; border: 0; background: none; border-radius: 16px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; transition: color .2s, background .2s; }
  .bn-i.on { color: var(--blue); background: rgba(10, 132, 255, .12); }
  .fab { width: 56px; height: 56px; margin-top: -30px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; cursor: pointer; background: linear-gradient(180deg, #3aa0ff, var(--blue)); box-shadow: 0 10px 24px rgba(10, 132, 255, .5), 0 0 0 5px var(--glass-s); transition: transform .15s; }
  .fab:active { transform: scale(.92); }
  input, select, textarea { font-size: 16px; }
  .kartu-blok { grid-template-columns: 1fr; }
  .ov { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; }
}
@media (max-width: 760px) {
  .tblwrap { border: 0; background: none; overflow: visible; }
  .tbl, .tbl tbody, .tbl tfoot, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--line-s); border-radius: 16px; background: var(--glass-s); }
  .tbl tr:hover { background: var(--glass-s); }
  .tbl td { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 14px; border: 0 !important; padding: 5px 0; text-align: right; }
  .tbl td::before { content: attr(data-l); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; }
  .tbl td[data-l=""]::before { display: none; }
  .tbl td.aksi { justify-content: flex-end; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line) !important; }
  .tbl td .bar { min-width: 120px; flex: 1; }
}
@media (max-width: 560px) {
  .kpis, .kpis-2 { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 14px; } .kpi-v { font-size: 19px; }
  .row2 { grid-template-columns: 1fr; }
  .filters .fld { min-width: 100%; }
  .filters .btn { width: 100%; }
}

/* ===== Cetak / simpan PDF ===== */
@media print {
  #smoke, .side, .top, .bottom, .pv, .ph-act, .aksi, #toasts, .ov { display: none !important; }
  body { background: #fff; color: #000; }
  .main { margin: 0; padding: 0; }
  .glass, .tblwrap { box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .smoke-in { animation: none; }
}

/* ===== Penyempurnaan ===== */
.pv-on .main { padding-top: 44px; }
.pv-on .top { top: 44px; }
.pv-on .login { padding-top: 44px; }
.kpis6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
@media (min-width: 700px) { .kpis6 { grid-template-columns: repeat(3, 1fr); } }
.card small.muted { display: block; margin: -2px 0 12px; }
@media (max-width: 900px) {
  .pv-on .main { padding-top: calc(46px + env(safe-area-inset-top)); }
  .pv-on .top { top: calc(44px + env(safe-area-inset-top)); }
  .pv { top: calc(6px + env(safe-area-inset-top)); }
}
@media (max-width: 560px) {
  .kpis6 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .filters { gap: 8px 12px; }
  .filters .fld { min-width: calc(50% - 6px); flex: 1; }
  .filters .grow { min-width: 100%; }
  .donut { width: 150px; }
}

/* ===== Talangan teman & portal ===== */
.card.off { opacity: .6; }
.tm-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 18px; margin-bottom: 8px; }
.tm-h h3 { margin: 0 0 2px; }
.tm-s { display: flex; gap: 22px; }
.tm-s small { display: block; color: var(--muted); font-size: 12px; }
.tm-s b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bln-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 14px; }
.bln-nav b { min-width: 150px; text-align: center; font-size: 16px; }
.bln-nav .ic-btn { font-size: 22px; line-height: 1; }
.tab-card + .tab-card { margin-top: 14px; }
section.card + section.card { margin-top: 14px; }
.pt-wrap { max-width: 760px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 16px 48px; }
.pt-h { text-align: center; margin-bottom: 18px; }
.pt-h h1 { font-size: 26px; margin: 8px 0 2px; }
.pt-brand { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; color: #fff; background: linear-gradient(180deg, #3aa0ff, var(--blue)); box-shadow: 0 10px 24px rgba(10, 132, 255, .35); }
.pt-item { margin-bottom: 14px; }
.pt-item h3 { margin: 0; }
.pt-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 14px; margin-top: 8px; }
.pt-row span { color: var(--muted); }
.pt-item details { margin-top: 10px; font-size: 13.5px; }
.pt-item summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.pt-item ul { list-style: none; margin: 8px 0 0; padding: 0; }
.pt-item li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 560px) { .tm-s { gap: 16px; } .tm-s b { font-size: 15px; } }

/* ===== Rekap tagihan (matriks kartu x bulan) ===== */
.mtxwrap { overflow-x: auto; border-radius: 16px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
.mtxwrap.glass { border: 1px solid var(--line-s); }
.mtx { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mtx th, .mtx td { padding: 9px 12px; border-bottom: 1px solid var(--line-s); white-space: nowrap; text-align: right; }
.mtx thead th { background: var(--th); font-size: 12.5px; color: var(--muted); position: sticky; top: 0; }
.mtx tbody th { text-align: left; font-weight: 500; position: sticky; left: 0; z-index: 1; background: var(--glass-s); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); min-width: 150px; }
.mtx tbody th small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.mtx thead th:first-child { text-align: left; position: sticky; left: 0; z-index: 2; }
.mtx .cur { background: rgba(10, 132, 255, .08); }
.mtx tr.tot th, .mtx tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
.mtx tr.neg td { color: var(--red); font-weight: 600; }
.mtx .cell { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.mtx .cell:hover { background: rgba(10, 132, 255, .14); color: var(--blue); }
.mtx-h { margin: 16px 2px 8px; font-size: 15px; }
.ph.sm { align-items: flex-end; margin-top: 22px; }
.ph.sm .sec { margin: 0; }

/* ===== Versioning ===== */
.side-f .ver, .ver-login { color: var(--muted); font-size: 11.5px; }
.ver-login { display: block; margin-top: 16px; }
.upd { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; max-width: calc(100vw - 24px); }
@media (max-width: 900px) { .upd { bottom: calc(100px + env(safe-area-inset-bottom)); } }
details.riwayat { margin-top: 12px; font-size: 14px; }
details.riwayat summary { cursor: pointer; color: var(--blue); font-weight: 600; }
details.riwayat .rv { margin-top: 10px; }
details.riwayat ul { margin: 4px 0 0; padding-left: 20px; color: var(--muted); }
