/* ============================================================
   STUDENT HEALTH TRACKER — styles.css
   Design: Soft botanical / organic wellness aesthetic
   Fonts: Fraunces (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────── */
:root {
  /* Light Mode Palette */
  --bg-base:        #f4f7f2;
  --bg-card:        #ffffff;
  --bg-subtle:      #eef3eb;
  --bg-sidebar:     #2c4a3e;
  --bg-sidebar-hover: #3a5e50;

  --text-primary:   #1e2d27;
  --text-secondary: #4a6358;
  --text-muted:     #7a9486;
  --text-on-dark:   #e8f0ec;
  --text-accent:    #2c4a3e;

  --accent-green:   #4a8c6e;
  --accent-sage:    #7aaf94;
  --accent-blue:    #4a7ca8;
  --accent-sky:     #7ab8d4;
  --accent-gold:    #c4a35a;
  --accent-rose:    #c47a7a;

  --border:         #d8e5d6;
  --border-light:   #eef3eb;
  --shadow-sm:      0 2px 8px rgba(44,74,62,0.07);
  --shadow-md:      0 4px 20px rgba(44,74,62,0.10);
  --shadow-lg:      0 8px 40px rgba(44,74,62,0.14);

  --mood-happy:     #4a8c6e;
  --mood-neutral:   #4a7ca8;
  --mood-stressed:  #c4a35a;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --sidebar-w: 260px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-base:        #111c17;
  --bg-card:        #182620;
  --bg-subtle:      #1e3028;
  --bg-sidebar:     #0d1a13;
  --bg-sidebar-hover: #1a2e22;

  --text-primary:   #e0ece6;
  --text-secondary: #93b8a4;
  --text-muted:     #5e8a74;
  --text-on-dark:   #c8ddd3;
  --text-accent:    #7aaf94;

  --accent-green:   #5fa882;
  --accent-sage:    #6a9e84;
  --accent-blue:    #5a90c0;
  --accent-sky:     #6aaec8;
  --accent-gold:    #d4b36a;
  --accent-rose:    #d48a8a;

  --border:         #253d2e;
  --border-light:   #1e3028;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.45);
}

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

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ─── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-subtle); }
::-webkit-scrollbar-thumb { background: var(--accent-sage); border-radius: 99px; }

/* ─── ONBOARDING SCREEN ─────────────────────────────────── */
#onboarding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

#onboarding::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(74,140,110,0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
  pointer-events: none;
}

#onboarding::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(74,124,168,0.10) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  border-radius: 50%;
  pointer-events: none;
}

.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 52px 48px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s ease both;
}

.onboarding-icon {
  font-size: 52px;
  margin-bottom: 20px;
  display: block;
}

.onboarding-card h1 {
  font-size: 2.1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.onboarding-card .subtitle {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 36px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.97rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(74,140,110,0.12);
  background: var(--bg-card);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.93rem;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent-green);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 14px;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--bg-sidebar);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(196,122,122,0.12);
  color: var(--accent-rose);
  border: 1.5px solid rgba(196,122,122,0.25);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ─── APP SHELL ─────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sidebar-logo-icon { font-size: 26px; }

.sidebar-logo span {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  color: var(--text-on-dark);
  line-height: 1.25;
}

.sidebar-logo small {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.profile-mini {
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-mini-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.profile-mini-name {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-mini-level {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 8px 12px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(232,240,236,0.7);
  font-size: 0.88rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-on-dark);
}

.nav-item.active {
  background: var(--accent-green);
  color: #fff;
  font-weight: 500;
}

.nav-item-icon { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 8px;
}

.sidebar-footer .btn {
  flex: 1;
  justify-content: center;
  padding: 9px;
  font-size: 0.8rem;
}

/* Theme toggle */
.theme-toggle {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-on-dark);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  flex: 1;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.14);
}

/* ─── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 0;
}

/* ─── MOBILE TOPBAR ─────────────────────────────────────── */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ─── PAGE SECTIONS ─────────────────────────────────────── */
.page-section {
  display: none;
  padding: 36px 40px;
  max-width: 1000px;
  animation: fadeIn 0.3s ease;
}

.page-section.active { display: block; }

.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* ─── MOTIVATION BANNER ─────────────────────────────────── */
.motivation-banner {
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-blue) 100%);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
}

.motivation-banner:hover { transform: translateY(-1px); }

