/* ===================================================
   NEXUS — AI Life Navigator
   Main CSS: Design System, Layout, Core Styles
   =================================================== */

/* ─── CSS Custom Properties ─────────────────────────── */
:root {
  /* Color Palette */
  --bg-primary: #0a0b1e;
  --bg-secondary: #0f1035;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(15, 16, 53, 0.85);

  /* Brand Colors */
  --purple: #6c63ff;
  --purple-light: #8b85ff;
  --purple-dark: #4f49cc;
  --teal: #00d4ff;
  --teal-dark: #00a8cc;
  --gold: #ffd166;
  --gold-dark: #e6ba55;
  --green: #06d6a0;
  --rose: #ff6b9d;
  --orange: #ff9f43;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-link: var(--teal);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(108, 99, 255, 0.6);

  /* Gradients */
  --grad-purple: linear-gradient(135deg, #6c63ff 0%, #a855f7 100%);
  --grad-teal: linear-gradient(135deg, #00d4ff 0%, #06d6a0 100%);
  --grad-gold: linear-gradient(135deg, #ffd166 0%, #ff9f43 100%);
  --grad-rose: linear-gradient(135deg, #ff6b9d 0%, #ff9f43 100%);
  --grad-hero: linear-gradient(135deg, #0a0b1e 0%, #1a0a3e 50%, #0a1e3e 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-purple: 0 8px 32px rgba(108, 99, 255, 0.3);
  --shadow-teal: 0 8px 32px rgba(0, 212, 255, 0.2);
  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.4);

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

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

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 60px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.4s var(--ease);

  /* Module Colors */
  --mindspace: #a855f7;
  --careerlab: #00d4ff;
  --moneyiq: #ffd166;
  --community: #06d6a0;
  --journal: #ff6b9d;
  --achievements: #ff9f43;
}

/* Accessibility: contrast/focus only — NO font or size changes */
body.accessibility-mode {
  outline-style: solid;
}
body.high-contrast {
  --bg-primary: #000010;
  --bg-secondary: #0a0a1a;
  --bg-card: rgba(255, 255, 255, 0.09);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.92);
  --border: rgba(255, 255, 255, 0.28);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; }

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108, 99, 255, 0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 99, 255, 0.7); }

/* ─── Loading Screen ────────────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}
.nexus-logo-anim {
  position: relative;
  width: 100px;
  height: 100px;
}
.logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.ring-1 {
  border-color: var(--purple);
  animation: spin 2s linear infinite;
}
.ring-2 {
  inset: 10px;
  border-color: var(--teal);
  animation: spin 3s linear infinite reverse;
}
.ring-3 {
  inset: 20px;
  border-color: var(--gold);
  animation: spin 1.5s linear infinite;
}
.logo-core {
  position: absolute;
  inset: 30px;
  background: var(--grad-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}
.logo-n {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}
.loading-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loading-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.loading-fill {
  height: 100%;
  width: 0;
  background: var(--grad-purple);
  border-radius: var(--radius-full);
  transition: width 0.3s var(--ease);
}

/* ─── Screen Utilities ──────────────────────────────── */
.screen { position: fixed; inset: 0; z-index: 100; overflow-y: auto; }
.hidden { display: none !important; }
.invisible { visibility: hidden; opacity: 0; pointer-events: none; }

/* ─── Main App Layout ───────────────────────────────── */
.main-app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ─── Sidebar ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition-slow), width var(--transition-slow);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  min-height: 70px;
}

.nexus-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-icon {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.brand-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--purple);
  animation: pulse-ring 2s ease-in-out infinite;
}
.brand-n {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-purple);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-tagline { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.05em; }

.sidebar-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  opacity: 0.6;
  transition: opacity var(--transition);
  display: none;
}
.sidebar-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
}
.sidebar-toggle:hover { opacity: 1; }

/* User Card */
.user-card {
  margin: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-purple);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.9rem; truncate: true; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-level { display: flex; align-items: center; gap: var(--space-xs); margin-top: 2px; }
.level-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  background: rgba(108, 99, 255, 0.2);
  color: var(--purple-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(108, 99, 255, 0.3);
}
.level-xp { font-size: 0.65rem; color: var(--text-muted); }
.user-mood { font-size: 1.3rem; }

