:root {
  --bg-main:
    radial-gradient(900px 420px at 12% -8%, rgba(59,130,246,.18) 0%, rgba(59,130,246,0) 55%),
    radial-gradient(700px 380px at 88% 0%, rgba(14,165,233,.12) 0%, rgba(14,165,233,0) 50%),
    linear-gradient(168deg, #0b1120 0%, #111827 42%, #0f172a 100%);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --text-on-accent: #0f172a;
  --text-danger: #fecaca;
  --text-error: #fecaca;
  --card-bg: linear-gradient(168deg, rgba(30,41,59,.78), rgba(15,23,42,.88));
  --card-border: rgba(148,163,184,.2);
  --sidebar-bg: rgba(15,23,42,.88);
  /* Income = light green, Spend = light blue (charts, bars, amounts) */
  --fi-income-soft: #bbf7d0;
  --fi-income: #86efac;
  --fi-income-mid: #4ade80;
  --fi-income-deep: #22c55e;
  --fi-spend-soft: #dbeafe;
  --fi-spend: #93c5fd;
  --fi-spend-mid: #60a5fa;
  --fi-spend-deep: #3b82f6;
}

[data-theme='light'] {
  --bg-main:
    linear-gradient(180deg, #fdfcfa 0%, #f5efe6 48%, #e8e0d4 100%);
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-subtle: #475569;
  --text-on-accent: #0f172a;
  --text-danger: #b91c1c;
  --text-error: #b91c1c;
  --card-bg: linear-gradient(165deg, #fffefb 0%, #f7f2eb 100%);
  --card-border: rgba(148, 163, 184, 0.22);
  --sidebar-bg: rgba(255, 252, 248, 0.96);
  --fi-income-soft: #d1fae5;
  --fi-income: #34d399;
  --fi-income-mid: #10b981;
  --fi-income-deep: #047857;
  --fi-spend-soft: #e0f2fe;
  --fi-spend: #38bdf8;
  --fi-spend-mid: #0ea5e9;
  --fi-spend-deep: #0369a1;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html {
  color-scheme: dark;
}
html[data-theme='light'] {
  color-scheme: light;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
}
.app-shell { min-height: 100vh; }
.app-shell--topnav { display: flex; flex-direction: column; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(148,163,184,.15);
  backdrop-filter: blur(14px);
  color: var(--text-main);
}
.workspace-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 16px 10px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid rgba(148,163,184,.12);
  font-size: .82rem;
  color: var(--text-main);
}
.workspace-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(148,163,184,.12);
  color: inherit;
}
.workspace-badge--individual {
  border-color: rgba(56,189,248,.45);
  background: rgba(56,189,248,.14);
  color: #7dd3fc;
}
.workspace-badge--household {
  border-color: rgba(251,191,36,.45);
  background: rgba(251,191,36,.14);
  color: #fcd34d;
}
.workspace-name { font-weight: 700; }
.workspace-meta { font-size: .8rem; color: var(--text-muted); }
.workspace-hint {
  margin-left: auto;
  font-size: .76rem;
  max-width: 420px;
  text-align: right;
  color: var(--text-muted);
}
[data-theme='light'] .workspace-badge--individual {
  color: #0369a1;
  background: rgba(14,165,233,.12);
  border-color: rgba(14,165,233,.35);
}
[data-theme='light'] .workspace-badge--household {
  color: #a16207;
  background: rgba(251,191,36,.15);
  border-color: rgba(217,119,6,.35);
}
[data-theme='light'] .workspace-hint { text-align: left; margin-left: 0; }
@media (max-width: 720px) {
  .workspace-hint { flex-basis: 100%; text-align: left; margin-left: 0; }
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  max-width: 1320px;
  margin: 0 auto;
}
.brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-right: 8px;
}
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-dd { position: relative; }
.nav-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color: inherit;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  cursor: pointer;
}
.nav-dd-chevron {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.72;
  margin-top: 1px;
}
.nav-dd-trigger:hover { background: rgba(255,179,0,.12); }
.nav-dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 8px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  z-index: 120;
  color: var(--text-main);
}
.nav-dd-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-main);
  text-decoration: none;
  font-size: .88rem;
}
.nav-dd-panel a:hover { background: rgba(255,179,0,.12); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.header-icon-btn:hover {
  background: rgba(255, 179, 0, 0.12);
}
.header-logout-form {
  margin: 0;
  display: inline;
}
.header-profile {
  position: relative;
}
.header-profile-trigger {
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.header-profile-trigger .header-user {
  max-width: 160px;
}
.header-profile-panel {
  right: 0;
  left: auto;
}
.header-user {
  font-size: .85rem;
  color: var(--text-main);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-compact { padding: 8px 12px; font-size: .82rem; }
.nav-burger {
  display: none;
  margin-left: auto;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: inherit;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
}
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 16px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  max-width: 1320px;
  margin: 0 auto;
}
.nav-mobile a {
  padding: 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: .9rem;
}
.nav-mobile a:hover { background: rgba(255,179,0,.12); }
.nav-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.content { padding: 24px; }
.content--topnav {
  padding: 16px 16px 28px;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}
/* Vertical rhythm between stacked cards (Reports, Insights, etc.) */
.content--topnav > section + section,
.content--topnav > .dashboard-dense > section + section {
  margin-top: 1.35rem;
}
.topbar { display:flex; justify-content: space-between; align-items:center; margin-bottom: 14px; }
.userbox { display:flex; gap:10px; align-items:center; }
.top-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom: 14px; }
.action-buttons { display:flex; gap:10px; }
.inline-form { display:flex; gap:10px; align-items:center; }
.chip {
  display:inline-block;
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(125,160,255,.15);
}
.mobile-toggle { display: none; }
.grid { display: grid; gap: 16px; }
[data-theme='light'] .grid {
  gap: 18px;
}
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 10px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  color: var(--text-main);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.38),
    0 3px 6px rgba(0, 0, 0, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.38),
    0 18px 42px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  transition: transform .22s ease, box-shadow .22s ease;
}
.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}
.io-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text-main);
}
.io-card-title--compact {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

/* Compact chart + side panel (Income / Spend / Cashflow) */
.chart-feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr);
  gap: 18px 22px;
  align-items: start;
}
.chart-feature-split__chart {
  text-align: left;
  min-width: 0;
}
.chart-feature-split__chart .chart-page-trend--compact {
  max-width: min(100%, 520px);
  margin-left: 0;
  margin-right: auto;
}
.chart-page-trend--compact {
  max-height: 180px;
  margin-top: 2px;
}
.chart-page-trend--compact canvas {
  max-height: 165px !important;
}
.chart-feature-split__aside {
  min-width: 0;
  padding-top: 2px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  padding-left: 18px;
}
[data-theme='light'] .chart-feature-split__aside {
  border-left-color: rgba(148, 163, 184, 0.22);
}
.chart-feature-split__aside-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.chart-feature-split__ledger-title {
  margin: 1rem 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}
