:root {
  --bg: #f3f1ed;
  --bg-2: #ebe7e1;
  --card: rgba(255,255,255,0.88);
  --text: #454545;
  --muted: #706a67;
  --brand: #7d8c7e;
  --brand-2: #e58bc7;
  --brand-3: #8fd3e7;
  --line: rgba(125, 140, 126, 0.16);
  --shadow: 0 18px 46px rgba(69, 69, 69, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Noto Sans", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body.modal-open {
  overflow: hidden;
}

.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
}
.glow-a { top: -80px; left: -60px; background: rgba(143, 211, 231, 0.35); }
.glow-b { right: -80px; top: 120px; background: rgba(229, 139, 199, 0.24); }

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.header-hero {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 320px;
  padding: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.82) 0%, rgba(243, 241, 237, 0.74) 100%);
}

.header-hero-chart,
.header-hero-scrim,
.header-hero-topbar,
.header-hero-content {
  position: relative;
  z-index: 1;
}

.header-hero-chart {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.header-hero-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
}

.header-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.24) 0%, rgba(243,241,237,0.06) 44%, rgba(255,255,255,0.14) 100%);
}

.header-hero-topbar {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
}

.header-hero-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  min-height: 240px;
}

.header-copy-card {
  width: min(100%, 470px);
  padding: 24px 26px;
  border-radius: 28px;
  background: rgba(255,255,255,0.24);
  border: 1px solid rgba(255,255,255,0.40);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(69, 69, 69, 0.06);
}

.header-copy-card .muted {
  display: block;
  max-width: 32rem;
}

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

.header-portfolio-card {
  width: min(100%, 380px);
  padding: 20px 22px;
  margin-left: auto;
  margin-top: 2px;
  border-radius: 24px;
  background: rgba(255,255,255,0.48);
  border: 1px solid rgba(255,255,255,0.46);
  backdrop-filter: blur(10px);
  align-self: flex-start;
  box-shadow: 0 16px 40px rgba(69, 69, 69, 0.08);
}

.header-portfolio-topline,
.header-portfolio-delta-row,
.header-portfolio-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-portfolio-scope,
.header-portfolio-period,
.header-portfolio-meta {
  font-size: 13px;
}

.header-portfolio-balance {
  font-family: Manrope, Inter, "Noto Sans", sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  margin: 10px 0 12px;
}

.header-portfolio-chart {
  margin: 4px 0 12px;
}

.header-portfolio-chart svg {
  display: block;
  width: 100%;
  height: 84px;
  overflow: visible;
}

.header-portfolio-area {
  fill: rgba(125, 140, 126, 0.12);
  stroke: none;
}

.header-portfolio-line {
  fill: none;
  stroke: rgba(125, 140, 126, 0.95);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-portfolio-dot {
  fill: #ffffff;
  stroke: rgba(125, 140, 126, 0.95);
  stroke-width: 1.4;
}

.header-portfolio-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-top: 6px;
}

.header-portfolio-delta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}

.header-portfolio-delta.is-positive {
  color: #2f8a57;
}

.header-portfolio-delta.is-negative {
  color: #c25757;
}

.header-portfolio-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
}

.header-role-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.header-role-copy {
  font-size: 14px;
}

.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.top-nav-subtle {
  gap: 8px;
  margin-bottom: 10px;
}

.tenant-switcher {
  margin-bottom: 16px;
}

.tenant-switcher label {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tenant-switcher select {
  min-width: 240px;
}

.top-nav a,
.static-pill,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.top-nav-subtle a {
  padding: 8px 12px;
  background: rgba(255,255,255,0.52);
  color: var(--muted);
  border-color: rgba(125, 140, 126, 0.12);
  font-size: 13px;
  font-weight: 600;
}

.top-nav-subtle a:hover {
  background: rgba(255,255,255,0.74);
  color: var(--text);
}

.icon-link {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 14px;
}

.icon-link:hover {
  background: rgba(125, 140, 126, 0.14);
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  font-family: Manrope, Inter, "Noto Sans", sans-serif;
}
h1 { font-size: 42px; }
h2 { font-size: 34px; }
h3 { font-size: 24px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 28px;
  align-items: start;
}

.compact-hero {
  padding: 24px 28px;
}

.hero-copy {
  margin-top: 8px;
  max-width: 46rem;
  line-height: 1.45;
  color: var(--muted);
}

.access-note-card,
.role-summary-card {
  margin-top: 20px;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.role-summary-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.status-badge,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.toolbar-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 12px;
  align-items: center;
}

.toolbar-button {
  min-width: 180px;
}

.toolbar-search-row {
  justify-content: space-between;
}

.toolbar-search-field {
  flex: 1 1 420px;
  max-width: 560px;
}

.toolbar-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(125, 140, 126, 0.18);
  background: rgba(255,255,255,0.88);
  color: var(--text);
  font-weight: 700;
}