/* Nav Menu */
.nav-menu {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: color var(--transition);
}
.nav-glow {
  position: absolute;
  inset: 0;
  background: var(--grad-purple);
  opacity: 0;
  transition: opacity var(--transition);
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-item:hover .nav-icon { color: var(--purple-light); }
.nav-item.active {
  color: var(--text-primary);
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.25);
}
.nav-item.active .nav-icon { color: var(--purple-light); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--grad-purple);
  border-radius: 0 2px 2px 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.btn-accessibility, .btn-safe-space {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.78rem;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}
.btn-accessibility:hover { color: var(--teal); background: rgba(0, 212, 255, 0.08); }
.btn-safe-space:hover { color: var(--rose); background: rgba(255, 107, 157, 0.08); }

.crisis-line {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding-top: var(--space-xs);
}
.crisis-link {
  color: var(--rose);
  font-weight: 600;
}
.crisis-link:hover { text-decoration: underline; }

/* ─── Main Content ──────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-slow);
}

.module-container {
  flex: 1;
  padding: var(--space-xl) var(--space-xl);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Mobile Header ─────────────────────────────────── */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-menu-btn {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
}
.mobile-menu-btn span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition);
}
.mobile-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mobile-mood { font-size: 1.3rem; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.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);
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(108, 99, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ─── Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-xl);
  background: var(--grad-purple);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  box-shadow: var(--shadow-purple);
  cursor: pointer;
  border: none;
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(108, 99, 255, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 11px var(--space-xl);
  background: transparent;
  color: var(--purple-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid rgba(108, 99, 255, 0.4);
  transition: all var(--transition);
  cursor: pointer;
}
.btn-secondary:hover {
  background: rgba(108, 99, 255, 0.15);
  border-color: var(--purple);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}
.btn-ghost:hover { color: var(--text-secondary); background: var(--bg-card); }

.btn-teal {
  background: var(--grad-teal);
  color: var(--bg-primary);
  font-weight: 700;
  box-shadow: var(--shadow-teal);
}
.btn-teal:hover { box-shadow: 0 12px 40px rgba(0, 212, 255, 0.4); }

.btn-gold {
  background: var(--grad-gold);
  color: var(--bg-primary);
  font-weight: 700;
}

.btn-sm { padding: 8px var(--space-md); font-size: 0.8rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Inputs ────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 12px var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: rgba(108, 99, 255, 0.6);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Badges & Pills ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-purple { background: rgba(108, 99, 255, 0.2); color: var(--purple-light); border: 1px solid rgba(108, 99, 255, 0.3); }
.badge-teal { background: rgba(0, 212, 255, 0.15); color: var(--teal); border: 1px solid rgba(0, 212, 255, 0.25); }
.badge-gold { background: rgba(255, 209, 102, 0.15); color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.25); }
.badge-green { background: rgba(6, 214, 160, 0.15); color: var(--green); border: 1px solid rgba(6, 214, 160, 0.25); }
.badge-rose { background: rgba(255, 107, 157, 0.15); color: var(--rose); border: 1px solid rgba(255, 107, 157, 0.25); }

/* ─── Section Headers ───────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Progress Bars ─────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-purple);
  transition: width 1s var(--ease);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(4px);
}

/* ─── Grid Layouts ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md); }

/* ─── Chat Interface ────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.chat-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.02);
}
.chat-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-purple);
  position: relative;
}
.chat-ai-avatar::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.chat-ai-info { flex: 1; }
.chat-ai-name { font-weight: 600; font-size: 0.9rem; }
.chat-ai-status { font-size: 0.72rem; color: var(--green); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.chat-msg {
  display: flex;
  gap: var(--space-sm);
  max-width: 85%;
  animation: msgSlide 0.3s var(--ease);
}
.chat-msg.ai { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 4px;
}
.chat-msg.ai .msg-avatar { background: var(--grad-purple); }
.chat-msg.user .msg-avatar { background: var(--grad-teal); color: var(--bg-primary); }

.msg-bubble {
  padding: 10px var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
}
.chat-msg.ai .msg-bubble {
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}
.chat-msg.user .msg-bubble {
  background: var(--grad-purple);
  color: white;
  border-top-right-radius: 4px;
  box-shadow: var(--shadow-purple);
}

.chat-msg.ai .msg-bubble ul { padding-left: var(--space-md); margin-top: var(--space-xs); }
.chat-msg.ai .msg-bubble li { margin-bottom: 4px; }
.chat-msg.ai .msg-bubble strong { color: var(--purple-light); }
.chat-msg.ai .msg-bubble a { color: var(--teal); text-decoration: underline; }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px var(--space-md);
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  width: fit-content;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-light);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

.chat-input-area {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.chat-input-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 12px var(--space-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.4;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:focus { border-color: rgba(108, 99, 255, 0.5); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  box-shadow: var(--shadow-purple);
}
.chat-send-btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(108, 99, 255, 0.5); }
.chat-send-btn:disabled { opacity: 0.5; transform: none; }

.chat-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.chat-voice-btn:hover { background: rgba(0, 212, 255, 0.25); }
.chat-voice-btn.recording { background: rgba(255, 107, 157, 0.2); border-color: var(--rose); color: var(--rose); animation: pulse 1s ease-in-out infinite; }

.chat-suggestions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}
.suggestion-chip {
  padding: 6px var(--space-md);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--purple-light);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.suggestion-chip:hover {
  background: rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.4);
}

/* Emotion indicator bar */
.emotion-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.emotion-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.emotion-label { color: var(--text-secondary); }

/* Crisis banner */
.crisis-banner {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.15) 0%, rgba(255, 159, 67, 0.15) 100%);
  border: 1px solid rgba(255, 107, 157, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  animation: slideDown 0.3s var(--ease);
}
.crisis-icon { font-size: 1.5rem; flex-shrink: 0; }
.crisis-text h4 { color: var(--rose); font-weight: 600; margin-bottom: 4px; }
.crisis-text p { font-size: 0.85rem; color: var(--text-secondary); }
.crisis-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); flex-wrap: wrap; }
.crisis-btn {
  padding: 6px var(--space-md);
  background: var(--rose);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity var(--transition);
  display: inline-block;
}
.crisis-btn:hover { opacity: 0.85; }

