/* ==========================================================================
   TSIX MONTHLY — Cosmic Financial Command Center Stylesheet
   Custom Typography (Ethnocentric + Helvetica + Helvetica Light),
   Rectangular Rounded Controls & Photorealistic Cosmic Horizon
   ========================================================================== */

@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: 'HelveticaCustom';
  src: url('./fonts/helvetica-light-587ebe5a59211.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* Default Theme: Cosmic Violet */
  --bg-void: #06040d;
  --bg-deep: #0a0716;
  --bg-surface: rgba(18, 13, 36, 0.72);
  --bg-surface-elevated: rgba(27, 20, 52, 0.86);
  --bg-input: rgba(12, 9, 25, 0.78);
  --border-glass: rgba(167, 139, 250, 0.18);
  --border-glass-strong: rgba(196, 181, 253, 0.34);

  --accent-primary: #7c3aed;
  --accent-secondary: #a855f7;
  --accent-bright: #c4b5fd;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(139, 92, 246, 0.48);

  --planet-rim: #e9d5ff;
  --planet-mid: #7c3aed;
  --planet-core: #170d33;
  --aurora-1: rgba(139, 92, 246, 0.55);
  --aurora-2: rgba(192, 132, 252, 0.32);

  --crystal-fill-1: #1d123b;
  --crystal-fill-2: #0d081e;
  --crystal-edge: #a78bfa;

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

  --income-color: #10b981;
  --income-bg: rgba(16, 185, 129, 0.14);
  --expense-color: #f43f5e;
  --expense-bg: rgba(244, 63, 94, 0.14);
  --warning-color: #f59e0b;

  --shadow-card: 0 18px 45px -12px rgba(0, 0, 0, 0.65);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-btn: 11px;
  --radius-btn-icon: 7px;
  --radius-pill: 9999px;

  --font-brand: 'Ethnocentric', 'Space Grotesk', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'HelveticaCustom', system-ui, sans-serif;
  --font-sans: 'HelveticaCustom', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Theme 2: Cyber Cyan */
[data-theme="cyber-cyan"] {
  --bg-void: #030912;
  --bg-deep: #061221;
  --bg-surface: rgba(10, 24, 44, 0.74);
  --bg-surface-elevated: rgba(14, 34, 62, 0.86);
  --bg-input: rgba(6, 16, 32, 0.8);
  --border-glass: rgba(34, 211, 238, 0.2);
  --border-glass-strong: rgba(103, 232, 249, 0.38);

  --accent-primary: #0891b2;
  --accent-secondary: #06b6d4;
  --accent-bright: #67e8f9;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(6, 182, 212, 0.45);

  --planet-rim: #cffafe;
  --planet-mid: #06b6d4;
  --planet-core: #08233d;
  --aurora-1: rgba(6, 182, 212, 0.5);
  --aurora-2: rgba(56, 189, 248, 0.28);

  --crystal-fill-1: #0d2b45;
  --crystal-fill-2: #051324;
  --crystal-edge: #22d3ee;
}

/* Theme 3: Emerald Nebula */
[data-theme="emerald-nebula"] {
  --bg-void: #030d0a;
  --bg-deep: #061712;
  --bg-surface: rgba(10, 30, 24, 0.74);
  --bg-surface-elevated: rgba(15, 42, 34, 0.86);
  --bg-input: rgba(6, 20, 16, 0.8);
  --border-glass: rgba(52, 211, 153, 0.2);
  --border-glass-strong: rgba(110, 231, 183, 0.36);

  --accent-primary: #059669;
  --accent-secondary: #10b981;
  --accent-bright: #6ee7b7;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(16, 185, 129, 0.45);

  --planet-rim: #d1fae5;
  --planet-mid: #10b981;
  --planet-core: #062c22;
  --aurora-1: rgba(16, 185, 129, 0.48);
  --aurora-2: rgba(45, 212, 191, 0.26);

  --crystal-fill-1: #0c3529;
  --crystal-fill-2: #041712;
  --crystal-edge: #34d399;
}

/* Theme 4: Solar Gold */
[data-theme="solar-gold"] {
  --bg-void: #0c0803;
  --bg-deep: #160f06;
  --bg-surface: rgba(32, 22, 10, 0.75);
  --bg-surface-elevated: rgba(46, 31, 14, 0.86);
  --bg-input: rgba(20, 14, 6, 0.82);
  --border-glass: rgba(251, 191, 36, 0.22);
  --border-glass-strong: rgba(253, 224, 71, 0.38);

  --accent-primary: #d97706;
  --accent-secondary: #f59e0b;
  --accent-bright: #fde68a;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(245, 158, 11, 0.45);

  --planet-rim: #fef3c7;
  --planet-mid: #f59e0b;
  --planet-core: #331e07;
  --aurora-1: rgba(245, 158, 11, 0.48);
  --aurora-2: rgba(251, 146, 60, 0.28);

  --crystal-fill-1: #3b250b;
  --crystal-fill-2: #170e04;
  --crystal-edge: #fbbf24;
}

/* Theme 5: Crimson Nova */
[data-theme="crimson-nova"] {
  --bg-void: #0d0408;
  --bg-deep: #17070e;
  --bg-surface: rgba(34, 11, 21, 0.74);
  --bg-surface-elevated: rgba(48, 15, 30, 0.86);
  --bg-input: rgba(22, 7, 14, 0.8);
  --border-glass: rgba(251, 113, 133, 0.22);
  --border-glass-strong: rgba(253, 164, 175, 0.38);

  --accent-primary: #e11d48;
  --accent-secondary: #f43f5e;
  --accent-bright: #fda4af;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(244, 63, 94, 0.45);

  --planet-rim: #ffe4e6;
  --planet-mid: #f43f5e;
  --planet-core: #360b19;
  --aurora-1: rgba(244, 63, 94, 0.5);
  --aurora-2: rgba(232, 121, 249, 0.25);

  --crystal-fill-1: #3d1021;
  --crystal-fill-2: #17060d;
  --crystal-edge: #fb7185;
}

/* Theme 6: Aether Blue */
[data-theme="aether-blue"] {
  --bg-void: #040612;
  --bg-deep: #080d24;
  --bg-surface: rgba(14, 21, 52, 0.74);
  --bg-surface-elevated: rgba(20, 30, 72, 0.86);
  --bg-input: rgba(9, 14, 36, 0.8);
  --border-glass: rgba(96, 165, 250, 0.22);
  --border-glass-strong: rgba(147, 197, 253, 0.38);

  --accent-primary: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-bright: #93c5fd;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(59, 130, 246, 0.48);

  --planet-rim: #dbeafe;
  --planet-mid: #3b82f6;
  --planet-core: #0f1e4a;
  --aurora-1: rgba(59, 130, 246, 0.52);
  --aurora-2: rgba(99, 102, 241, 0.3);

  --crystal-fill-1: #132559;
  --crystal-fill-2: #070d26;
  --crystal-edge: #60a5fa;
}

/* Theme 7: Rose Quartz */
[data-theme="rose-quartz"] {
  --bg-void: #0c0410;
  --bg-deep: #16081d;
  --bg-surface: rgba(32, 13, 41, 0.74);
  --bg-surface-elevated: rgba(45, 19, 58, 0.86);
  --bg-input: rgba(20, 8, 27, 0.8);
  --border-glass: rgba(244, 114, 182, 0.22);
  --border-glass-strong: rgba(249, 168, 212, 0.38);

  --accent-primary: #db2777;
  --accent-secondary: #ec4899;
  --accent-bright: #f9a8d4;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(236, 72, 153, 0.46);

  --planet-rim: #fce7f3;
  --planet-mid: #ec4899;
  --planet-core: #350e3d;
  --aurora-1: rgba(236, 72, 153, 0.5);
  --aurora-2: rgba(168, 85, 247, 0.28);

  --crystal-fill-1: #3b1347;
  --crystal-fill-2: #16071c;
  --crystal-edge: #f472b6;
}

/* Theme 8: Arctic Frost (Clean Daylight Mode) */
[data-theme="arctic-frost"] {
  --bg-void: #eef2ff;
  --bg-deep: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.84);
  --bg-surface-elevated: rgba(255, 255, 255, 0.96);
  --bg-input: rgba(241, 245, 249, 0.92);
  --border-glass: rgba(99, 102, 241, 0.16);
  --border-glass-strong: rgba(99, 102, 241, 0.32);

  --accent-primary: #4f46e5;
  --accent-secondary: #6366f1;
  --accent-bright: #4338ca;
  --accent-contrast: #ffffff;
  --accent-glow: rgba(79, 70, 229, 0.26);

  --planet-rim: #4f46e5;
  --planet-mid: #818cf8;
  --planet-core: #e0e7ff;
  --aurora-1: rgba(99, 102, 241, 0.28);
  --aurora-2: rgba(56, 189, 248, 0.22);

  --crystal-fill-1: #c7d2fe;
  --crystal-fill-2: #e0e7ff;
  --crystal-edge: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --shadow-card: 0 14px 35px -10px rgba(30, 41, 59, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-void);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background-color 0.45s ease, color 0.35s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Cosmic Background Canvas & Horizon Layer */
.cosmic-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 10%, var(--bg-deep) 0%, var(--bg-void) 100%);
  transition: background 0.5s ease;
}

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

