:root {
  --bg: #f3eddf;
  --surface: #fffaf1;
  --surface-soft: #f8f0df;
  --line: #dfd1bc;
  --line-strong: #c9b69a;
  --text: #17201c;
  --muted: #66736b;
  --blue: #2d5b4f;
  --blue-soft: #e2eee7;
  --green: #557b43;
  --green-soft: #e7f0dd;
  --red: #a3422f;
  --red-soft: #f8e3dc;
  --orange: #b8673c;
  --orange-soft: #f8e7d9;
  --purple: #625778;
  --purple-soft: #e9e3f0;
  --yellow: #b38a35;
  --yellow-soft: #f4e9bf;
  --shadow: 0 18px 42px rgba(45, 35, 20, .09);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 7% 0%, rgba(184, 103, 60, .16), transparent 31rem),
    radial-gradient(circle at 88% 10%, rgba(45, 91, 79, .18), transparent 28rem),
    linear-gradient(145deg, #f3eddf 0%, #f9f3e7 52%, #edf1e6 100%);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: clamp(240px, 18vw, 270px) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100vw;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 18px;
  background: rgba(255, 250, 241, .9);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 30px rgba(45, 35, 20, .04);
}

.sidebar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: clamp(1.05rem, 1.2vw, 1.2rem);
  font-weight: 850;
}

.sidebar-label,
.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark,
.nav-icon,
.icon-disc {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: var(--text);
  color: var(--surface);
  font-size: .72rem;
  font-weight: 900;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex: 0 0 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 241, .78);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

.sidebar-toggle:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  color: #4d5b55;
  font-weight: 720;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--blue);
}

.nav-link.active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-icon {
  width: 22px;
  color: currentColor;
  font-size: 1.05rem;
}

.nav-svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell.is-sidebar-collapsed .sidebar {
  gap: 24px;
  padding: 24px 12px;
}

.app-shell.is-sidebar-collapsed .sidebar-top {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.is-sidebar-collapsed .brand {
  justify-content: center;
}

.app-shell.is-sidebar-collapsed .sidebar-label,
.app-shell.is-sidebar-collapsed .nav-label,
.app-shell.is-sidebar-collapsed .help-arrow {
  display: none;
}

.app-shell.is-sidebar-collapsed .nav-link {
  justify-content: center;
  gap: 0;
  padding: 0;
}

.app-shell.is-sidebar-collapsed .help-card {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px;
}

.help-card {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff9ee, #edf2e4);
  color: var(--blue);
  box-shadow: var(--shadow);
}

.help-card strong {
  display: block;
  font-size: .94rem;
}

.help-card span {
  color: var(--muted);
  font-size: .78rem;
}

.main {
  min-width: 0;
  padding: clamp(16px, 2vw, 26px) clamp(16px, 2.1vw, 28px) 40px;
}

.main.page-transition {
  animation: page-enter 240ms cubic-bezier(.2, .72, .22, 1) both;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.992);
    filter: blur(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .main.page-transition {
    animation: none;
  }
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.select,
.input,
.chip,
.segmented button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--text);
  border-color: var(--text);
  color: white;
  box-shadow: 0 14px 24px rgba(23, 32, 28, .18);
}

.button.ghost {
  color: var(--blue);
}

.select,
.input {
  min-height: 42px;
  padding: 0 14px;
  outline: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(185px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  min-width: 0;
  background: rgba(255, 250, 241, .84);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.metric-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: clamp(14px, 1.5vw, 18px);
}

.metric-card h3,
.panel h2,
.panel h3,
.table-panel h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.money {
  display: block;
  margin: 4px 0;
  color: var(--blue);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.1;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.money.green,
.positive {
  color: var(--green);
}

.money.red,
.negative {
  color: var(--red);
}

.money.orange {
  color: var(--orange);
}

.money.purple {
  color: var(--purple);
}

.icon-disc {
  width: clamp(44px, 4.2vw, 54px);
  height: clamp(44px, 4.2vw, 54px);
  border-radius: 999px;
  color: white;
  font-size: 1.3rem;
  font-weight: 900;
}

.icon-disc.green {
  background: linear-gradient(135deg, #719558, #3f6c36);
}

.icon-disc.blue {
  background: linear-gradient(135deg, #467c70, #1f4e44);
}

.icon-disc.orange {
  background: linear-gradient(135deg, #d38a55, #9f4f2c);
}

.icon-disc.red {
  background: linear-gradient(135deg, #c66954, #933523);
}

.icon-disc.purple {
  background: linear-gradient(135deg, #7d7192, #514663);
}

.status-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid #cddfba;
  border-radius: 12px;
  background: rgba(239, 247, 228, .8);
}

.status-banner strong {
  color: var(--green);
}

.demo-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 177, 105, .34);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(255, 177, 105, .18), transparent 18rem),
    rgba(255, 177, 105, .08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.demo-mode-banner strong,
.demo-mode-banner span {
  display: block;
}

.demo-mode-banner strong {
  color: var(--orange);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.demo-mode-banner span {
  margin-top: 3px;
  color: var(--text);
  font-weight: 850;
}

.demo-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.start-here-card,
.empty-state-card {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-color: rgba(125, 183, 255, .22);
}

.start-here-card {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr);
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(125, 183, 255, .14), transparent 20rem),
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
}

.start-here-card h2,
.empty-state-card h2 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.7rem, 4vw, 3.4rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.start-here-card p,
.empty-state-card p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
}

.start-steps {
  display: grid;
  gap: 8px;
}

.start-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
}

.start-steps strong {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(125, 183, 255, .18);
  color: var(--blue);
  font-size: .8rem;
}

.start-steps span {
  color: var(--text);
  font-weight: 850;
}

.start-actions,
.empty-state-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(125, 183, 255, .28);
  border-radius: 16px;
  background: rgba(125, 183, 255, .055);
}

.inline-empty-state strong {
  color: var(--text);
  font-size: 1rem;
}

.inline-empty-state span {
  color: var(--muted);
}

@media (max-width: 720px) {
  .demo-mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-mode-actions {
    justify-content: stretch;
  }

  .demo-mode-actions .button {
    flex: 1 1 160px;
  }

  .start-here-card {
    grid-template-columns: 1fr;
  }

  .start-actions .button,
  .empty-state-actions .button {
    flex: 1 1 160px;
  }
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1d5c3;
}

.progress-fill {
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: var(--bar, var(--blue));
}

.dashboard-grid,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: start;
}

.panel,
.table-panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
}

.chart-card {
  min-height: 274px;
}

.bar-chart {
  height: 212px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(5px, .85vw, 12px);
  align-items: end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.month-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-items: end;
  min-height: 160px;
}