/* ─── Mood Overlay ──────────────────────────────────── */
.mood-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 30, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.mood-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.3s var(--ease-spring);
}
.mood-card-header h2 { font-size: 1.4rem; font-family: var(--font-display); margin-bottom: var(--space-xs); }
.mood-card-header p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: var(--space-xl); }
.mood-emojis {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  background: var(--bg-card);
  transition: all var(--transition);
  min-width: 68px;
  cursor: pointer;
}
.mood-btn span { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }
.mood-btn:first-child { font-size: 2rem; }
.mood-btn { font-size: 2rem; }
.mood-btn:hover { border-color: var(--purple); background: rgba(108, 99, 255, 0.1); transform: scale(1.05); }
.mood-btn.selected { border-color: var(--purple); background: rgba(108, 99, 255, 0.15); transform: scale(1.1); }
.mood-note-row { margin-bottom: var(--space-lg); }
.mood-note-row input {
  width: 100%;
  padding: 10px var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}
.mood-note-row input:focus { border-color: rgba(108, 99, 255, 0.5); }
.mood-note-row input::placeholder { color: var(--text-muted); }
.mood-overlay .btn-primary { width: 100%; margin-bottom: var(--space-sm); }
.mood-overlay .btn-ghost { width: 100%; }

/* ─── Safe Space Overlay ────────────────────────────── */
.safe-space-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 15, 0.97);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.safe-space-inner {
  max-width: 520px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-height: 90vh;
}
.safe-badge {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rose);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}
.safe-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.safe-chat {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-height: 300px;
  min-height: 150px;
}
.safe-msg {
  padding: 10px var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 85%;
}
.safe-msg.ai {
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.2);
  align-self: flex-start;
}
.safe-msg.user {
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 107, 157, 0.2);
  align-self: flex-end;
}
.safe-input-row {
  display: flex;
  gap: var(--space-sm);
}
.safe-input-row input {
  flex: 1;
  padding: 12px var(--space-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
}
.safe-input-row input:focus { border-color: rgba(255, 107, 157, 0.5); }
.safe-input-row input::placeholder { color: var(--text-muted); }
.safe-input-row button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 107, 157, 0.2);
  border: 1px solid rgba(255, 107, 157, 0.4);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}
