/* ==========================================================================
   TRACE: Hyper-Polished Modern Fintech Design System
   Inspired by Linear, Wise, Revolut, and Apple Wallet.
   Supports Desktop Widescreen & Mobile Viewports at all times.
   ========================================================================== */

:root {
  /* Color System: Deep Obsidian Dark Mode (Default) */
  --bg-app: #080a0d;
  --bg-sidebar: #0d1117;
  --bg-surface: #121720;
  --bg-surface-elevated: #18202c;
  --bg-surface-hover: #1e2736;
  --bg-card-subtle: rgba(255, 255, 255, 0.03);

  /* Primary Brand: Electric Mint & Emerald */
  --brand-primary: #10b981;
  --brand-primary-hover: #059669;
  --brand-primary-glow: rgba(16, 185, 129, 0.15);
  --brand-mint: #10b981;
  --brand-mint-light: #34d399;
  --brand-mint-subtle: rgba(16, 185, 129, 0.1);

  /* Intent Colors: Need (Shield/Emerald) vs Want (Spark/Violet) */
  --color-need: #10b981;
  --color-need-bg: rgba(16, 185, 129, 0.12);
  --color-need-border: rgba(16, 185, 129, 0.25);

  --color-want: #a855f7;
  --color-want-bg: rgba(168, 85, 247, 0.12);
  --color-want-border: rgba(168, 85, 247, 0.25);
  --color-want-glow: rgba(168, 85, 247, 0.2);

  /* Status Colors */
  --color-ok: #10b981;
  --color-warn: #f59e0b;
  --color-bad: #ef4444;
  --color-info: #3b82f6;

  /* Typography / Ink */
  --ink-primary: #f1f5f9;
  --ink-secondary: #94a3b8;
  --ink-tertiary: #64748b;
  --ink-inverted: #090b0e;

  /* Borders & Lines */
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.04);

  /* Geometry & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px 0 rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);

  /* Typography Stack */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --sidebar-width: 250px;
  --header-height: 64px;
  --bottom-nav-height: 64px;
}

/* Light Theme Override */
body[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-card-subtle: #f8fafc;

  --brand-primary: #059669;
  --brand-primary-hover: #047857;
  --brand-primary-glow: rgba(5, 150, 105, 0.12);
  --brand-mint: #059669;
  --brand-mint-light: #10b981;
  --brand-mint-subtle: rgba(5, 150, 105, 0.08);

  --color-need: #059669;
  --color-need-bg: rgba(5, 150, 105, 0.08);
  --color-need-border: rgba(5, 150, 105, 0.2);

  --color-want: #9333ea;
  --color-want-bg: rgba(147, 51, 234, 0.08);
  --color-want-border: rgba(147, 51, 234, 0.2);

  --ink-primary: #0f172a;
  --ink-secondary: #475569;
  --ink-tertiary: #94a3b8;
  --ink-inverted: #ffffff;

  --border: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(5, 150, 105, 0.5);
  --border-subtle: rgba(0, 0, 0, 0.04);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--ink-primary);
  line-height: 1.5;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* Layout Framework */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  background-color: var(--bg-app);
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile Simulation Mode on Desktop */
.app-wrapper.mobile-frame-mode {
  max-width: 440px;
  margin: 20px auto;
  min-height: calc(100vh - 40px);
  border: 1px solid var(--border);
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 12px #181f2a;
  overflow: hidden;
}

.app-wrapper.mobile-frame-mode .sidebar {
  display: none !important;
}

.app-wrapper.mobile-frame-mode .bottom-nav {
  display: flex !important;
  position: sticky;
  bottom: 0;
}

/* Sidebar Navigation (Desktop Default) */
.sidebar {
  display: none;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
  }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  line-height: 1.1;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-item a svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.nav-item a:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
}

.nav-item a[aria-current="page"] {
  color: #ffffff;
  background: var(--brand-mint-subtle);
  border-left: 3px solid var(--brand-mint);
  padding-left: 11px;
  color: var(--brand-mint-light);
}

.nav-item a[aria-current="page"] svg {
  stroke: var(--brand-mint-light);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pulse-card {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.pulse-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-primary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-mint);
  box-shadow: 0 0 10px var(--brand-mint);
  animation: pulseAnimation 2s infinite ease-in-out;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Canvas Wrapper */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-app);
}

/* Top Navigation Bar */
.top-nav {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-brand-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-mint);
}

@media (min-width: 900px) {
  .mobile-brand-icon {
    display: none;
  }
}

.top-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-tertiary);
}

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