.bar {
  border-radius: 5px 5px 0 0;
  min-height: 18px;
  background: var(--bar);
}

.month-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

.donut-wrap {
  display: grid;
  grid-template-columns: minmax(124px, 160px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.donut {
  width: min(160px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--donut, conic-gradient(var(--blue) 0 28%, var(--green) 28% 50%, var(--purple) 50% 64%, var(--orange) 64% 75%, var(--yellow) 75% 83%, #a99c87 83% 100%));
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: inherit;
  background: var(--surface);
}

.donut span {
  position: relative;
  z-index: 1;
  text-align: center;
  font-weight: 900;
}

.legend-list,
.mini-list,
.settings-list,
.rule-list {
  display: grid;
  gap: 12px;
}

.legend-row,
.mini-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.legend-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--blue));
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.table td:last-child,
.table th:last-child {
  text-align: right;
}

.table.compact th,
.table.compact td {
  padding: 7px 12px;
}

.table .indent {
  padding-left: 34px;
  color: #4d5b55;
}

.table .parent-row {
  background: rgba(235, 225, 209, .72);
  font-weight: 850;
}

.table-input,
.table-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.import-frame-shell {
  min-height: calc(100vh - 96px);
  padding: 0;
  overflow: hidden;
}

.import-frame {
  width: 100%;
  min-height: calc(100vh - 96px);
  display: block;
  border: 0;
  background: transparent;
}

.amount-input {
  max-width: 110px;
  text-align: right;
}

.action-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  padding: 4px 6px;
}

.action-link.danger {
  color: var(--red);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.pill.red {
  background: var(--red-soft);
  color: var(--red);
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.pill.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.pill.gray {
  background: #ede5d7;
  color: var(--muted);
}

.filters-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
}

.suggestion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #cddfba;
  border-radius: 12px;
  background: rgba(239, 247, 228, .78);
}

.suggestion-banner strong,
.suggestion-banner span {
  display: block;
}

.suggestion-banner span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .9rem;
}

.filters-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(150px, .6fr));
  gap: 12px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented button,
.chip {
  min-height: 38px;
  padding: 0 14px;
  font-weight: 780;
}

.segmented button.active {
  border-color: #a7bc9a;
  background: var(--blue-soft);
  color: var(--blue);
}

.side-stack {
  display: grid;
  gap: 16px;
}

.suggestion-inline {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 240, 223, .72);
  color: var(--muted);
  font-size: .82rem;
  text-align: left;
}

.suggestion-inline.is-applied {
  border-color: #cddfba;
  background: rgba(239, 247, 228, .72);
}

.suggestion-inline strong {
  color: var(--text);
}

.suggestion-inline small {
  color: var(--muted);
}

.suggestion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  padding: 0 10px;
}

.suggestion-actions button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.alert-card {
  border-color: #e3b3a4;
  background: rgba(255, 245, 239, .85);
}

.alert-card h3 {
  color: var(--red);
}

.account-group,
.budget-section {
  overflow: hidden;
  margin-bottom: 14px;
}

.group-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  text-align: right;
}

.collapsed-note {
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 700;
}

.group-title,
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 850;
}

.goal-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

.goal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.goal-meta span,
.setting-label {
  color: var(--muted);
  font-size: .82rem;
}

.goal-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 1.05rem;
}

.line-chart {
  width: 100%;
  height: 270px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.setting-row .select {
  width: min(220px, 100%);
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle {
  width: 46px;
  height: 26px;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #d8cbb8;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.toggle.on {
  background: var(--blue);
  border-color: var(--blue);
}

.toggle.on::after {
  left: 23px;
}

.range {
  width: 100%;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: .85rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 250, 241, .95);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast[hidden] {
  display: none;
}

.toast-message {
  min-width: 0;
  line-height: 1.35;
}

.toast-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(45, 91, 79, .2);
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-size: .86rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.toast-action:hover {
  transform: translateY(-1px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(23, 32, 28, .34);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 241, .96);
  box-shadow: 0 24px 80px rgba(23, 32, 28, .24);
  padding: 20px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.intro-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.intro-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.intro-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 10px;
}

.intro-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.28rem;
  font-weight: 950;
  letter-spacing: -.04em;
}

.intro-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.intro-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-weight: 820;
}

.intro-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 12px;
}

.intro-links a:hover {
  color: var(--text);
}

.intro-links .intro-nav-cta {
  padding: 0 15px;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 12px 24px rgba(23, 32, 28, .18);
  white-space: nowrap;
}

.intro-links .intro-nav-cta:hover {
  background: #2f3834;
  color: var(--surface);
}

.intro-hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr);
  gap: 42px;
  align-items: center;
  padding: 28px 0 44px;
}

.intro-eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, .74);
  color: var(--muted);
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(45, 35, 20, .05);
}

.intro-eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.intro-hero h1 {
  max-width: 760px;
  margin: 16px 0;
  font-size: clamp(3.3rem, 8vw, 6.8rem);
  line-height: .86;
  letter-spacing: -.085em;
}

.intro-lead {
  max-width: 640px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.intro-note {
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

.intro-note strong {
  color: var(--orange);
}

.intro-preview {
  position: relative;
}

.intro-preview::before,
.intro-preview::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  z-index: 0;
}

.intro-preview::before {
  inset: -34px auto auto -26px;
  width: 115px;
  height: 115px;
  background: rgba(184, 103, 60, .22);
}

.intro-preview::after {
  right: -24px;
  bottom: -28px;
  width: 160px;
  height: 160px;
  background: rgba(85, 123, 67, .2);
}

.ledger-card {
  position: relative;
  z-index: 1;
  padding: 20px;
  border-radius: 28px;
  transform: rotate(1.1deg);
}

.ledger-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.ledger-card p {
  margin: 0;
  color: var(--muted);
}

.ledger-sheet {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 250, 241, .94), rgba(248, 240, 223, .88));
}

.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-weight: 820;
}

.ledger-row:first-child {
  border-top: 0;
  background: rgba(235, 225, 209, .75);
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ledger-row strong {
  color: var(--blue);
}

.ledger-row .negative {
  color: var(--red);
}

.intro-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 0 34px;
}

.intro-stat {
  padding: 18px;
}

.intro-stat span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.intro-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.55rem;
}

.intro-section {
  padding: 38px 0;
}

.intro-section h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  letter-spacing: -.055em;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.intro-feature {
  padding: 20px;
}

.intro-feature h3 {
  margin: 0 0 8px;
}

.intro-feature p {
  margin: 0;
  color: var(--muted);
}

.intro-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 24px;
  margin: 28px 0 44px;
}

.intro-cta h2 {
  margin: 0 0 6px;
}

.intro-cta p {
  margin: 0;
  color: var(--muted);
}