[data-theme="arctic-frost"] #cosmic-stars {
  opacity: 0.32;
}

/* Photorealistic 3D-Shaded Planet Horizon Stage */
.planet-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

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

.planet-canvas {
  position: relative;
  width: min(168vw, 1480px);
  height: min(168vw, 1480px);
  transform: translateY(56%);
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 -12px 60px var(--accent-glow));
  transition: filter 0.5s ease;
}

/* Aurora / Plasma Flame at Bottom Center */
.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(30px);
  mix-blend-mode: screen;
  animation: auroraDance 7s ease-in-out infinite alternate;
}

[data-theme="arctic-frost"] .aurora-plume {
  mix-blend-mode: normal;
}

@keyframes auroraDance {
  0% {
    transform: translateX(-50%) scale(0.96, 0.94) skewX(-2deg);
    opacity: 0.72;
  }
  50% {
    transform: translateX(-49%) scale(1.04, 1.06) skewX(2deg);
    opacity: 0.95;
  }
  100% {
    transform: translateX(-51%) scale(0.98, 1.02) skewX(-1deg);
    opacity: 0.8;
  }
}

/* Floating 3D Faceted Crystal Shards */
.crystal-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

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

.crystal-shard {
  position: absolute;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.7));
  will-change: transform;
}

.crystal-shard svg {
  width: 100%;
  height: 100%;
  display: block;
}

