/* ═══════════════════════════════════════════════════════════════
   InsulinIQ — Design System
   Palette: Chlorophyll meets Volcanic Glass
   Fonts: Bricolage Grotesque (display) + Instrument Sans (body)
═══════════════════════════════════════════════════════════════ */

:root {
  /* Core Colors */
  --green-bright: #B8F369;
  --green-mid: #7DC832;
  --green-deep: #2D6A1E;
  --green-darkest: #0A1F02;
  --bg-dark: #0D1117;
  --bg-card: #161B22;
  --bg-card-hover: #1C2330;
  --bg-elevated: #21262D;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(184,243,105,0.3);
  --text-primary: #F0FFF0;
  --text-secondary: #8B9A8B;
  --text-muted: #4A5A4A;
  --accent-blue: #60A5FA;
  --accent-amber: #F59E0B;
  --accent-red: #F87171;
  --accent-purple: #A78BFA;

  /* Typography */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(184,243,105,0.15);

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── PAGE SYSTEM ──────────────────────────────────────────── */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ── UTILITY ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.loading-state { color: var(--text-secondary); text-align: center; padding: 2rem; font-style: italic; }
.empty-state { color: var(--text-secondary); text-align: center; padding: 2rem; font-size: 0.9rem; }

/* ── BUTTONS ──────────────────────────────────────────────── */
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }

.btn-primary {
  background: var(--green-bright);
  color: var(--green-darkest);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: #ceff7a; transform: translateY(-1px); box-shadow: var(--shadow-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green-bright);
  color: var(--green-darkest);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}
.btn-hero:hover { background: #ceff7a; transform: translateY(-2px); box-shadow: 0 8px 32px rgba(184,243,105,0.3); }

.btn-full { width: 100%; }

.link-btn {
  background: none;
  border: none;
  color: var(--green-bright);
  font-family: var(--font-body);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  transition: var(--transition);
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(184,243,105,0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B9A8B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-section-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--green-bright); margin: 1.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 3rem; }
.input-toggle { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; opacity: 0.6; }
.input-toggle:hover { opacity: 1; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green-bright); color: var(--green-bright); }
.toast.error { border-color: var(--accent-red); color: var(--accent-red); }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════════════════ */

/* NAV */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { font-size: 1.4rem; }
.logo-text { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--text-primary); }
.nav-links { display: flex; gap: 2rem; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.nav-link:hover { color: var(--text-primary); }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; padding: 0.5rem; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: var(--transition); }
.mobile-nav {
  display: none;
  position: fixed;
  top: 65px; left: 0; right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 99;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--text-secondary); text-decoration: none; font-size: 1rem; }

/* HERO */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 8rem 4rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(184,243,105,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(184,243,105,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.hero-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(45,106,30,0.3), transparent); top: -100px; right: -100px; }
.hero-orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(184,243,105,0.08), transparent); bottom: 0; left: -100px; }
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(184,243,105,0.1);
  border: 1px solid rgba(184,243,105,0.2);
  color: var(--green-bright);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}
.badge-dot { width: 6px; height: 6px; background: var(--green-bright); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.3)} }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}
.hero-title em { font-style: normal; color: var(--green-bright); }
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 2.5rem; max-width: 520px; }
.hero-cta { margin-bottom: 3rem; }
.hero-cta-note { margin-top: 0.75rem; font-size: 0.82rem; color: var(--text-muted); }
.hero-stats { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--green-bright); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* DASHBOARD PREVIEW */
.hero-visual { position: relative; z-index: 1; }
.dashboard-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.preview-dots { display: flex; gap: 6px; }
.preview-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.preview-dots span:nth-child(1) { background: #FF5F57; }
.preview-dots span:nth-child(2) { background: #FFBD2E; }
.preview-dots span:nth-child(3) { background: #28CA41; }
.preview-title { font-size: 0.8rem; color: var(--text-secondary); margin-left: auto; }
.preview-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.preview-score { display: flex; justify-content: center; }
.score-ring { position: relative; width: 100px; height: 100px; }
.score-ring svg { width: 100%; height: 100%; }
.score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--green-bright); }
.score-label { font-size: 0.6rem; color: var(--text-muted); }
.preview-meals { display: flex; flex-direction: column; gap: 0.5rem; }
.preview-meal-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.meal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.meal-dot.breakfast { background: var(--accent-amber); }
.meal-dot.lunch { background: var(--green-bright); }
.meal-dot.dinner { background: var(--accent-blue); }
.meal-cal { margin-left: auto; color: var(--text-muted); font-size: 0.75rem; }
.preview-timing { }
.timing-bar { display: flex; flex-direction: column; gap: 0.4rem; }
.timing-label { font-size: 0.75rem; color: var(--text-muted); }
.timing-track { position: relative; height: 8px; background: var(--bg-elevated); border-radius: 4px; overflow: visible; }
.timing-fill { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green-bright)); border-radius: 4px; }
.timing-now { position: absolute; top: -4px; width: 16px; height: 16px; background: var(--green-bright); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 8px rgba(184,243,105,0.6); }
.timing-times { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }

/* SECTIONS */
.features-section, .science-section, .pricing-section {
  padding: 6rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  background: rgba(184,243,105,0.1);
  border: 1px solid rgba(184,243,105,0.2);
  color: var(--green-bright);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; margin-bottom: 1rem; }
.section-subtitle { color: var(--text-secondary); font-size: 1rem; max-width: 560px; margin: 0 auto; }

/* FEATURES GRID */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-2px); }
.feature-card--large { grid-column: span 2; }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.feature-tag { display: inline-block; margin-top: 1rem; font-size: 0.75rem; color: var(--green-bright); background: rgba(184,243,105,0.08); padding: 0.3rem 0.75rem; border-radius: var(--radius-full); }

/* SCIENCE */
.science-section { background: var(--bg-card); border-radius: var(--radius-xl); max-width: 1200px; margin: 0 auto 4rem; padding: 4rem; }
.science-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 2rem; }
.science-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.science-num { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: rgba(184,243,105,0.2); margin-bottom: 0.5rem; }
.science-card h4 { font-family: var(--font-display); font-weight: 700; margin-bottom: 0.5rem; }
.science-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }

/* PRICING */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  transition: var(--transition);
}
.pricing-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.pricing-card--featured { border-color: var(--green-bright); background: linear-gradient(135deg, rgba(184,243,105,0.05), var(--bg-card)); }
.pricing-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--green-bright);
  color: var(--green-darkest);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.9rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.pricing-plan { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.pricing-price { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 0.25rem; }
.price-currency { font-size: 1.5rem; vertical-align: top; margin-top: 0.5rem; display: inline-block; }
.price-period { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.pricing-savings { font-size: 0.8rem; color: var(--green-bright); font-weight: 600; margin-bottom: 1.25rem; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.75rem; }
.pricing-features li { font-size: 0.88rem; color: var(--text-secondary); }
.btn-pricing {
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-pricing:hover { border-color: var(--green-bright); color: var(--green-bright); }
.btn-pricing--featured { background: var(--green-bright); color: var(--green-darkest); border-color: var(--green-bright); }
.btn-pricing--featured:hover { background: #ceff7a; color: var(--green-darkest); }

/* FOOTER */
.landing-footer { text-align: center; padding: 3rem 2rem; border-top: 1px solid var(--border); }
.footer-tagline { color: var(--text-secondary); margin: 0.5rem 0 1rem; }
.footer-disclaimer { font-size: 0.78rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 1rem; line-height: 1.6; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════════════════════ */
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-brand {
  background: linear-gradient(135deg, var(--green-darkest), #0D2A0A);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(184,243,105,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(184,243,105,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.auth-back { position: relative; z-index: 1; align-self: flex-start; color: rgba(184,243,105,0.6); font-size: 0.85rem; background: none; border: none; cursor: pointer; transition: var(--transition); }
.auth-back:hover { color: var(--green-bright); }
.auth-brand-content { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; padding: 2rem 0; }
.auth-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; }
.auth-brand-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; margin-bottom: 2rem; }
.auth-brand-stats { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-stat { display: flex; align-items: center; gap: 0.75rem; color: rgba(240,255,240,0.7); font-size: 0.9rem; }
.auth-form-panel { background: var(--bg-dark); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form-container { width: 100%; max-width: 420px; }
.auth-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.9rem; }
.auth-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--accent-red); padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.88rem; margin-bottom: 1rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.88rem; color: var(--text-secondary); }
.btn-auth {
  width: 100%;
  padding: 0.85rem;
  background: var(--green-bright);
  color: var(--green-darkest);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  border-radius: var(--radius-full);
  margin-top: 1.25rem;
  transition: var(--transition);
}
.btn-auth:hover { background: #ceff7a; transform: translateY(-1px); }
.demo-hint { margin-top: 1.5rem; background: rgba(184,243,105,0.06); border: 1px solid rgba(184,243,105,0.15); border-radius: var(--radius-md); padding: 0.75rem 1rem; font-size: 0.82rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════
   SUBSCRIBE PAGE
═══════════════════════════════════════════════════════════ */
.subscribe-layout { min-height: 100vh; display: flex; flex-direction: column; }
.subscribe-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); }
.subscribe-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 2rem; }
.subscribe-title { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 0.75rem; }
.subscribe-subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 3rem; max-width: 500px; }
.subscribe-pricing { max-width: 900px; width: 100%; }
.subscribe-note { margin-top: 1.5rem; font-size: 0.82rem; color: var(--text-muted); text-align: center; }

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════════ */
#page-app { display: none; }
#page-app.active { display: flex; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform var(--transition-slow);
}
.sidebar-logo { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.5rem; margin-bottom: 2rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: rgba(184,243,105,0.1); color: var(--green-bright); }
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.sidebar-bottom { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.logout-btn:hover { background: rgba(248,113,113,0.1); color: var(--accent-red); }

.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu-btn { font-size: 1.3rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; }
.mobile-logo { display: flex; align-items: center; gap: 0.4rem; }
.mobile-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green-deep); color: var(--green-bright); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 49; }
.sidebar-overlay.show { display: block; }