.chart-feature-split__muted {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.chart-feature-split__muted--tight {
  margin-bottom: 0.35rem;
}
.pulse-stat-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.pulse-stat {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.12rem 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.pulse-stat:last-child {
  border-bottom: 0;
}
.pulse-stat dt {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
.pulse-stat dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.cashflow-ledger {
  max-height: 200px;
  overflow: auto;
  margin-top: 4px;
  padding-right: 4px;
}
.cashflow-ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 88px) minmax(0, 1fr) max-content;
  gap: 6px 10px;
  align-items: baseline;
  font-size: 0.84rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-main);
}
.cashflow-ledger__row:last-child {
  border-bottom: 0;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42),
    0 6px 10px rgba(0, 0, 0, 0.32),
    0 16px 36px rgba(0, 0, 0, 0.45),
    0 24px 52px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(15, 23, 42, 0.4);
}
[data-theme='light'] .card {
  background: linear-gradient(165deg, #fffefb 0%, #faf6f0 55%, #f0e9e0 100%);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--text-main);
  box-shadow:
    inset 2px 2px 6px rgba(255, 255, 255, 0.98),
    inset -2px -3px 8px rgba(148, 163, 184, 0.12),
    0 5px 0 rgba(148, 163, 184, 0.08),
    0 10px 22px rgba(15, 23, 42, 0.07),
    0 18px 40px rgba(15, 23, 42, 0.1),
    0 4px 12px rgba(148, 163, 184, 0.14);
}
[data-theme='light'] .card:hover {
  box-shadow:
    inset 2px 2px 8px rgba(255, 255, 255, 0.99),
    inset -2px -3px 10px rgba(148, 163, 184, 0.14),
    0 7px 0 rgba(148, 163, 184, 0.1),
    0 14px 28px rgba(15, 23, 42, 0.09),
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 6px 16px rgba(148, 163, 184, 0.16);
}
[data-theme='light'] .card.neo-panel {
  box-shadow:
    inset 3px 3px 8px rgba(255, 255, 255, 0.98),
    inset -4px -5px 12px rgba(148, 163, 184, 0.16),
    0 6px 0 rgba(148, 163, 184, 0.09),
    -6px -6px 18px rgba(255, 255, 255, 0.85),
    10px 12px 28px rgba(15, 23, 42, 0.1),
    14px 22px 44px rgba(15, 23, 42, 0.11),
    0 5px 14px rgba(59, 130, 246, 0.06);
}
[data-theme='light'] .card.neo-panel:hover {
  box-shadow:
    inset 3px 3px 10px rgba(255, 255, 255, 0.99),
    inset -4px -5px 14px rgba(148, 163, 184, 0.18),
    0 8px 0 rgba(148, 163, 184, 0.11),
    -7px -7px 22px rgba(255, 255, 255, 0.9),
    12px 16px 34px rgba(15, 23, 42, 0.11),
    18px 28px 52px rgba(15, 23, 42, 0.13),
    0 6px 18px rgba(59, 130, 246, 0.08);
}
[data-theme='light'] .insight {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
[data-theme='light'] .nav-dd-panel {
  background: linear-gradient(165deg, #ffffff, #f1f5f9);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
}
.glow { border-color: rgba(255,179,0,.55); }
/* Neumorphic depth on top of base card elevation (all neo-panel UIs use .card.neo-panel) */
.card.neo-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42),
    inset 2px 2px 0 rgba(255, 255, 255, 0.04),
    12px 14px 28px rgba(4, 8, 21, 0.72),
    -8px -10px 26px rgba(50, 76, 145, 0.24),
    4px 8px 18px rgba(0, 0, 0, 0.35),
    0 18px 44px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(15, 23, 42, 0.38);
}
.card.neo-panel:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    inset 2px 2px 0 rgba(255, 255, 255, 0.05),
    14px 18px 34px rgba(4, 8, 21, 0.78),
    -9px -12px 30px rgba(50, 76, 145, 0.28),
    6px 12px 22px rgba(0, 0, 0, 0.4),
    0 22px 52px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(15, 23, 42, 0.42);
}
.value {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 8px 0;
  color: var(--text-main);
}
.fi-income { color: var(--fi-income); font-weight: 700; }
.fi-spend { color: var(--fi-spend); font-weight: 700; }
.accent { color: var(--fi-income-mid); }
.danger { color: var(--text-danger); }
.insight { margin: 8px 0; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.insight.warn { border-left: 4px solid #FFB300; }
.insight.critical { border-left: 4px solid #E53935; }
.insight.info { border-left: 4px solid #00C853; }
.budget-row, .member-row {
  display: grid; gap: 12px; grid-template-columns: 1fr 2fr 1fr; align-items: center; margin: 10px 0;
}
.tx-row { grid-template-columns: 1.5fr 2fr 1fr auto; }
.compact-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.alert-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.alert-critical { border-color: rgba(229,57,53,.55); }
.alert-warn { border-color: rgba(255,179,0,.45); }
.alert-info { border-color: rgba(0,200,83,.45); }
.compare-row {
  display: grid;
  grid-template-columns: 120px 1fr 140px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.compare-bars {
  display: grid;
  gap: 8px;
}
.bar {
  display: block;
  height: 10px;
  border-radius: 999px;
}
.bar.income { background: linear-gradient(90deg, var(--fi-income-deep), var(--fi-income)); }
.bar.expense { background: linear-gradient(90deg, var(--fi-spend-deep), var(--fi-spend)); }

.net-momentum {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 10px;
}
.net-momentum__head,
.net-momentum__row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1fr) 120px;
  gap: 12px 16px;
  align-items: center;
  padding: 10px 14px;
}
.net-momentum__head {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(148,163,184,.08);
  border-bottom: 1px solid var(--card-border);
}
.net-momentum__row:nth-child(even) {
  background: rgba(148,163,184,.04);
}
.net-momentum__month {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-main);
}
.net-momentum__tracks {
  display: grid;
  gap: 6px;
}
.net-momentum__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.15);
  overflow: hidden;
}
.net-momentum__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transition: width .25s ease;
}
.net-momentum__fill--income {
  background: linear-gradient(90deg, var(--fi-income-deep), var(--fi-income));
}
.net-momentum__fill--spend {
  background: linear-gradient(90deg, var(--fi-spend-deep), var(--fi-spend));
}
.net-momentum__nums {
  display: grid;
  gap: 4px;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.net-momentum__net {
  text-align: right;
  font-weight: 800;
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.net-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.net-pill--pos {
  background: rgba(74,222,128,.15);
  color: var(--fi-income-mid);
  border: 1px solid rgba(74,222,128,.35);
}
.net-pill--neg {
  background: rgba(244,63,94,.12);
  color: #fda4af;
  border: 1px solid rgba(244,63,94,.35);
}
[data-theme='light'] .net-pill--pos {
  color: var(--fi-income-deep);
  background: rgba(16,185,129,.12);
}
[data-theme='light'] .net-pill--neg {
  color: #be123c;
}
@media (max-width: 720px) {
  .net-momentum__head,
  .net-momentum__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .net-momentum__net { text-align: left; }
}

.progress {
  height: 10px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,.14);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,.2), inset -2px -2px 4px rgba(255,255,255,.05);
}
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #ffb300, #00C853); }
code {
  color: var(--text-main);
  background: rgba(255,255,255,.13);
  padding: 3px 6px;
  border-radius: 6px;
}
.form-grid { display:grid; gap:10px; max-width: 540px; }
label { font-size: .9rem; color: var(--text-muted); }
input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-main);
  background: rgba(255,255,255,.08);
  box-shadow: inset 3px 3px 8px rgba(0,0,0,.24), inset -3px -3px 8px rgba(255,255,255,.04);
}
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-main);
  background: linear-gradient(160deg, rgba(15,26,54,.9), rgba(20,37,79,.85));
  box-shadow: inset 5px 5px 10px rgba(5,10,25,.7), inset -5px -5px 10px rgba(58,86,160,.22);
}
.neo-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-main);
  background: linear-gradient(160deg, rgba(15,26,54,.9), rgba(20,37,79,.85));
  box-shadow: inset 5px 5px 10px rgba(5,10,25,.7), inset -5px -5px 10px rgba(58,86,160,.22);
}
input::placeholder,
textarea::placeholder,
.neo-input::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}
.btn-primary,
.btn-soft {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.btn-primary {
  color: var(--text-on-accent);
  background: linear-gradient(120deg, #ffb300, #e28300);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 4px 8px rgba(180, 100, 0, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.28);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 6px 12px rgba(180, 100, 0, 0.32),
    0 14px 28px rgba(0, 0, 0, 0.32);
}
.btn-soft {
  color: var(--text-main);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
}
.auth-wrap { min-height: 70vh; display:grid; place-items:center; }
.auth-card { width: min(560px, 95%); }
.muted { color: var(--text-muted); }
.error { color: var(--text-error); }
.flash {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-left: 4px solid #00C853;
  background: rgba(0,200,83,.15);
  border-radius: 10px;
  color: var(--fi-income-soft);
}
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--text-main);
}
.alert-bar {
  border-left: 4px solid rgba(148,163,184,.45);
  background: rgba(148,163,184,.08);
  color: var(--text-main);
}
.alert-bar--positive {
  border-left-color: rgba(34,197,94,.85);
  background: rgba(34,197,94,.1);
}
.alert-bar--negative {
  border-left-color: rgba(244,63,94,.85);
  background: rgba(244,63,94,.1);
}
.alert-bar--neutral {
  border-left-color: rgba(148,163,184,.55);
  background: rgba(148,163,184,.08);
}
.card-forecast {
  border-left: 4px solid rgba(148,163,184,.35);
}
.card-forecast--positive {
  border-color: rgba(34,197,94,.42);
  border-left-color: rgba(34,197,94,.75);
  background: linear-gradient(135deg, rgba(34,197,94,.06), transparent 55%);
}
.card-forecast--negative {
  border-color: rgba(244,63,94,.42);
  border-left-color: rgba(244,63,94,.75);
  background: linear-gradient(135deg, rgba(244,63,94,.08), transparent 55%);
}
.card-forecast--neutral {
  border-left-color: rgba(148,163,184,.5);
}
.value-forecast { font-weight: 800; }
.value-forecast--positive { color: var(--fi-income); }
.value-forecast--negative { color: #fda4af; }
.value-forecast--neutral { color: inherit; }
[data-theme='light'] .value-forecast--positive { color: #15803d; }
[data-theme='light'] .value-forecast--negative { color: #be123c; }
.forecast-strip--positive .card-forecast { border-left-color: rgba(34,197,94,.65); }
.forecast-strip--negative .card-forecast { border-left-color: rgba(244,63,94,.65); }
.forecast-strip--neutral .card-forecast { border-left-color: rgba(148,163,184,.45); }
.chart-card { padding: 12px 14px; }
.chart-compact { max-height: 120px; }
.chart-monthly-compare-host {
  position: relative;
  width: 100%;
  max-height: 280px;
  margin-top: 6px;
}
.chart-monthly-compare-host canvas {
  max-height: 260px !important;
}
.chart-daily-bar-host,
.chart-daily-line-host {
  position: relative;
  width: 100%;
  max-height: 220px;
  margin-top: 4px;
}
.chart-daily-bar-host canvas,
.chart-daily-line-host canvas {
  max-height: 200px !important;
}

/* Income / Spend: donut + list — label/value column tracks content width */
.io-split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  margin-top: 4px;
}
.io-split__viz {
  flex: 0 1 clamp(140px, 34vw, 220px);
  max-width: 100%;
  min-width: 120px;
}
.io-split__viz canvas {
  max-height: 200px !important;
}
.io-split__body {
  flex: 1 1 min(0, 420px);
  min-width: 0;
}
.io-split--solo .io-split__body {
  flex-basis: 100%;
}
.chart-page-trend--tight {
  max-height: 240px;
  margin-top: 2px;
}
.chart-page-trend--tight canvas {
  max-height: 220px !important;
}

.kv-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.kv-rows__empty {
  margin: 0.25rem 0 0;
}
.kv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.kv-row:last-child {
  border-bottom: 0;
}
.kv-row__label {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 0;
  word-break: break-word;
  color: var(--text-main);
}
.kv-row__val {
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--text-main);
}
.kv-row__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.kv-row--pad {
  grid-template-columns: minmax(0, 1fr) auto max-content;
  gap: 8px 12px;
}

.recent-tx {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-tx__empty {
  margin: 0.25rem 0 0;
}
.recent-tx__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) max-content;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.recent-tx__date {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
}
.recent-tx__mid {
  min-width: 0;
}
.recent-tx__cat {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}
.recent-tx__note {
  font-size: 0.76rem;
  margin-top: 2px;
  line-height: 1.35;
  color: var(--text-muted);
}
.recent-tx__amt {
  font-weight: 800;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  padding-top: 1px;
}
@media (max-width: 520px) {
  .recent-tx__item {
    grid-template-columns: 1fr max-content;
    grid-template-rows: auto auto;
  }
  .recent-tx__date {
    grid-column: 1 / -1;
  }
}

.family-meta {
  margin-top: 8px;
}
.family-meta__row {
  margin: 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.family-leave {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.dashboard-dense .card { padding: 14px 16px; }
.dashboard-dense .value { font-size: 1.35rem; }
.scroll-soft { max-height: 200px; overflow-y: auto; padding-right: 4px; }
.chart-toggle { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-toggle button {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text-main);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  cursor: pointer;
}
.chart-toggle button.active {
  background: rgba(255,179,0,.22);
  border-color: rgba(255,179,0,.45);
  color: var(--text-on-accent);
}
.spend-mini { max-height: 100px; }
.chart-host-tight {
  position: relative;
  max-height: 200px;
}
.chart-donut-compact {
  max-width: 200px;
  max-height: 200px;
  margin: 4px auto 0;
}
.chart-donut-compact canvas {
  max-height: 180px !important;
}
.chart-reports-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin-top: 8px;
}
.chart-reports-cell { min-width: 0; }
.chart-subhead {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.chart-reports-inout,
.chart-reports-net {
  position: relative;
  max-height: 240px;
}
.chart-reports-inout canvas,
.chart-reports-net canvas {
  max-height: 220px !important;
}
.chart-page-trend {
  position: relative;
  max-height: 260px;
}
.chart-page-trend canvas {
  max-height: 240px !important;
}
@media (max-width: 900px) {
  .chart-reports-split { grid-template-columns: 1fr; }
}

/* Laravel pagination (non-Tailwind): compact row */
.pagination-fin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--text-main);
}
.pagination-fin-meta {
  margin: 0;
  font-size: .82rem;
  color: var(--text-muted);
}
.pagination-fin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pagination-fin-list li {
  margin: 0;
}
.pagination-fin-current {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-on-accent);
  background: rgba(255,179,0,.22);
  border: 1px solid rgba(255,179,0,.4);
}
.pagination-fin-disabled {
  font-size: .82rem;
  padding: 6px 8px;
  color: var(--text-subtle);
  opacity: 0.8;
}
.pagination-fin-ellipsis {
  padding: 0 4px;
  font-size: .85rem;
  color: var(--text-muted);
  opacity: 0.9;
}