.toolbar-toggle-chip input {
  margin: 0;
  width: auto;
}

.toolbar-search-field span {
  display: none;
}

.toolbar-search-field input {
  width: 100%;
  min-height: 48px;
}

.budget-config-row-parent {
  background: rgba(125, 140, 126, 0.08);
}

.budget-config-row-child {
  background: rgba(143, 211, 231, 0.08);
}

.budget-category-cell {
  position: relative;
  display: grid;
  gap: 6px;
}

.budget-category-name {
  display: inline-block;
}

.budget-category-cell-child {
  padding-left: calc(0.85rem + (var(--budget-depth, 1) * 1.1rem));
}

.budget-category-cell-child::before {
  content: "";
  position: absolute;
  left: calc(0.45rem + ((var(--budget-depth, 1) - 1) * 1.1rem));
  top: 0.15rem;
  bottom: 0.15rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(143, 211, 231, 0.65), rgba(125, 140, 126, 0.4));
}

.budget-category-cell-child::after {
  content: "";
  position: absolute;
  left: calc(0.45rem + ((var(--budget-depth, 1) - 1) * 1.1rem));
  top: 0.9rem;
  width: 0.8rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(143, 211, 231, 0.65);
}

.budget-category-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.budget-tree-badge,
.budget-tree-total {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.budget-tree-badge-parent {
  background: rgba(125, 140, 126, 0.14);
  color: #566557;
}

.budget-tree-badge-child {
  background: rgba(143, 211, 231, 0.18);
  color: #226274;
}

.budget-tree-badge-standalone {
  background: rgba(112, 106, 103, 0.12);
  color: var(--muted);
}

.budget-tree-total {
  background: rgba(229, 139, 199, 0.14);
  color: #965887;
}

.budget-hint-subline {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(0, 1.6fr);
  align-items: start;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 38px;
}

.monthly-kpi-grid .compact-stat-card strong {
  font-size: 28px;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.two-col .card {
  padding: 24px;
}

.form-card,
.table-card {
  padding: 28px;
}

.compact-card {
  padding: 18px 20px;
}

.spaced-form {
  margin-top: 18px;
}

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

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

.split-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.login-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 30px;
}

.login-copy {
  margin-top: 12px;
}

.login-form {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.checkbox-row span {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.button-row button {
  flex: 1 1 220px;
}

.form-actions {
  margin-top: 6px;
  justify-content: flex-end;
  align-items: stretch;
}

.form-actions .inline-link {
  flex: 1 1 180px;
}

.form-actions > * {
  min-height: 48px;
}

.form-actions button,
.form-actions .inline-link {
  min-width: 180px;
}

.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 180px;
}

.inline-form {
  margin: 0;
}

.inline-form button,
.row-actions .inline-link {
  width: auto;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.button-danger {
  background: linear-gradient(135deg, #b42318 0%, #d92d20 100%);
}

.button-danger:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

input,
button,
select,
textarea {
  width: 100%;
  font: inherit;
  border-radius: 16px;
  padding: 13px 14px;
}

input,
select,
textarea {
  border: 1px solid rgba(125, 140, 126, 0.24);
  background: rgba(255,255,255,0.94);
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(125, 140, 126, 0.16);
}

button {
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, #96a693 100%);
  color: white;
  font-weight: 700;
}

.alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
}

.alert-error {
  background: #fff1f2;
  color: #b42318;
  border: 1px solid #fecdd3;
}

.alert-success {
  background: #ecfdf3;
  color: #146c43;
  border: 1px solid #a7f3d0;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

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

.chart-head {
  align-items: flex-end;
}

.chart-copy {
  margin-top: 10px;
}

.dashboard-chart-head {
  display: grid;
  gap: 18px;
}

.dashboard-chart-title-block {
  width: 100%;
}

.dashboard-chart-filter-form {
  width: 100%;
  flex-wrap: wrap;
  align-items: end;
}

.chart-filter-form {
  display: flex;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.section-head-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-filter-label span {
  margin-bottom: 8px;
}

.chart-filter-label select {
  min-width: 180px;
}

.chart-range-label {
  min-width: 220px;
}

.chart-range-label strong {
  color: var(--brand);
}

.chart-range-label input[type="range"] {
  min-width: 220px;
}

.chart-card {
  overflow: hidden;
}

.dashboard-hero {
  align-items: center;
}

.dashboard-premium-shell {
  display: grid;
  gap: 18px;
}

.dashboard-premium-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.9fr);
  gap: 18px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at top left, rgba(143, 211, 231, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(28, 35, 48, 0.98), rgba(43, 52, 67, 0.96));
  color: #f7f8fb;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 46px rgba(32, 41, 57, 0.18);
}

.dashboard-premium-hero .eyebrow,
.dashboard-premium-hero .hero-copy,
.dashboard-premium-hero .muted {
  color: rgba(247, 248, 251, 0.72);
}

.dashboard-premium-hero .accent {
  color: #8fd3e7;
}

.dashboard-premium-copy h2 {
  max-width: 12ch;
  font-size: 30px;
}

.dashboard-hero-quickstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.dashboard-hero-stat {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.dashboard-hero-stat span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(247, 248, 251, 0.6);
}

.dashboard-hero-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  color: #fff;
}

.dashboard-premium-summary-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,246,249,0.92));
  color: #263142;
}

