@font-face {
  font-family: 'Ethnocentric';
  src: url('./fonts/Ethnocentric-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Custom';
  src: url('./fonts/Helvetica-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Custom';
  src: url('./fonts/Helvetica.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Custom';
  src: url('./fonts/Helvetica-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-void: #05030b;
  --bg-deep: #0b0718;
  --surface-rgb: 16, 12, 32;
  --glass-opacity: 0.68;
  --glass-blur: 16px;
  --card-radius: 18px;
  --glow-strength: 0.55;

  --accent-primary: #8b5cf6;
  --accent-secondary: #a855f7;
  --accent-bright: #d8b4fe;
  --accent-rgb: 139, 92, 246;
  --stroke-rgb: 196, 181, 253;

  --planet-rim: #e9d5ff;
  --planet-mid: #7c3aed;
  --planet-core: #160c32;
  --aurora-1: rgba(139, 92, 246, 0.52);
  --aurora-2: rgba(192, 132, 252, 0.30);
  --crystal-fill-1: #1c1238;
  --crystal-fill-2: #0c071c;
  --crystal-edge: #a78bfa;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --income-color: #34d399;
  --expense-color: #fb7185;
  --warning-color: #fbbf24;

  --font-display: 'Ethnocentric', sans-serif;
  --font-sans: 'Helvetica Custom', Helvetica, Arial, sans-serif;
}

[data-theme="cyber-cyan"] {
  --bg-void: #030811;
  --bg-deep: #061224;
  --surface-rgb: 9, 22, 42;
  --accent-primary: #06b6d4;
  --accent-secondary: #22d3ee;
  --accent-bright: #a5f3fc;
  --accent-rgb: 6, 182, 212;
  --stroke-rgb: 103, 232, 249;
  --planet-rim: #cffafe;
  --planet-mid: #06b6d4;
  --planet-core: #08233d;
  --aurora-1: rgba(6, 182, 212, 0.48);
  --aurora-2: rgba(56, 189, 248, 0.26);
  --crystal-fill-1: #0d2b45;
  --crystal-fill-2: #051324;
  --crystal-edge: #22d3ee;
}

[data-theme="frost-platinum"] {
  --bg-void: #040406;
  --bg-deep: #0b0c10;
  --surface-rgb: 18, 19, 24;
  --accent-primary: #cbd5e1;
  --accent-secondary: #f8fafc;
  --accent-bright: #ffffff;
  --accent-rgb: 226, 232, 240;
  --stroke-rgb: 241, 245, 249;
  --planet-rim: #ffffff;
  --planet-mid: #94a3b8;
  --planet-core: #14161d;
  --aurora-1: rgba(226, 232, 240, 0.34);
  --aurora-2: rgba(148, 163, 184, 0.20);
  --crystal-fill-1: #1e2029;
  --crystal-fill-2: #0b0c10;
  --crystal-edge: #e2e8f0;
}

[data-theme="emerald-nebula"] {
  --bg-void: #030c09;
  --bg-deep: #061812;
  --surface-rgb: 9, 28, 22;
  --accent-primary: #10b981;
  --accent-secondary: #34d399;
  --accent-bright: #a7f3d0;
  --accent-rgb: 16, 185, 129;
  --stroke-rgb: 110, 231, 183;
  --planet-rim: #d1fae5;
  --planet-mid: #10b981;
  --planet-core: #062c22;
  --aurora-1: rgba(16, 185, 129, 0.46);
  --aurora-2: rgba(45, 212, 191, 0.24);
  --crystal-fill-1: #0c3529;
  --crystal-fill-2: #041712;
  --crystal-edge: #34d399;
}

[data-theme="solar-gold"] {
  --bg-void: #0b0703;
  --bg-deep: #170f05;
  --surface-rgb: 30, 20, 9;
  --accent-primary: #f59e0b;
  --accent-secondary: #fbbf24;
  --accent-bright: #fde68a;
  --accent-rgb: 245, 158, 11;
  --stroke-rgb: 253, 224, 71;
  --planet-rim: #fef3c7;
  --planet-mid: #f59e0b;
  --planet-core: #331e07;
  --aurora-1: rgba(245, 158, 11, 0.46);
  --aurora-2: rgba(251, 146, 60, 0.26);
  --crystal-fill-1: #3b250b;
  --crystal-fill-2: #170e04;
  --crystal-edge: #fbbf24;
}

[data-theme="crimson-nova"] {
  --bg-void: #0c0407;
  --bg-deep: #18070e;
  --surface-rgb: 32, 10, 20;
  --accent-primary: #f43f5e;
  --accent-secondary: #fb7185;
  --accent-bright: #fecdd3;
  --accent-rgb: 244, 63, 94;
  --stroke-rgb: 253, 164, 175;
  --planet-rim: #ffe4e6;
  --planet-mid: #f43f5e;
  --planet-core: #360b19;
  --aurora-1: rgba(244, 63, 94, 0.48);
  --aurora-2: rgba(232, 121, 249, 0.24);
  --crystal-fill-1: #3d1021;
  --crystal-fill-2: #17060d;
  --crystal-edge: #fb7185;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background-color: var(--bg-void);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.48;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.text-light {
  font-weight: 300;
}

/* Cosmic Backdrop */
.cosmic-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 8%, var(--bg-deep) 0%, var(--bg-void) 100%);
}

#cosmic-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.planet-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

body.mode-workspace .planet-stage {
  transform: translateY(36%) scale(0.92);
  opacity: 0.34;
}

.planet-sphere {
  position: relative;
  width: min(145vw, 1260px);
  height: min(145vw, 1260px);
  border-radius: 50%;
  transform: translateY(58%);
  background: radial-gradient(circle at 50% 8%, color-mix(in srgb, var(--planet-mid) 44%, transparent) 0%, var(--planet-core) 28%, var(--bg-void) 68%);
  box-shadow:
    0 -3px 26px 1px var(--planet-rim),
    0 -16px 80px 10px rgba(var(--accent-rgb), 0.45),
    inset 0 6px 38px 3px var(--planet-rim);
}

.aurora-plume {
  position: absolute;
  bottom: -6%;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 760px);
  height: min(44vh, 380px);
  background:
    radial-gradient(ellipse 45% 65% at 50% 92%, var(--aurora-1) 0%, transparent 72%),
    radial-gradient(ellipse 70% 55% at 46% 96%, var(--aurora-2) 0%, transparent 75%);
  filter: blur(28px);
}

.crystal-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

body.mode-workspace .crystal-field {
  opacity: 0.16;
}

.crystal-shard {
  position: absolute;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

.shard-1 { width: clamp(110px, 16vw, 190px); bottom: 10%; left: 3%; }
.shard-2 { width: clamp(64px, 9vw, 105px); top: 34%; left: 7%; }
.shard-3 { width: clamp(60px, 8.5vw, 98px); top: 32%; right: 7%; }
.shard-4 { width: clamp(105px, 15vw, 185px); bottom: 9%; right: 3%; }

/* Top Rounded Trapezoidal Notch */
.top-shell {
  position: relative;
  z-index: 20;
  width: 100%;
}

.top-notch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.top-notch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(90vw, 370px);
  height: 58px;
  padding: 0 38px 4px;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 6px 22px rgba(var(--accent-rgb), calc(0.32 + var(--glow-strength) * 0.45)));
}

