/* ============================================
   GOALFLOW — DESIGN SYSTEM
   Dark mode premium with glassmorphism
   ============================================ */

/* --- Color Scheme --- */
:root {
  color-scheme: dark;

  /* Brand Colors */
  --purple: #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark: #6D28D9;
  --cyan: #06B6D4;
  --cyan-light: #67E8F9;
  --green: #10B981;
  --green-light: #6EE7B7;
  --amber: #F59E0B;
  --red: #EF4444;
  --pink: #EC4899;

  /* Neutrals */
  --bg-0: #05070F;
  --bg-1: #0D1117;
  --bg-2: #161B26;
  --bg-3: #1E2538;
  --text-0: #F8FAFC;
  --text-1: #CBD5E1;
  --text-2: #64748B;
  --text-3: #334155;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.07);

  /* Gradients */
  --grad-purple: linear-gradient(135deg in oklch, var(--purple-dark) 0%, var(--purple) 50%, var(--purple-light) 100%);
  --grad-cyan: linear-gradient(135deg in oklch, #0891B2 0%, var(--cyan) 100%);
  --grad-green: linear-gradient(135deg in oklch, #059669 0%, var(--green) 100%);
  --grad-multi: linear-gradient(135deg in oklch, var(--purple) 0%, var(--cyan) 50%, var(--green) 100%);

  /* Spacing */
  --sidebar-w: 240px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.25);
  --shadow-glow-cyan: 0 0 40px rgba(6, 182, 212, 0.2);

  /* Transitions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

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

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-0);
  color: var(--text-0);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* --- Animated Background Particles --- */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
  animation: float-particle 20s infinite ease-in-out;
}

.particle:nth-child(1) {
  width: 500px; height: 500px;
  background: var(--purple);
  top: -100px; left: -100px;
  animation-duration: 25s;
}
.particle:nth-child(2) {
  width: 400px; height: 400px;
  background: var(--cyan);
  bottom: -80px; right: -80px;
  animation-duration: 20s;
  animation-delay: -8s;
}
.particle:nth-child(3) {
  width: 300px; height: 300px;
  background: var(--green);
  top: 40%; left: 60%;
  animation-duration: 30s;
  animation-delay: -15s;
}
.particle:nth-child(4) {
  width: 250px; height: 250px;
  background: var(--pink);
  top: 70%; left: 20%;
  animation-duration: 18s;
  animation-delay: -5s;
  opacity: 0.05;
}
.particle:nth-child(5) {
  width: 200px; height: 200px;
  background: var(--amber);
  top: 10%; left: 50%;
  animation-duration: 22s;
  animation-delay: -12s;
  opacity: 0.05;
}

@keyframes float-particle {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(20px, 15px) scale(1.02); }
}

/* --- Confetti Canvas --- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  width: 100%;
  height: 100%;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  z-index: 100;
  background: rgba(13, 17, 23, 0.95);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--dur-slow) var(--ease-smooth);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.75rem;
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--grad-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow-purple);
  flex-shrink: 0;
}

.logo-icon svg { width: 20px; height: 20px; }

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--grad-multi);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
  text-align: left;
}

.nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-btn:hover {
  background: var(--glass-hover);
  color: var(--text-0);
}

.nav-btn.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-light);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.sidebar-footer {
  padding: 0 0.75rem;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--amber);
  font-weight: 600;
  font-size: 0.875rem;
}

.streak-badge svg { width: 18px; height: 18px; }

/* ============================================
   MOBILE HEADER
   ============================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: rgba(13, 17, 23, 0.95);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
}

.hamburger, .btn-icon {
  width: 40px; height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
  flex-shrink: 0;
}

.hamburger svg, .btn-icon svg { width: 20px; height: 20px; }

.hamburger:hover, .btn-icon:hover {
  background: var(--glass-hover);
  color: var(--text-0);
}

.mobile-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--grad-multi);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-streak {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--amber);
  font-weight: 600;
  font-size: 0.875rem;
}

.mobile-streak svg { width: 16px; height: 16px; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  display: none;
  animation: section-in var(--dur-slow) var(--ease-smooth);
}

.section.active { display: block; }

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: 0.25rem;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-0);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

/* ============================================
   GLASS CARDS
   ============================================ */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--dur-normal) var(--ease-smooth), transform var(--dur-normal) var(--ease-smooth);
}

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

/* ============================================
   AI MOTIVATIONAL WIDGET
   ============================================ */
.ai-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  border-color: rgba(139, 92, 246, 0.25);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.ai-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05), transparent, rgba(6, 182, 212, 0.05));
  animation: ai-shimmer 4s ease-in-out infinite;
}

@keyframes ai-shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.ai-avatar {
  position: relative;
  flex-shrink: 0;
}

.ai-orb {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--grad-purple);
  box-shadow: var(--shadow-glow-purple);
  animation: orb-pulse 3s ease-in-out infinite;
}

.ai-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