.dashboard-summary-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

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

.dashboard-summary-metric {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(38, 49, 66, 0.08);
  background: rgba(255,255,255,0.9);
}

.dashboard-summary-metric span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dashboard-summary-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.dashboard-summary-metric.income strong { color: #146c43; }
.dashboard-summary-metric.expense strong { color: #b42318; }
.dashboard-summary-metric.net strong { color: #1f5f72; }
.dashboard-summary-metric.neutral strong { color: #263142; }

.text-positive {
  color: #146c43;
}

.text-negative {
  color: #b42318;
}

.dashboard-summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-summary-footer {
  font-size: 12px;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.dashboard-main-grid--single {
  grid-template-columns: 1fr;
}

.dashboard-chart-card {
  background: linear-gradient(180deg, rgba(38, 49, 66, 0.98), rgba(49, 62, 80, 0.95));
  border-color: rgba(255,255,255,0.08);
  color: #f7f8fb;
}

.dashboard-chart-card--full {
  width: 100%;
}

.dashboard-chart-card .section-head-inline,
.dashboard-chart-card .chart-copy,
.dashboard-chart-card .cell-sub,
.dashboard-chart-card .muted,
.dashboard-chart-card .trend-chart-footnote,
.dashboard-chart-card .chart-filter-label span {
  color: rgba(247, 248, 251, 0.72);
}

.dashboard-chart-card .trend-summary-item {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

.dashboard-chart-card .trend-summary-item strong,
.dashboard-chart-card .section-head-inline h3 {
  color: #fff;
}

.dashboard-chart-card .section-head-inline h3 {
  font-size: 28px;
}

.dashboard-chart-card .chart-copy,
.dashboard-chart-card .chart-filter-label span,
.dashboard-chart-card .cell-sub,
.dashboard-chart-card .muted {
  font-size: 15px;
}

.dashboard-chart-card .secondary-button,
.dashboard-chart-card .chart-filter-label select {
  background: rgba(255,255,255,0.9);
}

.dashboard-insight-stack {
  display: grid;
  gap: 14px;
}

.dashboard-insight-card {
  padding: 18px 20px;
}

.dashboard-insight-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.dashboard-insight-metrics span,
.dashboard-category-row span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dashboard-insight-metrics strong,
.dashboard-category-row strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.dashboard-category-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dashboard-category-row {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(125, 140, 126, 0.06);
  border: 1px solid rgba(125, 140, 126, 0.12);
}

.dashboard-insight-copy {
  margin-top: 12px;
  line-height: 1.6;
}

.admin-dashboard-hero .dashboard-premium-copy h2 {
  max-width: none;
}

.admin-overview-card {
  min-height: 100%;
}

.admin-overview-list {
  margin-top: 16px;
}

.admin-overview-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.admin-overview-row > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-overview-row-meta {
  min-width: 110px;
  text-align: right;
}

.admin-overview-row-meta span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-overview-row-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.compact-actions {
  margin-top: 14px;
}

.dashboard-table-card {
  padding: 18px 20px;
}

.trend-summary-item span {
  font-size: 13px;
}

.trend-summary-item strong {
  font-size: 24px;
}

.dashboard-section-head {
  align-items: flex-start;
}

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

.dashboard-table {
  min-width: 0;
}

.dashboard-table tbody tr:hover td {
  background: rgba(125, 140, 126, 0.04);
}

.premium-chart-shell {
  margin-top: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.dashboard-section-head h3,
.dashboard-premium-summary-card h3,
.dashboard-insight-card h3 {
  font-size: 20px;
}

.dashboard-table .data-table td,
.dashboard-table td {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 15px;
}

.dashboard-table .data-table th,
.dashboard-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 12px;
}

.table-pagination-bar {
  gap: 10px;
  margin-top: 14px;
}

.pagination-chip,
.pagination-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.dashboard-hero-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.dashboard-hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-support-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  align-items: start;
}

.dashboard-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

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

.dashboard-shortcuts {
  padding-top: 4px;
  border-top: 1px solid rgba(125, 140, 126, 0.12);
}

.dashboard-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

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

.compact-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.compact-table {
  min-width: 0;
}

.compact-table th:last-child,
.compact-table td:last-child {
  min-width: 0;
}

.table-pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.table-pagination-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

.pagination-copy {
  font-size: 13px;
}

.pagination-chip,
.pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 140, 126, 0.16);
  background: rgba(255,255,255,0.86);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.pagination-chip.is-current {
  background: rgba(125, 140, 126, 0.14);
  color: var(--brand);
  border-color: rgba(125, 140, 126, 0.28);
}

.trend-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.trend-summary-item {
  padding: 18px;
  border-radius: 20px;
  background: rgba(125, 140, 126, 0.08);
  border: 1px solid rgba(125, 140, 126, 0.12);
}

.trend-summary-item span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.trend-summary-item strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.trend-chart-shell {
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.balance-chart-tooltip {
  position: fixed;
  z-index: 80;
  width: min(340px, calc(100vw - 24px));
  border-radius: 18px;
  border: 1px solid rgba(125, 140, 126, 0.18);
  background: rgba(17, 24, 20, 0.96);
  color: #f5f7f6;
  box-shadow: 0 18px 44px rgba(15, 23, 18, 0.28);
  padding: 14px;
  pointer-events: none;
}

.balance-chart-tooltip__header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.balance-chart-tooltip__header strong {
  font-size: 15px;
}

.balance-chart-tooltip__balance {
  font-size: 20px;
  font-weight: 700;
}

.balance-chart-tooltip__change,
.balance-chart-tooltip__empty,
.balance-chart-tooltip__subtitle,
.balance-chart-tooltip__more {
  font-size: 13px;
  color: rgba(245, 247, 246, 0.76);
}

.balance-chart-tooltip__list {
  display: grid;
  gap: 10px;
}

.balance-chart-tooltip__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.balance-chart-tooltip__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.balance-chart-tooltip__copy strong {
  font-size: 13px;
  line-height: 1.35;
}

.balance-chart-tooltip__amount {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.balance-chart-tooltip__amount.is-positive {
  color: #8ce0aa;
}

.balance-chart-tooltip__amount.is-negative {
  color: #ffb0bd;
}

.trend-chart {
  min-width: 100%;
}

.trend-chart svg {
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
}

.trend-chart-footnote {
  margin-top: 14px;
  font-size: 13px;
}

.section-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.inline-action-form {
  margin-top: 18px;
}

.inline-action-form button {
  width: auto;
  min-width: 280px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  padding-bottom: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(69, 69, 69, 0.45);
  backdrop-filter: blur(6px);
  z-index: 40;
  padding: 24px;
  overflow-y: auto;
}

.modal-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.modal-card {
  width: min(760px, 100%);
  padding: 28px;
  border-radius: 30px;
}

.position-modal-card {
  width: min(920px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin-top: 4px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
}

.category-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.category-stat {
  padding: 18px;
  border-radius: 20px;
  background: rgba(125, 140, 126, 0.08);
  border: 1px solid rgba(125, 140, 126, 0.12);
}

.category-stat span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.category-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.mapping-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(125, 140, 126, 0.08);
  border: 1px solid rgba(125, 140, 126, 0.12);
}

.mapping-item span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.mapping-item strong {
  display: block;
  margin-top: 8px;
  word-break: break-word;
}

.table-link {
  color: var(--text);
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.preview-copy,
.preview-subhead {
  margin-top: 18px;
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.action-table {
  min-width: 980px;
}

.data-table th:last-child,
.data-table td:last-child {
  min-width: 210px;
}

.action-table th:last-child,
.action-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -10px 0 18px rgba(69, 69, 69, 0.06);
}

.action-table tbody tr:hover td:last-child {
  background: rgba(255, 255, 255, 1);
}

.action-table .recurring-marked-row td:last-child,
.action-table .recurring-marked-row:hover td:last-child,
.action-table .recurring-marked-row:focus td:last-child {
  background: rgba(20, 108, 67, 0.06);
}

.action-table .recurring-auto-row td:last-child,
.action-table .recurring-auto-row:hover td:last-child,
.action-table .recurring-auto-row:focus td:last-child {
  background: rgba(31, 95, 114, 0.06);
}

.data-table th {
  padding: 14px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid rgba(125, 140, 126, 0.12);
}

.data-table td {
  padding: 15px 12px;
  border-top: 1px solid rgba(125, 140, 126, 0.1);
  vertical-align: top;
}

.recurring-marked-row td {
  background: rgba(20, 108, 67, 0.06);
}

.recurring-marked-row td:first-child {
  box-shadow: inset 4px 0 0 #146c43;
}

.recurring-auto-row td {
  background: rgba(31, 95, 114, 0.06);
}

.recurring-auto-row td:first-child {
  box-shadow: inset 4px 0 0 #1f5f72;
}

.recurring-marked-row:focus {
  outline: none;
}

.recurring-marked-row:focus td {
  background: rgba(20, 108, 67, 0.12);
}

.recurring-auto-row:focus {
  outline: none;
}

.recurring-auto-row:focus td {
  background: rgba(31, 95, 114, 0.12);
}

.data-table tbody tr:first-child td {
  border-top: 0;
}

.cell-sub,
.empty-copy {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}

.empty-copy {
  margin-top: 18px;
}

.checklist {
  margin: 18px 0 0;
  padding-left: 20px;
  line-height: 1.7;
}

.module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.module-list span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(125, 140, 126, 0.12);
  color: var(--brand);
  font-weight: 700;
}

.secondary-button {
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border: 1px solid rgba(125, 140, 126, 0.22);
}

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

.user-admin-card {
  border: 1px solid rgba(125, 140, 126, 0.14);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,0.6);
  display: grid;
  gap: 14px;
}

.user-admin-head,
.user-admin-actions,
.user-admin-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.user-admin-head > :first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.user-admin-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 0;
  align-items: stretch;
}

.user-admin-meta div {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(125, 140, 126, 0.1);
  background: rgba(255,255,255,0.62);
}

.user-admin-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.user-admin-meta strong {
  display: block;
  margin-top: 6px;
  word-break: break-word;
}

.user-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.user-admin-section {
  padding-top: 14px;
  border-top: 1px solid rgba(125, 140, 126, 0.12);
}

.user-admin-section .eyebrow {
  margin-bottom: 6px;
}

.user-admin-section > .empty-copy {
  margin-top: 10px;
}

.embedded-table-wrap {
  margin-top: 12px;
  border: 1px solid rgba(125, 140, 126, 0.12);
  border-radius: 18px;
  overflow: auto;
  padding-bottom: 0;
  background: rgba(255,255,255,0.45);
}

.embedded-table-wrap table {
  margin: 0;
}

.embedded-table-wrap .data-table,
.embedded-table-wrap .action-table {
  min-width: 680px;
}

.embedded-table-wrap .data-table th,
.embedded-table-wrap .data-table td {
  padding: 12px 10px;
}

.embedded-table-wrap .action-table th:last-child,
.embedded-table-wrap .action-table td:last-child {
  position: static;
  min-width: 160px;
  box-shadow: none;
  background: transparent;
}

.table-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(125, 140, 126, 0.12);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account-compact-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-logo-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(125, 140, 126, 0.18), rgba(143, 211, 231, 0.22));
  color: #314052;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chip-success {
  background: rgba(20, 108, 67, 0.12);
  color: #146c43;
}

.chip-admin {
  background: rgba(125, 140, 126, 0.16);
  color: var(--brand);
}

.chip-user {
  background: rgba(143, 211, 231, 0.18);
  color: #1f5f72;
}

.chip-muted {
  background: rgba(112, 106, 103, 0.12);
  color: var(--muted);
}

.chip-recurring {
  background: rgba(20, 108, 67, 0.14);
  color: #146c43;
}

.chip-auto-recurring {
  background: rgba(31, 95, 114, 0.14);
  color: #1f5f72;
}

.inline-chip {
  margin-left: 8px;
}

.inline-auto-note {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: #1f5f72;
  font-size: 12px;
  font-weight: 700;
}

.bulk-category-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-select-all-button {
  min-width: 160px;
}

.bulk-category-table-wrap {
  max-height: 380px;
  overflow: auto;
}

.bulk-category-table td:first-child,
.bulk-category-table th:first-child {
  width: 140px;
}

.bulk-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.account-reconcile-history {
  margin-top: 10px;
}

.account-reconcile-history summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.account-reconcile-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.account-reconcile-history-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(125, 140, 126, 0.08);
  font-size: 12px;
}

.account-reconcile-history-item strong {
  margin-bottom: 2px;
}

.account-reconcile-history-item span {
  color: var(--muted);
}

.account-reconcile-history-panel {
  margin-top: 18px;
}

.modal-history-list {
  max-height: 220px;
  overflow: auto;
}

.bulk-checkbox-label input {
  width: auto;
  margin: 0;
}

.user-admin-actions {
  margin-top: 14px;
  align-items: end;
}

.inline-reset-form {
  margin-top: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.inline-reset-form button,
.user-admin-actions .inline-form button,
.user-admin-actions .inline-form select {
  width: auto;
  min-width: 160px;
}

@media (max-width: 1100px) {
  .admin-layout,
  .dashboard-support-grid,
  .dashboard-list-grid,
  .dashboard-main-grid,
  .dashboard-lists-grid,
  .dashboard-premium-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .header, .hero, .two-field-grid, .three-field-grid {
    grid-template-columns: 1fr;
  }

  .access-note-card,
  .role-summary-card {
    flex-direction: column;
  }

  .inline-reset-form {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 24px 16px 44px;
  }

  .form-card,
  .table-card,
  .hero,
  .compact-hero,
  .two-col .card,
  .modal-card {
    padding: 20px;
  }

  .toolbar-row {
    justify-content: stretch;
    flex-direction: column;
  }

  .toolbar-search-row {
    justify-content: stretch;
  }

  .toolbar-search-field {
    max-width: none;
    width: 100%;
  }

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

  .chart-filter-form,
  .chart-filter-label,
  .chart-filter-label select,
  .dashboard-hero-actions,
  .dashboard-hero-links,
  .dashboard-shortcut-grid,
  .table-pagination-bar,
  .table-pagination-actions,
  .dashboard-summary-actions {
    width: 100%;
  }

  .dashboard-hero-actions,
  .dashboard-hero-links {
    justify-items: stretch;
    justify-content: stretch;
  }

  .dashboard-shortcut-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-grid,
  .dashboard-insight-metrics,
  .dashboard-hero-quickstats,
  .dashboard-lists-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-premium-hero {
    padding: 22px;
  }

  .toolbar-button {
    width: 100%;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .modal-shell {
    min-height: calc(100vh - 32px);
  }

  .modal-head {
    gap: 10px;
  }

  .row-actions {
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form,
  .row-actions .inline-link {
    flex: 1 1 100%;
  }

  .inline-action-form button {
    width: 100%;
    min-width: 0;
  }

  .inline-form button,
  .row-actions .inline-link {
    width: 100%;
    justify-content: center;
  }

  .action-table {
    min-width: 760px;
  }

  h1 { font-size: 34px; }
  h2 { font-size: 28px; }
}

.chart-filter-label--multiselect select {
  min-height: 8.5rem;
}

.checkbox-label input[type='checkbox'] {
  width: auto;
  min-width: 1rem;
  align-self: flex-start;
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .header-hero {
    padding: 18px;
    min-height: 0;
  }

  .header-hero-topbar {
    position: static;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .header-hero-content {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .header-copy-card,
  .header-portfolio-card {
    width: 100%;
  }

  .header-portfolio-card {
    margin-left: 0;
  }

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