.app-main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  padding: 2rem;
  overflow-y: auto;
}

/* TABS */
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.tab-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; }
.tab-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.25rem; }
.header-date { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; padding-top: 0.5rem; }

/* ── DASHBOARD ────────────────────────────────────────────── */
.dashboard-top { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; margin-bottom: 1.5rem; align-items: start; }
.insulin-score-card {
  background: linear-gradient(135deg, rgba(45,106,30,0.3), rgba(13,17,23,0.8));
  border: 1px solid rgba(184,243,105,0.2);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}
.score-card-left { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.score-card-left h3 { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); text-align: center; }
.big-score-ring { position: relative; width: 140px; height: 140px; }
.big-score-ring svg { width: 100%; height: 100%; }
.big-score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.big-score-num { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; color: var(--green-bright); }
.big-score-label { font-size: 0.7rem; color: var(--text-muted); }
.score-status { font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.8rem; border-radius: var(--radius-full); background: rgba(184,243,105,0.1); color: var(--green-bright); }
.score-card-right { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.score-detail { display: flex; flex-direction: column; gap: 0.2rem; }
.score-detail-label { font-size: 0.75rem; color: var(--text-muted); }
.score-detail-val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }

.quick-stats { display: flex; flex-direction: column; gap: 0.75rem; }
.quick-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}
.qs-icon { font-size: 1.5rem; }
.qs-info { display: flex; flex-direction: column; }
.qs-val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.qs-label { font-size: 0.72rem; color: var(--text-muted); }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.dash-card-header h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.dash-card-action { font-size: 0.8rem; color: var(--green-bright); background: none; border: none; cursor: pointer; }
.dash-card-action:hover { text-decoration: underline; }

.today-meals-list { display: flex; flex-direction: column; gap: 0.6rem; }
.today-meal-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.today-meal-row .meal-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(184,243,105,0.1);
  color: var(--green-bright);
  text-transform: capitalize;
  white-space: nowrap;
}
.today-meal-row .meal-name { flex: 1; color: var(--text-primary); }
.today-meal-row .meal-cals { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }

.timing-widget { display: flex; flex-direction: column; gap: 1rem; }
.timing-protocol-label { font-size: 0.8rem; font-weight: 700; color: var(--green-bright); text-transform: uppercase; letter-spacing: 0.05em; }
.timing-window-bar { position: relative; height: 12px; background: var(--bg-elevated); border-radius: 6px; overflow: hidden; }
.timing-window-fill { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green-bright)); border-radius: 6px; }
.timing-window-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }
.timing-meals-list { display: flex; flex-direction: column; gap: 0.5rem; }
.timing-meal-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; }
.timing-meal-time { font-weight: 700; color: var(--green-bright); min-width: 70px; }
.timing-meal-name { color: var(--text-primary); }
.timing-meal-desc { color: var(--text-muted); font-size: 0.75rem; }