.shard-1 {
  width: clamp(95px, 16vw, 220px);
  bottom: -2%;
  left: -2%;
  animation: floatShard1 9s ease-in-out infinite;
}

.shard-2 {
  width: clamp(58px, 8.5vw, 118px);
  top: 46%;
  left: 13%;
  animation: floatShard2 7.5s ease-in-out infinite;
}

.shard-3 {
  width: clamp(52px, 7.5vw, 102px);
  top: 43%;
  right: 17%;
  animation: floatShard3 8.2s ease-in-out infinite;
}

.shard-4 {
  width: clamp(86px, 14vw, 195px);
  bottom: -3%;
  right: 2%;
  animation: floatShard1 10s ease-in-out infinite reverse;
}

.shard-5 {
  width: clamp(28px, 3.8vw, 52px);
  top: 23%;
  right: 26%;
  opacity: 0.85;
  animation: floatShard2 6.5s ease-in-out infinite;
}

@keyframes floatShard1 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -14px, 0) rotate(2.5deg); }
}

@keyframes floatShard2 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(6px, -18px, 0) rotate(-3.5deg); }
}

@keyframes floatShard3 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-7px, -15px, 0) rotate(3deg); }
}

/* ==========================================================================
   Top Notched Brand Frame & Header Navigation
   ========================================================================== */
.top-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(6, 4, 13, 0.72) 0%, rgba(6, 4, 13, 0.25) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

[data-theme="arctic-frost"] .top-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.top-notch-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.top-notch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 26px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.top-notch:hover {
  border-color: var(--border-glass-strong);
}

.brand-orb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--planet-rim), var(--accent-primary));
  box-shadow: 0 0 12px var(--accent-glow);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  color: var(--text-primary);
}

.nav-bar {
  max-width: 1220px;
  margin: 0 auto;
  padding: 8px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

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

.nav-item svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="arctic-frost"] .nav-item:hover {
  background: rgba(15, 23, 42, 0.06);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--border-glass-strong);
  box-shadow: 0 0 18px -4px var(--accent-glow);
}

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

.cycle-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--income-color);
  box-shadow: 0 0 8px var(--income-color);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.82); }
}

/* Rectangular CTA Button with Slightly Rounded Corners & Square Arrow Box */
.pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 6px 7px 6px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-glass-strong);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.pill-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px var(--accent-glow);
}

.pill-cta:active {
  transform: scale(0.97);
}

.pill-cta-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow: 0 8px 28px -4px var(--accent-glow);
}

.pill-cta-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-btn-icon);
  background: #ffffff;
  color: #0b0718;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.22s ease;
}

.pill-cta:hover .pill-cta-icon {
  transform: translate(1px, -1px);
}

/* ==========================================================================
   Main App Container & View Transitions
   ========================================================================== */