.pagination-fin-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 2.1rem;
  padding: 6px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}
.pagination-fin-nav--icon-only {
  min-width: 2.25rem;
  padding-left: 10px;
  padding-right: 10px;
}
.pagination-fin-nav .pagination-fin-nav__text {
  font-weight: 600;
}
.pagination-fin-chev {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  display: block;
}
.pagination-fin-nav--disabled {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: not-allowed;
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--text-muted);
  opacity: 0.75;
}
.pagination-fin .btn-soft.pagination-fin-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Safety: default Laravel pagination SVGs */
nav[aria-label="Pagination Navigation"] svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
  vertical-align: middle;
}
.pagination-fin .pagination-fin-nav svg,
.pagination-fin .pagination-fin-nav--disabled svg {
  width: 11px !important;
  height: 11px !important;
  max-width: 11px;
  max-height: 11px;
  vertical-align: middle;
}
/* Add Transaction + dense forms */
.form-add-tx {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.form-add-tx__grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.form-add-tx__field label,
.form-add-tx label.field-label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 5px;
  color: var(--text-muted);
}
.form-add-tx__full {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .form-add-tx__grid2 {
    grid-template-columns: 1fr;
  }
}
details.dashboard-details > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  color: var(--text-main);
}
details.dashboard-details > summary::-webkit-details-marker { display: none; }
[data-theme='light'] .app-header {
  border-bottom-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme='light'] .nav-dd-trigger,
