:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --panel: rgba(255, 251, 242, 0.94);
  --panel-strong: #fffdf8;
  --ink: #1f2c28;
  --muted: #5d6b65;
  --line: rgba(46, 68, 61, 0.16);
  --green: #2f7d5d;
  --green-soft: #dff3ea;
  --amber: #b8770f;
  --amber-soft: #fff1d7;
  --red: #a54035;
  --red-soft: #fce4dd;
  --blue: #275b73;
  --blue-soft: #deeff6;
  --shadow: 0 20px 40px rgba(32, 41, 37, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(216, 235, 227, 0.9), transparent 32%),
    radial-gradient(circle at bottom left, rgba(246, 231, 202, 0.95), transparent 30%),
    linear-gradient(180deg, #faf6ef 0%, var(--bg) 100%);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100vh;
  padding: 1.6rem;
  border-right: 1px solid rgba(37, 74, 64, 0.08);
  background: linear-gradient(180deg, rgba(245, 240, 228, 0.9), rgba(241, 237, 228, 0.75));
  backdrop-filter: blur(14px);
}

.brand-block {
  padding: 1rem 0.4rem 0;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand-block h1,
.topbar h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 2.2rem;
}

.subcopy,
.microcopy,
.muted-copy {
  color: var(--muted);
  line-height: 1.55;
}