.notch-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.notch-shape-path {
  fill: rgba(var(--surface-rgb), 0.86);
  stroke: rgba(var(--stroke-rgb), 0.55);
  stroke-width: 1.25;
}

.brand-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 2.4vw, 1.02rem);
  letter-spacing: 0.14em;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.72),
    0 0 18px rgba(var(--accent-rgb), 0.85),
    0 0 34px rgba(var(--accent-rgb), 0.55);
  animation: ethnocentricGlow 3.6s ease-in-out infinite alternate;
}

@keyframes ethnocentricGlow {
  0% {
    text-shadow:
      0 0 6px rgba(255, 255, 255, 0.58),
      0 0 14px rgba(var(--accent-rgb), 0.65),
      0 0 26px rgba(var(--accent-rgb), 0.35);
    opacity: 0.94;
  }
  100% {
    text-shadow:
      0 0 11px rgba(255, 255, 255, 0.92),
      0 0 24px rgba(var(--accent-rgb), 0.95),
      0 0 44px rgba(var(--accent-rgb), 0.72);
    opacity: 1;
  }
}

.brand-tagline {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.64rem, 1.8vw, 0.76rem);
  letter-spacing: 0.24em;
  color: var(--text-secondary);
  text-align: center;
  padding: 0 16px;
}

/* Desktop Navigation Bar */
.nav-bar {
  display: none;
  max-width: 1080px;
  margin: 14px auto 0;
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  background: rgba(var(--surface-rgb), var(--glass-opacity));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(var(--stroke-rgb), calc(0.18 + var(--glow-strength) * 0.24));
  box-shadow: 0 0 24px -6px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.5));
}