[data-theme='light'] .nav-burger,
[data-theme='light'] .header-icon-btn {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.28);
}
[data-theme='light'] .header-profile-trigger {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.28);
}
[data-theme='light'] .nav-mobile a { color: var(--text-main); }
[data-theme='light'] .chip {
  color: var(--text-subtle);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
}
[data-theme='light'] .recent-tx__item {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}
[data-theme='light'] .kv-row {
  border-bottom-color: rgba(148, 163, 184, 0.2);
}
[data-theme='light'] .flash {
  color: #14532d;
  background: rgba(34,197,94,.12);
  border-left-color: #22c55e;
}
[data-theme='light'] .neo-input,
[data-theme='light'] select,
[data-theme='light'] input {
  color: var(--text-main);
  background: linear-gradient(160deg, #ffffff, #f4efe8);
  border-color: rgba(148, 163, 184, 0.35);
}
[data-theme='light'] .btn-soft {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.35);
}
[data-theme='light'] .muted { color: var(--text-muted); }
[data-theme='light'] code {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.15);
}
[data-theme='light'] .progress {
  background: rgba(148, 163, 184, 0.2);
  box-shadow: inset 1px 1px 3px rgba(15, 23, 42, 0.08);
}
[data-theme='light'] .chart-toggle button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(148, 163, 184, 0.35);
}
[data-theme='light'] .chart-toggle button.active {
  background: rgba(251, 191, 36, 0.28);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--text-on-accent);
}
[data-theme='light'] .neo-input::placeholder,
[data-theme='light'] input::placeholder,
[data-theme='light'] textarea::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}
[data-theme='light'] textarea {
  color: var(--text-main);
  background: linear-gradient(160deg, #ffffff, #f4efe8);
  border-color: rgba(148, 163, 184, 0.35);
}
[data-theme='light'] .insight,
[data-theme='light'] .insight p {
  color: var(--text-main);
}
[data-theme='light'] .workspace-strip {
  color: var(--text-main);
  border-top-color: rgba(148, 163, 184, 0.22);
}
[data-theme='light'] .nav-mobile {
  border-top-color: rgba(148, 163, 184, 0.22);
}
[data-theme='light'] .nav-mobile-actions {
  border-top-color: rgba(148, 163, 184, 0.25);
}
[data-theme='light'] .pagination-fin-nav {
  color: var(--text-main);
}
[data-theme='light'] .pagination-fin-disabled,
[data-theme='light'] .pagination-fin-ellipsis {
  color: var(--text-subtle);
}
[data-theme='light'] .pagination-fin-nav--disabled {
  color: var(--text-muted);
}
[data-theme='light'] .cashflow-ledger__row,
[data-theme='light'] .pulse-stat {
  border-bottom-color: rgba(148, 163, 184, 0.22);
}
[data-theme='light'] .net-momentum__head {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.1);
}
[data-theme='light'] .chart-subhead {
  color: var(--text-muted);
}
[data-theme='light'] .alert-bar,
[data-theme='light'] .alert-bar strong {
  color: var(--text-main);
}
[data-theme='light'] .family-leave {
  border-top-color: rgba(148, 163, 184, 0.25);
}
[data-theme='light'] .header-user {
  color: var(--text-muted);
}
@media (max-width: 960px) {
  .nav-desktop { display: none; }
  .header-actions { display: none; }
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; }
  .nav-mobile { display: flex; }
  .cols-3, .cols-2, .compact-grid { grid-template-columns: 1fr; }
  .top-actions, .action-buttons, .inline-form { flex-direction: column; align-items: stretch; }
  .budget-row, .member-row, .tx-row, .compare-row { grid-template-columns: 1fr; }
  .chart-feature-split {
    grid-template-columns: 1fr;
  }
  .chart-feature-split__aside {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 14px;
  }
  [data-theme='light'] .chart-feature-split__aside {
    border-top-color: rgba(148, 163, 184, 0.22);
  }
  .chart-feature-split__chart .chart-page-trend--compact {
    max-width: 100%;
  }
  .cashflow-ledger__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
@media (min-width: 961px) {
  .nav-mobile { display: none !important; }
}

