/* ============================================
   FINSIGHT — Design System & Styles
   Personal Finance for Young Professionals
   ============================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables (Design Tokens) ── */
:root {
  /* Colors — Core */
  --bg-primary: #050816;
  --bg-secondary: #0a0e27;
  --bg-tertiary: #111538;
  --bg-card: rgba(17, 21, 56, 0.6);
  --bg-card-hover: rgba(25, 30, 70, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-strong: rgba(255, 255, 255, 0.08);

  /* Colors — Accent */
  --accent-primary: #00d4aa;
  --accent-primary-glow: rgba(0, 212, 170, 0.3);
  --accent-secondary: #667eea;
  --accent-secondary-glow: rgba(102, 126, 234, 0.3);
  --accent-tertiary: #a855f7;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #00d4aa 100%);
  --accent-gradient-warm: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient-cool: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

  /* Colors — Semantic */
  --color-success: #00d4aa;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-info: #60a5fa;

  /* Colors — Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-accent: #00d4aa;

  /* Colors — Border */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(0, 212, 170, 0.3);

  /* Typography */
  --font-heading: 'DM Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px rgba(0, 212, 170, 0.15);
  --shadow-glow-strong: 0 0 60px rgba(0, 212, 170, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --nav-height: 72px;
  --content-max-width: 480px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Ambient Background ── */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.ambient-orb:nth-child(1) {
  width: 300px;
  height: 300px;
  background: var(--accent-secondary);
  top: -100px;
  right: -80px;
  animation-delay: 0s;
}

.ambient-orb:nth-child(2) {
  width: 250px;
  height: 250px;
  background: var(--accent-primary);
  bottom: 20%;
  left: -80px;
  animation-delay: -7s;
}

.ambient-orb:nth-child(3) {
  width: 200px;
  height: 200px;
  background: var(--accent-tertiary);
  top: 40%;
  right: -60px;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.1); }
  50% { transform: translate(-20px, 30px) scale(0.9); }
  75% { transform: translate(20px, 20px) scale(1.05); }
}

/* ── App Shell ── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 20px);
}

/* ── Screen Management ── */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  padding: var(--space-lg);
  padding-top: var(--space-xl);
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.screen.slide-in {
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-primary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.glass-card-sm {
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}

.glass-card-flat {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max-width);
  height: var(--nav-height);
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 var(--space-sm);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-family: var(--font-body);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: all var(--transition-base);
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 0 0 2px 2px;
}

.nav-item:hover {
  color: var(--text-primary);
}

/* ── Onboarding Screen ── */
.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.onboarding-steps {
  width: 100%;
  position: relative;
}

.onboarding-step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  animation: fadeSlideUp 0.6s ease forwards;
}

.onboarding-step.active {
  display: flex;
}

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

.onboarding-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}

.onboarding-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-gradient);
  opacity: 0.3;
  filter: blur(15px);
}

.onboarding h1 {
  font-size: 1.75rem;
  max-width: 300px;
}

.onboarding p {
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.6;
}

.step-indicators {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  transition: all var(--transition-base);
}

.step-dot.active {
  width: 28px;
  background: var(--accent-primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-primary-glow);
}

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

.btn-secondary {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 20px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── FAB (Floating Action Button) ── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  right: calc(50% - var(--content-max-width) / 2 + 20px);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 32px var(--accent-primary-glow);
  z-index: 90;
  transition: all var(--transition-base);
  animation: fabPulse 3s ease-in-out infinite;
}

.fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-primary-glow);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 8px 32px var(--accent-primary-glow); }
  50% { box-shadow: 0 8px 48px rgba(0, 212, 170, 0.4); }
}

/* ── Dashboard ── */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.user-greeting h2 {
  font-size: 1.5rem;
}

.user-greeting .greeting-sub {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 2px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Balance Card */
.balance-card {
  background: var(--accent-gradient);
  border: none;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.balance-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.balance-card .label {
  color: rgba(255,255,255,0.7);
}

.balance-amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: var(--space-sm) 0;
  color: white;
}

.balance-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  font-size: 0.8125rem;
  font-weight: 500;
  color: white;
}

.balance-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  position: relative;
  z-index: 1;
}

.balance-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  font-family: var(--font-body);
}

.balance-action:hover {
  background: rgba(255,255,255,0.25);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.bento-item {
  cursor: pointer;
}

.bento-item.wide {
  grid-column: 1 / -1;
}

.bento-value {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin: var(--space-sm) 0 var(--space-xs);
}

.bento-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

/* Spending Donut Container */
.donut-container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}

.donut-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.donut-wrapper canvas {
  width: 100%;
  height: 100%;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .amount {
  font-weight: 700;
  font-size: 0.9375rem;
}

.donut-center .sub {
  font-size: 0.625rem;
  color: var(--text-tertiary);
}

.legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
}

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

.legend-item .legend-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
}