@media (min-width: 820px) {
  .nav-bar {
    display: flex;
  }
  body {
    padding-bottom: 36px;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.22s ease;
}

.nav-item svg {
  width: 16px;
  height: 16px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(var(--stroke-rgb), 0.08);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--stroke-rgb), 0.42);
  box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), 0.55);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cycle-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 300;
  font-size: 0.76rem;
  color: var(--text-secondary);
  border: 1px solid rgba(var(--stroke-rgb), 0.24);
  background: rgba(var(--surface-rgb), 0.5);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
}

/* Glass Card with Thin Stroke & Subtle Column Glow */
.glass-card {
  background: rgba(var(--surface-rgb), var(--glass-opacity));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--card-radius);
  border: 1px solid rgba(var(--stroke-rgb), calc(0.18 + var(--glow-strength) * 0.26));
  box-shadow:
    0 14px 36px -14px rgba(0, 0, 0, 0.72),
    0 0 26px -6px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.55)),
    inset 0 1px 0 0 rgba(var(--stroke-rgb), calc(0.14 + var(--glow-strength) * 0.18));
  padding: 18px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, border-radius 0.2s ease, background 0.2s ease;
}

/* Main Views */
.app-main {
  position: relative;
  z-index: 10;
  padding: 14px 14px 20px;
}