.intro-footer {
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    padding: 14px;
  }

  .app-shell.is-sidebar-collapsed .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
  }

  .app-shell.is-sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  .app-shell.is-sidebar-collapsed .sidebar-label,
  .app-shell.is-sidebar-collapsed .nav-label {
    display: inline;
  }

  .app-shell.is-sidebar-collapsed .nav-link {
    justify-content: flex-start;
    gap: 13px;
    padding: 0 14px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-card {
    display: none;
  }

  .main {
    padding: 20px 16px 34px;
  }

  .page-header {
    display: grid;
  }

  .header-actions {
    justify-content: start;
  }

  .filters-row,
  .settings-grid,
  .goal-meta,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .suggestion-banner {
    display: grid;
  }

  .section-head {
    display: grid;
    justify-items: start;
  }

  .section-actions {
    justify-content: flex-start;
    text-align: left;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .intro-nav {
    align-items: flex-start;
  }

  .intro-links {
    flex-wrap: wrap;
  }

  .intro-hero,
  .intro-cta {
    grid-template-columns: 1fr;
  }

  .intro-hero {
    min-height: auto;
  }

  .intro-preview {
    max-width: 560px;
  }

  .intro-stats,
  .intro-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .intro-shell {
    width: min(100% - 28px, 1180px);
  }

  .intro-nav {
    display: grid;
  }

  .intro-links {
    justify-content: flex-start;
  }

  .intro-hero h1 {
    font-size: clamp(3rem, 18vw, 4.9rem);
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 14px;
  }

  .intro-actions .button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: start;
  }

  .modal-actions {
    display: grid;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .table-panel {
    overflow-x: auto;
  }

  .table {
    min-width: 720px;
  }
}

/* Premium dark app layer */
:root {
  --bg: #070b10;
  --surface: rgba(15, 23, 30, .86);
  --surface-soft: rgba(28, 40, 48, .78);
  --line: rgba(218, 233, 225, .12);
  --line-strong: rgba(218, 233, 225, .22);
  --text: #f4f7f2;
  --muted: #9aa9a2;
  --blue: #7db7ff;
  --blue-soft: rgba(125, 183, 255, .16);
  --green: #72e0a3;
  --green-soft: rgba(114, 224, 163, .14);
  --red: #ff7a68;
  --red-soft: rgba(255, 122, 104, .14);
  --orange: #ffb169;
  --orange-soft: rgba(255, 177, 105, .15);
  --purple: #b79cff;
  --purple-soft: rgba(183, 156, 255, .15);
  --yellow: #f5d36c;
  --yellow-soft: rgba(245, 211, 108, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  color-scheme: dark;
}

html,
body {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 10% -10%, rgba(112, 167, 255, .18), transparent 32rem),
    radial-gradient(circle at 92% 4%, rgba(114, 224, 163, .14), transparent 34rem),
    linear-gradient(145deg, #070b10 0%, #0c1318 46%, #101b19 100%);
}

.sidebar {
  background: rgba(8, 13, 18, .78);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 14px 0 44px rgba(0, 0, 0, .24);
  backdrop-filter: blur(22px);
}

.brand-mark,
.button.primary {
  background: linear-gradient(135deg, #f4f7f2, #aab8b1);
  color: #081016;
}

.sidebar-toggle,
.button,
.select,
.input,
.chip,
.segmented button,
.table-input,
.table-select {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .12);
  color: var(--text);
  box-shadow: none;
}

.nav-link {
  color: #a8b8b0;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(114, 224, 163, .1);
  color: var(--green);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--green), 0 12px 36px rgba(0, 0, 0, .18);
}

.help-card,
.card,
.panel,
.table-panel,
.account-group,
.budget-section,
.goal-card,
.modal-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
  border-color: rgba(255, 255, 255, .12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card {
  background:
    radial-gradient(circle at top left, rgba(114, 224, 163, .12), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
}

.group-head,
.section-head,
.table .parent-row {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .1);
}

.table th,
.table td,
.goal-meta,
.setting-row {
  border-color: rgba(255, 255, 255, .1);
}

.status-banner,
.suggestion-banner {
  border-color: rgba(114, 224, 163, .2);
  background: linear-gradient(135deg, rgba(114, 224, 163, .12), rgba(112, 167, 255, .08));
}

.progress-track {
  background: rgba(255, 255, 255, .11);
}

.pill.gray,
.chip {
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
}

.toast {
  background: rgba(12, 19, 24, .94);
  border-color: rgba(255, 255, 255, .14);
}

.modal-backdrop {
  background: rgba(0, 0, 0, .58);
}

.intro-page .ledger-card {
  background:
    radial-gradient(circle at 100% 100%, rgba(114, 224, 163, .12), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
}

.intro-page .ledger-card h2 {
  color: var(--text);
}

.intro-page .ledger-card p {
  color: #aeb9b4;
}

.intro-page .ledger-sheet {
  background: linear-gradient(180deg, #f5eddf, #ece3d4);
  border-color: rgba(255, 255, 255, .16);
  color: #17201c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 18px 42px rgba(0, 0, 0, .22);
}

.intro-page .ledger-row {
  border-color: rgba(36, 47, 42, .09);
  color: #17201c;
}

.intro-page .ledger-row:first-child {
  background: rgba(232, 219, 198, .92);
  color: #73837a;
}

.intro-page .ledger-row strong {
  color: #3c86ff;
}

.intro-page .ledger-row .negative {
  color: #f05f50;
}

/* Intro page: one-screen landing with subtle local-data rain. */
.intro-page {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(60, 134, 255, .2), transparent 22rem),
    radial-gradient(circle at 82% 74%, rgba(125, 183, 255, .14), transparent 24rem),
    linear-gradient(135deg, #050b10 0%, #0a1218 52%, #0d1620 100%);
}

.intro-page .matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .34;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}

.intro-page .matrix-rain span {
  position: absolute;
  top: -38rem;
  left: var(--x);
  color: rgba(125, 183, 255, .42);
  font-family: "Courier New", monospace;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1.2;
  text-orientation: mixed;
  text-shadow: 0 0 18px rgba(60, 134, 255, .34);
  writing-mode: vertical-rl;
  animation: matrix-fall var(--speed) linear infinite;
  animation-delay: var(--delay);
}

.intro-page .matrix-rain span:nth-child(1) { --x: 5%; --speed: 17s; --delay: -4s; }
.intro-page .matrix-rain span:nth-child(2) { --x: 17%; --speed: 22s; --delay: -12s; }
.intro-page .matrix-rain span:nth-child(3) { --x: 31%; --speed: 18s; --delay: -7s; }
.intro-page .matrix-rain span:nth-child(4) { --x: 45%; --speed: 24s; --delay: -16s; }
.intro-page .matrix-rain span:nth-child(5) { --x: 59%; --speed: 19s; --delay: -9s; }
.intro-page .matrix-rain span:nth-child(6) { --x: 72%; --speed: 23s; --delay: -14s; }
.intro-page .matrix-rain span:nth-child(7) { --x: 84%; --speed: 20s; --delay: -3s; }
.intro-page .matrix-rain span:nth-child(8) { --x: 94%; --speed: 25s; --delay: -18s; }

@keyframes matrix-fall {
  to {
    transform: translateY(145dvh);
  }
}

.intro-page .intro-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.intro-page .intro-nav {
  padding: clamp(14px, 2.2vh, 22px) 0 0;
}

.intro-page .intro-hero {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr);
  gap: clamp(22px, 4vw, 42px);
  padding: clamp(8px, 2.6vh, 28px) 0 clamp(8px, 3vh, 26px);
}

.intro-page .intro-hero h1 {
  font-size: clamp(3rem, 7.4vw, 6.1rem);
  margin: clamp(10px, 2vh, 16px) 0;
}

.intro-page .intro-lead {
  margin-bottom: clamp(14px, 2vh, 20px);
}

.intro-page .intro-actions {
  margin-bottom: 12px;
}

.intro-page .intro-footer {
  padding: 0 0 clamp(12px, 2vh, 22px);
}

.intro-page .intro-preview::before {
  background: rgba(60, 134, 255, .2);
}

.intro-page .intro-preview::after {
  background: rgba(125, 183, 255, .16);
}

@media (max-width: 880px), (max-height: 720px) {
  .intro-page .intro-hero {
    grid-template-columns: 1fr;
  }

  .intro-page .intro-preview {
    display: none;
  }
}

@media (max-width: 640px) {
  .intro-page .intro-nav {
    display: flex;
  }

  .intro-page .intro-hero h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .intro-page .intro-footer {
    font-size: .8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-page .matrix-rain span {
    animation: none;
  }
}

/* Budget parent collapse final layer */
.budget-parent-row {
  cursor: pointer;
}

.budget-parent-row.is-collapsed {
  background: rgba(255, 255, 255, .032);
}

.budget-parent-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.budget-parent-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--blue);
  cursor: pointer;
}

.budget-caret {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 160ms ease;
}

.budget-parent-row.is-collapsed .budget-caret {
  transform: translateX(-1px) rotate(-45deg);
}

/* Budget page final overrides after theme layers */
.budget-score-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.budget-score-card {
  min-height: 104px;
  padding: 14px;
}

.budget-section {
  margin-bottom: 0;
}

.budget-section-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.budget-section-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, auto)) minmax(120px, 180px) auto;
  gap: 12px;
  align-items: center;
}

