:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --ink: #0f172a;
  --ink2: #334155;
  --muted: #64748b;
  --line: #e4ebf1;
  --line2: #eef3f7;
  --primary: #0f766e;
  --primary-h: #0b5e58;
  --primary-soft: #ecfdf5;
  --accent: #10b981;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #e11d48;
  --red-soft: #fff1f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --sb: #071923;
  --sb-ink: #cbd5e1;
  --r: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 4px 16px -8px rgba(15, 23, 42, .08);
}
[data-theme="dark"] {
  --bg: #07111a;
  --surface: #0e1c28;
  --surface2: #132535;
  --ink: #f1f5f9;
  --ink2: #cbd5e1;
  --muted: #8aa0b8;
  --line: #1c3144;
  --line2: #162838;
  --primary: #14b8a6;
  --primary-h: #0d9488;
  --primary-soft: rgba(20, 184, 166, .14);
  --green: #34d399;
  --green-soft: rgba(16, 185, 129, .14);
  --red: #fb7185;
  --red-soft: rgba(244, 63, 94, .14);
  --blue: #60a5fa;
  --blue-soft: rgba(59, 130, 246, .14);
  --amber: #fbbf24;
  --amber-soft: rgba(245, 158, 11, .14);
  --shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Hind Siliguri", system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.blu { color: var(--blue); }
.muted { color: var(--muted); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #be123c; }
@media (min-width: 960px) { .toast { bottom: 26px; } }

/* Buttons & Inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover { background: var(--primary-h); }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.ghost { background: var(--surface); color: var(--ink2); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.danger:hover { filter: brightness(.95); }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.ibtn {
  width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.ibtn:hover { background: var(--surface2); color: var(--ink); }
.ibtn.del:hover { background: var(--red-soft); color: var(--red); }
.ibtn svg { width: 16px; height: 16px; }

label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.field {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.field { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; }
select.field { appearance: auto; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fgrid.r1 { grid-template-columns: 1fr; } }

/* Auth Screen */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 14px;
  background: radial-gradient(circle at 15% 15%, #114c52 0%, #071923 55%, #040d13 100%);
}
.auth-top { width: 100%; max-width: 960px; display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.pill-btn {
  height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #e2e8f0; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.pill-btn:hover { background: rgba(255,255,255,.16); }
.pill-btn svg { width: 15px; height: 15px; }
.auth-card {
  width: 100%; max-width: 960px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  border-radius: 24px; overflow: hidden; background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.65);
}
.auth-hero {
  position: relative; padding: 38px 36px; color: #fff; display: flex; flex-direction: column; gap: 24px;
  background: linear-gradient(155deg, #0d9488 0%, #0b4a52 48%, #071923 100%);
  overflow: hidden;
}
.auth-hero::after {
  content: ""; position: absolute; right: -80px; bottom: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(52,211,153,.32), transparent 70%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; overflow: hidden; box-shadow: 0 6px 16px rgba(15,118,110,.35); }
.brand-ic img { width: 100%; height: 100%; display: block; }
.brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.brand small { display: block; font-size: 11.5px; opacity: .75; }
.auth-hero h1 { margin: 0; font-size: 29px; line-height: 1.28; font-weight: 800; letter-spacing: -.02em; }
.auth-hero p { margin: 8px 0 0; color: rgba(255,255,255,.82); font-size: 14.5px; }
.auth-feats { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.auth-feats li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #ecfdf5; }
.auth-feats svg { width: 18px; height: 18px; color: #6ee7b7; flex: none; }
.auth-body { padding: 36px 34px; display: flex; flex-direction: column; justify-content: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface2); padding: 4px; border-radius: 12px; margin-bottom: 20px; border: 1px solid var(--line); }
.auth-tabs button { height: 38px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.auth-err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.demo-box { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; }
.demo-box small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
@media (max-width: 820px) {
  .auth-card { grid-template-columns: 1fr; max-width: 430px; }
  .auth-hero { padding: 24px 22px; gap: 14px; }
  .auth-hero h1 { font-size: 22px; }
  .auth-feats { display: none; }
  .auth-body { padding: 24px 22px; }
}

/* App Shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--sb); color: var(--sb-ink);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto;
}
.side .brand { padding: 2px 6px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; }
.side .brand b { color: #fff; }
.side-cta { margin-bottom: 14px; height: 42px; font-weight: 700; box-shadow: 0 8px 20px -8px rgba(16,185,129,.7); }
.snav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.snav button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border-radius: 11px; border: 0; background: transparent; color: var(--sb-ink);
  font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
}
.snav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.snav button.on { background: rgba(20,184,166,.16); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.snav button svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-width: 0; }
.av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #10b981, #0f766e); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13.5px; flex: none; }
.me b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: #94a3b8; font-size: 11.5px; }
.side-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-tools button {
  height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
  color: #e2e8f0; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.side-tools button:hover { background: rgba(255,255,255,.1); }
.side-tools svg { width: 15px; height: 15px; }

.topbar { display: none; }
.bnav { display: none; }
.main { min-width: 0; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 24px 28px 64px; }

@media (max-width: 959px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: sticky; top: 0; z-index: 40; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 10px 14px;
  }
  .topbar .brand b { font-size: 15px; }
  .topbar .brand small { display: none; }
  .topbar .brand-ic { width: 32px; height: 32px; border-radius: 9px; }
  .tb-r { display: flex; align-items: center; gap: 6px; }
  .tb-pill {
    height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line);
    background: var(--surface2); color: var(--ink2); font-size: 12.5px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  }
  .tb-pill svg { width: 15px; height: 15px; }
  .wrap { padding: 14px 12px 92px; }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  }
  .bnav button {
    border: 0; background: transparent; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10.5px; font-weight: 600; padding: 4px 2px; cursor: pointer; min-width: 0;
  }
  .bnav button svg { width: 20px; height: 20px; }
  .bnav button.on { color: var(--primary); }
  .bnav button.fab {
    width: 50px; height: 50px; margin: -22px auto 0; border-radius: 16px;
    background: linear-gradient(135deg, #10b981, #0f766e); color: #fff;
    box-shadow: 0 10px 24px -6px rgba(15,118,110,.7);
  }
  .bnav button.fab svg { width: 24px; height: 24px; }
}

/* Header + Month Switcher */
.phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.phead h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.phead p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.mswitch {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px;
}
.mswitch button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--ink2); cursor: pointer; }
.mswitch button:hover { background: var(--surface2); }
.mswitch button svg { width: 16px; height: 16px; }
.mswitch span { font-weight: 700; font-size: 13.5px; padding: 0 8px; white-space: nowrap; }

/* Hero Net Balance Card */
.hero {
  background: linear-gradient(135deg, #071e26 0%, #0b3c44 55%, #0f766e 100%);
  color: #fff; border-radius: 20px; padding: 22px 22px 18px; margin-bottom: 16px;
  box-shadow: 0 14px 36px -14px rgba(7, 30, 38, .65); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(52,211,153,.22), transparent 70%);
  pointer-events: none;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-lbl { font-size: 12.5px; color: #a7d5d0; font-weight: 600; }
.hero-bal { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.hero-chip {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16);
  padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: #d1fae5; white-space: nowrap;
}
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.hero-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; padding: 11px 13px; min-width: 0; }
.hero-stat small { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #b6ded9; }
.hero-stat small svg { width: 14px; height: 14px; }
.hero-stat b { display: block; font-size: 18px; font-weight: 800; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stat.in b { color: #6ee7b7; }
.hero-stat.out b { color: #fda4af; }
@media (max-width: 600px) {
  .hero { padding: 18px 16px 15px; border-radius: 18px; }
  .hero-bal { font-size: 26px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-stats > :last-child { grid-column: 1 / -1; }
  .hero-stat b { font-size: 16px; }
}

/* Wallets Strip */
.wstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 600px) { .wstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.wcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; box-shadow: var(--shadow); cursor: pointer; text-align: left;
  transition: transform .12s, border-color .15s; min-width: 0; position: relative; overflow: hidden;
}
.wcard:hover { transform: translateY(-1px); border-color: var(--primary); }
.wcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--wc, #10b981); }
.wcard-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wcard-name { font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard-type { font-size: 11px; color: var(--muted); background: var(--surface2); padding: 1px 7px; border-radius: 99px; font-weight: 600; flex: none; }
.wcard-bal { font-size: 17px; font-weight: 800; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcard.add {
  border-style: dashed; background: transparent; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-weight: 700; font-size: 13px; min-height: 74px;
}
.wcard.add svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 600px) { .wcard.add { grid-column: 1 / -1; flex-direction: row; min-height: 44px; padding: 10px 14px; } }
.wcard.add::before { display: none; }
.wcard.add:hover { color: var(--primary); border-color: var(--primary); }

/* Cards & Grid */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.grid2 .card { margin-bottom: 0; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line2);
}
.card-h h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h h2 svg { width: 17px; height: 17px; color: var(--primary); }
.card-b { padding: 15px 16px; }
.chip { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface2); color: var(--muted); }

/* Charts */
.chart-wrap { width: 100%; overflow: hidden; }
.bar-svg { width: 100%; height: 195px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.donut-grid { display: grid; grid-template-columns: 156px minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 520px) { .donut-grid { grid-template-columns: 1fr; justify-items: center; } .donut-list { width: 100%; } }
.donut-box { position: relative; width: 156px; height: 156px; }
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 14px; }
.donut-mid small { font-size: 11px; color: var(--muted); font-weight: 600; }
.donut-mid b { font-size: 14px; font-weight: 800; line-height: 1.25; }
.donut-list { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.drow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ddot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dpct { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.damt { font-weight: 700; white-space: nowrap; }

/* Transaction Rows */
.day-h {
  display: flex; justify-content: space-between; align-items: center; padding: 7px 16px;
  background: var(--surface2); border-bottom: 1px solid var(--line2); font-size: 12px; font-weight: 700; color: var(--muted);
}
.tx {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--line2); transition: background .12s;
}
.tx:last-child { border-bottom: 0; }
.tx:hover { background: var(--surface2); }
.tx-ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.tx-ic svg { width: 18px; height: 18px; }
.tx-m { flex: 1; min-width: 0; }
.tx-t { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-s { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
.wtag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--line); color: var(--ink2); }
.tx-r { text-align: right; flex: none; }
.tx-a { font-size: 14.5px; font-weight: 800; white-space: nowrap; }
.tx-acts { display: flex; justify-content: flex-end; gap: 2px; margin-top: 2px; }
@media (max-width: 600px) { .tx { padding: 11px 12px; gap: 10px; } .tx-ic { width: 34px; height: 34px; border-radius: 10px; } }

/* Filters bar */
.fbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line2); background: var(--surface2); }
.fbar .field { height: 36px; font-size: 13.5px; flex: 1 1 130px; min-width: 0; }
.fbar .search { flex: 2 1 180px; }

/* Progress Bars (Budgets & Goals) */
.prog-item { padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.prog-item:last-child { border-bottom: 0; }
.prog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.prog-top b { font-size: 14px; }
.pbar { height: 8px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line2); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--green); transition: width .25s; }
.pbar i.warn { background: var(--amber); }
.pbar i.over { background: var(--red); }
.prog-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; gap: 8px; flex-wrap: wrap; }

/* Debts & Goals cards */
.kpi2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 21px; font-weight: 800; margin-top: 4px; }
.debt-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.debt-row:last-child { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.badge.in { background: var(--green-soft); color: var(--green); }
.badge.out { background: var(--red-soft); color: var(--red); }
.badge.done { background: var(--surface2); color: var(--muted); }

/* Modal / Bottom Sheet */
.mback {
  position: fixed; inset: 0; z-index: 120; background: rgba(2, 10, 18, .62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
}
@media (max-width: 600px) {
  .mback { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 90vh; border-bottom: 0; }
}
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line2); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-h h3 { margin: 0; font-size: 16.5px; font-weight: 800; }
.modal-b { padding: 16px 18px 20px; }
.tseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.tseg button {
  height: 40px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 13.5px; color: var(--ink2); cursor: pointer;
}
.tseg button.on-expense { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.tseg button.on-income { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.tseg button.on-transfer { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.amt-big {
  width: 100%; height: 58px; font-size: 28px; font-weight: 800; text-align: center;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface2); color: var(--ink);
  font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.amt-big:focus { outline: none; border-color: var(--primary); }
.amt-hint { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--primary); min-height: 18px; margin-bottom: 10px; }
.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600;
  color: var(--ink2); cursor: pointer;
}
.cat-pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cat-pill.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.sw-row:last-child { border-bottom: 0; }
.colors { display: flex; gap: 7px; flex-wrap: wrap; }
.cswatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.cswatch.on { border-color: var(--ink); transform: scale(1.1); }

/* Offline & Sync Status Pills + Email Badges */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: opacity .15s;
}
.sync-pill .sdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.sync-pill.ok { background: rgba(16,185,129,.14); color: #10b981; border-color: rgba(16,185,129,.25); }
.sync-pill.off { background: rgba(245,158,11,.16); color: #f59e0b; border-color: rgba(245,158,11,.35); }
.sync-pill.pend { background: rgba(59,130,246,.16); color: #3b82f6; border-color: rgba(59,130,246,.35); }
.side .sync-pill { width: 100%; justify-content: center; margin-bottom: 8px; height: 32px; }
.off-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(217,119,6,.3);
  padding: 9px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 600;
}
.checks2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .checks2 { grid-template-columns: 1fr; } }
.checks2 label {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.checks2 input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; flex: none; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }

@media print {
  .side, .topbar, .bnav, .no-print, .tx-acts, .fbar, .btn { display: none !important; }
  .shell { display: block; }
  .wrap { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