.view-section {
  display: none;
  animation: fadeSlideIn 0.28s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Home Hero Card */
.hero-view {
  min-height: calc(100dvh - 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 18px;
}

.hero-balance-card {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-card-label {
  font-weight: 300;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.hero-cycle-tag {
  font-weight: 300;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent-bright);
  border: 1px solid rgba(var(--stroke-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.14);
}

.hero-balance-amount {
  margin-top: 12px;
  font-weight: 700;
  font-size: clamp(1.85rem, 6.5vw, 2.45rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-shadow: 0 0 22px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.45));
}

.hero-balance-note {
  margin-top: 4px;
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Segmented Bar (Reference Style) */
.ref-segment-wrap {
  margin-top: 16px;
}

.ref-segment-track {
  display: flex;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  gap: 3px;
  padding: 1.5px;
  background: rgba(5, 4, 12, 0.75);
  border: 1px solid rgba(var(--stroke-rgb), 0.25);
}

.ref-segment-tall {
  height: 13px;
}

.seg-slice {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.ref-segment-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.hero-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.hero-flow-col {
  padding: 11px 13px;
  border-radius: calc(var(--card-radius) * 0.75);
  background: rgba(8, 6, 18, 0.55);
  border: 1px solid rgba(var(--stroke-rgb), calc(0.16 + var(--glow-strength) * 0.2));
  box-shadow: inset 0 1px 0 rgba(var(--stroke-rgb), 0.12);
}

.hero-flow-label {
  display: block;
  font-weight: 300;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hero-flow-val {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
}

.hero-flow-val.income, .kpi-value.income { color: var(--income-color); }
.hero-flow-val.expense, .kpi-value.expense { color: var(--expense-color); }

.hero-card-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pill-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(var(--stroke-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 0 20px -4px rgba(var(--accent-rgb), calc(0.35 + var(--glow-strength) * 0.45));
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.pill-cta:hover {
  transform: translateY(-1px);
  background: rgba(var(--accent-rgb), 0.36);
}

.pill-cta-primary {
  width: 100%;
  padding: 12px 22px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.72), rgba(var(--accent-rgb), 0.38));
}

.hero-sub-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 8px;
}

.hero-sub-link:hover {
  color: var(--accent-bright);
}

/* Recap Layout */
.cycle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
}

.cycle-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: calc(var(--card-radius) * 0.65);
  border: 1px solid rgba(var(--stroke-rgb), 0.28);
  background: rgba(var(--surface-rgb), 0.6);
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
}

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

.cycle-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
}

.cycle-select option {
  background: #0d091f;
  color: #f8fafc;
}

.cycle-range-sub {
  display: block;
  font-weight: 300;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.badge-current-cycle, .kpi-badge {
  font-weight: 300;
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent-bright);
  border: 1px solid rgba(var(--stroke-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.14);
}

.btn-jump-now {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--stroke-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.26);
  color: #fff;
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 820px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  padding: 15px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kpi-label {
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.kpi-value {
  margin-top: 8px;
  font-weight: 700;
  font-size: clamp(1.05rem, 3vw, 1.32rem);
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 300;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.budget-bar-track {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(5, 4, 12, 0.72);
  border: 1px solid rgba(var(--stroke-rgb), 0.2);
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent-primary);
  transition: width 0.35s ease;
}

.link-inline {
  background: none;
  border: none;
  color: var(--accent-bright);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
}

.seg-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.seg-chip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 300;
  font-size: 0.73rem;
  color: var(--text-secondary);
  background: rgba(8, 6, 18, 0.55);
  border: 1px solid rgba(var(--stroke-rgb), 0.2);
}

.seg-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

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

.card-title {
  font-weight: 700;
  font-size: 0.96rem;
}

.card-subtitle {
  font-weight: 300;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 820px) {
  .charts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(6, 5, 14, 0.7);
  border: 1px solid rgba(var(--stroke-rgb), 0.22);
}

.seg-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  cursor: pointer;
}

.seg-btn.active {
  background: rgba(var(--accent-rgb), 0.34);
  color: #fff;
}

.donut-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

@media (min-width: 520px) {
  .donut-layout {
    flex-direction: row;
    align-items: center;
  }
}

.donut-canvas-wrap {
  position: relative;
  width: 195px;
  height: 195px;
  flex-shrink: 0;
}

.donut-center-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.donut-center-title {
  font-weight: 300;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.donut-center-val {
  font-weight: 700;
  font-size: 0.86rem;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.donut-legend {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: calc(var(--card-radius) * 0.6);
  background: rgba(8, 6, 18, 0.48);
  border: 1px solid rgba(var(--stroke-rgb), 0.16);
  font-size: 0.78rem;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.bar-legend-inline {
  display: flex;
  gap: 12px;
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.bar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bar-canvas-wrap {
  width: 100%;
  height: 225px;
}

/* Transaction Controls & List */
.tx-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-box input, .form-input, .cat-filter-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: calc(var(--card-radius) * 0.65);
  border: 1px solid rgba(var(--stroke-rgb), 0.24);
  background: rgba(7, 5, 16, 0.68);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.84rem;
  outline: none;
}

.search-box input {
  padding-left: 32px;
}

.search-box input::placeholder, .form-input::placeholder {
  font-weight: 300;
  color: var(--text-muted);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.filter-chip, .preset-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--stroke-rgb), 0.22);
  background: rgba(8, 6, 18, 0.52);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.76rem;
  cursor: pointer;
}

.filter-chip.active {
  background: rgba(var(--accent-rgb), 0.3);
  border-color: rgba(var(--stroke-rgb), 0.45);
  color: #fff;
  font-weight: 400;
}

.cat-filter-select {
  width: auto;
  padding: 6px 10px;
  font-size: 0.76rem;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: calc(var(--card-radius) * 0.72);
  background: rgba(8, 6, 18, 0.52);
  border: 1px solid rgba(var(--stroke-rgb), 0.18);
  box-shadow: 0 0 18px -8px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.4));
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tx-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: calc(var(--card-radius) * 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 1px solid rgba(var(--stroke-rgb), 0.24);
  flex-shrink: 0;
}

.tx-info {
  min-width: 0;
}

.tx-cat-name {
  font-weight: 400;
  font-size: 0.86rem;
}

.tx-note-date {
  font-weight: 300;
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tx-amount {
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.tx-amount.income { color: var(--income-color); }
.tx-amount.expense { color: var(--expense-color); }

.tx-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(var(--stroke-rgb), 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.76rem;
  cursor: pointer;
}

/* Settings & Theme Grids */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 820px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-full {
    grid-column: 1 / -1;
  }
}

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

.switch-title { font-weight: 400; font-size: 0.88rem; }
.switch-desc { font-weight: 300; font-size: 0.74rem; color: var(--text-muted); }

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(var(--stroke-rgb), 0.28);
  cursor: pointer;
  transition: 0.25s;
}

.slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  transition: 0.25s;
}

.switch input:checked + .slider {
  background: rgba(var(--accent-rgb), 0.55);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-prefix {
  position: absolute;
  left: 12px;
  font-weight: 300;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.amount-input {
  padding-left: 38px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.btn-solid, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: calc(var(--card-radius) * 0.65);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-solid {
  border: 1px solid rgba(var(--stroke-rgb), 0.45);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.72), rgba(var(--accent-rgb), 0.4));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 18px -4px rgba(var(--accent-rgb), 0.5);
}

.btn-outline {
  border: 1px solid rgba(var(--stroke-rgb), 0.26);
  background: rgba(8, 6, 18, 0.55);
  color: var(--text-primary);
  font-weight: 400;
}

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

.btn-danger-outline {
  border-color: rgba(251, 113, 133, 0.36);
  color: var(--expense-color);
}

.data-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-divider-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--stroke-rgb), 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-grid, .emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.swatch-opt {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.swatch-opt.selected {
  border-color: #fff;
  transform: scale(1.1);
}

.emoji-opt {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(var(--stroke-rgb), 0.22);
  background: rgba(8, 6, 18, 0.55);
  font-size: 1rem;
  cursor: pointer;
}

.emoji-opt.selected {
  border-color: rgba(var(--stroke-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.28);
}

.cat-manage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.cat-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-radius: calc(var(--card-radius) * 0.65);
  background: rgba(8, 6, 18, 0.52);
  border: 1px solid rgba(var(--stroke-rgb), 0.18);
  font-size: 0.82rem;
}

/* Theme Tab Controls */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.theme-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: calc(var(--card-radius) * 0.72);
  border: 1px solid rgba(var(--stroke-rgb), 0.2);
  background: rgba(8, 6, 18, 0.55);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.theme-card.active {
  border-color: rgba(var(--stroke-rgb), 0.65);
  box-shadow: 0 0 18px -4px rgba(var(--accent-rgb), 0.55);
}

.theme-orb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.theme-name { font-weight: 400; font-size: 0.82rem; }
.theme-desc { font-weight: 300; font-size: 0.7rem; color: var(--text-muted); }

.custom-color-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--stroke-rgb), 0.28);
  background: rgba(8, 6, 18, 0.6);
  font-weight: 300;
  font-size: 0.74rem;
  cursor: pointer;
}