.motivation-banner::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.motivation-banner::after {
  content: '';
  position: absolute;
  right: 30px; bottom: -40px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.motivation-icon { font-size: 26px; flex-shrink: 0; }

.motivation-text {
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

.motivation-hint {
  font-size: 0.74rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* ─── DASHBOARD GRID ─────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.sleep   { background: rgba(90,144,192,0.12); }
.stat-icon.water   { background: rgba(74,156,212,0.12); }
.stat-icon.active  { background: rgba(74,140,110,0.12); }
.stat-icon.mood    { background: rgba(196,163,90,0.12); }

.stat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── PROGRESS BARS ─────────────────────────────────────── */
.progress-bar-wrap { margin-top: 14px; }

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.green { background: linear-gradient(90deg, var(--accent-sage), var(--accent-green)); }
.progress-fill.blue  { background: linear-gradient(90deg, var(--accent-sky), var(--accent-blue)); }
.progress-fill.gold  { background: linear-gradient(90deg, #d4b36a, #c4a35a); }

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon { font-size: 20px; }

/* ─── HEALTH LOG FORM ────────────────────────────────────── */
.log-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group.full { grid-column: 1 / -1; }

.range-group { position: relative; }

.range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-subtle);
  outline: none;
  margin-top: 8px;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.range-input::-webkit-slider-thumb:hover { transform: scale(1.2); }

.range-value {
  position: absolute;
  right: 0; top: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-green);
}

/* Mood selector */
.mood-selector {
  display: flex;
  gap: 10px;
}

.mood-option {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mood-option:hover { border-color: var(--accent-sage); color: var(--text-primary); }

.mood-option.selected.happy    { border-color: var(--accent-green); background: rgba(74,140,110,0.1); color: var(--accent-green); }
.mood-option.selected.neutral  { border-color: var(--accent-blue);  background: rgba(74,124,168,0.1); color: var(--accent-blue); }
.mood-option.selected.stressed { border-color: var(--accent-gold);  background: rgba(196,163,90,0.1); color: var(--accent-gold); }

.mood-emoji { font-size: 22px; }

/* Symptom chips */
.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-chip {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 400;
}

.symptom-chip:hover { border-color: var(--accent-sage); color: var(--text-secondary); }

.symptom-chip.selected {
  border-color: var(--accent-rose);
  background: rgba(196,122,122,0.1);
  color: var(--accent-rose);
  font-weight: 500;
}

/* ─── LOG ENTRIES ────────────────────────────────────────── */
.log-entries { display: flex; flex-direction: column; gap: 12px; }

.log-entry {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  animation: fadeUp 0.3s ease both;
}

.log-entry:hover { border-color: var(--border); background: var(--bg-card); }

.log-entry-date {
  min-width: 52px;
  text-align: center;
}

.log-entry-date-day {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
}

.log-entry-date-month {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.log-entry-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.log-entry-body { flex: 1; min-width: 0; }

.log-entry-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.log-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.log-stat-icon { font-size: 14px; }

.log-entry-mood {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
}

.log-entry-mood.happy    { background: rgba(74,140,110,0.12); color: var(--mood-happy); }
.log-entry-mood.neutral  { background: rgba(74,124,168,0.12); color: var(--mood-neutral); }
.log-entry-mood.stressed { background: rgba(196,163,90,0.12); color: var(--mood-stressed); }

.log-entry-symptoms {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.symptom-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(196,122,122,0.1);
  color: var(--accent-rose);
}

.log-entry-actions {
  display: flex;
  gap: 6px;
  align-self: flex-start;
}

.entry-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.entry-btn:hover { border-color: var(--accent-rose); color: var(--accent-rose); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 42px; margin-bottom: 12px; }
.empty-state-text { font-size: 0.9rem; }

/* ─── HABIT PROGRESS ─────────────────────────────────────── */
.habit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.habit-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.habit-icon { font-size: 28px; margin-bottom: 8px; }
.habit-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.habit-value { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 300; color: var(--text-primary); }
.habit-unit  { font-size: 0.8rem; color: var(--text-muted); }

/* Canvas chart */
.chart-wrap {
  position: relative;
  height: 180px;
  margin: 8px 0;
}

/* Streak dots */
.streak-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.streak-dot {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition);
}

.streak-dot.logged { background: var(--accent-green); border-color: var(--accent-green); color: #fff; }
.streak-dot.today  { border-color: var(--accent-blue); }

/* ─── TIPS SECTION ───────────────────────────────────────── */
.tips-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tips-search-bar input {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition);
}

.tips-search-bar input:focus {
  border-color: var(--accent-green);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(74,140,110,0.1);
}

.tips-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.cat-pill {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.cat-pill:hover { border-color: var(--accent-sage); color: var(--text-secondary); }

.cat-pill.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: all var(--transition);
  animation: fadeUp 0.3s ease both;
}

.tip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-sage);
}

.tip-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.tip-emoji { font-size: 26px; flex-shrink: 0; }

.tip-title {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
}

.tip-body {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── NOTES SECTION ──────────────────────────────────────── */
.notes-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.notes-list { display: flex; flex-direction: column; gap: 12px; }

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all var(--transition);
  animation: fadeUp 0.3s ease both;
}

.note-card:hover { border-color: var(--accent-sage); }

.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.note-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.note-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.note-content-edit {
  width: 100%;
  border: 1.5px solid var(--accent-green);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 80px;
  resize: vertical;
  outline: none;
}

/* ─── PROFILE SECTION ────────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--accent-green) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #fff;
}

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 400;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-hero-name {
  font-family: 'Fraunces', serif;
  font-size: 1.7rem;
  font-weight: 300;
  margin-bottom: 4px;
}

.profile-hero-level {
  font-size: 0.85rem;
  opacity: 0.8;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.profile-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.profile-stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--accent-green);
  margin-bottom: 4px;
}

.profile-stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease both;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease both;
  max-width: 300px;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid var(--accent-rose); }
.toast.info    { border-left: 3px solid var(--accent-blue); }

/* ─── UTILITIES ──────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .topbar { display: flex; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }

  .page-section { padding: 24px 20px; }

  .dashboard-grid { grid-template-columns: 1fr; }
  .log-form-grid  { grid-template-columns: 1fr; }
  .habit-grid     { grid-template-columns: 1fr 1fr; }
  .tips-grid      { grid-template-columns: 1fr; }
  .profile-stats-row { grid-template-columns: 1fr 1fr; }

  .mood-selector { flex-direction: row; }

  .modal { padding: 28px 24px; }

  .profile-hero { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .habit-grid { grid-template-columns: 1fr; }
  .profile-stats-row { grid-template-columns: 1fr; }
  .onboarding-card { padding: 36px 24px; }
}

/* ─── CANVAS TOOLTIP ─────────────────────────────────────── */
.chart-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  z-index: 10;
  display: none;
}