.budget-section-negative .section-head,
.budget-section-negative {
  border-color: rgba(255, 122, 104, .22);
}

.budget-section-neutral .section-head,
.budget-section-neutral {
  border-color: rgba(125, 183, 255, .16);
}

.budget-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.55fr) minmax(112px, .7fr) minmax(92px, .6fr) minmax(98px, .65fr) minmax(110px, .75fr) minmax(128px, .8fr) minmax(64px, auto);
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.budget-grid-head {
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(255, 255, 255, .025);
}

.budget-parent-row {
  background: rgba(255, 255, 255, .042);
  font-weight: 850;
  cursor: pointer;
}

.budget-parent-row.is-collapsed {
  background: rgba(255, 255, 255, .032);
}

.budget-parent-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.budget-parent-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--blue);
  cursor: pointer;
}

.budget-caret {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 160ms ease;
}

.budget-parent-row.is-collapsed .budget-caret {
  transform: translateX(-1px) rotate(-45deg);
}

.budget-status-banner strong,
.budget-available-main .hero-kicker {
  color: var(--blue);
}

@media (max-width: 1240px) {
  .budget-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .budget-section-head,
  .budget-section-totals {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .budget-score-grid {
    grid-template-columns: 1fr;
  }

  .budget-grid-head {
    display: none;
  }

  .budget-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px;
  }
}

/* Blue-first dark accent pass. Positive values can stay green; UI glow stays blue. */
body {
  background:
    radial-gradient(circle at 10% -10%, rgba(112, 167, 255, .2), transparent 32rem),
    radial-gradient(circle at 92% 4%, rgba(125, 183, 255, .14), transparent 34rem),
    linear-gradient(145deg, #070b10 0%, #0c1318 46%, #101b19 100%);
}

.metric-card,
.metric-card:nth-child(1),
.metric-card:nth-child(4) {
  background:
    radial-gradient(circle at top left, rgba(125, 183, 255, .13), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
}

.icon-disc.green,
.metric-card .icon-disc.green {
  background: linear-gradient(135deg, #7db7ff, #3569b7);
}

.budget-section-green .section-head {
  border-left-color: var(--blue);
}

.status-banner strong,
.status-banner > span:last-child,
.suggestion-banner strong {
  color: var(--blue);
}

.pill.green {
  background: var(--blue-soft);
  color: var(--blue);
}

/* Budget page polish */
.budget-available-banner {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.8fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: clamp(18px, 2.4vw, 26px);
  border-color: rgba(125, 183, 255, .2);
  background:
    radial-gradient(circle at top left, rgba(125, 183, 255, .18), transparent 24rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
}

.budget-available-banner.is-negative {
  border-color: rgba(255, 122, 104, .26);
}

.budget-available-main {
  display: grid;
  gap: 6px;
}

.budget-available-main strong {
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: .92;
  letter-spacing: -.07em;
}

.budget-available-main small,
.budget-available-stats small,
.budget-row-name span,
.budget-mobile-label,
.budget-row-status small {
  color: var(--muted);
  font-weight: 760;
}

.budget-available-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.budget-available-stats div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.budget-available-stats span,
.budget-grid-head span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.budget-available-stats strong {
  font-size: 1.12rem;
}

.budget-toolbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.budget-score-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.budget-score-card {
  min-height: 104px;
  padding: 14px;
}

.budget-score-card strong {
  font-size: 1.35rem;
}

.budget-score-negative {
  border-color: rgba(255, 122, 104, .24);
}

.budget-score-neutral {
  border-color: rgba(125, 183, 255, .16);
}

.budget-status-banner {
  margin-bottom: 14px;
}

.budget-sections-stack {
  display: grid;
  gap: 12px;
}

.budget-section {
  margin-bottom: 0;
}

.budget-section-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, auto);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.budget-section-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, auto)) minmax(120px, 180px) auto;
  gap: 12px;
  align-items: center;
}

.budget-section-totals span {
  display: grid;
  gap: 2px;
}