.recovery-card { border-color: rgba(245,158,11,0.2); background: linear-gradient(135deg, rgba(245,158,11,0.05), var(--bg-card)); }
.recovery-step { display: flex; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.recovery-step:last-child { border-bottom: none; }
.recovery-priority { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); white-space: nowrap; align-self: flex-start; }
.priority-high { background: rgba(248,113,113,0.15); color: var(--accent-red); }
.priority-medium { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.priority-low { background: rgba(184,243,105,0.1); color: var(--green-bright); }
.recovery-action { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.recovery-reason { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.quick-log-form { display: flex; flex-direction: column; gap: 0.75rem; }
.quick-log-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* ── MEAL PLAN ────────────────────────────────────────────── */
.calorie-target-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(184,243,105,0.06);
  border: 1px solid rgba(184,243,105,0.15);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}
.target-note { color: var(--text-muted); font-size: 0.8rem; }
.weekly-plan-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.75rem; overflow-x: auto; }
.day-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-width: 140px;
  transition: var(--transition);
}
.day-plan-card:hover { border-color: var(--border-hover); }
.day-plan-card.today { border-color: var(--green-bright); background: rgba(184,243,105,0.04); }
.day-name { font-family: var(--font-display); font-weight: 800; font-size: 0.85rem; margin-bottom: 0.75rem; color: var(--green-bright); }
.day-meals { display: flex; flex-direction: column; gap: 0.5rem; }
.day-meal-item { font-size: 0.75rem; }
.day-meal-type { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.day-meal-name { color: var(--text-secondary); line-height: 1.3; }
.day-meal-cal { color: var(--text-muted); font-size: 0.7rem; }
.day-total-cals { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--text-muted); }

/* ── RECIPES ──────────────────────────────────────────────── */
.recipe-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-search { flex: 1; min-width: 200px; }
.filter-select { min-width: 140px; }
.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.recipe-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.recipe-img { width: 100%; height: 160px; object-fit: cover; }
.recipe-body { padding: 1rem; }
.recipe-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.recipe-cuisine { font-size: 0.72rem; font-weight: 700; color: var(--green-bright); text-transform: uppercase; letter-spacing: 0.05em; }
.recipe-gi-badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); }
.gi-low { background: rgba(184,243,105,0.15); color: var(--green-bright); }
.gi-medium { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.gi-high { background: rgba(248,113,113,0.15); color: var(--accent-red); }
.recipe-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; line-height: 1.3; }
.recipe-stats { display: flex; gap: 1rem; }
.recipe-stat { display: flex; flex-direction: column; }
.recipe-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.recipe-stat-label { font-size: 0.65rem; color: var(--text-muted); }
.recipe-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.75rem; }
.recipe-tag { font-size: 0.68rem; padding: 0.15rem 0.5rem; background: var(--bg-elevated); border-radius: var(--radius-full); color: var(--text-muted); }

/* ── FOOD TRACKER ─────────────────────────────────────────── */
.tracker-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; }
.tracker-add-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.tracker-add-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; }
.gi-guide { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.gi-badge { font-size: 0.72rem; padding: 0.25rem 0.6rem; border-radius: var(--radius-full); font-weight: 600; }
.quick-foods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.quick-food-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.quick-food-btn:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.qf-name { font-size: 0.8rem; color: var(--text-primary); display: block; }
.qf-cal { font-size: 0.7rem; color: var(--text-muted); }

.daily-summary-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.daily-summary-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; }
.macro-rings { display: flex; justify-content: space-around; margin-bottom: 1.5rem; }
.macro-item { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.macro-circle {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: conic-gradient(var(--color) calc(var(--pct) * 1%), var(--bg-elevated) 0);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  position: relative;
}
.macro-circle::before { content: ''; position: absolute; inset: 8px; background: var(--bg-card); border-radius: 50%; }
.macro-circle span { position: relative; z-index: 1; font-size: 0.75rem; }
.macro-label { font-size: 0.72rem; color: var(--text-muted); }
.calorie-progress { }
.cal-progress-header { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 0.4rem; }
.progress-bar-track { height: 8px; background: var(--bg-elevated); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green-bright)); border-radius: 4px; transition: width 0.5s ease; }