.safe-input-row button:hover { background: rgba(255, 107, 157, 0.3); }
.safe-resources {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}
.resource-pill {
  padding: 6px var(--space-md);
  background: rgba(255, 107, 157, 0.1);
  border: 1px solid rgba(255, 107, 157, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--rose);
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.resource-pill:hover { background: rgba(255, 107, 157, 0.2); }
.safe-close {
  align-self: center;
  padding: 10px var(--space-xl);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.safe-close:hover { border-color: var(--text-muted); color: var(--text-primary); }

/* ─── Toast ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}
.toast {
  padding: 12px var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  pointer-events: all;
  max-width: 320px;
  backdrop-filter: blur(20px);
}
.toast.success { border-color: rgba(6, 214, 160, 0.4); }
.toast.success::before { content: '✨'; }
.toast.error { border-color: rgba(255, 107, 157, 0.4); }
.toast.error::before { content: '⚠️'; }
.toast.info::before { content: 'ℹ️'; }

/* XP Popup */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--grad-purple);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  z-index: 5000;
  box-shadow: var(--shadow-glow);
  pointer-events: none;
  animation: xpFloat 2s var(--ease) forwards;
}

/* ─── Onboarding ────────────────────────────────────── */
.onboarding-bg {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.orb-1 { width: 500px; height: 500px; background: var(--purple); top: -200px; right: -100px; animation: orbFloat 8s ease-in-out infinite; }
.orb-2 { width: 400px; height: 400px; background: var(--teal); bottom: -150px; left: -100px; animation: orbFloat 10s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: var(--gold); top: 50%; left: 50%; transform: translate(-50%, -50%); animation: orbFloat 6s ease-in-out infinite 2s; }

.onboarding-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

/* ─── Module Page Headers ───────────────────────────── */
.module-hero {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}
.module-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.module-hero h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
.module-hero p { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; max-width: 600px; }

/* ─── Stat Cards ────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 var(--radius-xl) 0 100%;
  opacity: 0.1;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 1.5rem; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.stat-change { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--rose); }

/* ─── Tabs ──────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: var(--space-xs);
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  width: fit-content;
  border: 1px solid var(--border);
}
.tab-btn {
  padding: 8px var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  background: var(--grad-purple);
  color: white;
  box-shadow: var(--shadow-purple);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s var(--ease); }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
  .module-container { padding: var(--space-lg); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-header { display: flex; }
  .module-container { padding: var(--space-md); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .chat-container { height: calc(100vh - 140px); }
  .tab-nav { overflow-x: auto; width: 100%; }
  .module-hero h1 { font-size: 1.7rem; }
  .toast-container { right: var(--space-md); bottom: var(--space-md); left: var(--space-md); }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .mood-emojis { gap: var(--space-xs); }
  .mood-btn { min-width: 56px; }
  .section-title { font-size: 1.25rem; }
}

/* ─── Utility Classes ───────────────────────────────── */
.text-gradient-purple {
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-teal {
  background: var(--grad-teal);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-gold {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.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); }
.mb-xl { margin-bottom: var(--space-xl); }
.w-full { width: 100%; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── ZENO Brand Colors ───────────────────────────────── */
.loading-title { background: linear-gradient(135deg, #8b85ff, #00d4ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ─── Toast Dismiss Button ───────────────────────────── */
.toast { pointer-events: all; position: relative; }
.toast-msg { flex: 1; }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 0 0 0 8px;
  line-height: 1; flex-shrink: 0; transition: color 0.15s;
}
.toast-close:hover { color: var(--text-primary); }
.toast-leaving { animation: toastOut 0.3s ease forwards !important; }
.toast-container { pointer-events: none; }

/* ─── Nav Badge (alert dot) ──────────────────────────── */
.nav-badge {
  position: absolute;
  top: 6px; right: 8px;
  min-width: 16px; height: 16px;
  background: var(--rose);
  color: #fff;
  border-radius: 99px;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 8px rgba(255,107,157,0.5);
  animation: pulse 2s ease infinite;
}

/* ─── Achievement Unlock Popup ───────────────────────── */
.achievement-unlock-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8000;
  pointer-events: none;
}
.aup-inner {
  background: linear-gradient(135deg, rgba(255,209,102,0.18), rgba(255,159,67,0.1));
  border: 2px solid rgba(255,209,102,0.5);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl) var(--space-2xl);
  text-align: center;
  backdrop-filter: blur(24px);
  box-shadow: 0 32px 80px rgba(255,209,102,0.25), 0 0 0 1px rgba(255,255,255,0.05);
  min-width: 240px;
}
.aup-icon { font-size: 3rem; margin-bottom: 8px; animation: floatUp 2s ease infinite; }
.aup-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.aup-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
@keyframes achieveIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  25%  { transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9) translateY(-20px); }
}