@keyframes orb-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.2); transform: scale(1); }
  50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 0 60px rgba(139, 92, 246, 0.3); transform: scale(1.05); }
}

.ai-content { flex: 1; position: relative; }

.ai-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: 0.375rem;
}

.ai-message {
  font-size: 0.95rem;
  color: var(--text-1);
  line-height: 1.6;
  transition: opacity var(--dur-slow) var(--ease-smooth);
}

.ai-pulse {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--purple-light);
  box-shadow: 0 0 12px var(--purple);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateY(-50%) scale(1.5); }
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--shadow-glow-purple);
}

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

.card-icon svg { width: 22px; height: 22px; }

.card-icon--purple { background: rgba(139, 92, 246, 0.2); color: var(--purple-light); }
.card-icon--cyan { background: rgba(6, 182, 212, 0.2); color: var(--cyan-light); }
.card-icon--green { background: rgba(16, 185, 129, 0.2); color: var(--green-light); }

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

.card-label {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 0.5rem;
}

.mini-progress {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.mini-progress-bar {
  height: 100%;
  background: var(--grad-purple);
  border-radius: 99px;
  transition: width 0.6s var(--ease-smooth);
}

.mini-progress-bar--cyan { background: var(--grad-cyan); }
.mini-progress-bar--green { background: var(--grad-green); }

.card-percent {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-light);
  flex-shrink: 0;
}

/* ============================================
   CHARTS
   ============================================ */
.charts-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card { position: relative; }
.chart-card--wide { }

.chart-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 1.25rem;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: -0.875rem;
  margin-bottom: 1.25rem;
}

.donut-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

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

.donut-percent {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: var(--grad-multi);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.donut-label {
  font-size: 0.7rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.125rem;
}

/* ============================================
   PROGRESS HERO BAR
   ============================================ */
.progress-hero {
  margin-bottom: 1.5rem;
}

.progress-hero-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.progress-hero-label {
  font-size: 0.875rem;
  color: var(--text-2);
  font-weight: 500;
}

.progress-hero-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-track {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-purple);
  border-radius: 99px;
  transition: width 0.8s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill--cyan { background: var(--grad-cyan); }
.progress-bar-fill--green { background: var(--grad-green); }

.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-2);
}

/* ============================================
   GOAL LIST ITEMS
   ============================================ */
.goals-list { display: flex; flex-direction: column; gap: 0.75rem; }

.empty-goals {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-2);
  background: var(--glass-bg);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.empty-goals p { margin-bottom: 1.5rem; font-size: 0.9rem; }

.goal-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--dur-normal) var(--ease-smooth);
  animation: item-in var(--dur-slow) var(--ease-bounce);
}

@keyframes item-in {
  from { opacity: 0; transform: translateX(-16px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.goal-item:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateX(4px);
}

.goal-item.completed {
  opacity: 0.6;
}

.goal-item.completed .goal-text {
  text-decoration: line-through;
  color: var(--text-2);
}

.goal-checkbox {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-normal) var(--ease-bounce);
  position: relative;
  overflow: hidden;
}

.goal-checkbox:hover {
  border-color: var(--purple-light);
  background: rgba(139, 92, 246, 0.1);
}

.goal-checkbox.checked {
  border-color: var(--purple);
  background: var(--grad-purple);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
  animation: check-bounce var(--dur-slow) var(--ease-bounce);
}

@keyframes check-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.goal-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

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

.goal-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.goal-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-weight: 500;
}

.tag-saude { background: rgba(16,185,129,0.15); color: var(--green-light); }
.tag-trabalho { background: rgba(6,182,212,0.15); color: var(--cyan-light); }
.tag-aprendizado { background: rgba(139,92,246,0.15); color: var(--purple-light); }
.tag-financas { background: rgba(245,158,11,0.15); color: var(--amber); }
.tag-pessoal { background: rgba(236,72,153,0.15); color: var(--pink); }
.tag-outro { background: rgba(255,255,255,0.08); color: var(--text-2); }

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

.priority-dot--low { background: var(--green); }
.priority-dot--medium { background: var(--amber); }
.priority-dot--high { background: var(--red); }

.goal-delete {
  width: 32px; height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-smooth);
  flex-shrink: 0;
  opacity: 0;
}

.goal-delete svg { width: 16px; height: 16px; }

.goal-item:hover .goal-delete {
  opacity: 1;
  color: var(--red);
}

/* Recent section */
.recent-section { }

.recent-goals-list { display: flex; flex-direction: column; gap: 0.5rem; }

.recent-goal-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  font-size: 0.875rem;
  color: var(--text-1);
}

.recent-goal-item .goal-checkbox {
  width: 20px; height: 20px;
}

/* ============================================
   WEEK DAYS ROW
   ============================================ */
.days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.day-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.day-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  transition: all var(--dur-normal) var(--ease-smooth);
  color: var(--text-2);
}

.day-dot.today {
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--purple-light);
}

