/* ─── CASSA Design System ───────────────────────────────────────────────────── */
:root {
  --bg-base:        #0a0c14;
  --bg-surface:     #111320;
  --bg-card:        #161929;
  --bg-card-hover:  #1c2035;
  --bg-input:       #1a1e30;
  --border:         #252a40;
  --border-light:   #2e3450;

  --gold:           #c9a84c;
  --gold-light:     #e8c96a;
  --gold-glow:      rgba(201, 168, 76, 0.15);
  --gold-subtle:    rgba(201, 168, 76, 0.08);

  --accent-blue:    #4f80ff;
  --accent-teal:    #2dd4bf;
  --accent-rose:    #f472b6;
  --accent-amber:   #fb923c;
  --accent-green:   #4ade80;
  --accent-purple:  #a78bfa;

  --text-primary:   #f0f2ff;
  --text-secondary: #8b91ab;
  --text-muted:     #555c78;

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 40px rgba(201, 168, 76, 0.1);

  --sidebar-w:   260px;
  --transition:  0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* ─── Auth Screen ────────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(201,168,76,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(79,128,255,0.06) 0%, transparent 60%),
              var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-card), var(--shadow-gold);
  animation: slideUp 0.4s ease;
}

.auth-logo {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2rem;
}

.logo-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem; font-weight: 700;
  color: #0a0c14;
  box-shadow: 0 4px 20px rgba(201,168,76,0.35);
  flex-shrink: 0;
}

.auth-brand {
  font-size: 1.2rem; font-weight: 700; letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.auth-tagline {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 2px;
  letter-spacing: 0.02em;
}

.auth-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 600;
  margin-bottom: 1.5rem; color: var(--text-primary);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }

.auth-switch {
  text-align: center; font-size: 0.8rem; color: var(--text-secondary);
  margin-top: 1rem;
}
.auth-switch a { color: var(--gold); text-decoration: none; }
.auth-switch a:hover { color: var(--gold-light); }