.food-log-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.food-log-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; }
.food-log-list { display: flex; flex-direction: column; gap: 0.5rem; }
.food-log-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.fli-type { font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); background: rgba(184,243,105,0.1); color: var(--green-bright); text-transform: capitalize; white-space: nowrap; }
.fli-name { flex: 1; color: var(--text-primary); }
.fli-cals { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.fli-gi { font-size: 0.7rem; padding: 0.15rem 0.4rem; border-radius: var(--radius-full); white-space: nowrap; }
.fli-delete { color: var(--text-muted); background: none; border: none; cursor: pointer; font-size: 0.9rem; opacity: 0.5; transition: var(--transition); }
.fli-delete:hover { opacity: 1; color: var(--accent-red); }
.date-picker { width: auto; }

/* ── EXERCISE ─────────────────────────────────────────────── */
.exercise-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.exercise-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover { border-color: var(--border-hover); color: var(--text-primary); }
.filter-pill.active { background: rgba(184,243,105,0.1); border-color: var(--green-bright); color: var(--green-bright); }
.exercise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.exercise-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.exercise-img { width: 100%; height: 140px; object-fit: cover; }
.exercise-body { padding: 1rem; }
.exercise-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.exercise-type { font-size: 0.72rem; font-weight: 700; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.05em; }
.exercise-level { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: var(--radius-full); }
.level-beginner { background: rgba(184,243,105,0.1); color: var(--green-bright); }
.level-intermediate { background: rgba(245,158,11,0.1); color: var(--accent-amber); }
.level-advanced { background: rgba(248,113,113,0.1); color: var(--accent-red); }
.exercise-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.exercise-desc { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.75rem; line-height: 1.4; }
.exercise-stats { display: flex; gap: 1rem; }
.exercise-stat { display: flex; flex-direction: column; }
.exercise-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 0.88rem; }
.exercise-stat-label { font-size: 0.65rem; color: var(--text-muted); }
.insulin-benefit { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; margin-top: 0.5rem; }
.benefit-very_high { color: var(--green-bright); }
.benefit-high { color: var(--green-mid); }
.benefit-medium { color: var(--accent-amber); }
.exercise-log-section h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1rem; }
.exercise-log-list { display: flex; flex-direction: column; gap: 0.5rem; }
.exercise-log-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.eli-icon { font-size: 1.2rem; }
.eli-info { flex: 1; }
.eli-name { font-weight: 600; color: var(--text-primary); }
.eli-meta { font-size: 0.75rem; color: var(--text-muted); }
.eli-cals { font-family: var(--font-display); font-weight: 700; color: var(--green-bright); }

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.progress-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ps-icon { font-size: 1.8rem; }
.ps-info { display: flex; flex-direction: column; }
.ps-val { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; }
.ps-label { font-size: 0.75rem; color: var(--text-muted); }
.progress-chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.progress-chart-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 160px; }
.bar-chart-col { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; flex: 1; }
.bar-chart-bar { width: 100%; background: linear-gradient(180deg, var(--green-bright), var(--green-deep)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.5s ease; }
.bar-chart-label { font-size: 0.68rem; color: var(--text-muted); }
.bar-chart-val { font-size: 0.7rem; color: var(--green-bright); font-weight: 600; }
.compliance-bar { display: flex; flex-direction: column; gap: 0.75rem; }
.compliance-row { display: flex; align-items: center; gap: 1rem; }
.compliance-label { font-size: 0.82rem; color: var(--text-secondary); min-width: 80px; }
.compliance-track { flex: 1; height: 10px; background: var(--bg-elevated); border-radius: 5px; overflow: hidden; }
.compliance-fill { height: 100%; background: linear-gradient(90deg, var(--green-deep), var(--green-bright)); border-radius: 5px; }
.compliance-pct { font-size: 0.8rem; font-weight: 700; color: var(--green-bright); min-width: 40px; text-align: right; }
.recent-activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.1rem; }
.activity-text { flex: 1; color: var(--text-secondary); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); }