/* ─── Typing Indicator (Safe Space) ─────────────────── */
.typing-indicator { display: flex; align-items: center; gap: 5px; padding: 12px 16px !important; }
.typing-indicator span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--purple-light);
  animation: typingBounce 1.2s ease infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── Button Ripple ──────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-gold { position: relative; overflow: hidden; }
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  width: 6px; height: 6px;
  background: rgba(255,255,255,0.35);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: translate(-50%, -50%) scale(40); opacity: 0; }
}

/* ─── Onboarding ZENO branding ───────────────────────── */
.brand-name { letter-spacing: 0.05em; }

/* ─── Real-time XP Bar in sidebar ───────────────────── */
#nav-xp-bar { will-change: width; }

/* ─── Toast color overrides ──────────────────────────── */
.toast.success { background: rgba(6,214,160,0.12); border-color: rgba(6,214,160,0.45); }
.toast.error   { background: rgba(255,107,157,0.12); border-color: rgba(255,107,157,0.45); }
.toast.info    { background: rgba(108,99,255,0.12); border-color: rgba(108,99,255,0.45); }

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: var(--space-md); opacity: 0.6; }
.empty-state-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: var(--space-sm); }
.empty-state-desc { font-size: 0.875rem; line-height: 1.7; max-width: 360px; margin: 0 auto; }

/* ─── Grid Auto ──────────────────────────────────────── */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-md); }
@media (max-width: 580px) { .grid-auto { grid-template-columns: 1fr 1fr; } }

/* ─── Section Header ─────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Badge Variants ─────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 600; }
.badge-purple { background: rgba(108,99,255,0.15); color: var(--purple-light); border: 1px solid rgba(108,99,255,0.3); }
.badge-teal   { background: rgba(0,212,255,0.12); color: var(--teal); border: 1px solid rgba(0,212,255,0.3); }
.badge-green  { background: rgba(6,214,160,0.12); color: var(--green); border: 1px solid rgba(6,214,160,0.3); }
.badge-rose   { background: rgba(255,107,157,0.12); color: var(--rose); border: 1px solid rgba(255,107,157,0.3); }
.badge-gold   { background: rgba(255,209,102,0.12); color: var(--gold); border: 1px solid rgba(255,209,102,0.3); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── Tab Nav ────────────────────────────────────────── */
.tab-nav { display: flex; gap: 6px; margin-bottom: var(--space-lg); flex-wrap: wrap; }
.tab-btn {
  padding: 8px 18px; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.tab-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.tab-btn.active {
  background: rgba(108,99,255,0.15);
  border-color: rgba(108,99,255,0.5);
  color: var(--purple-light);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Card ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: background var(--transition), border-color var(--transition);
}
.card:hover { background: var(--bg-card-hover); }

/* ─── Crisis Banner (inside modules) ────────────────── */
.crisis-banner {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(255,107,157,0.08), rgba(108,99,255,0.05));
  border: 1px solid rgba(255,107,157,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
}
.crisis-icon { font-size: 2rem; flex-shrink: 0; }
.crisis-text h4 { font-weight: 700; margin-bottom: 4px; }
.crisis-actions { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); flex-wrap: wrap; }
.crisis-btn {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,107,157,0.12);
  border: 1px solid rgba(255,107,157,0.3);
  border-radius: 99px;
  color: var(--rose);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.crisis-btn:hover { background: rgba(255,107,157,0.2); transform: translateY(-1px); }

/* ─── Streak Flame ───────────────────────────────────── */
.streak-flame { animation: floatUp 2s ease-in-out infinite; display: inline-block; }

/* ─── Progress Bar ───────────────────────────────────── */
.progress-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s var(--ease-spring); }

/* ─── Button Ghost ───────────────────────────────────── */
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-ghost:hover { color: var(--text-secondary); background: rgba(255,255,255,0.05); }

/* ─── Small Buttons ──────────────────────────────────── */
.btn-sm { padding: 6px 14px !important; font-size: 0.78rem !important; }
.btn-xs { padding: 4px 10px !important; font-size: 0.72rem !important; }

/* ─── Mood Overlay Update ────────────────────────────── */
.mood-card-header h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.mood-card-header p { color: var(--text-muted); font-size: 0.875rem; }

/* ─── Streak Indicator in Mobile Header ─────────────── */
#mobile-streak { animation: pulse 2s ease infinite; }