/* ─── Form Elements ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 0.4rem;
  letter-spacing: 0.05em; text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.875rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg-card); }

.auth-info {
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.auth-info.success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
}
.auth-info.error {
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.3);
  color: var(--accent-rose);
}

.form-error {
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.3);
  color: var(--accent-rose);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0a0c14;
  box-shadow: 0 4px 16px rgba(201,168,76,0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,168,76,0.4);
}
.btn-primary:active { transform: translateY(0); }

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

.btn-ghost {
  background: none; border: none; color: var(--text-secondary);
  font-family: 'Inter', sans-serif; font-size: 0.8rem; cursor: pointer;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-full { width: 100%; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

.btn-icon {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 0.5rem; cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center;
}
.btn-icon:hover { color: var(--gold); border-color: var(--gold); }

/* ─── App Layout ─────────────────────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 0.75rem;
}

.logo-mark-sm {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: #0a0c14;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--gold);
}

.sidebar-sub {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 170px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 450;
  color: var(--text-secondary);
  cursor: pointer; text-decoration: none;
  transition: all var(--transition);
  user-select: none;
}

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

.nav-item.active {
  background: var(--gold-subtle);
  color: var(--gold-light);
  font-weight: 500;
  border-left: 2px solid var(--gold);
  padding-left: calc(0.875rem - 2px);
}

.nav-icon { font-size: 1rem; }

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

/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1rem;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.2rem; cursor: pointer; padding: 0.25rem;
}

.topbar-date {
  font-size: 0.8rem; color: var(--text-muted); flex: 1;
}

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.user-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.875rem;
  font-size: 0.8rem; color: var(--text-secondary);
}

/* ─── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  scroll-behavior: smooth;
}

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

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

.card-sm { padding: 1rem; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 0.875rem; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ─── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.page-subtitle {
  font-size: 0.875rem; color: var(--text-muted);
}

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

/* ─── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--accent-green); }
.stat-value.rose { color: var(--accent-rose); }
.stat-value.blue { color: var(--accent-blue); }
.stat-delta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ─── Progress Bar ───────────────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 100px;
  transition: width 0.6s ease;
}
.progress-fill.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.progress-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-fill.purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

/* ─── Tags & Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem; font-weight: 500;
  white-space: nowrap;
}

.badge-gold { background: var(--gold-subtle); color: var(--gold); border: 1px solid rgba(201,168,76,0.2); }
.badge-green { background: rgba(74,222,128,0.1); color: var(--accent-green); border: 1px solid rgba(74,222,128,0.2); }
.badge-rose { background: rgba(244,114,182,0.1); color: var(--accent-rose); border: 1px solid rgba(244,114,182,0.2); }
.badge-blue { background: rgba(79,128,255,0.1); color: var(--accent-blue); border: 1px solid rgba(79,128,255,0.2); }
.badge-amber { background: rgba(251,146,60,0.1); color: var(--accent-amber); border: 1px solid rgba(251,146,60,0.2); }
.badge-teal { background: rgba(45,212,191,0.1); color: var(--accent-teal); border: 1px solid rgba(45,212,191,0.2); }
.badge-muted { background: rgba(139,145,171,0.1); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── List Items ─────────────────────────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

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

.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.list-meta { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }

/* ─── Calendar Grid ──────────────────────────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.week-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem 0.75rem;
  min-height: 100px;
  transition: border-color var(--transition);
}
.week-day.today {
  border-color: var(--gold);
  background: var(--gold-subtle);
}
.week-day-label {
  font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.week-day-num {
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-top: 2px;
}
.week-day.today .week-day-num { color: var(--gold); }
.week-events { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 2px; }
.week-event {
  font-size: 0.65rem; background: var(--gold-subtle); color: var(--gold);
  border-radius: 4px; padding: 2px 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.week-event.blue { background: rgba(79,128,255,0.1); color: var(--accent-blue); }
.week-event.teal { background: rgba(45,212,191,0.1); color: var(--accent-teal); }
.week-event.rose { background: rgba(244,114,182,0.1); color: var(--accent-rose); }
.week-event.amber { background: rgba(251,146,60,0.1); color: var(--accent-amber); }

/* ─── Meal Grid ──────────────────────────────────────────────────────────────── */
.meal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.meal-day {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0.75rem;
}
.meal-day-name { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.meal-name { font-size: 0.78rem; color: var(--text-primary); margin-top: 0.4rem; font-weight: 500; }

/* ─── Goal Cards ─────────────────────────────────────────────────────────────── */
.goal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.goal-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.goal-icon { font-size: 1.5rem; }
.goal-name { font-weight: 600; color: var(--text-primary); }
.goal-amounts { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }
.goal-pct { font-size: 0.75rem; font-weight: 600; color: var(--gold); }

/* ─── Spending Chart ─────────────────────────────────────────────────────────── */
.spending-bar { margin-bottom: 0.75rem; }
.spending-bar-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.spending-bar-track { height: 8px; background: var(--bg-input); border-radius: 100px; overflow: hidden; }
.spending-bar-fill { height: 100%; border-radius: 100px; transition: width 0.8s ease; }

/* ─── Activity Cards ─────────────────────────────────────────────────────────── */
.activity-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: all var(--transition);
  cursor: pointer;
}
.activity-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.activity-title { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.activity-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.activity-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ─── Health Records ─────────────────────────────────────────────────────────── */
.health-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.875rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}
.health-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.health-dot.green { background: var(--accent-green); box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.health-dot.amber { background: var(--accent-amber); box-shadow: 0 0 8px rgba(251,146,60,0.4); }
.health-dot.rose { background: var(--accent-rose); box-shadow: 0 0 8px rgba(244,114,182,0.4); }

/* ─── Joy ────────────────────────────────────────────────────────────────────── */
.joy-score-ring {
  width: 80px; height: 80px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.joy-score-num {
  font-size: 1.6rem; font-weight: 700; color: var(--gold);
}
.joy-entry {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold);
}
.joy-entry-text { font-size: 0.875rem; color: var(--text-primary); line-height: 1.6; font-style: italic; }
.joy-entry-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ─── Memory ─────────────────────────────────────────────────────────────────── */
.memory-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1rem;
  display: flex; align-items: flex-start; gap: 0.875rem;
}
.memory-key {
  font-size: 0.75rem; font-weight: 600; color: var(--gold);
  letter-spacing: 0.04em;
}
.memory-value { font-size: 0.875rem; color: var(--text-primary); margin-top: 2px; }
.memory-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Social ─────────────────────────────────────────────────────────────────── */
.social-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.social-status { display: flex; gap: 0.5rem; align-items: center; }