.day-dot.complete {
  background: var(--grad-green);
  border-color: transparent;
  color: white;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.day-dot.partial {
  background: linear-gradient(135deg, rgba(245,158,11,0.3), rgba(245,158,11,0.1));
  border-color: rgba(245,158,11,0.4);
  color: var(--amber);
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  transition: all var(--dur-normal) var(--ease-smooth);
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card svg {
  width: 28px; height: 28px;
  margin-bottom: 0.75rem;
  color: var(--purple-light);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  background: var(--grad-multi);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.375rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ============================================
   HEATMAP
   ============================================ */
.heatmap {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.heatmap-cell {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: rgba(139, 92, 246, 0.15);
  transition: all var(--dur-fast) var(--ease-smooth);
  cursor: pointer;
}

.heatmap-cell:hover { transform: scale(1.4); }
.heatmap-cell[data-level="1"] { background: rgba(139, 92, 246, 0.3); }
.heatmap-cell[data-level="2"] { background: rgba(139, 92, 246, 0.5); }
.heatmap-cell[data-level="3"] { background: rgba(139, 92, 246, 0.7); }
.heatmap-cell[data-level="4"] { background: rgba(139, 92, 246, 0.9); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-2);
}

.legend-boxes {
  display: flex;
  gap: 4px;
}

.legend-box {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--purple);
}

/* ============================================
   BADGES
   ============================================ */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-bottom: 0;
}

.badge-item {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  transition: all var(--dur-normal) var(--ease-bounce);
}

.badge-item:hover { transform: scale(1.05); }

.badge-item.unlocked {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.badge-item.locked { opacity: 0.35; filter: grayscale(1); }

.badge-emoji { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.badge-name { font-size: 0.7rem; font-weight: 600; color: var(--text-1); }
.badge-desc { font-size: 0.65rem; color: var(--text-2); margin-top: 0.125rem; }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--grad-purple);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

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

.btn-primary svg { width: 16px; height: 16px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  color: var(--text-0);
}

.link-btn {
  background: none;
  border: none;
  color: var(--purple-light);
  font-size: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur-fast);
}
.link-btn:hover { color: var(--purple-light); text-decoration: underline; }

/* ============================================
   MODAL / DIALOG
   ============================================ */
.modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 2rem);
  position: fixed;
}

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

.modal[open] {
  animation: modal-in var(--dur-slow) var(--ease-bounce);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content {
  background: var(--bg-2) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

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

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}

.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-0); }
.modal-close svg { width: 20px; height: 20px; }

/* ============================================
   FORM
   ============================================ */
.form-group { margin-bottom: 1.25rem; position: relative; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all var(--dur-normal) var(--ease-smooth);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-select option { background: var(--bg-2); color: var(--text-0); }

.char-count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-3);
  pointer-events: none;
}

.category-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-btn {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  background: transparent;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-smooth);
}

.cat-btn:hover, .cat-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--purple-light);
}

.priority-picker {
  display: flex;
  gap: 0.5rem;
}

.priority-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-smooth);
}

.priority-btn[data-priority="low"].active { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: var(--green-light); }
.priority-btn[data-priority="medium"].active { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: var(--amber); }
.priority-btn[data-priority="high"].active { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #FCA5A5; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  color: var(--text-0);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9998;
  transform: translateY(100px) scale(0.9);
  opacity: 0;
  transition: all var(--dur-slow) var(--ease-bounce);
  pointer-events: none;
  max-width: 360px;
}

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

.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }

/* ============================================
   RESPONSIVE — TABLET & MOBILE
   ============================================ */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }

  .mobile-header { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(60px + 1.25rem);
  }

  .cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .days-row { grid-template-columns: repeat(7, 1fr); }
  .section-title { font-size: 1.5rem; }
  .donut-wrapper { width: 140px; height: 140px; }
  .toast { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .particle, .ai-orb, .ai-card::before, .ai-pulse, .progress-bar-fill::after {
    animation: none !important;
  }
  .section { animation: none; }
  .goal-item { animation: none; }
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  padding: 1.5rem;
}

.login-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card), var(--shadow-glow-purple);
  animation: modal-in var(--dur-slow) var(--ease-bounce);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.login-logo .logo-icon {
  box-shadow: var(--shadow-glow-purple), 0 0 60px rgba(139,92,246,0.3);
}

.login-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  background: var(--grad-multi);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.625rem;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 300px;
  margin-inline: auto;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-0);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-smooth);
  width: 100%;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.btn-google:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-google:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.login-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-2);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(139,92,246,0.3);
  border-top-color: var(--purple-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-privacy {
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: 1rem;
}

/* ============================================
   SIDEBAR USER PROFILE
   ============================================ */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
  min-width: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(139,92,246,0.4);
}

.user-avatar-placeholder {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(139,92,246,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  width: 28px; height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}

.logout-btn svg { width: 14px; height: 14px; }
.logout-btn:hover { background: rgba(239,68,68,0.15); color: #FCA5A5; }