/* ── MEAL TIMING ──────────────────────────────────────────── */
.timing-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.timing-protocol-card {
  background: linear-gradient(135deg, rgba(45,106,30,0.2), var(--bg-card));
  border: 1px solid rgba(184,243,105,0.2);
  border-radius: var(--radius-xl);
  padding: 2rem;
}
.protocol-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.protocol-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--green-bright); }
.protocol-window { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }
.protocol-badge { background: rgba(184,243,105,0.1); border: 1px solid rgba(184,243,105,0.2); color: var(--green-bright); font-size: 0.8rem; font-weight: 700; padding: 0.4rem 1rem; border-radius: var(--radius-full); }
.protocol-timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.timeline-item { display: flex; align-items: flex-start; gap: 1rem; }
.timeline-time { font-family: var(--font-display); font-weight: 700; color: var(--green-bright); min-width: 80px; font-size: 0.9rem; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-bright); margin-top: 5px; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-meal { font-weight: 600; font-size: 0.9rem; }
.timeline-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.timing-science-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; }
.timing-science-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.5rem; }
.science-points { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.science-point { display: flex; gap: 1rem; }
.sp-icon { font-size: 1.5rem; flex-shrink: 0; }
.sp-content h4 { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; }
.sp-content p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.avoid-foods-card { background: rgba(248,113,113,0.04); border: 1px solid rgba(248,113,113,0.15); border-radius: var(--radius-xl); padding: 2rem; }
.avoid-foods-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; color: var(--accent-red); }
.avoid-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.avoid-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: var(--bg-elevated); border-radius: var(--radius-md); font-size: 0.85rem; }
.avoid-icon { font-size: 1.2rem; }
.avoid-item span:nth-child(2) { flex: 1; color: var(--text-secondary); }

/* ── PROFILE ──────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
.profile-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; }
.profile-avatar-section { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--green-deep); color: var(--green-bright); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; flex-shrink: 0; }
.profile-avatar-section h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.profile-email { color: var(--text-muted); font-size: 0.85rem; }
.subscription-badge { display: inline-block; margin-top: 0.4rem; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); background: rgba(184,243,105,0.1); color: var(--green-bright); text-transform: uppercase; letter-spacing: 0.05em; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.checkbox-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.checkbox-item input[type="checkbox"] { accent-color: var(--green-bright); width: 14px; height: 14px; }
.subscription-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1.5rem; height: fit-content; }
.subscription-card h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 1.25rem; }
.subscription-details { display: flex; flex-direction: column; gap: 0.75rem; }
.sub-detail { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.sub-detail:last-child { border-bottom: none; }
.sub-detail-label { color: var(--text-muted); }
.sub-detail-val { font-weight: 600; color: var(--text-primary); }

/* ── MODALS ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-hover); }
.modal-recipe-img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.modal-recipe-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.modal-recipe-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.modal-meta-badge { font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: var(--radius-full); background: var(--bg-elevated); color: var(--text-secondary); }
.modal-nutrition { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.modal-nut-item { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 0.75rem; text-align: center; }
.modal-nut-val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; color: var(--green-bright); }
.modal-nut-label { font-size: 0.7rem; color: var(--text-muted); }
.modal-section-title { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; margin-top: 1.25rem; }
.modal-ingredients { display: flex; flex-direction: column; gap: 0.4rem; }
.modal-ingredient { font-size: 0.88rem; color: var(--text-secondary); padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.modal-ingredient:last-child { border-bottom: none; }
.modal-instructions { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }
.modal-science { background: rgba(184,243,105,0.06); border: 1px solid rgba(184,243,105,0.15); border-radius: var(--radius-md); padding: 1rem; margin-top: 1rem; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }
.modal-science strong { color: var(--green-bright); }
.modal-log-btn { margin-top: 1.5rem; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .hero { grid-template-columns: 1fr; padding: 7rem 2rem 3rem; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-card--large { grid-column: span 1; }
  .weekly-plan-grid { grid-template-columns: repeat(4, 1fr); }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .landing-nav .nav-links, .landing-nav .nav-actions { display: none; }
  .nav-hamburger { display: flex; }
  .features-section, .science-section, .pricing-section { padding: 4rem 1.5rem; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .science-cards { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .dashboard-top { grid-template-columns: 1fr; }
  .quick-stats { flex-direction: row; flex-wrap: wrap; }
  .quick-stat-card { min-width: 140px; flex: 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .tracker-layout { grid-template-columns: 1fr; }
  .science-points { grid-template-columns: 1fr; }
  .avoid-grid { grid-template-columns: 1fr; }
  .progress-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; padding: 5rem 1rem 1rem; }
  .mobile-topbar { display: flex; }
  .insulin-score-card { flex-direction: column; text-align: center; }
  .score-card-right { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero { padding: 6rem 1rem 2rem; }
  .hero-title { font-size: 2.2rem; }
  .hero-stats { gap: 1rem; }
  .features-grid { grid-template-columns: 1fr; }
  .weekly-plan-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .modal-nutrition { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-stats-grid { grid-template-columns: 1fr; }
  .tab-header { flex-direction: column; }
  .recipe-filters { flex-direction: column; }
  .filter-select, .filter-search { width: 100%; }
}