.app-main {
  position: relative;
  z-index: 10;
  width: 100%;
}

.view-section {
  display: none;
  opacity: 0;
  transform: translateY(14px);
}

.view-section.active {
  display: block;
  animation: viewEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* ==========================================================================
   VIEW 1: HOME HERO
   ========================================================================== */
.hero-view {
  min-height: calc(100dvh - 82px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px 96px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
  backdrop-filter: blur(8px);
}

[data-theme="arctic-frost"] .hero-eyebrow {
  background: rgba(255, 255, 255, 0.75);
}

.hero-eyebrow-star {
  color: var(--accent-bright);
  display: inline-block;
  animation: spinSlow 12s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-display-title {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(1.7rem, 5.1vw, 3.75rem);
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  line-height: 1.18;
  color: var(--text-primary);
  text-shadow: 0 0 36px var(--accent-glow);
  margin-bottom: 14px;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(0.84rem, 1.8vw, 1.12rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.92;
  margin-bottom: 10px;
}

.hero-caption {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(0.84rem, 1.4vw, 0.96rem);
  color: var(--text-secondary);
  max-width: 490px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-cta-main {
  padding: 8px 9px 8px 22px;
  font-size: 0.95rem;
  border-radius: 12px;
}

.hero-cta-main .pill-cta-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.hero-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-glass-strong);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}

.hero-quick-pill:hover {
  border-color: var(--accent-bright);
  transform: translateY(-1px);
}

.hero-cycle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.hero-cycle-chip strong {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 600;
}

.hero-scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: bounceCue 2.2s ease-in-out infinite;
}

@keyframes bounceCue {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ==========================================================================
   WORKSPACE CONTAINER (RECAP & SETTINGS)
   ========================================================================== */
.workspace-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 110px;
}

/* Glass Card Base */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
  padding: 20px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.glass-card:hover {
  border-color: var(--border-glass-strong);
}

/* Cycle Navigator Bar */
.cycle-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 18px;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-glow);
}

.icon-btn:active {
  transform: scale(0.94);
}

.cycle-info-box {
  display: flex;
  flex-direction: column;
}

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

.cycle-select {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

.cycle-select option {
  background: #120d24;
  color: #f8fafc;
}

.cycle-range-sub {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.badge-current-cycle {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.16);
  color: var(--income-color);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-jump-now {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-btn-icon);
  background: var(--bg-surface-elevated);
  color: var(--accent-bright);
  border: 1px solid var(--border-glass-strong);
  cursor: pointer;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-bright), transparent);
  opacity: 0.55;
}

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

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

[data-theme="arctic-frost"] .kpi-badge {
  background: rgba(15, 23, 42, 0.06);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.1vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.kpi-value.income { color: var(--income-color); }
.kpi-value.expense { color: var(--expense-color); }

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

/* Budget Progress Bar inside KPI Card */
.budget-bar-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 4px;
}

[data-theme="arctic-frost"] .budget-bar-track {
  background: rgba(15, 23, 42, 0.1);
}

.budget-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-bright));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease;
}

.budget-bar-fill.warn {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.budget-bar-fill.danger {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

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

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  margin-bottom: 20px;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
}

.segmented-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
}

.seg-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seg-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* Donut Chart Layout */
.donut-layout {
  display: grid;
  grid-template-columns: 195px 1fr;
  align-items: center;
  gap: 18px;
}

.canvas-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.donut-center-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.donut-center-val {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.legend-row:hover {
  border-color: var(--border-glass);
}

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

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

.legend-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-weight: 500;
}

.legend-right {
  text-align: right;
  flex-shrink: 0;
}

.legend-amt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.legend-pct {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Bar Chart Layout */
.bar-canvas-wrap {
  width: 100%;
  height: 225px;
  position: relative;
}

.bar-legend-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

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

.chart-tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass-strong);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 0.78rem;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Transaction History Section
   ========================================================================== */
.tx-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.search-box {
  flex: 1 1 220px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent-bright);
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

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

.filter-chip {
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-bright);
  color: #ffffff;
}

.cat-filter-select {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.78rem;
  outline: none;
}

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

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

[data-theme="arctic-frost"] .tx-item {
  background: rgba(255, 255, 255, 0.65);
}

.tx-item:hover {
  border-color: var(--border-glass-strong);
  transform: translateX(2px);
}

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

.tx-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tx-meta {
  min-width: 0;
  flex: 1;
}

.tx-note {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tx-cat-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.7rem;
}

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

.tx-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: right;
}

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