.custom-color-pill input[type="color"] {
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  cursor: pointer;
}

.slider-control-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.slider-label { font-weight: 300; color: var(--text-secondary); }
.slider-val { font-weight: 400; color: var(--accent-bright); font-variant-numeric: tabular-nums; }

.glass-range {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.theme-preview-box {
  margin-top: 16px;
  padding: 13px;
  border-radius: var(--card-radius);
  background: rgba(var(--surface-rgb), var(--glass-opacity));
  border: 1px solid rgba(var(--stroke-rgb), calc(0.2 + var(--glow-strength) * 0.28));
  box-shadow: 0 0 22px -6px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.55));
}

.theme-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.theme-preview-amount {
  margin-top: 6px;
  font-weight: 700;
  font-size: 1.15rem;
}

/* Mobile Dock */
.mobile-dock {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(94vw, 430px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.84);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(var(--stroke-rgb), calc(0.22 + var(--glow-strength) * 0.26));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 22px -4px rgba(var(--accent-rgb), calc(var(--glow-strength) * 0.5));
}

@media (min-width: 820px) {
  .mobile-dock { display: none; }
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.68rem;
  padding: 4px 10px;
  cursor: pointer;
}

.dock-btn svg { width: 18px; height: 18px; }
.dock-btn.active { color: var(--accent-bright); font-weight: 400; }

.dock-fab {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(var(--stroke-rgb), 0.55);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-rgb), 0.48));
  color: #fff;
  font-size: 1.35rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.65);
}

/* Modals & Toasts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 2, 8, 0.74);
  backdrop-filter: blur(8px);
}

.modal-backdrop.open { display: flex; }

.modal-panel {
  width: 100%;
  max-width: 450px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--card-radius);
  background: rgba(var(--surface-rgb), 0.92);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(var(--stroke-rgb), 0.36);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 28px -4px rgba(var(--accent-rgb), 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-title { font-weight: 700; font-size: 1rem; }

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(var(--stroke-rgb), 0.24);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
}

.type-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.type-btn {
  padding: 10px;
  border-radius: calc(var(--card-radius) * 0.65);
  border: 1px solid rgba(var(--stroke-rgb), 0.2);
  background: rgba(8, 6, 18, 0.55);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  cursor: pointer;
}

.type-btn.active-expense {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.16);
  color: var(--expense-color);
  font-weight: 700;
}

.type-btn.active-income {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.16);
  color: var(--income-color);
  font-weight: 700;
}

.cat-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.cat-pill-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 6px;
  border-radius: calc(var(--card-radius) * 0.65);
  border: 1px solid rgba(var(--stroke-rgb), 0.18);
  background: rgba(8, 6, 18, 0.55);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.74rem;
  cursor: pointer;
}

.cat-pill-opt.selected {
  border-color: rgba(var(--stroke-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.24);
  color: #fff;
  font-weight: 400;
}

.confirm-msg {
  font-weight: 300;
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.chart-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(8, 6, 18, 0.94);
  border: 1px solid rgba(var(--stroke-rgb), 0.35);
  font-size: 0.76rem;
  color: #fff;
  transition: opacity 0.15s ease;
}

.chart-tooltip.visible { opacity: 1; }

.toast-container {
  position: fixed;
  top: 74px;
  right: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(12, 9, 26, 0.94);
  border: 1px solid rgba(var(--stroke-rgb), 0.36);
  color: #fff;
  font-weight: 300;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}