/* Progress Ring */
.progress-ring-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.progress-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.progress-ring circle {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-info .progress-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.progress-info .progress-value {
  font-weight: 600;
  font-size: 0.9375rem;
}

/* Mood Indicator Mini */
.mood-mini {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.mood-emoji {
  font-size: 2rem;
  animation: moodBounce 2s ease-in-out infinite;
}

@keyframes moodBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.mood-details .mood-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.mood-details .mood-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Transactions */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-header h3 {
  font-size: 1rem;
}

.see-all {
  font-size: 0.8125rem;
  color: var(--accent-primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 500;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
  cursor: pointer;
}

.transaction-item:hover {
  background: var(--bg-glass-strong);
  transform: translateX(4px);
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.transaction-info {
  flex: 1;
  min-width: 0;
}

.transaction-name {
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-category {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.transaction-amount {
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.transaction-amount.expense { color: var(--color-danger); }
.transaction-amount.income { color: var(--color-success); }

/* ── Insights / Analytics Screen ── */
.insights-header {
  margin-bottom: var(--space-lg);
}

.period-selector {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  background: var(--bg-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.period-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.period-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.chart-card {
  margin-bottom: var(--space-lg);
}

.chart-card canvas {
  width: 100%;
  height: 200px;
  margin-top: var(--space-md);
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  padding-top: var(--space-md);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 36px;
  border-radius: 8px 8px 4px 4px;
  background: var(--accent-gradient);
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  min-height: 4px;
}

.bar:hover {
  filter: brightness(1.2);
}

.bar.muted {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-subtle);
}

.bar-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.bar-value {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Insight Cards */
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
}

.insight-card .insight-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.insight-card .insight-text {
  flex: 1;
}

.insight-card .insight-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.insight-card .insight-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Category Breakdown Horizontal */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.category-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.category-bar-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 500;
}

.category-bar-amount {
  font-size: 0.8125rem;
  font-weight: 600;
}

.category-bar-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Goals Screen ── */
.goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.goals-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.goal-card {
  cursor: pointer;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.goal-emoji {
  font-size: 1.5rem;
}

.goal-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-primary);
}

.goal-badge.warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-warning);
}

.goal-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.goal-progress-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.goal-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.goal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-progress-fill.warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.goal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.goal-deadline {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ── Money Mood Screen ── */
.mood-screen-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.mood-screen-header h2 {
  margin-bottom: var(--space-sm);
}

.mood-checkin-card {
  text-align: center;
  padding: var(--space-xl);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.mood-question {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  line-height: 1.4;
}

.mood-options {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.mood-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 72px;
}

.mood-option:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-glass);
  transform: translateY(-4px);
}

.mood-option.selected {
  border-color: var(--accent-primary);
  background: rgba(0, 212, 170, 0.1);
  box-shadow: var(--shadow-glow);
}

.mood-option .mood-opt-emoji {
  font-size: 1.75rem;
}

.mood-option .mood-opt-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mood Journal */
.mood-journal-input {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition-base);
  margin-bottom: var(--space-lg);
}

.mood-journal-input:focus {
  border-color: var(--accent-primary);
}

.mood-journal-input::placeholder {
  color: var(--text-tertiary);
}

/* Mood Timeline */
.mood-timeline {
  margin-top: var(--space-xl);
}

.mood-week {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.mood-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.mood-day .day-label {
  font-size: 0.625rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
}

.mood-day .day-emoji {
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.mood-day .day-emoji.today {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.mood-day .day-emoji.empty {
  opacity: 0.3;
}

/* Mood Score */
.mood-score-card {
  text-align: center;
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.mood-score-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mood-score-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ── Profile Screen ── */
.profile-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto var(--space-md);
  position: relative;
}

.profile-avatar::after {
  content: '✏️';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.profile-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.settings-group {
  margin-bottom: var(--space-lg);
}

.settings-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
}

.settings-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.settings-item:hover {
  background: var(--bg-glass-strong);
}

.settings-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.settings-text {
  flex: 1;
}

.settings-text .settings-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.settings-text .settings-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.settings-arrow {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: all var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle.active::after {
  left: 22px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 22, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 100%;
  max-width: var(--content-max-width);
  background: var(--bg-secondary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-lg);
  border: 1px solid var(--border-glass);
  border-bottom: none;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  margin: 0 auto var(--space-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 12px var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-base);
}

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

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* Category Picker */
.category-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
}

.category-option:hover {
  background: var(--bg-glass-strong);
}

.category-option.selected {
  border-color: var(--accent-primary);
  background: rgba(0, 212, 170, 0.1);
}

.category-option .cat-emoji {
  font-size: 1.25rem;
}

.category-option .cat-label {
  font-size: 0.625rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Success Animation ── */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 22, 0.9);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-md);
}

.success-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.success-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

.success-text {
  font-weight: 600;
  font-size: 1.125rem;
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Color backgrounds for icons */
.bg-teal { background: rgba(0, 212, 170, 0.15); color: #00d4aa; }
.bg-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.bg-blue { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.bg-amber { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.bg-pink { background: rgba(244, 114, 182, 0.15); color: #f472b6; }
.bg-red { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.bg-green { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.bg-indigo { background: rgba(129, 140, 248, 0.15); color: #818cf8; }

/* ── Responsive — Desktop ── */
@media (min-width: 768px) {
  :root {
    --content-max-width: 520px;
  }
}

@media (min-width: 1024px) {
  :root {
    --content-max-width: 480px;
  }
  
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    max-height: 900px;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(5, 8, 22, 0.5);
    backdrop-filter: blur(10px);
  }

  .bottom-nav {
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
  }

  .fab {
    right: calc(50% - 220px);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Selection */
::selection {
  background: rgba(0, 212, 170, 0.3);
  color: white;
}

/* Animations for elements entering view */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  animation: animateIn 0.6s ease forwards;
}

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

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.4s; }

/* Number counter animation */
.count-up {
  display: inline-block;
}

/* Sparkline */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
}

.sparkline-bar {
  flex: 1;
  border-radius: 2px;
  background: rgba(0, 212, 170, 0.4);
  transition: height 0.5s ease;
}

/* Checkin flow steps */
.checkin-step {
  display: none;
}

.checkin-step.active {
  display: block;
  animation: fadeSlideUp 0.5s ease forwards;
}

/* Mood correlation */
.mood-correlation {
  margin-top: var(--space-lg);
}

.correlation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-sm);
}

.correlation-emoji {
  font-size: 1.25rem;
}

.correlation-text {
  flex: 1;
  margin: 0 var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.correlation-value {
  font-weight: 600;
  font-size: 0.875rem;
}