/* View Mode Pill Switcher */
.view-mode-pill {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

@media (min-width: 900px) {
  .view-mode-pill {
    display: flex;
  }
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
}

.action-btn svg {
  width: 17px;
  height: 17px;
}

/* Content Container */
.content-container {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 96px 20px;
}

@media (min-width: 900px) {
  .content-container {
    padding: 32px 32px 48px 32px;
  }
}

/* General Card Design (Sleek, Geometric, Tactile) */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="light"] .card:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.card-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--ink-tertiary);
  font-weight: 500;
  display: block;
}

/* Hero "Safe to Spend" Financial Card */
.hero-card {
  background: radial-gradient(120% 120% at 50% 0%, #152220 0%, #0d1318 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 30px rgba(16, 185, 129, 0.08);
}

body[data-theme="light"] .hero-card {
  background: radial-gradient(120% 120% at 50% 0%, #ecfdf5 0%, #ffffff 100%);
  border: 1px solid rgba(5, 150, 105, 0.25);
  box-shadow: 0 10px 30px rgba(5, 150, 105, 0.06);
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-mint);
  margin-bottom: 8px;
}

.hero-label svg {
  width: 14px;
  height: 14px;
}

.hero-amount-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 6px 0;
}

.hero-currency {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-mint-light);
  font-family: var(--font-mono);
}

.hero-amount {
  font-size: clamp(42px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

body[data-theme="light"] .hero-amount {
  color: #0f172a;
}

.hero-caption {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .hero-breakdown {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.hero-breakdown-item small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-tertiary);
  margin-bottom: 4px;
}

.hero-breakdown-item b {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--brand-mint);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-pill.bad {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Stats Multi-Card Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

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

.stat-card {
  padding: 16px;
  margin-bottom: 0;
}

.stat-card small {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-tertiary);
  display: block;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.stat-sub {
  font-size: 11px;
  color: var(--ink-tertiary);
  font-weight: 500;
}

/* ==========================================================================
   YOU WANT VS. YOU NEED COMPARATIVE SYSTEM
   ========================================================================== */

.comparison-card {
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.04) 0%, var(--bg-surface) 100%);
  position: relative;
}

.comparison-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-need) 0%, var(--color-want) 100%);
}

.split-meter-wrapper {
  margin: 18px 0;
}

.split-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.label-need {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-need);
}

.label-want {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-want);
}

.split-meter-bar {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.split-bar-fill-need {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-bar-fill-want {
  background: linear-gradient(90deg, #8b5cf6 0%, #d946ef 100%);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.comparison-box {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
}

.comparison-box.needs {
  border-left: 3px solid var(--color-need);
}

.comparison-box.wants {
  border-left: 3px solid var(--color-want);
}

.comparison-box small {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.comp-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.comp-meta {
  font-size: 11px;
  color: var(--ink-tertiary);
  font-weight: 500;
}

.comparison-advice-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-primary);
}

.comparison-advice-banner.ok {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.comparison-advice-banner.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.comparison-advice-banner.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Dashboard Split Grid (Charts + Bills) */
.dashboard-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 860px) {
  .dashboard-split {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* 7-Day Velocity Chart */
.chart-bars-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 140px;
  padding: 10px 0 0 0;
  gap: 8px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  justify-content: flex-end;
}

.chart-bar-track {
  width: 100%;
  max-width: 24px;
  height: 100px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  width: 100%;
  background: var(--brand-mint);
  border-radius: var(--radius-sm);
  min-height: 4px;
  transition: height 0.4s ease, background 0.2s ease;
}

.chart-col.is-today .chart-bar-fill {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.chart-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-tertiary);
  margin-top: 8px;
}

.chart-col.is-today .chart-day-label {
  color: var(--brand-mint);
}

.chart-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: #000000;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-family: var(--font-mono);
  z-index: 10;
}

.chart-col:hover .chart-tooltip {
  opacity: 1;
}

/* Transactions & Statements List Group */
.tx-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tx-filter-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tx-filter-pill.active {
  background: var(--ink-primary);
  color: var(--ink-inverted);
  border-color: var(--ink-primary);
}

.list-group {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.list-item:last-child {
  border-bottom: none;
}

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-mint);
  flex-shrink: 0;
}

.category-icon svg {
  width: 18px;
  height: 18px;
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.intent-badge:active {
  transform: scale(0.95);
}

.intent-badge.need {
  background: var(--color-need-bg);
  color: var(--color-need);
  border: 1px solid var(--color-need-border);
}

.intent-badge.want {
  background: var(--color-want-bg);
  color: var(--color-want);
  border: 1px solid var(--color-want-border);
}

.item-amount {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex-shrink: 0;
}

.item-amount.income {
  color: var(--brand-mint);
}

.item-amount.expense {
  color: var(--ink-primary);
}

.delete-btn {
  background: transparent;
  border: none;
  color: var(--ink-tertiary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1;
}

.delete-btn:hover {
  color: var(--color-bad);
  background: rgba(239, 68, 68, 0.1);
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-tertiary);
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================================================
   FORM CONTROLS & ADD ENTRY VIEW
   ========================================================================== */

.segmented-control {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.segmented-control button {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-control button[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: var(--shadow-sm);
}

.amount-hero-input {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 24px 0;
  gap: 4px;
}

.amount-hero-currency {
  font-size: 36px;
  font-weight: 700;
  color: var(--brand-mint);
  font-family: var(--font-mono);
}

.amount-hero-input input {
  background: transparent;
  border: none;
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 800;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  width: 100%;
  max-width: 280px;
  text-align: left;
  outline: none;
}

.form-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--brand-mint);
  box-shadow: 0 0 0 3px var(--brand-mint-subtle);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px 0;
}

.chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--bg-surface-hover);
  color: var(--ink-primary);
}