.tx-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tx-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.18s ease;
}

.tx-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-bright);
}

.tx-action-btn.del:hover {
  color: var(--expense-color);
  border-color: var(--expense-color);
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.8;
}

.empty-state-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ==========================================================================
   SETTINGS VIEW
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

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

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

.form-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-bright);
}

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

.preset-chip {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-chip:hover {
  border-color: var(--accent-bright);
  color: var(--text-primary);
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px -4px var(--accent-glow);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.btn-solid:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -4px var(--accent-glow);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-glass-strong);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-outline:hover {
  border-color: var(--accent-bright);
}

.btn-danger-outline {
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--expense-color);
}

/* Category Manager */
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-opt {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.emoji-opt.selected {
  border-color: var(--accent-bright);
  background: var(--accent-primary);
  transform: scale(1.06);
}

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

.swatch-opt {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.swatch-opt.selected {
  border-color: #ffffff;
  transform: scale(1.14);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

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

.cat-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
}

.cat-manage-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cat-manage-name {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-del-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: rgba(244, 63, 94, 0.14);
  color: var(--expense-color);
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
}

.data-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

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

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-pill);
  transition: 0.25s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.25s;
}

.switch input:checked + .slider {
  background-color: var(--accent-primary);
}

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

/* ==========================================================================
   MODALS & BOTTOM SHEETS (Mobile-Optimized)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 2, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass-strong);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  animation: modalPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Type Toggle in Transaction Modal */
.type-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.type-btn {
  padding: 11px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-btn.active-expense {
  background: var(--expense-bg);
  border-color: var(--expense-color);
  color: var(--expense-color);
}

.type-btn.active-income {
  background: var(--income-bg);
  border-color: var(--income-color);
  color: var(--income-color);
}

.amount-input-wrap {
  position: relative;
}

.amount-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-bright);
  font-size: 1rem;
}

.amount-input {
  padding-left: 44px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
}

.cat-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.cat-pill-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}

.cat-pill-opt.selected {
  border-color: var(--accent-bright);
  background: rgba(139, 92, 246, 0.18);
  color: var(--text-primary);
  box-shadow: 0 0 14px -4px var(--accent-glow);
}

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

.theme-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.theme-card:hover {
  border-color: var(--border-glass-strong);
  transform: translateY(-1px);
}

.theme-card.active {
  border-color: var(--accent-bright);
  box-shadow: 0 0 18px -4px var(--accent-glow);
}

.theme-orb-preview {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.theme-card-name {
  font-weight: 700;
  font-size: 0.84rem;
}

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

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-btn);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-glass-strong);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  animation: toastSlide 0.25s ease forwards;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-undo {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   MOBILE BOTTOM FLOATING DOCK (< 768px)
   ========================================================================== */
.mobile-dock {
  display: none;
}

@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .nav-links,
  .cycle-status-pill {
    display: none;
  }

  .nav-bar {
    padding: 6px 14px 10px;
    justify-content: flex-end;
  }

  .top-notch {
    padding: 5px 20px 7px;
  }

  .brand-title {
    font-size: 0.74rem;
  }

  .hero-view {
    min-height: calc(100dvh - 135px);
    padding: 16px 16px 88px;
  }

  .hero-display-title {
    font-size: clamp(1.45rem, 6.2vw, 2.3rem);
    letter-spacing: 0.1em;
    text-indent: 0.1em;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .glass-card {
    padding: 15px;
    border-radius: 20px;
  }

  .kpi-value {
    font-size: 1.08rem;
  }

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

  .donut-legend {
    width: 100%;
    max-height: 180px;
  }

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

  .tx-item {
    padding: 11px 12px;
    gap: 8px;
  }

  .tx-icon-badge {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .tx-amount {
    font-size: 0.84rem;
  }

  /* Bottom Sheet Modal on Mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  }

  /* Floating Glass Bottom Nav Bar */
  .mobile-dock {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 14px;
    right: 14px;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    padding: 7px 8px;
    border-radius: 18px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  }

  .dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 5px 2px;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .dock-btn svg {
    width: 18px;
    height: 18px;
  }

  .dock-btn.active {
    color: var(--accent-bright);
  }

  .dock-fab {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -18px 6px 0;
    box-shadow: 0 8px 24px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.18s ease;
  }

  .dock-fab:active {
    transform: scale(0.92);
  }

  .toast-container {
    top: auto;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    align-items: center;
  }
}

@media (max-width: 390px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .cat-select-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .theme-grid {
    grid-template-columns: 1fr;
  }
}