.budget-section-totals small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.budget-section-negative .section-head,
.budget-section-negative {
  border-color: rgba(255, 122, 104, .22);
}

.budget-section-neutral .section-head,
.budget-section-neutral {
  border-color: rgba(125, 183, 255, .16);
}

.budget-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.55fr) minmax(112px, .7fr) minmax(92px, .6fr) minmax(98px, .65fr) minmax(110px, .75fr) minmax(128px, .8fr) minmax(64px, auto);
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.budget-grid-head {
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(255, 255, 255, .025);
}

.budget-parent-row {
  background: rgba(255, 255, 255, .042);
  font-weight: 850;
  cursor: pointer;
}

.budget-parent-row.is-collapsed {
  background: rgba(255, 255, 255, .032);
}

.budget-parent-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.budget-parent-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--blue);
  cursor: pointer;
}

.budget-caret {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 160ms ease;
}

.budget-parent-row.is-collapsed .budget-caret {
  transform: translateX(-1px) rotate(-45deg);
}

.budget-line-row {
  min-height: 48px;
}

.budget-line-row.is-child .budget-row-name {
  padding-left: 22px;
  position: relative;
}

.budget-line-row.is-child .budget-row-name::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: rgba(125, 183, 255, .26);
}

.budget-row-name {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.budget-row-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-row-input {
  display: grid;
  gap: 4px;
}

.budget-row .amount-input {
  max-width: 118px;
}

.budget-row-progress .progress-track {
  min-width: 90px;
  height: 7px;
}

.budget-row-status {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.budget-row-actions {
  text-align: right;
}

.budget-mobile-label {
  display: none;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.neutral {
  color: var(--muted);
}

.budget-empty-state {
  display: grid;
  gap: 12px;
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 14px;
  border-color: rgba(125, 183, 255, .2);
}

.budget-empty-state h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.budget-empty-state p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .budget-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .budget-available-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .budget-available-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-section-head,
  .budget-section-totals {
    grid-template-columns: 1fr;
  }

  .budget-section-totals {
    gap: 8px;
  }

  .section-progress {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .budget-score-grid,
  .budget-available-stats {
    grid-template-columns: 1fr;
  }

  .budget-grid-head {
    display: none;
  }

  .budget-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px;
  }

  .budget-row-name,
  .budget-row-progress,
  .budget-row-status,
  .budget-row-actions {
    grid-column: 1 / -1;
  }

  .budget-mobile-label {
    display: block;
  }

  .budget-row .amount-input {
    max-width: none;
  }

  .budget-row-actions {
    text-align: left;
  }

  .budget-toolbar .button {
    flex: 1 1 180px;
  }
}

.completion-screen {
  display: grid;
  gap: 18px;
  animation: completion-fade 520ms cubic-bezier(.2, .72, .22, 1) both;
}

.completion-hero {
  min-height: 320px;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(114, 224, 163, .22), transparent 26rem),
    radial-gradient(circle at 90% 18%, rgba(112, 167, 255, .18), transparent 24rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.completion-kicker {
  color: var(--green);
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.completion-hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: .82;
  letter-spacing: -.08em;
}

.completion-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.completion-actions,
.completion-stat-grid,
.completion-grid {
  display: grid;
  gap: 14px;
}

.completion-actions {
  grid-template-columns: repeat(3, max-content);
  align-items: center;
}

.completion-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.completion-stat {
  display: grid;
  gap: 6px;
  padding: 18px;
  animation: stat-rise 500ms cubic-bezier(.2, .72, .22, 1) both;
  animation-delay: var(--delay, 0ms);
}

.completion-stat span,
.completion-stat small {
  color: var(--muted);
  font-weight: 750;
}

.completion-stat strong {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.completion-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
}

.monthly-snapshot-card,
.completion-chart-card {
  padding: 24px;
}

.snapshot-insight {
  color: #d9efe3;
  font-size: 1.05rem;
  line-height: 1.55;
}

.snapshot-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.completion-bars {
  display: grid;
  gap: 14px;
}

.completion-bars div {
  display: grid;
  gap: 8px;
}

.completion-bars span {
  color: var(--muted);
  font-weight: 800;
}

.completion-bars i {
  width: var(--bar, 0%);
  height: 12px;
  display: block;
  border-radius: 999px;
  background: var(--green);
  animation: bar-fill 760ms cubic-bezier(.2, .72, .22, 1) both;
}

.completion-bars i.red {
  background: var(--red);
}

.completion-bars i.blue {
  background: var(--blue);
}

.completion-ring {
  width: min(230px, 60vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 28px auto 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(12, 19, 24, .96) 0 55%, transparent 56%),
    conic-gradient(var(--green) var(--value, 0%), rgba(255, 255, 255, .11) 0);
  animation: stat-rise 620ms cubic-bezier(.2, .72, .22, 1) both;
}

.completion-ring span {
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
}

.completion-ring small {
  color: var(--muted);
  font-size: .8rem;
}

@keyframes completion-fade {
  from { opacity: 0; transform: translateY(14px) scale(.992); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes stat-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bar-fill {
  from { width: 0; }
}

@media (max-width: 980px) {
  .completion-stat-grid,
  .completion-grid {
    grid-template-columns: 1fr;
  }

  .completion-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .completion-screen,
  .completion-stat,
  .completion-ring,
  .completion-bars i {
    animation: none;
  }
}

/* Command-center polish */
.hero-kicker {
  color: var(--green);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.budget-hero,
.command-center,
.transaction-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(114, 224, 163, .16), transparent 23rem),
    radial-gradient(circle at 90% 20%, rgba(112, 167, 255, .13), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
}

.budget-hero h2,
.command-center h2,
.transaction-command h2 {
  max-width: 780px;
  margin: 8px 0;
  font-size: clamp(2rem, 4.5vw, 4.3rem);
  line-height: .92;
  letter-spacing: -.065em;
}

.budget-hero p,
.command-center p,
.transaction-command p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.budget-hero-total,
.transaction-totals {
  min-width: min(320px, 100%);
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
}

.budget-hero-total span,
.budget-hero-total small,
.transaction-totals span {
  color: var(--muted);
  font-weight: 800;
}

.budget-hero-total strong {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.budget-score-grid,
.command-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.budget-score-card,
.command-tile {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .08), transparent 12rem),
    rgba(255, 255, 255, .04);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
}

.budget-score-card span,
.command-tile span,
.budget-score-card small,
.command-tile small {
  color: var(--muted);
  font-weight: 800;
}

.budget-score-card strong,
.command-tile strong {
  font-size: 1.2rem;
}

.budget-score-card.green {
  border-color: rgba(114, 224, 163, .2);
}

.budget-score-card.orange {
  border-color: rgba(255, 177, 105, .2);
}

.budget-score-card.blue {
  border-color: rgba(112, 167, 255, .2);
}

.budget-score-card.purple {
  border-color: rgba(183, 156, 255, .2);
}

.section-head {
  align-items: stretch;
}

.section-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 760;
}

.section-total {
  display: grid;
  gap: 2px;
}

.section-total small,
.status-note {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 760;
}

.section-progress {
  width: min(180px, 28vw);
}

.budget-parent-row td:first-child,
.budget-line-row td:first-child {
  display: grid;
  gap: 2px;
}

.budget-parent-row .progress-track,
.budget-line-row .progress-track,
.budget-score-card .progress-track,
.command-tile .progress-track {
  min-width: 92px;
  height: 8px;
}

.budget-line-row .action-link,
.budget-parent-row .action-link {
  margin-left: 8px;
}

.budget-action-card {
  border-color: rgba(255, 177, 105, .18);
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.action-item strong,
.action-item small {
  display: block;
}

.action-item small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 760;
}

.command-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.transaction-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: min(430px, 100%);
}

.transaction-totals div {
  display: grid;
  gap: 4px;
}

.transaction-totals strong {
  font-size: 1.25rem;
}

.filter-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 760;
}

.transaction-row td:first-child,
.transaction-row td:nth-child(2) {
  display: grid;
  gap: 3px;
}

.account-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 180px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-cell {
  font-size: 1.02rem;
  font-weight: 900;
}

.transaction-table-card {
  overflow: hidden;
}

.transaction-table-scroll {
  max-height: min(64vh, 680px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .02);
}

.transaction-grid {
  --transaction-columns: minmax(104px, .58fr) minmax(260px, 2.15fr) minmax(122px, .72fr) minmax(148px, .86fr) minmax(148px, .86fr) 112px 70px;
  min-width: 1030px;
  display: grid;
  grid-template-columns: var(--transaction-columns);
  gap: 10px;
  align-items: center;
}

.transaction-grid > * {
  min-width: 0;
}

.transaction-grid-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  background: rgba(8, 16, 22, .97);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}