.nav-list {
  display: grid;
  gap: 0.45rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(40, 79, 67, 0.12);
  outline: none;
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(47, 125, 93, 0.14), rgba(255, 255, 255, 0.66));
  border-color: rgba(47, 125, 93, 0.24);
  font-weight: 700;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(46, 68, 61, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.compact-card {
  padding: 1.1rem;
}

.sidebar-footer h2,
.section-title,
.panel-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.quick-actions {
  display: grid;
  gap: 0.7rem;
}

.content {
  padding: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.topbar h2 {
  font-size: 2.2rem;
}

.topbar-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.sync-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(39, 91, 115, 0.15);
  color: var(--blue);
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.danger-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.75rem 1rem;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.ghost-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, #2f7d5d, #476e4b);
  color: #ffffff;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border-color: rgba(46, 68, 61, 0.1);
}

.ghost-btn {
  background: transparent;
  color: var(--ink);
  border-color: rgba(46, 68, 61, 0.14);
}

.danger-btn {
  background: rgba(165, 64, 53, 0.1);
  color: var(--red);
  border-color: rgba(165, 64, 53, 0.15);
}

.page {
  display: none;
  animation: rise 300ms ease;
}

.page.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.hero-grid,
.stat-grid,
.panel-grid,
.two-col-grid,
.three-col-grid,
.four-col-grid,
.report-grid,
.settings-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid,
.four-col-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.three-col-grid,
.report-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-col-grid,
.panel-grid,
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.panel-card,
.form-card,
.table-card,
.bucket-card,
.chart-card,
.timeline-card,
.settings-card {
  padding: 1.15rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -55px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}

.stat-label,
.small-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-value {
  margin: 0.55rem 0 0.2rem;
  font-size: clamp(1.8rem, 2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-footnote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.green-card {
  background: linear-gradient(180deg, rgba(223, 243, 234, 0.96), rgba(255, 255, 255, 0.9));
}

.amber-card {
  background: linear-gradient(180deg, rgba(255, 241, 215, 0.96), rgba(255, 255, 255, 0.9));
}

.red-card {
  background: linear-gradient(180deg, rgba(252, 228, 221, 0.96), rgba(255, 255, 255, 0.9));
}

.blue-card {
  background: linear-gradient(180deg, rgba(222, 239, 246, 0.96), rgba(255, 255, 255, 0.9));
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0 0.8rem;
}

.section-header p,
.panel-copy,
.list-copy {
  margin: 0;
  color: var(--muted);
}

.kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.kpi-row:last-child {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge.green,
.status-track,
.pill-green {
  color: var(--green);
  background: var(--green-soft);
}

.badge.amber,
.status-watch,
.status-warning,
.pill-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.red,
.status-alert,
.pill-red {
  color: var(--red);
  background: var(--red-soft);
}

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

.mini-list,
.warning-list,
.simple-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mini-list li,
.warning-item,
.timeline-item,
.bucket-row {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(46, 68, 61, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.inline-metric {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.progress-shell {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(32, 44, 40, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f7d5d, #4aa373);
}

.progress-bar.amber {
  background: linear-gradient(90deg, #b8770f, #d79a2c);
}

.progress-bar.red {
  background: linear-gradient(90deg, #a54035, #d35f52);
}

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

.grid-table th,
.grid-table td {
  padding: 0.8rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.grid-table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grid-table td strong {
  display: block;
}

.input-grid,
.field-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.82rem 0.92rem;
  border-radius: 16px;
  border: 1px solid rgba(46, 68, 61, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f3f6fb;
  color: #8694b0;
  cursor: not-allowed;
}

.field-hint {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.field-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.split-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.bar-chart {
  display: grid;
  gap: 0.7rem;
}

.bar-row {
  display: grid;
  gap: 0.4rem;
}

.bar-label-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(32, 44, 40, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #275b73, #5b8ea7);
}

.timeline-list {
  display: grid;
  gap: 0.8rem;
}

.timeline-item {
  display: grid;
  gap: 0.45rem;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.calendar-strip {
  display: grid;
  gap: 0.65rem;
}

.calendar-row {
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.empty-state {
  padding: 1.25rem;
  text-align: center;
}

.callout {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  margin: 0.8rem 0 1rem;
}

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

.callout.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

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

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

.pill-cluster {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-pill-grid {
  align-items: stretch;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(117, 135, 171, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.92rem;
}

.checkbox-pill input {
  margin: 0;
}

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

.small-value {
  font-size: 0.92rem;
  color: var(--muted);
}

.footer-note {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(37, 74, 64, 0.08);
  }

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

  .hero-grid,
  .four-col-grid,
  .three-col-grid,
  .two-col-grid,
  .panel-grid,
  .report-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .content,
  .sidebar {
    padding: 1rem;
  }

  .nav-list,
  .hero-grid,
  .four-col-grid,
  .three-col-grid,
  .two-col-grid,
  .panel-grid,
  .report-grid,
  .settings-grid,
  .input-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .calendar-row {
    grid-template-columns: 1fr;
  }
}

:root {
  --bg: #f4f7fb;
  --bg-accent: #eef4ff;
  --panel: rgba(255, 255, 255, 0.98);
  --panel-strong: #ffffff;
  --ink: #17233d;
  --muted: #67748e;
  --line: rgba(117, 135, 171, 0.16);
  --green: #17b26a;
  --green-soft: #def7ea;
  --amber: #f59e0b;
  --amber-soft: #fff3da;
  --red: #ef5b5b;
  --red-soft: #ffe2e2;
  --blue: #4f7cff;
  --blue-soft: #e7efff;
  --purple: #8d58ff;
  --purple-soft: #f1e9ff;
  --orange: #f39a26;
  --orange-soft: #fff0df;
  --navy: #0f1a36;
  --navy-soft: #152248;
  --shadow: 0 24px 60px rgba(17, 30, 67, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(233, 241, 255, 0.85), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 243, 219, 0.72), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  color: var(--ink);
  font-family: "Aptos", "Segoe UI Variable", "Aptos Display", "Trebuchet MS", sans-serif;
}

.app-shell {
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 0;
}

.sidebar {
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  border-right: none;
  background:
    radial-gradient(circle at top, rgba(96, 144, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #111c39 0%, #0c1530 100%);
  color: #eef4ff;
}

.brand-block {
  padding: 0.3rem 0.35rem 0;
}

.brand-shell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6da3ff, #4b7dff);
  box-shadow: 0 12px 30px rgba(68, 112, 255, 0.38);
}

.brand-wave {
  position: absolute;
  inset: 12px 10px 12px 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  border-left: 2px solid transparent;
  border-right: 2px solid transparent;
  transform: skewX(-18deg);
}

.brand-wave::before,
.brand-wave::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 8px;
  height: 8px;
  border-top: 2px solid rgba(255, 255, 255, 0.95);
  border-right: 2px solid rgba(255, 255, 255, 0.95);
  transform: rotate(-45deg);
}

.brand-wave::before {
  left: -2px;
}

.brand-wave::after {
  right: -2px;
}

.brand-copy h1 {
  font-family: "Aptos", "Segoe UI Variable", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-caption {
  margin: 0.18rem 0 0;
  color: rgba(221, 232, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-list {
  gap: 0.4rem;
}

.nav-link {
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.88rem 0.95rem;
  border-radius: 14px;
  color: rgba(236, 242, 255, 0.92);
  font-weight: 600;
  font-size: 0.96rem;
}

.nav-link span:last-child {
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(0);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-glyph {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 18px;
}

.nav-glyph::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  border: 1.6px solid rgba(255, 255, 255, 0.8);
}

.nav-link:nth-child(1) .nav-glyph::before {
  inset: 5px 4px 4px;
  border-top-width: 0;
}

.nav-link:nth-child(2) .nav-glyph::before {
  inset: 4px;
  border-radius: 50%;
}

.nav-link:nth-child(3) .nav-glyph::before {
  inset: 5px 3px;
  border-left-width: 0;
  border-right-width: 0;
}

.nav-link:nth-child(4) .nav-glyph::before,
.nav-link:nth-child(5) .nav-glyph::before,
.nav-link:nth-child(7) .nav-glyph::before,
.nav-link:nth-child(8) .nav-glyph::before {
  inset: 3px 4px 5px;
}

.nav-link:nth-child(6) .nav-glyph::before {
  inset: 3px;
  border-radius: 50%;
}

.nav-link:nth-child(9) .nav-glyph::before {
  inset: 3px 5px 4px;
}

.nav-link:nth-child(10) .nav-glyph::before {
  inset: 3px 4px;
  border-radius: 2px;
}

.nav-link:nth-child(11) .nav-glyph::before {
  inset: 4px;
  border-radius: 50%;
}

.sidebar-stack {
  margin-top: auto;
  display: grid;
  gap: 0.9rem;
}

.sidebar-footer.card {
  background: linear-gradient(180deg, rgba(28, 42, 80, 0.92), rgba(22, 34, 67, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #eef4ff;
}

.sidebar-income-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.sidebar-footer .eyebrow {
  margin: 0;
  color: rgba(220, 231, 255, 0.78);
}

.sidebar-date {
  margin: 0;
  color: rgba(220, 231, 255, 0.75);
  font-size: 0.82rem;
}

.sidebar-income-list {
  display: grid;
  gap: 0.95rem;
  margin-bottom: 1rem;
}

.income-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.income-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.income-row strong {
  display: block;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.income-row p {
  margin: 0;
  color: rgba(215, 227, 255, 0.72);
  font-size: 0.85rem;
}

.income-row span {
  color: #58d986;
  font-size: 1.05rem;
  font-weight: 700;
}

.sidebar-calendar-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-mini-actions {
  display: grid;
  gap: 0.7rem;
}

.sidebar-mini-actions .secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

.content {
  padding: 2rem 2.1rem 2.4rem;
}

.topbar {
  align-items: center;
  margin-bottom: 1.8rem;
}

.topbar-copy h2 {
  font-family: "Aptos Display", "Segoe UI Variable", sans-serif;
  font-size: clamp(2rem, 2.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.topbar-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.topbar-actions {
  gap: 0.85rem;
}

.sync-pill,
.topbar-pill,
.card-action,
.icon-btn {
  border-radius: 14px;
}

.sync-pill {
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  border-color: rgba(117, 135, 171, 0.14);
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.danger-btn,
.card-action {
  border-radius: 14px;
  padding: 0.78rem 1.05rem;
}

.primary-btn {
  background: linear-gradient(135deg, #17284d, #0f1a36);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 26, 54, 0.18);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-color: rgba(117, 135, 171, 0.14);
}

.card-action {
  border: 1px solid rgba(117, 135, 171, 0.18);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8c9b0, #8e5cf5);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(140, 92, 245, 0.18);
}

.card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(117, 135, 171, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dashboard-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-stat-card {
  padding: 1.25rem 1.2rem 1rem;
  min-height: 170px;
}

.dashboard-stat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.stat-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}

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

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

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

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

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

.stat-card .stat-value {
  margin-top: 0.95rem;
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 2vw, 2.2rem);
  letter-spacing: -0.05em;
}

.stat-green .stat-value {
  color: #159b62;
}

.stat-blue .stat-value {
  color: #25468d;
}

.stat-purple .stat-value {
  color: #7a47f5;
}

.stat-orange .stat-value {
  color: #e78613;
}

.stat-red .stat-value {
  color: #d94a4a;
}

.stat-sparkline {
  height: 56px;
}

.stat-sparkline svg {
  width: 100%;
  height: 100%;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-grid-main {
  grid-template-columns: 1.15fr 1.05fr 0.95fr;
}

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

.dashboard-panel {
  padding: 1.25rem;
}

.dashboard-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.dashboard-panel-head .panel-title {
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}

.dashboard-panel-head .panel-copy {
  margin: 0;
  color: var(--muted);
}

.plan-stack,
.upcoming-stack {
  display: grid;
  gap: 1rem;
}

.plan-row,
.upcoming-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.plan-icon,
.upcoming-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 38px;
}

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

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

.tone-sky {
  background: #e9f4ff;
  color: #2991ff;
}

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

.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

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

.plan-body,
.upcoming-body {
  flex: 1 1 auto;
}

.plan-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.plan-numbers {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-detail-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.plan-caption {
  margin: 0.48rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.sync-section,
.sync-summary-grid {
  margin-top: 1rem;
}

.sync-section-grid,
.sync-summary-grid {
  display: grid;
  gap: 0.9rem;
}

.sync-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.sync-section {
  padding: 1rem;
  border: 1px solid rgba(117, 135, 171, 0.12);
  border-radius: 18px;
  background: #fbfcff;
}

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

.sync-kpi {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(117, 135, 171, 0.12);
  border-radius: 18px;
  background: #fbfcff;
}

.sync-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.3rem;
}

.sync-kpi strong {
  display: block;
  font-size: 1rem;
  word-break: break-word;
}

.plan-meter {
  height: 8px;
  border-radius: 999px;
  background: #edf2fa;
  overflow: hidden;
}

.plan-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.fill-green {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.fill-amber {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.fill-red {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.chart-shell {
  position: relative;
  min-height: 260px;
}

.line-chart-block {
  position: relative;
  height: 100%;
}

.line-chart-block svg {
  width: 100%;
  height: 220px;
}

.chart-label-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.2rem;
}

.chart-callout {
  position: absolute;
  top: 2.1rem;
  transform: translateX(-50%);
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(117, 135, 171, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 32px rgba(23, 35, 61, 0.08);
}

.chart-callout span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.18rem;
}

.forecast-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.forecast-tile,
.dashboard-note {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(117, 135, 171, 0.12);
  background: #fbfcff;
}

.forecast-tile strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.table-action-btn {
  min-width: 74px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  font-size: 0.84rem;
}

.forecast-tile p,
.retirement-metrics p,
.retirement-gap-row p,
.dashboard-note,
.upcoming-body p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-mobile-only,
.mobile-tabbar,
.mobile-more-sheet,
.mobile-sheet-backdrop,
.mobile-alert-btn {
  display: none;
}

.dashboard-desktop-only {
  display: block;
}

.hidden {
  display: none !important;
}

.mobile-action-hero,
.mobile-inline-link,
.mobile-more-link {
  font: inherit;
}

.mobile-dashboard-shell {
  gap: 1rem;
}

.mobile-action-hero {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  border: none;
  border-radius: 24px;
  padding: 1rem 1.05rem;
  background: linear-gradient(135deg, #7f42ff, #5a33dd);
  color: #ffffff;
  box-shadow: 0 20px 28px rgba(90, 51, 221, 0.22);
}

.mobile-action-plus {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #6b3df0;
  font-size: 1.9rem;
  line-height: 1;
}

.mobile-action-copy {
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.mobile-action-copy strong {
  font-size: 1.2rem;
}

.mobile-action-copy span,
.mobile-action-arrow {
  opacity: 0.92;
}

.mobile-action-arrow {
  margin-left: auto;
  font-size: 1.8rem;
  line-height: 1;
}

.mobile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.mobile-section-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.mobile-inline-link {
  border: none;
  background: transparent;
  color: #6d42ef;
  font-weight: 700;
}

.mobile-bucket-list {
  display: grid;
  gap: 0.8rem;
}

.mobile-bucket-card {
  padding: 1rem;
  border-radius: 24px;
}

.mobile-bucket-top {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.mobile-bucket-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.mobile-bucket-copy strong,
.mobile-bucket-copy span {
  display: block;
}

.mobile-bucket-copy strong {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.mobile-bucket-copy span,
.mobile-bucket-foot {
  color: var(--muted);
  font-size: 0.88rem;
}

.mobile-bucket-amount {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: right;
}

.mobile-bucket-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.65rem;
}

.mobile-bucket-status {
  font-weight: 700;
}

.mobile-fortnight-card,
.mobile-forecast-card {
  padding: 1rem;
  border-radius: 24px;
}

.mobile-date-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #f6f7fb;
  color: var(--muted);
  font-size: 0.9rem;
}

.mobile-fortnight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.mobile-fortnight-metric {
  padding: 0 0.25rem;
  border-right: 1px solid rgba(117, 135, 171, 0.12);
}

.mobile-fortnight-metric:last-child {
  border-right: none;
}

.mobile-fortnight-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.mobile-fortnight-metric strong {
  display: block;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.mobile-tone-green {
  color: #16a34a;
}

.mobile-tone-red {
  color: #ef4444;
}

.mobile-tone-purple {
  color: #7a47f5;
}

.mobile-tone-orange {
  color: #f97316;
}

.mobile-forecast-balance {
  color: #7a47f5;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.mobile-forecast-chart .line-chart-block svg {
  height: 160px;
}

.mobile-forecast-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.mobile-alert-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.mobile-alert-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #111827;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  border-bottom-color: transparent;
  position: relative;
}

.mobile-alert-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: #111827;
  transform: translateX(-50%);
  border-radius: 999px;
}

.mobile-alert-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 0.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ff4d5f;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.7rem 0.7rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid rgba(117, 135, 171, 0.12);
  box-shadow: 0 -10px 24px rgba(15, 26, 54, 0.08);
}

.mobile-nav-link {
  flex: 1 1 0;
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  padding: 0.25rem 0.15rem;
}

.mobile-nav-glyph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(117, 135, 171, 0.1);
  color: #475569;
}

.mobile-nav-link.active {
  color: #6d42ef;
}

.mobile-nav-link.active .mobile-nav-glyph {
  background: rgba(122, 71, 245, 0.14);
  color: #6d42ef;
}

.mobile-nav-link-add .mobile-nav-glyph {
  width: 52px;
  height: 52px;
  margin-top: -20px;
  background: linear-gradient(135deg, #7f42ff, #5a33dd);
  color: #ffffff;
  box-shadow: 0 16px 26px rgba(90, 51, 221, 0.28);
  font-size: 1.8rem;
}

.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: rgba(15, 23, 42, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mobile-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-more-sheet {
  position: fixed;
  left: 0.9rem;
  right: 0.9rem;
  bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  padding: 1rem;
  border-radius: 28px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.mobile-more-sheet.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-more-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.mobile-more-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.mobile-more-link {
  border: 1px solid rgba(117, 135, 171, 0.14);
  border-radius: 16px;
  background: #fbfcff;
  color: var(--ink);
  padding: 0.95rem;
  text-align: left;
  font-weight: 700;
}

.success-text {
  color: var(--green);
}

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

.upcoming-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(117, 135, 171, 0.1);
}

.upcoming-row:last-child {
  border-bottom: none;
}

.upcoming-meta {
  text-align: right;
}

.upcoming-meta strong {
  display: block;
}

.upcoming-meta span {
  color: var(--blue);
  font-size: 0.88rem;
}

.debt-overview-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  align-items: center;
}

.donut-wrap {
  display: grid;
  place-items: center;
}

.donut-chart {
  --donut: conic-gradient(#4f7cff 0deg 360deg);
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: var(--donut);
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(117, 135, 171, 0.08);
}

.donut-core {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 1rem;
}

.donut-core span {
  color: var(--muted);
  font-size: 0.9rem;
}

.donut-core strong {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.debt-legend {
  display: grid;
  gap: 0.7rem;
}

.debt-legend-row,
.legend-key,
.recovery-stats,
.checkin-summary-row {
  display: flex;
  align-items: center;
}

.debt-legend-row {
  justify-content: space-between;
  gap: 0.8rem;
}

.legend-key {
  gap: 0.6rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.recovery-headline,
.retirement-metrics,
.retirement-gap-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.recovery-headline strong,
.retirement-metrics strong,
.retirement-gap-row strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.recovery-progress {
  margin: 1rem 0;
}

.recovery-stats {
  justify-content: space-between;
  gap: 0.8rem;
  align-items: stretch;
}

.recovery-stats > div,
.checkin-summary-row > div {
  display: grid;
  gap: 0.3rem;
}

.recovery-stats span,
.checkin-summary-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.note-success {
  background: rgba(133, 228, 177, 0.12);
  color: #0e9156;
}

.note-danger {
  background: rgba(255, 226, 226, 0.68);
  color: #c33f3f;
}

.note-info {
  background: rgba(231, 239, 255, 0.65);
  color: var(--blue);
}

.retirement-graphic {
  margin-top: 1rem;
  height: 110px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 78% 34%, rgba(255, 200, 69, 0.9), transparent 10%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(142, 92, 245, 0.08) 44%, rgba(142, 92, 245, 0.22) 100%),
    linear-gradient(145deg, rgba(164, 120, 255, 0.16), rgba(83, 64, 193, 0.2));
  clip-path: polygon(0 100%, 0 76%, 10% 64%, 18% 72%, 25% 60%, 33% 72%, 42% 55%, 52% 68%, 64% 42%, 74% 54%, 84% 36%, 92% 48%, 100% 38%, 100% 100%);
}

.dashboard-panel-checkin {
  margin-top: 1rem;
}

.checkin-summary-row {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkin-form .field-actions {
  margin-top: 0.8rem;
}

.callout.amber {
  background: rgba(255, 239, 207, 0.82);
  color: #bb7a12;
}

.table-card,
.form-card,
.panel-card,
.chart-card,
.bucket-card,
.timeline-card,
.settings-card {
  background: rgba(255, 255, 255, 0.98);
}

.grid-table th {
  color: #7b879e;
}

.grid-table th,
.grid-table td {
  border-bottom-color: rgba(117, 135, 171, 0.12);
}

.field input,
.field select,
.field textarea {
  border-radius: 14px;
  border-color: rgba(117, 135, 171, 0.16);
  background: #fbfcff;
}

.badge.green,
.status-track,
.pill-green {
  color: #10995f;
  background: rgba(180, 241, 206, 0.54);
}

.badge.amber,
.status-watch,
.pill-amber {
  color: #bf7a08;
  background: rgba(255, 236, 194, 0.7);
}

.badge.red,
.status-alert,
.pill-red {
  color: #d94a4a;
  background: rgba(255, 225, 225, 0.78);
}

.badge.blue,
.pill-blue {
  color: var(--blue);
  background: rgba(231, 239, 255, 0.88);
}

@media (max-width: 1320px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .dashboard-panel-upcoming {
    grid-column: 1 / -1;
  }
}

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

  .sidebar {
    position: static;
    min-height: auto;
    padding: 1rem;
  }

  .sidebar-stack {
    margin-top: 0;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

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

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

@media (max-width: 760px) {
  .content {
    padding: 1rem 1rem 7rem;
  }

  .sidebar {
    display: none;
  }

  .dashboard-desktop-only {
    display: none;
  }

  .dashboard-mobile-only,
  .mobile-tabbar,
  .mobile-alert-btn {
    display: grid;
  }

  .mobile-more-sheet,
  .mobile-sheet-backdrop {
    display: block;
  }

  .dashboard-stat-grid,
  .forecast-tiles,
  .recovery-headline,
  .retirement-metrics,
  .retirement-gap-row {
    grid-template-columns: 1fr;
  }

  .debt-overview-layout {
    grid-template-columns: 1fr;
  }

  .checkin-summary-row,
  .recovery-stats,
  .plan-topline {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .topbar {
    margin-bottom: 1.2rem;
    align-items: flex-start;
  }

  .topbar-copy h2 {
    font-size: 1.9rem;
    line-height: 1.05;
  }

  .topbar-subtitle {
    font-size: 1rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .sync-pill,
  #date-range-btn,
  #manual-top-btn,
  #export-json-btn {
    display: none;
  }

  .avatar-badge {
    width: 40px;
    height: 40px;
  }

  .mobile-dashboard-shell {
    display: grid;
  }

  .mobile-fortnight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0.9rem;
  }

  .mobile-fortnight-metric:nth-child(2) {
    border-right: none;
  }

  .mobile-fortnight-metric:nth-child(3),
  .mobile-fortnight-metric:nth-child(4) {
    padding-top: 0.35rem;
  }

  .mobile-bucket-top {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .mobile-bucket-amount {
    grid-column: 2;
    text-align: left;
    margin-top: -0.15rem;
  }

  .mobile-bucket-foot,
  .mobile-forecast-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-more-grid {
    grid-template-columns: 1fr;
  }
}
