/* ═══════════════════════════════════════════════════════════
   HisabPro — Design System
   Premium Smart Analytics · Light & Dark · EN / বাংলা
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f4f6f2;
  --bg-soft: #eef2ec;
  --surface: #ffffff;
  --surface-2: #f6f8f4;
  --surface-3: #ebf0e8;
  --text: #12201a;
  --text-2: #3b4d45;
  --muted: #5f7069;
  --muted-2: #93a29b;
  --border: #e1e8df;
  --border-strong: #cfd9cc;
  --brand: #0b7a58;
  --brand-strong: #085c43;
  --brand-soft: #e2f4ec;
  --brand-ink: #064c38;
  --accent: #c9ea5a;
  --accent-soft: #f2f9db;
  --danger: #d94b4b;
  --danger-soft: #fdecec;
  --warning: #d9922e;
  --warning-soft: #fdf3e2;
  --info: #2563eb;
  --info-soft: #eaf1fc;
  --violet: #7c5cd6;
  --violet-soft: #f1ecfd;
  --income: #047857;
  --expense: #b8453d;
  --sidebar: #0b1f18;
  --sidebar-2: #0f2a21;
  --sidebar-text: #dcece5;
  --sidebar-muted: #7f9a90;
  --shadow-sm: 0 1px 2px rgba(16, 40, 30, .05), 0 1px 3px rgba(16, 40, 30, .04);
  --shadow-md: 0 8px 24px -8px rgba(13, 45, 33, .16), 0 2px 8px rgba(13, 45, 33, .05);
  --shadow-lg: 0 24px 60px -18px rgba(8, 35, 25, .28), 0 8px 24px -12px rgba(8, 35, 25, .16);
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar-w: 264px;
  --topbar-h: 76px;
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Noto Sans Bengali", "Nirmala UI", "Hind Siliguri", sans-serif;
  --font-num: "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", -apple-system, "Noto Sans Bengali", sans-serif;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --max: 1500px;
}

[data-theme="dark"] {
  --bg: #0a110e;
  --bg-soft: #0d1713;
  --surface: #111d17;
  --surface-2: #16241d;
  --surface-3: #1d2f26;
  --text: #eaf3ed;
  --text-2: #c3d5cb;
  --muted: #8ba398;
  --muted-2: #6c8579;
  --border: #22342b;
  --border-strong: #2e4639;
  --brand: #2ecf97;
  --brand-strong: #6ee9bf;
  --brand-soft: #14352a;
  --brand-ink: #9df0d2;
  --accent: #c9ea5a;
  --accent-soft: #27301a;
  --danger: #ff7b72;
  --danger-soft: #351c1b;
  --warning: #f0b259;
  --warning-soft: #332616;
  --info: #78a8f5;
  --info-soft: #16263c;
  --violet: #a68ef0;
  --violet-soft: #251f3a;
  --income: #35d39f;
  --expense: #ff8a80;
  --sidebar: #060d0a;
  --sidebar-2: #0a1510;
  --sidebar-text: #dcece5;
  --sidebar-muted: #708a7e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, .55);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: var(--brand); color: #fff; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; }
*::-webkit-scrollbar-track { background: transparent; }

.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

/* ═══════════ typography helpers ═══════════ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand);
}
.eyebrow.light { color: var(--accent); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(201, 234, 90, .14); }
.mono { font-variant-numeric: tabular-nums; font-family: var(--font-num); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pos { color: var(--income); }
.neg { color: var(--expense); }

/* ═══════════ buttons ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--text);
  font-size: 13.5px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; transition: background .18s, border-color .18s, transform .18s, box-shadow .18s, color .18s;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn .icon { width: 17px; height: 17px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(11, 122, 88, .7); }
.btn--primary:hover { background: var(--brand-strong); }
[data-theme="dark"] .btn--primary { color: #041a12; }
.btn--accent { background: var(--accent); color: #17240a; }
.btn--accent:hover { filter: brightness(.96); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn--soft:hover { background: var(--brand-soft); filter: brightness(.97); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--quiet { color: var(--muted); padding: 0 10px; }
.btn--quiet:hover { color: var(--text); background: var(--surface-2); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn--lg { height: 48px; padding: 0 22px; border-radius: 14px; font-size: 14.5px; }
.btn--full { width: 100%; }
.btn--pill { border-radius: 999px; }

.icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 38px; height: 38px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); transition: all .18s;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.icon-btn.subtle { border-color: transparent; background: transparent; color: var(--sidebar-muted); }
.icon-btn .lang-code { font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* ═══════════ brand ═══════════ */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), #14b981);
  box-shadow: 0 6px 16px -8px rgba(20, 185, 129, .8);
  color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 19px; font-weight: 780; letter-spacing: -.035em; color: var(--text); }
.brand-name span { color: var(--brand); }
.brand--light .brand-name { color: #f0f7f3; }
.brand--light .brand-name span { color: var(--accent); }

/* ═══════════ AUTH ═══════════ */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.08fr .92fr;
  background: var(--bg);
}
.auth-visual {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 600px at -10% 110%, rgba(20, 185, 129, .28), transparent 60%),
    radial-gradient(700px 500px at 105% -10%, rgba(201, 234, 90, .16), transparent 60%),
    linear-gradient(160deg, #071a13 0%, #0a241b 48%, #0b1f18 100%);
  color: #eaf4ef;
  padding: 44px clamp(28px, 5vw, 72px);
  display: flex; align-items: center;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(160deg, rgba(0,0,0,.5), transparent 65%);
  opacity: .5;
}
.auth-visual::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -220px; bottom: -260px;
  border-radius: 50%; border: 1px solid rgba(201, 234, 90, .22);
  box-shadow: 0 0 0 80px rgba(201, 234, 90, .035), 0 0 0 160px rgba(201, 234, 90, .025);
}
.auth-visual-inner { position: relative; z-index: 1; width: 100%; max-width: 620px; margin: auto; display: flex; flex-direction: column; min-height: min(760px, calc(100vh - 88px)); }
.auth-hero-copy { margin-top: clamp(46px, 8vh, 86px); }
.auth-hero-copy h1 {
  font-size: clamp(38px, 4.6vw, 62px); line-height: 1.02;
  letter-spacing: -.045em; font-weight: 760; margin: 20px 0 22px;
  color: #f3f8f6;
}
.auth-hero-copy h1 em { font-style: normal; color: var(--accent); }
.auth-hero-copy p { max-width: 470px; color: #a8c1b7; font-size: 15.5px; line-height: 1.65; }
.auth-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.auth-badges span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: #c8ddd4;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .1);
  padding: 7px 11px; border-radius: 999px; backdrop-filter: blur(6px);
}
.auth-badges .icon { width: 14px; height: 14px; color: var(--accent); }