/* ─── Coverage Gap Alert ─────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  padding: 0.875rem 1.1rem;
  font-size: 0.85rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
  margin-bottom: 1rem;
}
.alert-warning {
  background: rgba(251,146,60,0.1);
  border: 1px solid rgba(251,146,60,0.25);
  color: var(--accent-amber);
}
.alert-info {
  background: rgba(79,128,255,0.08);
  border: 1px solid rgba(79,128,255,0.2);
  color: var(--accent-blue);
}
.alert-success {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  color: var(--accent-green);
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1rem; cursor: pointer; padding: 0.25rem;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
#modal-body { padding: 1.5rem; }

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem; color: var(--text-primary);
  box-shadow: var(--shadow-card);
  animation: slideUp 0.25s ease;
}

/* ─── Gratitude Prompt ───────────────────────────────────────────────────────── */
.gratitude-prompt {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.03));
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.gratitude-prompt .prompt-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.gratitude-prompt .prompt-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; color: var(--gold-light); line-height: 1.6;
  margin-bottom: 1rem;
}

/* ─── Family Members Row ─────────────────────────────────────────────────────── */
.member-chips {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.member-chip {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.3rem 0.75rem;
  font-size: 0.78rem; color: var(--text-secondary);
}
.member-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: white;
}

/* ─── Section Divider ────────────────────────────────────────────────────────── */
.section-gap { margin-top: 1.75rem; }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.font-semibold { font-weight: 600; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }

/* ─── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-in { animation: slideUp 0.3s ease; }
.loading { animation: pulse 1.5s ease infinite; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .meal-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .page-content { padding: 1.25rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(3, 1fr); }
  .meal-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Onboarding Wizard ───────────────────────────────────────────────────────── */
.onboarding-overlay {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}
.onboarding-progress {
  height: 4px; background: var(--border);
  border-radius: 2px; margin-bottom: 0.5rem;
}
.onboarding-progress-bar {
  height: 100%; background: var(--gold);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.onboarding-step-label {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }
.ob-heading {
  font-size: 1.3rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 0.4rem;
}
.ob-subtext {
  font-size: 0.875rem; color: var(--text-muted);
  margin-bottom: 1.5rem; line-height: 1.5;
}
.onboarding-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
/* Module grid */
.ob-module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.ob-module {
  background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 0.75rem;
  text-align: center; cursor: default;
}
.ob-module.toggle-module { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ob-module.toggle-module:hover { border-color: var(--gold); }
.ob-module.toggle-module.active {
  border-color: var(--gold); background: rgba(212,175,55,0.08);
}
.ob-module.locked { opacity: 0.7; }
.ob-module-icon { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.ob-module-name { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.ob-module-badge {
  font-size: 0.7rem; color: var(--gold);
  margin-top: 0.3rem;
}
.ob-toggle-indicator {
  font-size: 0.7rem; color: var(--text-muted);
  margin-top: 0.3rem; font-weight: 600; letter-spacing: 0.05em;
}
.ob-module.active .ob-toggle-indicator { color: var(--gold); }
/* Member / health record rows */
.ob-row {
  display: grid; gap: 0.5rem;
  grid-template-columns: 1fr 1fr auto;
  align-items: center; margin-bottom: 0.6rem;
}
.ob-row-3 { grid-template-columns: 1fr 1fr 1fr auto; }
.ob-row-wide { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
.ob-remove-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}
.ob-remove-btn:hover { color: var(--accent-rose); background: rgba(244,114,182,0.1); }
.label-optional { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.ob-location-group { margin-bottom: 1rem; }
.ob-location-label {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.35rem; font-weight: 500;
}

/* ── Calendar feed colour swatches ─────────────────────────────────────────── */
.color-swatch.selected { border-color: var(--text-primary) !important; }