.chip[aria-pressed="true"] {
  background: var(--brand-mint);
  color: #ffffff;
  border-color: var(--brand-mint);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Intent Choice Selector Buttons (Need vs Want) */
.intent-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 20px 0;
}

.intent-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.intent-btn .intent-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.intent-btn[data-intent="need"] .intent-icon-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-need);
}

.intent-btn[data-intent="want"] .intent-icon-badge {
  background: rgba(168, 85, 247, 0.15);
  color: var(--color-want);
}

.intent-labels b {
  display: block;
  font-size: 14px;
  color: var(--ink-primary);
}

.intent-labels small {
  display: block;
  font-size: 11px;
  color: var(--ink-tertiary);
  font-weight: 500;
  margin-top: 2px;
}

.intent-btn.active[data-intent="need"] {
  border-color: var(--color-need);
  background: var(--color-need-bg);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.intent-btn.active[data-intent="want"] {
  border-color: var(--color-want);
  background: var(--color-want-bg);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

/* Student Presets Container */
.student-presets {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-surface-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.presets-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-tertiary);
  display: block;
  margin-bottom: 8px;
}

/* Live Impact Preview Box */
.impact-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.impact-preview-icon {
  color: var(--brand-mint);
  flex-shrink: 0;
  margin-top: 2px;
}

.impact-preview-text {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.impact-preview-text b {
  color: var(--ink-primary);
}

/* Scanner Dropzone */
.scanner-dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  background: var(--bg-surface-elevated);
  cursor: pointer;
  margin: 20px 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.scanner-dropzone:hover {
  border-color: var(--brand-mint);
  background: var(--brand-mint-subtle);
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--brand-mint) 50%, transparent 100%);
  box-shadow: 0 0 8px var(--brand-mint);
  opacity: 0;
  pointer-events: none;
}

.scanner-dropzone.scanning .scanner-laser {
  opacity: 1;
  animation: laserScan 2s infinite ease-in-out;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanner-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  color: var(--brand-mint);
}

.scanner-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: var(--brand-mint);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   AI FINANCIAL GUIDE CHAT
   ========================================================================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: clamp(480px, 65vh, 680px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.bot {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--brand-mint);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble ul, .chat-bubble ol {
  margin: 8px 0 8px 20px;
}

.chat-input-bar {
  display: flex;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  gap: 10px;
}

.chat-input-bar input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  color: var(--ink-primary);
  font-size: 14px;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--brand-mint);
}

.chat-send-btn {
  background: var(--brand-mint);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-send-btn:hover {
  background: var(--brand-primary-hover);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 900px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-tertiary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: all 0.15s ease;
}

.bottom-tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.bottom-tab[aria-current="page"] {
  color: var(--brand-mint);
}

.bottom-tab[aria-current="page"] svg {
  stroke: var(--brand-mint);
  transform: translateY(-2px);
}

/* Modal Dialog */
.custom-modal {
  margin: auto;
  border: none;
  background: transparent;
  padding: 20px;
}

.custom-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  color: var(--ink-primary);
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--ink-tertiary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--ink-primary);
}

/* Category Bars Progress */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Simulator Mobile Frame Mode */
.app-wrapper.simulator-mode {
  max-width: 440px;
  margin: 20px auto;
  min-height: calc(100vh - 40px);
  border: 1px solid var(--border);
  border-radius: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 12px #181f2a;
  overflow: hidden;
}

.app-wrapper.simulator-mode .sidebar {
  display: none !important;
}

.app-wrapper.simulator-mode .bottom-nav {
  display: flex !important;
  position: sticky;
  bottom: 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast svg {
  color: var(--brand-mint);
  flex-shrink: 0;
}

/* Chat Message Bubbles */
.message-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.message-bubble.assistant,
.message-bubble.bot {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-bubble.user {
  background: var(--brand-mint);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-mint);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Category Analytics Row */
.cat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.cat-header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cat-header span svg {
  color: var(--brand-mint);
}

.cat-header b {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-secondary);
}

/* Card Enter Animation */
.card-enter {
  animation: cardFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