.transaction-grid-header span:nth-child(6),
.transaction-grid-header span:nth-child(7) {
  text-align: right;
}

.transaction-grid-row {
  min-height: 56px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.transaction-grid-row:last-child {
  border-bottom: 0;
}

.transaction-date,
.transaction-description,
.transaction-field {
  display: grid;
  gap: 2px;
}

.transaction-date strong,
.transaction-description strong {
  overflow: hidden;
  color: var(--text);
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-date span,
.transaction-meta {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
}

.transaction-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-height: 14px;
}

.transaction-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 16px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-badge.is-suggested {
  background: rgba(125, 183, 255, .14);
  color: var(--blue);
}

.transaction-badge.is-source {
  background: rgba(255, 255, 255, .055);
  color: #9aa9a2;
}

.transaction-account .account-pill {
  max-width: 100%;
  padding: 5px 8px;
  font-size: .75rem;
  line-height: 1;
}

.transaction-grid .transaction-select {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-amount {
  justify-self: end;
  text-align: right;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.transaction-actions {
  justify-self: end;
}

.transaction-actions .action-link {
  font-size: .78rem;
  white-space: nowrap;
}

.transaction-field .suggestion-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin: 2px 0 0;
  padding: 3px 5px;
  border-radius: 10px;
  font-size: .66rem;
}

.transaction-field .suggestion-inline .pill {
  padding: 1px 5px;
  font-size: .58rem;
}

.transaction-field .suggestion-inline small {
  display: none;
}

.transaction-field .suggestion-actions {
  gap: 4px;
}

.transaction-field .suggestion-actions button {
  min-height: 22px;
  padding: 0 6px;
  font-size: .62rem;
}

.transaction-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0 2px;
}

@media (max-width: 1180px) {
  .budget-score-grid,
  .command-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-hero,
  .command-center,
  .transaction-command {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .transaction-table-scroll {
    max-height: min(66vh, 620px);
  }

  .transaction-grid {
    --transaction-columns: 104px minmax(240px, 2fr) 118px 142px 142px 106px 68px;
    min-width: 940px;
    gap: 8px;
  }

  .transaction-grid-row {
    min-height: 54px;
    padding: 5px 10px;
  }

  .transaction-grid-header {
    padding: 0 10px;
  }
}

@media (max-width: 720px) {
  .budget-score-grid,
  .command-strip,
  .transaction-totals {
    grid-template-columns: 1fr;
  }

  .section-actions {
    justify-content: flex-start;
    text-align: left;
  }

  .section-progress {
    width: 100%;
  }
}

/* Warm-light completion layer */
:root {
  --bg: #f3eddf;
  --surface: #fffaf1;
  --surface-soft: #f8f0df;
  --line: #dfd1bc;
  --line-strong: #c9b69a;
  --text: #17201c;
  --muted: #66736b;
  --blue: #2d5b4f;
  --blue-soft: #e2eee7;
  --green: #557b43;
  --green-soft: #e7f0dd;
  --red: #a3422f;
  --red-soft: #f8e3dc;
  --orange: #b8673c;
  --orange-soft: #f8e7d9;
  --purple: #625778;
  --purple-soft: #e9e3f0;
  --yellow: #b38a35;
  --yellow-soft: #f4e9bf;
  --shadow: 0 18px 42px rgba(45, 35, 20, .09);
  color-scheme: light;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at 7% 0%, rgba(184, 103, 60, .16), transparent 31rem),
    radial-gradient(circle at 88% 10%, rgba(45, 91, 79, .18), transparent 28rem),
    linear-gradient(145deg, #f3eddf 0%, #f9f3e7 52%, #edf1e6 100%);
}

.sidebar {
  background: rgba(255, 250, 241, .9);
  border-color: var(--line);
  box-shadow: 10px 0 30px rgba(45, 35, 20, .04);
}

.brand-mark {
  background: var(--text);
  color: var(--surface);
}

.sidebar-toggle,
.button,
.select,
.input,
.chip,
.segmented button,
.table-input,
.table-select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

.select option,
.table-select option {
  background: var(--surface);
  color: var(--text);
}

.button.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
  box-shadow: 0 14px 24px rgba(23, 32, 28, .18);
}

.button.ghost {
  color: var(--blue);
}

.nav-link {
  color: #4d5b55;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--blue);
}

.nav-link.active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.help-card,
.card,
.panel,
.table-panel,
.account-group,
.budget-section,
.goal-card,
.modal-card {
  background: rgba(255, 250, 241, .84);
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.metric-card {
  background:
    radial-gradient(circle at top left, rgba(85, 123, 67, .1), transparent 14rem),
    rgba(255, 250, 241, .88);
}

.budget-hero,
.command-center,
.transaction-command,
.completion-hero {
  background:
    radial-gradient(circle at top left, rgba(85, 123, 67, .15), transparent 22rem),
    radial-gradient(circle at 90% 20%, rgba(45, 91, 79, .12), transparent 18rem),
    linear-gradient(145deg, rgba(255, 250, 241, .92), rgba(248, 240, 223, .78));
  border-color: var(--line);
}

.budget-hero h2,
.command-center h2,
.transaction-command h2,
.completion-hero h1 {
  color: var(--text);
}

.budget-hero-total,
.transaction-totals {
  border-color: var(--line);
  background: rgba(255, 250, 241, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.budget-score-card,
.command-tile {
  border-color: var(--line);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .68), transparent 12rem),
    rgba(255, 250, 241, .76);
  box-shadow: 0 12px 28px rgba(45, 35, 20, .07);
}

.budget-score-card.green,
.budget-section-green {
  border-color: #cddfba;
}

.budget-score-card.orange,
.budget-section-orange {
  border-color: #e5c3a9;
}

.budget-score-card.blue,
.budget-section-blue {
  border-color: #bdd8ce;
}

.budget-score-card.purple,
.budget-section-purple {
  border-color: #d4c9e2;
}

.group-head,
.section-head,
.table .parent-row {
  background: linear-gradient(180deg, rgba(248, 240, 223, .94), rgba(238, 229, 211, .74));
  border-color: var(--line);
}

.budget-section .section-head {
  border-left: 4px solid var(--blue);
}

.budget-section-green .section-head {
  border-left-color: var(--green);
}

.budget-section-orange .section-head {
  border-left-color: var(--orange);
}

.budget-section-blue .section-head {
  border-left-color: var(--blue);
}

.budget-section-purple .section-head {
  border-left-color: var(--purple);
}

.table-panel {
  overflow-x: auto;
}

.table {
  min-width: 760px;
}

.table th,
.table td,
.goal-meta,
.setting-row {
  border-color: var(--line);
}

.table th {
  color: #5f6c75;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.table .parent-row {
  color: var(--text);
}

.table .indent {
  color: #4d5b55;
}

.budget-parent-row td:first-child {
  position: relative;
}

.budget-line-row .indent {
  position: relative;
  padding-left: 42px;
}

.budget-line-row .indent::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 999px;
  background: rgba(45, 91, 79, .18);
}

.account-row td:first-child,
.transaction-row td:first-child,
.transaction-row td:nth-child(2) {
  display: grid;
  gap: 3px;
}

.account-pill,
.action-item {
  border-color: var(--line);
  background: rgba(248, 240, 223, .72);
}

.status-banner,
.suggestion-banner {
  border-color: #cddfba;
  background: linear-gradient(135deg, rgba(231, 240, 221, .88), rgba(226, 238, 231, .78));
}

.progress-track {
  background: #e1d5c3;
}

.pill.gray,
.chip {
  background: #ede5d7;
  color: var(--muted);
}

.alert-card,
.privacy-panel {
  background: rgba(255, 245, 239, .85);
}

.toast {
  background: rgba(255, 250, 241, .96);
  border-color: var(--line);
  color: var(--text);
}

.modal-backdrop {
  background: rgba(23, 32, 28, .38);
}

.intro-page .ledger-card {
  background: rgba(255, 250, 241, .84);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow);
}

