/* ============ Dagangin — gaya tampilan ============ */
:root {
  --bg: #F7F8FC;
  --surface: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;
  --line: #E8EBF3;
  --brand-1: #0D9488;
  --brand-2: #2563EB;
  --brand-grad: linear-gradient(135deg, #0FB5A6 0%, #0D9488 45%, #2563EB 100%);
  --teal: #0FB5A6;
  --in: #0EA57A;
  --in-soft: #E3F8F0;
  --out: #E5484D;
  --out-soft: #FDECEC;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 30px rgba(13, 148, 136, .12);
  --radius: 20px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
html { overflow-x: clip; }
body { min-height: 100dvh; overflow-x: hidden; font-size: 15px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
h1, h2, h3, p { margin: 0; }
h3 { font-size: 15px; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 11px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

.bg-orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .35; z-index: 0; pointer-events: none; }
.orb-1 { width: 260px; height: 260px; background: #A7F3D0; top: -80px; right: 0; transform: translateX(30%); }
.orb-2 { width: 220px; height: 220px; background: #BFF3EC; bottom: 120px; left: -100px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

/* ---------- Tombol ---------- */
.btn-primary {
  width: 100%; height: 54px; border-radius: 16px; color: #fff; font-weight: 700; font-size: 16px;
  background: var(--brand-grad); box-shadow: 0 10px 24px rgba(13, 148, 136, .32);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, opacity .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary[disabled] { opacity: .7; pointer-events: none; }
.btn-ghost, .btn-danger, .btn-danger-ghost {
  width: 100%; height: 50px; border-radius: 14px; font-weight: 600;
  transition: transform .15s ease;
}
.btn-ghost { background: #E6FAF7; color: #0F766E; }
.btn-danger { background: var(--out); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--out); margin: 8px 0 6px; }
.btn-ghost:active, .btn-danger:active { transform: scale(.98); }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn.round { border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
.link-btn { color: var(--brand-1); font-weight: 600; font-size: 13px; padding: 6px 2px; }
.dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #F59E0B; border: 2px solid #fff; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Masuk ---------- */
.login { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; border-radius: 28px; padding: 28px 22px; text-align: center; animation: rise .5s ease both; }
.login-card h1 { font-size: 24px; font-weight: 800; margin-top: 12px; letter-spacing: -.02em; }
.login-card form { text-align: left; margin-top: 22px; display: grid; gap: 6px; }
.login-card .btn-primary { margin-top: 12px; }
.logo-mark img { width: 72px; height: 72px; border-radius: 22px; box-shadow: var(--shadow-md); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 48px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* ---------- Isian ---------- */
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.input, .login input, select {
  width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; outline: none; transition: border-color .2s, box-shadow .2s; font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.input:focus, .login input:focus, select:focus { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(13, 148, 136, .12); }
.form-error { color: var(--out); font-size: 13px; min-height: 0; margin-top: 4px; }
.form-error:empty { display: none; }
.invalid { border-color: var(--out) !important; box-shadow: 0 0 0 4px rgba(229, 72, 77, .1) !important; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 90px; height: 46px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; transition: all .2s; }
.seg button.active { border-color: transparent; background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(13,148,136,.25); }

/* ---------- Kerangka aplikasi ---------- */
#app { position: relative; z-index: 1; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + var(--safe-t)) 20px 10px; background: linear-gradient(var(--bg) 70%, rgba(247,248,252,0));
}
.topbar h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
main { padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 560px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Chip filter ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--surface); color: var(--ink-2);
  font-weight: 600; font-size: 14px; border: 1px solid var(--line); transition: all .2s;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.outline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.custom-range { display: flex; align-items: center; gap: 8px; margin: -2px 0 12px; }
.custom-range input { flex: 1; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 10px; font-size: 14px; min-width: 0; }

/* ---------- Kartu saldo ---------- */
.hero-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 18px; color: #fff;
  background: var(--brand-grad); box-shadow: 0 16px 40px rgba(13, 148, 136, .32);
}
.hero-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%);
}
.hero-label { font-size: 13px; opacity: .85; font-weight: 500; }
.hero-amount { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 16px; font-variant-numeric: tabular-nums; word-break: break-all; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-split > div { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); min-width: 0; }
.hero-split .small { opacity: .85; font-size: 12px; }
.hero-split .strong { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; background: #fff; }
.pill.in { color: var(--in); } .pill.out { color: var(--out); }

/* ---------- Insight ---------- */
.insight-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin: 14px 0 4px; }
.insight { border-radius: 18px; padding: 14px; background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); min-width: 0; }
.insight.wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.insight .ico { font-size: 20px; }
.insight .label { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.insight.wide .label { margin-top: 0; }
.insight.wide .val { white-space: normal; }
.insight .val { font-weight: 700; font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.good { background: var(--in-soft); color: var(--in); }
.badge.bad { background: var(--out-soft); color: var(--out); }
.badge.flat { background: #F1F5F9; color: var(--ink-2); }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 8px; }

/* ---------- Daftar transaksi ---------- */
.tx-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.tx-group-title { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 14px 4px 2px; }
.tx {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); width: 100%; text-align: left; transition: transform .15s, box-shadow .2s;
  animation: fadeUp .3s ease both;
}
.tx:active { transform: scale(.985); }
.tx .cat-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: #ECFDF9; }
.tx.in .cat-ico { background: var(--in-soft); }
.tx .body { flex: 1; min-width: 0; }
.tx .title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .sub { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx.in .amt { color: var(--in); } .tx.out .amt { color: var(--ink); }
.tx.pending { opacity: .75; border-style: dashed; }
.tag-pending { font-size: 10px; font-weight: 700; color: #B45309; background: #FEF3C7; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

/* ---------- Kosong & loading ---------- */
.empty { text-align: center; padding: 34px 20px; border-radius: 20px; border: 1.5px dashed var(--line); background: rgba(255,255,255,.6); }
.empty .art { font-size: 40px; }
.empty h4 { margin: 8px 0 4px; font-size: 15px; }
.empty p { color: var(--ink-2); font-size: 13px; }
.empty .btn-ghost { margin-top: 14px; width: auto; padding: 0 20px; height: 44px; }
.skeleton { height: 68px; border-radius: 18px; background: linear-gradient(90deg, #EEF1F7 25%, #F7F8FC 50%, #EEF1F7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Riwayat ---------- */
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; border-radius: 16px; color: var(--ink-3); margin-bottom: 10px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--ink); min-width: 0; }
.filter-row.two { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.filter-row.two select { height: 40px; border-radius: 999px; font-size: 14px; }
#riwayatRingkas { margin: 4px 4px 2px; }

/* ---------- Kartu & grafik ---------- */
.card { border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; margin-bottom: 10px; }
#view-akun .card .seg { margin-top: 10px; }

.chart-donut { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; }
.chart-donut svg { width: 140px; height: 140px; }
.donut-center { font-weight: 800; font-size: 13px; }
.cat-legend { display: grid; gap: 8px; min-width: 0; }
.cat-legend .row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.cat-legend .row i { width: 10px; height: 10px; border-radius: 3px; }
.cat-legend .row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-legend .row b { font-variant-numeric: tabular-nums; font-size: 12px; }
.chart-bars svg { width: 100%; height: 180px; display: block; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg.in { background: var(--in); } .lg.out { background: #2563EB; }
.hbar { margin: 10px 0; }
.hbar .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.hbar .top b { font-variant-numeric: tabular-nums; }
.hbar .track { height: 12px; border-radius: 999px; background: #F1F4F9; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.fill.in { background: linear-gradient(90deg, #10B981, #0FB5A6); }
.fill.out { background: var(--brand-grad); }
.fill.prev { background: #CBD5E1; }
.chart-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 24px 0; }

/* ---------- Navigasi bawah ---------- */
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 30; height: var(--nav-h);
  border-radius: 24px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; max-width: 536px; margin: 0 auto;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .10);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); height: 100%; justify-content: center; transition: color .2s; }
.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.nav-item.active { color: var(--brand-1); }
.nav-item.active svg { transform: translateY(-1px); }
.fab {
  justify-self: center; width: 62px; height: 62px; border-radius: 22px; margin-top: -30px; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; box-shadow: 0 12px 26px rgba(13, 148, 136, .45); border: 4px solid #fff; transition: transform .18s;
}
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.fab:active { transform: scale(.92); }

/* ---------- Lembar bawah (bottom sheet) ---------- */
.sheet-backdrop, .dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .32); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sheet-backdrop.show, .dialog-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 8px 18px calc(18px + var(--safe-b)); max-height: 94dvh; overflow-y: auto; max-width: 560px; margin: 0 auto;
  transform: translateY(105%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .9, .25, 1), visibility 0s linear .32s; box-shadow: 0 -10px 40px rgba(15,23,42,.12);
  overscroll-behavior: contain;
}
.sheet.show { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.2, .9, .25, 1), visibility 0s; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: #E2E8F0; margin: 4px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-head h3 { font-size: 18px; }

.jenis-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #F1F4F9; border-radius: 16px; padding: 4px; margin-top: 6px; }
.jenis-toggle button { position: relative; z-index: 1; height: 44px; font-weight: 700; color: var(--ink-2); transition: color .25s; }
.jenis-toggle button.active { color: #fff; }
.jenis-slider { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: linear-gradient(135deg, #F0565B, #E5484D); transition: transform .3s cubic-bezier(.2,.9,.25,1), background .3s; box-shadow: 0 6px 14px rgba(229,72,77,.3); }
.jenis-toggle.in .jenis-slider { transform: translateX(100%); background: linear-gradient(135deg, #10B981, #0FB5A6); box-shadow: 0 6px 14px rgba(16,185,129,.3); }

.amount-wrap { display: flex; align-items: center; gap: 8px; border-radius: 18px; border: 1.5px solid var(--line); padding: 0 16px; height: 68px; transition: border-color .2s, box-shadow .2s; }
.amount-wrap:focus-within { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(13,148,136,.12); }
.amount-wrap span { font-weight: 700; color: var(--ink-3); font-size: 20px; }
.amount-wrap input { flex: 1; border: 0; outline: none; font-size: 30px; font-weight: 800; letter-spacing: -.02em; min-width: 0; background: transparent; font-variant-numeric: tabular-nums; }
.quick-amounts { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.quick-amounts::-webkit-scrollbar { display: none; }
.quick-amounts button { flex: none; height: 34px; padding: 0 12px; border-radius: 10px; background: #ECFDF9; color: #0F766E; font-weight: 600; font-size: 13px; }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 11px; font-weight: 600; color: var(--ink-2); line-height: 1.2; text-align: center; min-height: 76px; transition: all .18s;
}
.cat-grid button .e { font-size: 22px; }
.cat-grid button.active { border-color: var(--brand-1); background: #ECFDF9; color: #0F766E; box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.cat-grid.invalid-grid button { border-color: #F6B7B9; }

.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row-2 > * { min-width: 0; }
input[type="date"] { min-width: 0; max-width: 100%; }
.sheet { overflow-x: hidden; }
#txForm .btn-primary { margin-top: 18px; }
#detailSheet .row-2 { margin-top: 16px; }
.detail-amt { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.detail-amt.in { color: var(--in); }
.detail-rows .kv { font-size: 14px; }
.detail-rows .kv span { color: var(--ink-2); }
.detail-rows .kv strong { text-align: right; max-width: 65%; word-break: break-word; }

/* ---------- Dialog ---------- */
.dialog-backdrop { display: grid; place-items: center; padding: 24px; z-index: 60; }
.dialog { width: 100%; max-width: 360px; background: #fff; border-radius: 24px; padding: 22px; transform: scale(.94); transition: transform .25s; }
.dialog-backdrop.show .dialog { transform: none; }
.dialog h3 { font-size: 18px; margin-bottom: 6px; }
.dialog .row-2 { margin-top: 18px; }

/* ---------- Notifikasi (toast) ---------- */
.toast-wrap { position: fixed; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 80; display: grid; gap: 8px; pointer-events: none; max-width: 520px; margin: 0 auto; }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #0F172A; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px rgba(15,23,42,.25); animation: toastIn .3s cubic-bezier(.2,.9,.25,1) both; pointer-events: auto;
}
.toast.success .ti { background: #10B981; } .toast.error .ti { background: var(--out); } .toast.info .ti { background: #F59E0B; }
.toast .ti { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

@media (min-width: 420px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Foto nota ---------- */
.scan-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 4px; border-radius: 18px; text-align: left;
  background: linear-gradient(135deg, rgba(13,148,136,.08), rgba(168,85,247,.10)); border: 1.5px dashed rgba(124,92,250,.45); transition: transform .15s;
}
.scan-btn:active { transform: scale(.985); }
.scan-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--brand-grad); box-shadow: 0 6px 14px rgba(13,148,136,.3); }
.scan-txt { flex: 1; min-width: 0; display: grid; }
.scan-txt b { font-size: 15px; color: #3B2FB8; }
.scan-txt small, .scan-info small { font-size: 12px; color: var(--ink-2); }
.scan-arrow { font-size: 24px; color: #7C5CFA; }
.scan-status { display: flex; align-items: center; gap: 12px; padding: 10px; margin-top: 4px; border-radius: 18px; background: #F6F7FF; border: 1px solid var(--line); }
.scan-status img { flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #E8EBF3; }
.scan-info { flex: 1; min-width: 0; display: grid; }
.scan-info b { font-size: 14px; }
.scan-status.loading .scan-info b::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -1px; border: 2px solid #C7CEFF; border-top-color: var(--brand-1); border-radius: 50%; animation: spin .7s linear infinite; }
.scan-status.loading { background: linear-gradient(90deg, #F3F5FF 25%, #FBFBFF 50%, #F3F5FF 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.scan-status.ok { background: #EFFBF6; border-color: #BDEBD8; }
.scan-status.fail { background: #FFF5F5; border-color: #F8CACC; }
.autofill { animation: autofill 1.2s ease; }
@keyframes autofill { 0% { box-shadow: 0 0 0 0 rgba(124,92,250,.0); } 25% { box-shadow: 0 0 0 5px rgba(124,92,250,.25); background-color: #F4F1FF; } 100% { box-shadow: 0 0 0 0 rgba(124,92,250,0); } }
.bukti-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-1); font-weight: 600; text-decoration: none; }
.primary-solid { background: var(--brand-grad) !important; color: #fff !important; }

/* ======== Tambahan aplikasi usaha ======== */
.role-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #E6FAF7; color: #0F766E; margin-left: 6px; vertical-align: 2px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.stat .l { font-size: 11px; color: var(--ink-2); }
.stat .v { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stok-grid { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 0; font-size: 14px; }
.stok-grid > div { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.stok-grid .h { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.stok-grid .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: 14px; }
.stok-grid .neg { color: var(--out); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #F1F5F9; color: var(--ink-2); }
.mini-chip.warn { background: #FEF3C7; color: #B45309; }
.mini-chip.bad { background: var(--out-soft); color: var(--out); }
.mini-chip.ok { background: var(--in-soft); color: var(--in); }
.list-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); width: 100%; text-align: left; }
.list-card + .list-card { margin-top: 8px; }
.list-card .body { flex: 1; min-width: 0; }
.list-card .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.list-card .s { font-size: 12px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card .r { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-card .r small { display: block; font-weight: 600; font-size: 11px; color: var(--ink-3); }
.list-card.overdue { border-color: #F8CACC; background: #FFF8F8; }
.ico-box { flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 19px; background: #ECFDF9; }
.seg-tabs { display: flex; background: #EEF2F6; border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg-tabs button { flex: 1; height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.item-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; align-items: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: 8px; transition: border-color .2s, background .2s; }
.item-row.on { border-color: var(--brand-1); background: #F4FDFB; }
.item-row .nm { font-weight: 700; }
.item-row .st { font-size: 12px; color: var(--ink-3); }
.item-row .st.low { color: var(--out); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; background: #EEF2F6; font-size: 22px; font-weight: 700; color: var(--ink); }
.stepper input { width: 58px; height: 40px; text-align: center; border-radius: 12px; border: 1.5px solid var(--line); font-size: 17px; font-weight: 700; padding: 0; }
.harga-wrap { grid-column: 1 / -1; display: none; align-items: center; gap: 8px; }
.item-row.on .harga-wrap { display: flex; }
.harga-wrap label { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.harga-wrap .rp { flex: 1; display: flex; align-items: center; gap: 6px; height: 42px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; }
.harga-wrap .rp span { color: var(--ink-3); font-weight: 600; }
.harga-wrap input { border: 0; outline: none; flex: 1; min-width: 0; font-size: 16px; font-weight: 700; background: transparent; }
.harga-wrap .sub { font-size: 13px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.harga-wrap .warn { color: var(--out); font-size: 12px; font-weight: 600; }
.total-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 16px; background: #0F172A; color: #fff; margin-top: 12px; }
.total-bar b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px rgba(15,23,42,.12); z-index: 5; max-height: 240px; overflow-y: auto; }
.ac-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; font-size: 15px; border-bottom: 1px solid #F1F5F9; }
.ac-list button small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ac-list mark { background: #CCFBF1; color: inherit; border-radius: 3px; }
.hint { font-size: 13px; color: #B45309; background: #FEF3C7; border-radius: 12px; padding: 8px 12px; margin-top: 6px; }
.hint button { color: #0F766E; font-weight: 700; text-decoration: underline; }
.calc { border-radius: 16px; border: 1px solid var(--line); padding: 4px 14px; background: #FAFBFD; }
.calc .kv strong { font-variant-numeric: tabular-nums; }
.calc .kv.total { font-weight: 800; font-size: 16px; }
.calc .kv.minus strong { color: var(--out); }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 6px; }
.menu-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; border-radius: 18px; background: #F7F9FC; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.menu-grid button .e { font-size: 26px; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.laba-pos { color: var(--in); } .laba-neg { color: var(--out); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 4px; border-bottom: 1px solid #F1F5F9; font-variant-numeric: tabular-nums; }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.rank { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 8px; align-items: center; padding: 8px 0; width: 100%; text-align: left; }
.rank .no { font-size: 12px; font-weight: 800; color: var(--ink-3); text-align: center; }
.rank .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.rank .top span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .top b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .track { height: 10px; border-radius: 999px; background: #F1F4F9; overflow: hidden; }
.rank .fill { height: 100%; border-radius: 999px; background: var(--brand-grad); }
.rank .meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 12px; }
.switch input { width: 22px; height: 22px; accent-color: var(--brand-1); }
.fill.mobil { background: linear-gradient(90deg, #0FB5A6, #2563EB); }
.item-row > * { min-width: 0; }
.harga-wrap .rp { min-width: 0; }
.harga-wrap input { width: 100%; }

/* ---------- v2.2: laporan order & muat ulang ---------- */
.lp-toko { margin-top: 10px; }
.lp-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.lp-head .lp-no { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--in-soft); color: var(--in); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.lp-head .lp-nama { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-head b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-meta { font-size: 12px; color: var(--ink-3); margin: 4px 0 6px 30px; }
.lp-tbl td:first-child, .lp-tbl th:first-child { padding-left: 30px; }
.alert-habis { margin-top: 12px; border: 1px solid #FCD34D; background: #FFFBEB; }
.alert-habis h3 { color: #B45309; }

/* ---------- Bantuan (v3) ---------- */
details.bantuan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; overflow: hidden; }
details.bantuan summary { cursor: pointer; padding: 13px 14px; font-weight: 700; list-style: none; position: relative; padding-right: 34px; }
details.bantuan summary::-webkit-details-marker { display: none; }
details.bantuan summary::after { content: '›'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(90deg); color: var(--ink-3); font-size: 18px; transition: transform .2s; }
details.bantuan[open] summary::after { transform: translateY(-50%) rotate(-90deg); }
details.bantuan .bantuan-isi { padding: 0 14px 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
a.btn-primary { display: flex; align-items: center; justify-content: center; }