.auth-preview {
  position: relative; margin-top: clamp(40px, 6vh, 64px);
  padding: 22px 24px; border-radius: 22px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8);
  backdrop-filter: blur(14px);
  max-width: 460px;
}
.auth-preview::before {
  content: ""; position: absolute; inset: -1px; border-radius: 22px; padding: 1px;
  background: linear-gradient(140deg, rgba(201, 234, 90, .4), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.auth-preview-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mini-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #8fac9f; font-weight: 700; margin-bottom: 5px; }
.auth-preview-top strong { font-size: 25px; letter-spacing: -.035em; font-weight: 720; color: #f5faf7; }
.auth-preview-chart { margin: 10px -6px 4px; height: 92px; }
.auth-preview-chart svg { width: 100%; height: 100%; }
.auth-preview-foot { display: flex; flex-wrap: wrap; gap: 16px; border-top: 1px solid rgba(255, 255, 255, .09); margin-top: 10px; padding-top: 14px; }
.auth-preview-foot div { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #93afa3; }
.auth-preview-foot b { color: #e8f2ed; font-weight: 650; }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; }
.mini-dot.income { background: #35d39f; }
.mini-dot.expense { background: #ff8a80; }
.mini-dot.savings { background: var(--accent); }
.auth-legal { margin-top: auto; padding-top: 40px; font-size: 10.5px; color: #5f7b6f; letter-spacing: .01em; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px clamp(22px, 4vw, 64px); background: var(--surface); }
.auth-card { width: 100%; max-width: 432px; }
.auth-card-head .eyebrow { color: var(--brand); }
.auth-card-head h2 { font-size: clamp(25px, 2.6vw, 31px); letter-spacing: -.035em; font-weight: 750; margin: 14px 0 8px; }
.auth-card-head p { color: var(--muted); font-size: 13.5px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; margin: 26px 0 22px; }
.auth-tab { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; transition: all .18s; }
.auth-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .signup-only { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); letter-spacing: .01em; }
.field small { font-size: 10.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-wrap { position: relative; }
.input-action { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.input-action:hover { background: var(--surface-2); color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; height: 44px; padding: 0 13px;
  border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
input[type="date"] { color-scheme: light; }
[data-theme="dark"] input[type="date"] { color-scheme: dark; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f8078' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-row--2 { grid-template-columns: repeat(2, 1fr); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: all .18s; height: 100%; }
.choice b { font-size: 12px; font-weight: 700; }
.choice small { font-size: 9.5px; color: var(--muted); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-error { font-size: 12px; color: var(--danger); background: var(--danger-soft); padding: 9px 11px; border-radius: 9px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.auth-note { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 16px; font-size: 10.5px; color: var(--muted-2); text-align: center; }
.auth-note .icon { width: 13px; height: 13px; }
.auth-card .btn--ghost { border-color: var(--border); }

/* ═══════════ APP SHELL ═══════════ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(20, 185, 129, .14), transparent 70%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  padding: 20px 14px 14px;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar-top { padding: 0 8px; position: relative; }
.sidebar-top .brand { padding: 2px 2px 18px; }
.workspace-switch {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; margin-bottom: 8px;
  border-radius: 13px; border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05);
  color: var(--sidebar-text); text-align: left;
  transition: all .18s;
}
.workspace-switch:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .14); }
.workspace-switch > .icon { margin-left: auto; width: 15px; height: 15px; color: var(--sidebar-muted); }
.ws-avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #1d2b0a; font-weight: 800; font-size: 13px; flex: none; }
.ws-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ws-meta small { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--sidebar-muted); font-weight: 700; }
.ws-meta b { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.workspace-menu {
  position: absolute; left: 8px; right: 8px; top: calc(100% - 4px); z-index: 60;
  background: #10271f; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 6px; box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .7);
}
.workspace-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--sidebar-text); text-align: left; font-size: 12.5px; }
.workspace-menu button:hover { background: rgba(255, 255, 255, .07); }
.workspace-menu button.is-active { background: rgba(201, 234, 90, .12); color: var(--accent); }
.workspace-menu .ws-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.workspace-menu .ws-menu-add { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 4px; padding-top: 9px; color: var(--accent); }

.side-nav { flex: 1; overflow-y: auto; padding: 6px 0 10px; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-label { display: block; padding: 0 12px 6px; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 750; color: var(--sidebar-muted); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 39px; padding: 0 12px; margin: 1px 0;
  border-radius: 10px; color: var(--sidebar-muted);
  font-size: 12.75px; font-weight: 560;
  transition: color .16s, background .16s;
}
.nav-item .icon { width: 17px; height: 17px; }
.nav-item:hover { color: var(--sidebar-text); background: rgba(255, 255, 255, .055); }
.nav-item.is-active { color: #f2f9f5; background: rgba(255, 255, 255, .1); font-weight: 650; }
.nav-item.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item.is-active .icon { color: var(--accent); }
.nav-count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--sidebar-muted); font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-count.alert { background: var(--accent); color: #1d2b0a; }
.sidebar-foot { padding: 10px 6px 2px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sync-chip { display: flex; align-items: center; gap: 7px; padding: 6px 8px 10px; font-size: 10px; color: var(--sidebar-muted); }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--income); box-shadow: 0 0 0 3px rgba(53, 211, 159, .13); flex: none; }
.sync-chip.is-offline .sync-dot { background: var(--warning); box-shadow: 0 0 0 3px rgba(217, 146, 46, .15); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 11px; }
.side-user:hover { background: rgba(255, 255, 255, .04); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: linear-gradient(145deg, #1c4b3b, #123329); color: #eaf7f1; font-weight: 700; font-size: 11.5px; flex: none; border: 1px solid rgba(255, 255, 255, .09); }
.avatar--btn { cursor: pointer; transition: box-shadow .18s; }
.avatar--btn:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.side-user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; flex: 1; }
.side-user-meta b { font-size: 11.5px; font-weight: 650; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta small { font-size: 9.5px; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(18px, 2.6vw, 34px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-titles { min-width: 0; }
.topbar-titles h1 { font-size: clamp(18px, 2vw, 23px); font-weight: 750; letter-spacing: -.035em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-titles p { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  color: var(--muted); font-size: 12px; transition: all .18s; min-width: 204px;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.search-trigger .icon { width: 15px; height: 15px; }
.search-trigger kbd { margin-left: auto; font-family: var(--font); font-size: 9.5px; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.notif-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--surface); }
.notif-dot.hidden { display: none; }
.mobile-only { display: none !important; }
.mobile-brand { display: none; align-items: center; gap: 8px; font-weight: 750; letter-spacing: -.03em; font-size: 15px; }
.mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.mobile-brand .brand-mark svg { width: 18px; height: 18px; }

.view { padding: clamp(16px, 2.4vw, 30px) clamp(16px, 2.8vw, 38px) 56px; max-width: var(--max); width: 100%; margin: 0 auto; outline: none; }
.view > * { animation: rise .4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ═══════════ page header / cards ═══════════ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: clamp(20px, 2.2vw, 27px); font-weight: 740; letter-spacing: -.04em; line-height: 1.1; }
.page-head p { font-size: 12.5px; color: var(--muted); margin-top: 5px; max-width: 620px; }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.section-head h3 { font-size: 14.5px; font-weight: 720; letter-spacing: -.02em; }
.section-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.section-head .link { font-size: 11.5px; font-weight: 650; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-head .link:hover { text-decoration: underline; }
.section-head .link .icon { width: 13px; height: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card--pad { padding: 18px; }
.card--flush { overflow: hidden; }
.card--accent { background: linear-gradient(150deg, var(--brand-strong), var(--brand)); color: #f2fbf6; border: 0; }
.card--accent .muted { color: rgba(255,255,255,.66); }
[data-theme="dark"] .card--accent { background: linear-gradient(150deg, #0c5a44, #0a3226); }
.card--dark { background: linear-gradient(150deg, #0b241c, #133b2e); color: #eaf5ef; border-color: transparent; }
.grid { display: grid; gap: 14px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--dash { grid-template-columns: minmax(0, 1.62fr) minmax(300px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* KPI */
.kpi { position: relative; padding: 17px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--brand-soft); opacity: .55; }
.kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); position: relative; z-index: 1; }
.kpi-icon .icon { width: 16px; height: 16px; }
.kpi-icon.expense { background: var(--danger-soft); color: var(--expense); }
.kpi-icon.income { background: color-mix(in srgb, var(--income) 13%, transparent); color: var(--income); }
.kpi-icon.savings { background: var(--violet-soft); color: var(--violet); }
.kpi-label { font-size: 11px; font-weight: 620; color: var(--muted); }
.kpi-value { font-size: clamp(21px, 2.2vw, 27px); font-weight: 740; letter-spacing: -.045em; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.kpi-value .cur { font-size: .62em; font-weight: 650; color: var(--muted); margin-right: 2px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; font-size: 10.5px; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.trend .icon { width: 11px; height: 11px; }
.trend.up { color: var(--income); background: color-mix(in srgb, var(--income) 11%, transparent); }
.trend.down { color: var(--expense); background: color-mix(in srgb, var(--expense) 11%, transparent); }
.trend.flat { color: var(--muted); background: var(--surface-2); }

/* ═══════════ chips / segmented ═══════════ */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 9.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.chip .icon { width: 11px; height: 11px; }
.chip--income { background: color-mix(in srgb, var(--income) 11%, transparent); color: var(--income); }
.chip--expense { background: color-mix(in srgb, var(--expense) 11%, transparent); color: var(--expense); }
.chip--transfer { background: var(--info-soft); color: var(--info); }
.chip--brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip--warning { background: var(--warning-soft); color: var(--warning); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--muted { background: var(--surface-2); color: var(--muted); }
.chip--violet { background: var(--violet-soft); color: var(--violet); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill .icon { width: 11px; height: 11px; }
.pill--success { background: color-mix(in srgb, var(--income) 12%, transparent); color: var(--income); }

.segmented { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button { height: 30px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 650; transition: all .16s; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented--dark { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
.segmented--dark button { color: rgba(255,255,255,.58); }
.segmented--dark button.is-active { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }

/* ═══════════ dashboard ═══════════ */
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-hero h2 { font-size: clamp(21px, 2.5vw, 29px); font-weight: 750; letter-spacing: -.045em; }
.dash-hero h2 span { color: var(--brand); }
.dash-hero p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.range-chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font-size: 11.5px; font-weight: 620; color: var(--text-2); }
.range-chip .icon { width: 15px; height: 15px; color: var(--muted); }
.range-chip:focus { outline: 2px solid var(--brand); }

.chart-card { padding: 18px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-head h3 { font-size: 14.5px; font-weight: 720; letter-spacing: -.02em; }
.chart-head p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.chart-legend { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); font-weight: 560; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { font-family: var(--font); }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; opacity: .7; }
.chart-svg .axis-label { fill: var(--muted); font-size: 10px; font-weight: 600; }
.chart-svg .chart-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .chart-line--dashed { stroke-dasharray: 5 5; stroke-width: 1.8; opacity: .75; }
.chart-svg .chart-point { stroke: var(--surface); stroke-width: 2.5; }
.chart-svg .chart-bar { rx: 4; }
.chart-empty { display: grid; place-items: center; min-height: 170px; color: var(--muted); font-size: 12px; text-align: center; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; flex: none; width: 128px; height: 128px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-linejoin: round; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center b { font-size: 16px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.donut-center small { font-size: 8.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.cat-list { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.cat-row .cat-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cat-row .cat-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row .cat-val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.cat-row .cat-pct { width: 30px; text-align: right; color: var(--muted); font-size: 9.5px; }

.budget-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.budget-hero strong { font-size: 22px; font-weight: 750; letter-spacing: -.04em; display: block; line-height: 1.15; }
.budget-hero small { font-size: 10.5px; color: var(--muted); }
.ring { position: relative; width: 64px; height: 64px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 750; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .5s var(--ease); }
.progress.is-warning > i { background: var(--warning); }
.progress.is-danger > i { background: var(--danger); }
.progress--sm { height: 4px; }
.budget-line { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 7px; }

.insight-card { padding: 17px 18px; background: linear-gradient(145deg, #f7fbee, #eef7df); border: 1px solid #e0ecc9; border-radius: var(--radius); }
[data-theme="dark"] .insight-card { background: linear-gradient(145deg, #1c2a16, #15220f); border-color: #2c3d23; }
.insight-card .insight-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.insight-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #22310a; }
.insight-icon .icon { width: 15px; height: 15px; }
.insight-card h4 { font-size: 12px; font-weight: 720; color: var(--text); }
.insight-card p { font-size: 11.5px; line-height: 1.55; color: var(--text-2); }
.insight-card p b { color: var(--brand); }
.insight-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 9.5px; color: var(--muted); }
.insight-foot .icon { width: 12px; height: 12px; }

.tx-list { display: flex; flex-direction: column; }
.tx-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.tx-row:last-child { border-bottom: 0; }
.tx-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--surface-2); flex: none; }
.tx-main { min-width: 0; flex: 1; }
.tx-main b { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tx-amount { text-align: right; flex: none; }
.tx-amount b { display: block; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount small { font-size: 9.5px; color: var(--muted); }
.tx-amount .income { color: var(--income); }
.tx-amount .expense { color: var(--expense); }
.tx-amount .transfer { color: var(--info); }

.account-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-account { padding: 12px 13px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); }
.mini-account-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.mini-account-top .acc-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.mini-account-top .acc-dot .icon { width: 12px; height: 12px; }
.mini-account-top span { font-size: 9.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-account b { font-size: 14px; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.upcoming-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.upcoming-row:last-child { border-bottom: 0; }
.due-date { width: 34px; height: 38px; border-radius: 9px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1; }
.due-date b { font-size: 12px; font-weight: 750; }
.due-date small { font-size: 8px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 2px; }
.upcoming-main { min-width: 0; flex: 1; }
.upcoming-main b { display: block; font-size: 11.5px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-main small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.upcoming-amt { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }

/* quick action tiles */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.quick-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: all .18s; }
.quick-tile:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.quick-tile .qt-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.quick-tile .qt-icon.expense { background: var(--danger-soft); color: var(--expense); }
.quick-tile .qt-icon.transfer { background: var(--info-soft); color: var(--info); }
.quick-tile .qt-icon.savings { background: var(--violet-soft); color: var(--violet); }
.quick-tile b { font-size: 11.5px; font-weight: 650; }
.quick-tile small { font-size: 9.5px; color: var(--muted); }

/* ═══════════ transactions page ═══════════ */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; }
.filter-search { position: relative; flex: 1; min-width: 200px; }
.filter-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.filter-search input { padding-left: 35px; height: 38px; background: var(--surface-2); border-color: transparent; }
.filter-search input:focus { background: var(--surface); border-color: var(--brand); }
.toolbar select { width: auto; min-width: 120px; height: 38px; background-color: var(--surface-2); border-color: transparent; font-size: 12px; }
.toolbar select:focus { background-color: var(--surface); border-color: var(--brand); }
.toolbar .icon-btn { width: 38px; height: 38px; }
.tx-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding: 0 2px; }
.tx-summary span { font-size: 11px; color: var(--muted); }
.tx-summary b { color: var(--text); font-weight: 700; }
.tx-group { margin-bottom: 10px; }
.tx-group-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 4px 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.tx-group-head b { font-weight: 700; color: var(--text-2); }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; transition: border-color .16s, box-shadow .16s; }
.tx-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tx-item .tx-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .16s; }
.tx-item:hover .tx-actions, .tx-item:focus-within .tx-actions { opacity: 1; }
.tx-actions .icon-btn { width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--muted); }
.tx-actions .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.tx-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.tx-actions .icon { width: 14px; height: 14px; }
.empty-state { padding: 52px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state .empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-state .empty-icon .icon { width: 24px; height: 24px; }
.empty-state h4 { font-size: 14px; font-weight: 700; }
.empty-state p { font-size: 11.5px; color: var(--muted); margin: 5px auto 16px; max-width: 320px; }

/* ═══════════ accounts ═══════════ */
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.account-card { position: relative; padding: 17px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.account-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.account-card::after { content: ""; position: absolute; right: -36px; bottom: -46px; width: 120px; height: 120px; border-radius: 50%; background: var(--acc-soft, var(--brand-soft)); opacity: .7; }
.account-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; position: relative; z-index: 1; }
.account-type-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--acc-soft, var(--brand-soft)); color: var(--acc-ink, var(--brand-ink)); }
.account-type-icon .icon { width: 17px; height: 17px; }
.account-card-top b { font-size: 12.5px; font-weight: 680; display: block; }
.account-card-top small { font-size: 9.5px; color: var(--muted); display: block; margin-top: 1px; }
.account-card .acc-balance { font-size: 22px; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.account-card .acc-balance small { font-size: 10px; color: var(--muted); font-weight: 600; display: block; letter-spacing: 0; margin-top: 4px; }
.account-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border); position: relative; z-index: 1; font-size: 9.5px; color: var(--muted); }
.account-card-foot .icon-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); }
.account-card-foot .icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ═══════════ budgets ═══════════ */
.budget-overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.budget-spotlight { padding: 20px; border-radius: var(--radius); background: linear-gradient(150deg, #0b3a2b, #0f5c45); color: #eefaf5; position: relative; overflow: hidden; }
[data-theme="dark"] .budget-spotlight { background: linear-gradient(150deg, #0b2e23, #0d4b39); }
.budget-spotlight::after { content: ""; position: absolute; right: -50px; top: -70px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(201,234,90,.22); box-shadow: 0 0 0 44px rgba(201,234,90,.04), 0 0 0 88px rgba(201,234,90,.025); }
.budget-spotlight .eyebrow { color: var(--accent); }
.budget-spotlight h3 { font-size: 19px; font-weight: 730; letter-spacing: -.03em; margin: 8px 0 4px; }
.budget-spotlight .spot-num { font-size: clamp(30px, 3.6vw, 42px); font-weight: 760; letter-spacing: -.05em; margin: 18px 0 2px; line-height: 1; }
.budget-spotlight .spot-sub { font-size: 11px; color: rgba(238,250,245,.62); }
.budget-spotlight .progress { background: rgba(255,255,255,.15); margin-top: 18px; height: 8px; }
.budget-spotlight .progress > i { background: var(--accent); }
.budget-spotlight .spot-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 10.5px; color: rgba(238,250,245,.66); position: relative; z-index: 1; }
.budget-spotlight .spot-foot b { color: #fff; }
.budget-alert-list { padding: 17px; }
.budget-alert { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 11px; }
.budget-alert:last-child { border-bottom: 0; }
.budget-alert .ba-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.budget-alert b { font-weight: 650; }
.budget-alert small { color: var(--muted); display: block; margin-top: 1px; }
.budget-alert .ba-val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-list { display: flex; flex-direction: column; gap: 0; }
.budget-item { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.budget-item:last-child { border-bottom: 0; }
.budget-item-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.budget-cat-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--surface-2); flex: none; }
.budget-item-main { flex: 1; min-width: 0; }
.budget-item-main b { display: block; font-size: 12px; font-weight: 650; }
.budget-item-main small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.budget-item .bi-amount { text-align: right; flex: none; }
.budget-item .bi-amount b { display: block; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.budget-item .bi-amount small { font-size: 9px; color: var(--muted); }

/* ═══════════ savings ═══════════ */
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.goal-card { padding: 17px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.goal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.goal-emoji { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; }
.goal-card h4 { font-size: 13px; font-weight: 680; }
.goal-card .goal-deadline { font-size: 9.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.goal-card .goal-deadline .icon { width: 11px; height: 11px; }
.goal-progress-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 12px 0 7px; }
.goal-progress-line b { font-size: 18px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.goal-progress-line small { font-size: 10px; color: var(--muted); }
.goal-card .goal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 8px; }
.goal-card .goal-foot small { font-size: 9.5px; color: var(--muted); }
.goal-card .btn { height: 30px; font-size: 11px; }
.goal-ring { width: 46px; height: 46px; flex: none; }
.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring circle { fill: none; stroke-linecap: round; }
.goal-ring .ring-label { font-size: 9.5px; }

/* ═══════════ debts ═══════════ */
.debt-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.debt-stat { padding: 15px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.debt-stat small { font-size: 10px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.debt-stat small .icon { width: 13px; height: 13px; }
.debt-stat b { display: block; font-size: 20px; font-weight: 750; letter-spacing: -.04em; margin-top: 7px; font-variant-numeric: tabular-nums; }
.debt-list { display: flex; flex-direction: column; gap: 9px; }
.debt-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); }
.debt-item .debt-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 16px; }
.debt-item .debt-icon.borrowed { background: var(--danger-soft); color: var(--expense); }
.debt-item .debt-icon.lent { background: var(--info-soft); color: var(--info); }
.debt-item .debt-main { flex: 1; min-width: 0; }
.debt-item .debt-main b { display: block; font-size: 12.5px; font-weight: 650; }
.debt-item .debt-main small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.debt-item .debt-amt { text-align: right; flex: none; }
.debt-item .debt-amt b { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.debt-item .debt-amt small { font-size: 9px; color: var(--muted); }
.debt-item .debt-actions { display: flex; gap: 4px; flex: none; }
.debt-item .debt-actions .btn { height: 30px; font-size: 10.5px; padding: 0 9px; }

/* ═══════════ reports / analytics ═══════════ */
.report-tabs { display: flex; gap: 3px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.report-tabs::-webkit-scrollbar { display: none; }
.report-tabs button { height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; transition: all .16s; }
.report-tabs button:hover { color: var(--text); }
.report-tabs button.is-active { background: var(--brand-soft); color: var(--brand-ink); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.report-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.report-table th { text-align: left; padding: 9px 10px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table td { padding: 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent); font-variant-numeric: tabular-nums; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table .num { text-align: right; }
.report-table .strong td { font-weight: 700; }
.report-table .sub td { color: var(--muted); font-size: 10.5px; }
.report-table .bar-cell { width: 32%; }
.report-table .mini-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.report-table .mini-bar i { display: block; height: 100%; border-radius: 3px; }
.table-wrap { overflow-x: auto; }
.summary-rows { display: flex; flex-direction: column; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 11.5px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); }
.summary-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-row.total { border-top: 1px solid var(--border); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 13px; }
.summary-row.total span { color: var(--text); font-weight: 650; }

.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.analytic-card { padding: 15px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.analytic-card .ac-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.analytic-card .ac-icon { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.analytic-card .ac-icon .icon { width: 15px; height: 15px; }
.analytic-card small { font-size: 9.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.analytic-card b { display: block; font-size: 18px; font-weight: 740; letter-spacing: -.04em; margin: 3px 0 3px; font-variant-numeric: tabular-nums; }
.analytic-card p { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.analytic-card p b { display: inline; font-size: inherit; margin: 0; letter-spacing: 0; color: var(--text-2); }
.weekday-chart { display: flex; align-items: flex-end; gap: 7px; height: 120px; padding-top: 10px; }
.weekday-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.weekday-col i { width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: var(--brand); opacity: .75; min-height: 3px; transition: height .4s var(--ease); }
.weekday-col:hover i { opacity: 1; }
.weekday-col small { font-size: 8.5px; color: var(--muted); font-weight: 650; }
.weekday-col b { font-size: 8.5px; color: var(--muted-2); font-weight: 600; }

/* ═══════════ calendar ═══════════ */
.calendar-card { padding: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-head h3 { font-size: 16px; font-weight: 720; letter-spacing: -.02em; }
.calendar-nav { display: flex; gap: 4px; }
.calendar-nav .icon-btn { width: 32px; height: 32px; }
.calendar-nav .cal-prev-icon { transform: rotate(90deg); }
.calendar-nav .cal-next-icon { transform: rotate(-90deg); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.calendar-weekdays span { text-align: center; font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { min-height: 78px; border-radius: 9px; border: 1px solid transparent; padding: 5px 6px; cursor: pointer; transition: background .16s, border-color .16s; position: relative; }
.cal-day:hover { background: var(--surface-2); border-color: var(--border); }
.cal-day.is-outside { opacity: .35; }
.cal-day.is-today { border-color: var(--brand); background: var(--brand-soft); }
.cal-day .cal-num { font-size: 10.5px; font-weight: 650; color: var(--text-2); }
.cal-day.is-today .cal-num { color: var(--brand-ink); }
.cal-day .cal-amt { display: block; font-size: 8.5px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .cal-amt.pos { color: var(--income); }
.cal-day .cal-amt.neg { color: var(--expense); }
.cal-day .cal-events { display: flex; gap: 2px; margin-top: 4px; flex-wrap: wrap; }
.cal-day .cal-events i { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.cal-day .cal-events i.expense { background: var(--expense); }
.cal-day .cal-events i.income { background: var(--income); }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, 1fr); gap: 14px; align-items: start; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 9.5px; color: var(--muted); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 6px; height: 6px; border-radius: 50%; }

/* ═══════════ assistant ═══════════ */
.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 14px; align-items: start; }
.chat-card { display: flex; flex-direction: column; height: min(680px, calc(100vh - 180px)); min-height: 460px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.chat-avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), #14b981); color: #fff; flex: none; }
.chat-head b { display: block; font-size: 13px; font-weight: 700; }
.chat-head small { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-2); }
.msg { display: flex; gap: 9px; max-width: 88%; }
.msg--user { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.msg-avatar .icon { width: 14px; height: 14px; }
.msg--user .msg-avatar { background: var(--text); color: var(--surface); }
.msg-bubble { padding: 10px 13px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; line-height: 1.6; color: var(--text-2); box-shadow: var(--shadow-sm); }
.msg--user .msg-bubble { background: var(--brand); color: #fff; border-color: transparent; }
[data-theme="dark"] .msg--user .msg-bubble { color: #041a12; }
.msg-bubble b { color: var(--text); font-weight: 700; }
.msg--user .msg-bubble b { color: #fff; }
.msg-bubble ul { margin: 7px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.msg-bubble li { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.msg-bubble li:last-child { border-bottom: 0; }
.msg-bubble li span { color: var(--muted); }
.msg-bubble li b { font-variant-numeric: tabular-nums; }
.msg-time { font-size: 8.5px; color: var(--muted-2); margin-top: 5px; }
.chat-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 11px 14px 0; background: var(--surface); border-top: 1px solid var(--border); }
.suggestion { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 10.5px; color: var(--text-2); transition: all .16s; }
.suggestion:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.chat-input { display: flex; gap: 8px; padding: 12px 14px 14px; background: var(--surface); }
.chat-input input { height: 42px; }
.chat-input .btn { width: 42px; padding: 0; flex: none; }
.chat-note { padding: 0 14px 12px; font-size: 9px; color: var(--muted-2); background: var(--surface); }
.typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.ai-side-card { padding: 16px; }
.ai-side-card h4 { font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.ai-cap { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; font-size: 10.5px; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.ai-cap:last-child { border-bottom: 0; }
.ai-cap .icon { width: 13px; height: 13px; color: var(--brand); margin-top: 1px; flex: none; }
.ai-disclaimer { display: flex; gap: 7px; padding: 11px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 9.5px; line-height: 1.5; margin-top: 10px; }
.ai-disclaimer .icon { width: 13px; height: 13px; flex: none; margin-top: 1px; }

/* ═══════════ notifications ═══════════ */
.notif-list { display: flex; flex-direction: column; gap: 7px; }
.notif-item { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: border-color .16s; }
.notif-item:hover { border-color: var(--border-strong); }
.notif-item.is-unread { border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface)); }
.notif-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-icon .icon { width: 16px; height: 16px; }
.notif-icon.warning { background: var(--warning-soft); color: var(--warning); }
.notif-icon.danger { background: var(--danger-soft); color: var(--danger); }
.notif-icon.brand { background: var(--brand-soft); color: var(--brand-ink); }
.notif-icon.info { background: var(--info-soft); color: var(--info); }
.notif-main { flex: 1; min-width: 0; }
.notif-main b { display: block; font-size: 12px; font-weight: 650; }
.notif-main p { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.notif-main small { display: block; font-size: 9px; color: var(--muted-2); margin-top: 4px; }
.notif-item .icon-btn { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); }

/* ═══════════ settings ═══════════ */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 18px); }
.settings-nav button { display: flex; align-items: center; gap: 9px; height: 37px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 620; text-align: left; }
.settings-nav button .icon { width: 15px; height: 15px; }
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button.is-active { background: var(--brand-soft); color: var(--brand-ink); }
.settings-panel { display: flex; flex-direction: column; gap: 14px; }
.setting-card { padding: 18px; }
.setting-card h3 { font-size: 14px; font-weight: 720; letter-spacing: -.02em; margin-bottom: 3px; }
.setting-card > p { font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row:first-of-type { padding-top: 0; }
.setting-row-main b { display: block; font-size: 12px; font-weight: 620; }
.setting-row-main small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; max-width: 420px; line-height: 1.45; }
.setting-row .select-inline { width: 170px; height: 36px; font-size: 11.5px; }
.setting-row .btn { flex: none; }
.switch { position: relative; width: 40px; height: 23px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); cursor: pointer; transition: all .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 50%; left: 2px; transform: translateY(-50%); width: 17px; height: 17px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .2s; }
.switch.is-on { background: var(--brand); border-color: var(--brand); }
.switch.is-on::after { left: 19px; background: #fff; }
.profile-block { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.profile-avatar { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(145deg, #0b6b52, #14b981); color: #fff; font-size: 20px; font-weight: 750; flex: none; }
.profile-block b { display: block; font-size: 15px; font-weight: 720; }
.profile-block small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.profile-block .chip { margin-top: 5px; }

/* ═══════════ members ═══════════ */
.member-list { display: flex; flex-direction: column; }
.member-row { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-row .avatar { width: 34px; height: 34px; font-size: 11px; }
.member-info { flex: 1; min-width: 0; }
.member-info b { display: block; font-size: 12px; font-weight: 650; }
.member-info small { display: block; font-size: 10px; color: var(--muted); }
.member-row select { width: 130px; height: 32px; font-size: 10.5px; background-color: var(--surface-2); border-color: transparent; }
.member-row .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--income); flex: none; }
.member-row .status-dot.pending { background: var(--warning); }

/* ═══════════ recurring ═══════════ */
.recurring-list { display: flex; flex-direction: column; gap: 8px; }
.recurring-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.recurring-item.is-paused { opacity: .62; }
.recurring-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--surface-2); flex: none; }
.recurring-main { flex: 1; min-width: 0; }
.recurring-main b { display: block; font-size: 12px; font-weight: 650; }
.recurring-main small { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.recurring-amt { text-align: right; flex: none; }
.recurring-amt b { display: block; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recurring-amt small { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.recurring-item .switch { margin: 0 4px; }

/* ═══════════ modals / sheets ═══════════ */
.modal-root, .sheet-root, .drawer-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop, .sheet-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(5, 16, 12, .55); backdrop-filter: blur(5px); animation: fade .2s both; }
.sheet-backdrop, .drawer-backdrop { background: rgba(5, 16, 12, .45); backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; width: 100%; max-width: 540px; max-height: min(88vh, 880px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: modalIn .3s var(--ease) both; overflow: hidden; z-index: 1; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal--wide { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 740; letter-spacing: -.03em; }
.modal-subtitle { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.modal-head .icon-btn { width: 32px; height: 32px; border-color: transparent; background: var(--surface-2); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.modal-foot .btn--quiet { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .span-2 { grid-column: span 2; }
.type-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 16px; }
.type-toggle button { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all .16s; }
.type-toggle button .icon { width: 15px; height: 15px; }
.type-toggle button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.type-toggle button[data-type="income"].is-active { color: var(--income); }
.type-toggle button[data-type="expense"].is-active { color: var(--expense); }
.type-toggle button[data-type="transfer"].is-active { color: var(--info); }
.amount-input { position: relative; }
.amount-input .cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 650; color: var(--muted); }
.amount-input input { height: 58px; padding-left: 42px; font-size: 25px; font-weight: 740; letter-spacing: -.04em; font-variant-numeric: tabular-nums; border-radius: 13px; }
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.hint { font-size: 9.5px; color: var(--muted-2); margin-top: 4px; }
.modal-note { display: flex; gap: 7px; padding: 10px 11px; border-radius: 9px; background: var(--surface-2); font-size: 10px; color: var(--muted); line-height: 1.5; }
.modal-note .icon { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--brand); }
.confirm-text { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.confirm-amount { font-size: 24px; font-weight: 750; letter-spacing: -.04em; margin: 4px 0 12px; }

.sheet-root { align-items: flex-end; padding: 0; }
.sheet { position: relative; width: 100%; max-width: 540px; background: var(--surface); border-radius: 22px 22px 0 0; border: 1px solid var(--border); border-bottom: 0; box-shadow: var(--shadow-lg); padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheetIn .28s var(--ease) both; z-index: 1; }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 36px; height: 4px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h3 { font-size: 15px; font-weight: 720; letter-spacing: -.02em; }
.sheet-head .icon-btn { width: 30px; height: 30px; border-color: transparent; background: var(--surface-2); }
.sheet-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-action { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); font-size: 10px; font-weight: 650; color: var(--text-2); }
.sheet-action .qt-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.sheet-action .qt-icon .icon { width: 18px; height: 18px; }
.sheet-action .qt-icon.expense { background: var(--danger-soft); color: var(--expense); }
.sheet-action .qt-icon.transfer { background: var(--info-soft); color: var(--info); }
.sheet-action .qt-icon.savings { background: var(--violet-soft); color: var(--violet); }
.sheet-action:hover { border-color: var(--brand); }

.drawer-root { justify-content: flex-start; padding: 0; }
.drawer { position: relative; width: min(320px, 88vw); height: 100%; background: var(--sidebar); color: var(--sidebar-text); padding: 18px 14px; overflow-y: auto; z-index: 1; animation: drawerIn .26s var(--ease) both; display: flex; flex-direction: column; }
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 16px; }
.drawer-nav { flex: 1; }
.drawer-nav .nav-group { margin-top: 10px; }
.drawer-foot { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.drawer-foot .side-user { width: 100%; }

/* toast */
.toast-root { position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 11px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 11.5px; font-weight: 600; animation: toastIn .28s var(--ease) both; pointer-events: auto; }
[data-theme="dark"] .toast { background: #eaf3ed; color: #0a110e; }
.toast .icon { width: 15px; height: 15px; flex: none; }
.toast.success .icon { color: #53e0a7; }
.toast.error .icon { color: #ff8a80; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.is-out { animation: toastOut .25s both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* bottom nav */
.bottom-nav { display: none; }

/* ═══════════ responsive ═══════════ */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--dash { grid-template-columns: minmax(0, 1fr); }
  .account-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .assistant-layout { grid-template-columns: minmax(0, 1fr); }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .goal-grid, .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { display: none; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .mobile-only { display: inline-flex !important; }
  .mobile-brand { display: flex; }
  .topbar-titles { display: none; }
  .topbar { min-height: 64px; padding: 10px 16px; gap: 10px; }
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .view { padding: 18px 16px 96px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px) saturate(1.3);
    border-top: 1px solid var(--border);
  }
  .bottom-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; border: 0; background: transparent; color: var(--muted); font-size: 8.5px; font-weight: 650; }
  .bottom-item .icon { width: 20px; height: 20px; }
  .bottom-item.is-active { color: var(--brand); }
  .bottom-item.is-active .icon { stroke-width: 2.2; }
  .bottom-fab {
    width: 48px; height: 48px; border-radius: 15px; margin: -20px auto 0;
    display: grid; place-items: center; border: 0;
    background: linear-gradient(145deg, var(--brand), #14b981); color: #fff;
    box-shadow: 0 8px 22px -6px rgba(11, 122, 88, .65);
    transform: rotate(0deg); transition: transform .18s;
  }
  .bottom-fab:active { transform: scale(.94); }
  .bottom-fab .icon { width: 24px; height: 24px; stroke-width: 2.4; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; min-height: 100dvh; padding: 28px 22px; }
  .auth-card { max-width: 440px; }
  .topbar .avatar--btn { display: none; }
  .topbar-actions { gap: 6px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; margin-bottom: 2px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { white-space: nowrap; }
}
@media (max-width: 720px) {
  .grid--4, .grid--3, .grid--2, .goal-grid, .account-grid, .insight-grid, .debt-summary { grid-template-columns: minmax(0, 1fr); }
  .debt-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .debt-stat { padding: 11px 10px; }
  .debt-stat b { font-size: 15px; }
  .debt-stat small { font-size: 8.5px; }
  .budget-overview { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { gap: 14px; }
  .donut { width: 108px; height: 108px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .account-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1; }
  .range-chip { display: none; }
  .tx-item .tx-actions { opacity: 1; }
  .tx-item { gap: 9px; padding: 10px 11px; }
  .tx-item .tx-icon { width: 34px; height: 34px; }
  .toolbar { padding: 10px; gap: 7px; }
  .filter-search { min-width: 100%; order: -1; }
  .toolbar select { flex: 1; min-width: 0; }
  .toolbar .btn { flex: 1; }
  .member-row { flex-wrap: wrap; }
  .member-row select { width: 100%; }
  .recurring-item { flex-wrap: wrap; }
  .recurring-amt { margin-left: auto; }
  .modal-root { padding: 0; align-items: flex-end; }
  .modal { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; border-bottom: 0; animation: sheetIn .28s var(--ease) both; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .span-2 { grid-column: span 1; }
  .form-grid .field-row { gap: 10px; }
  .sheet-actions { grid-template-columns: repeat(4, 1fr); }
  .sheet-action { padding: 10px 4px; font-size: 9px; }
  .sheet-action .qt-icon { width: 34px; height: 34px; }
  .calendar-card { padding: 11px; }
  .cal-day { min-height: 58px; padding: 4px; }
  .cal-day .cal-amt { display: none; }
  .cal-day .cal-events { margin-top: 2px; }
  .cal-day .cal-events i { width: 3px; height: 3px; }
  .calendar-grid, .calendar-weekdays { gap: 2px; }
  .chat-card { height: calc(100vh - 190px); min-height: 400px; }
  .chat-suggestions { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .chat-suggestions::-webkit-scrollbar { display: none; }
  .suggestion { white-space: nowrap; flex: none; }
  .msg { max-width: 94%; }
  .settings-panel { gap: 10px; }
  .setting-card { padding: 15px; }
  .setting-row { gap: 10px; }
  .setting-row .select-inline { width: 130px; }
  .auth-card-head h2 { font-size: 25px; }
}
@media (max-width: 420px) {
  .topbar .search-trigger, .topbar .icon-btn#langToggle { display: none; }
  .debt-item { flex-wrap: wrap; gap: 8px 10px; }
  .debt-item .debt-main { flex: 1 1 calc(100% - 50px); }
  .debt-item .debt-amt { margin-left: 48px; text-align: left; }
  .debt-item .debt-actions { margin-left: auto; }
  .topbar { gap: 8px; }
  .mobile-brand span:last-child { font-size: 14px; }
  .kpi { padding: 14px 15px; }
  .card--pad { padding: 15px; }
  .chart-card { padding: 15px 12px 8px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .budget-hero strong { font-size: 19px; }
  .tx-summary { gap: 10px; }
  .quick-grid { gap: 7px; }
  .auth-panel { padding: 22px 16px; }
  .auth-tabs { margin: 20px 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