.intro-page .ledger-card p {
  color: var(--muted);
}

.intro-page .ledger-sheet {
  background: linear-gradient(180deg, rgba(255, 250, 241, .94), rgba(248, 240, 223, .88));
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}

.intro-page .ledger-row {
  border-color: var(--line);
  color: var(--text);
}

.intro-page .ledger-row:first-child {
  background: rgba(232, 219, 198, .72);
  color: var(--muted);
}

.intro-page .ledger-row strong {
  color: #3c86ff;
}

.intro-page .ledger-row .negative {
  color: var(--red);
}

@media (max-width: 1180px) {
  .table {
    min-width: 720px;
  }
}

@media (max-width: 860px) {
  .budget-hero,
  .command-center,
  .transaction-command {
    grid-template-columns: 1fr;
  }

  .budget-hero-total,
  .transaction-totals {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .table {
    min-width: 680px;
  }

  .command-tile,
  .budget-score-card,
  .panel,
  .table-panel {
    border-radius: 14px;
  }

  .budget-line-row .indent {
    padding-left: 32px;
  }

  .budget-line-row .indent::before {
    left: 18px;
  }
}

/* Premium dark final layer */
:root {
  --bg: #070b10;
  --surface: #101820;
  --surface-soft: rgba(28, 40, 48, .78);
  --line: rgba(218, 233, 225, .12);
  --line-strong: rgba(218, 233, 225, .2);
  --text: #f4f7f2;
  --muted: #9aa9a2;
  --blue: #70a7ff;
  --blue-soft: rgba(112, 167, 255, .14);
  --green: #72e0a3;
  --green-soft: rgba(114, 224, 163, .14);
  --red: #ff7a68;
  --red-soft: rgba(255, 122, 104, .14);
  --orange: #ffb169;
  --orange-soft: rgba(255, 177, 105, .15);
  --purple: #b79cff;
  --purple-soft: rgba(183, 156, 255, .15);
  --yellow: #f5d36c;
  --yellow-soft: rgba(245, 211, 108, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  color-scheme: dark;
}

html,
body {
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at 10% -10%, rgba(112, 167, 255, .18), transparent 32rem),
    radial-gradient(circle at 92% 4%, rgba(114, 224, 163, .14), transparent 34rem),
    linear-gradient(145deg, #070b10 0%, #0c1318 46%, #101b19 100%);
}

.sidebar {
  background: rgba(8, 13, 18, .78);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 14px 0 44px rgba(0, 0, 0, .24);
  backdrop-filter: blur(22px);
}

.brand,
.sidebar-brand,
.intro-brand {
  color: var(--text);
}

.brand-mark,
.button.primary,
.intro-links .intro-nav-cta {
  background: linear-gradient(135deg, #f4f7f2, #aab8b1);
  border-color: transparent;
  color: #081016;
}

.button.primary:hover,
.intro-links .intro-nav-cta:hover {
  background: linear-gradient(135deg, #ffffff, #c5d0ca);
  color: #081016;
}

.sidebar-toggle,
.button,
.select,
.input,
.chip,
.segmented button,
.table-input,
.table-select {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .12);
  color: var(--text);
  box-shadow: none;
}

.select option,
.table-select option {
  background: #0c1318;
  color: var(--text);
}

.button.ghost {
  color: var(--blue);
}

.nav-link {
  color: #a8b8b0;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(125, 183, 255, .11);
  color: var(--blue);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--blue), 0 12px 36px rgba(0, 0, 0, .18);
}

.help-card,
.card,
.panel,
.table-panel,
.account-group,
.budget-section,
.goal-card,
.modal-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
  border-color: rgba(255, 255, 255, .12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card {
  background:
    radial-gradient(circle at top left, rgba(114, 224, 163, .12), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
}

.budget-hero,
.command-center,
.transaction-command,
.completion-hero {
  background:
    radial-gradient(circle at top left, rgba(125, 183, 255, .18), transparent 23rem),
    radial-gradient(circle at 90% 20%, rgba(112, 167, 255, .13), transparent 18rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  border-color: rgba(255, 255, 255, .12);
}

.budget-hero h2,
.command-center h2,
.transaction-command h2,
.completion-hero h1 {
  color: var(--text);
}

.budget-hero-total,
.transaction-totals {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.budget-score-card,
.command-tile {
  border-color: rgba(255, 255, 255, .11);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, .08), transparent 12rem),
    rgba(255, 255, 255, .04);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
}

.budget-score-card.green,
.budget-section-green {
  border-color: rgba(125, 183, 255, .22);
}

.budget-score-card.orange,
.budget-section-orange {
  border-color: rgba(255, 177, 105, .22);
}

.budget-score-card.blue,
.budget-section-blue {
  border-color: rgba(112, 167, 255, .22);
}

.budget-score-card.purple,
.budget-section-purple {
  border-color: rgba(183, 156, 255, .22);
}

.budget-score-positive,
.budget-section-positive {
  border-color: rgba(111, 220, 157, .32);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(111, 220, 157, .04);
}

.budget-score-negative,
.budget-section-negative {
  border-color: rgba(255, 122, 104, .34);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 122, 104, .05);
}

.budget-score-neutral,
.budget-section-neutral {
  border-color: rgba(125, 183, 255, .2);
}

.group-head,
.section-head,
.table .parent-row {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .1);
}

.budget-section .section-head {
  border-left: 4px solid var(--blue);
}

.budget-section-green .section-head {
  border-left-color: var(--green);
}

.budget-section-orange .section-head {
  border-left-color: var(--orange);
}

.budget-section-blue .section-head {
  border-left-color: var(--blue);
}

.budget-section-purple .section-head {
  border-left-color: var(--purple);
}

.budget-section-positive .section-head {
  border-left-color: var(--green);
}

.budget-section-negative .section-head {
  border-left-color: var(--red);
}

.budget-section-neutral .section-head {
  border-left-color: rgba(125, 183, 255, .58);
}

.budget-remaining {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: -.01em;
}

.budget-remaining-positive {
  color: var(--green);
}

.budget-remaining-negative {
  color: var(--red);
}

.budget-remaining-neutral {
  color: var(--muted);
}

.budget-row-positive {
  background: linear-gradient(90deg, rgba(111, 220, 157, .055), transparent 42%);
}

.budget-row-negative {
  background: linear-gradient(90deg, rgba(255, 122, 104, .07), transparent 46%);
  border-top-color: rgba(255, 122, 104, .22);
}

.budget-row-neutral {
  background: rgba(255, 255, 255, .018);
}

.budget-parent-row.budget-row-positive {
  background:
    linear-gradient(90deg, rgba(111, 220, 157, .09), transparent 48%),
    rgba(255, 255, 255, .042);
}

.budget-parent-row.budget-row-negative {
  background:
    linear-gradient(90deg, rgba(255, 122, 104, .12), transparent 52%),
    rgba(255, 255, 255, .042);
}

.budget-parent-row.budget-row-neutral {
  background: rgba(255, 255, 255, .035);
}

.budget-progress .progress-track {
  min-width: 90px;
}

.budget-progress-positive .progress-fill {
  box-shadow: 0 0 14px rgba(111, 220, 157, .24);
}

.budget-progress-negative .progress-track {
  background: rgba(255, 122, 104, .16);
}

.budget-progress-negative .progress-fill {
  box-shadow: 0 0 14px rgba(255, 122, 104, .28);
}

.budget-progress-neutral .progress-fill {
  opacity: .78;
}

.budget-section .pill.green,
.budget-score-card .pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.table th,
.table td,
.goal-meta,
.setting-row {
  border-color: rgba(255, 255, 255, .1);
}

.table th {
  color: #9aa9a2;
}

.table .parent-row {
  color: var(--text);
}

.table .indent {
  color: #c2cfc8;
}

.budget-line-row .indent::before {
  background: rgba(125, 183, 255, .22);
}

.account-pill,
.action-item {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .045);
}

.status-banner,
.suggestion-banner {
  border-color: rgba(125, 183, 255, .22);
  background: linear-gradient(135deg, rgba(125, 183, 255, .12), rgba(112, 167, 255, .08));
}

.alert-card,
.privacy-panel {
  background:
    radial-gradient(circle at top left, rgba(255, 122, 104, .1), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
}

.progress-track {
  background: rgba(255, 255, 255, .11);
}

.pill.gray,
.chip {
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
}

.toast {
  background: rgba(12, 19, 24, .94);
  border-color: rgba(255, 255, 255, .14);
  color: var(--text);
}

.toast-action {
  border-color: rgba(125, 183, 255, .32);
  background: linear-gradient(135deg, var(--blue), #3c86ff);
  color: #061019;
  box-shadow: 0 8px 22px rgba(60, 134, 255, .2);
}

.modal-backdrop {
  background: rgba(0, 0, 0, .58);
}

.intro-eyebrow,
.intro-links a:not(.intro-nav-cta) {
  color: var(--muted);
}

.intro-links a:not(.intro-nav-cta):hover {
  color: var(--text);
}

.intro-note,
.intro-lead {
  color: var(--muted);
}

.intro-page .ledger-card {
  background:
    radial-gradient(circle at 100% 100%, rgba(125, 183, 255, .12), transparent 15rem),
    linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  border-color: rgba(255, 255, 255, .12);
  color: var(--text);
  box-shadow: var(--shadow);
}

.hero-kicker,
.completion-kicker {
  color: var(--blue);
}

.intro-page .ledger-card p {
  color: #aeb9b4;
}

.intro-page .ledger-sheet {
  background: linear-gradient(180deg, #f5eddf, #ece3d4);
  border-color: rgba(255, 255, 255, .16);
  color: #17201c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 18px 42px rgba(0, 0, 0, .22);
}

.intro-page .ledger-row {
  border-color: rgba(36, 47, 42, .09);
  color: #17201c;
}

.intro-page .ledger-row:first-child {
  background: rgba(232, 219, 198, .92);
  color: #73837a;
}

.intro-page .ledger-row strong {
  color: #3c86ff;
}

.intro-page .ledger-row .negative {
  color: #f05f50;
}
