/* ════════════════════════════════════════════════════════════
   JEDILNIK — DESIGN SYSTEM v2
   ════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@500;600;700;800&display=swap');

/* ── 1. Design Tokens ─────────────────────────────────────── */
/* Palette: vivid emerald / gold / indigo / red — a saturated, energetic
   palette matching this app's own gamification layer (XP, streaks,
   achievements) rather than a quiet muted one. Token names kept as-is
   so every existing var(--green-600) etc. call site repaints without
   being touched. */
:root {
  /* Emerald (brand / nutrition) */
  --green-50:  #e6faf0;
  --green-100: #c3f3dc;
  --green-200: #8fe6bc;
  --green-400: #34d399;
  --green-600: #10b981;
  --green-700: #059669;
  --green-800: #065f46;

  /* Gold (Pro / premium / warning) */
  --amber-50:  #fff8e1;
  --amber-100: #ffecb3;
  --amber-200: #ffdd7a;
  --amber-400: #ffc233;
  --amber-600: #f5a200;
  --amber-700: #cc8400;
  --amber-800: #996200;

  /* Electric indigo (smart coach / info / secondary brand) */
  --blue-50:   #eef2ff;
  --blue-100:  #d9e2ff;
  --blue-600:  #4f6bff;
  --blue-800:  #2f3fbf;

  /* Clean red (danger) */
  --red-50:    #ffebee;
  --red-100:   #ffcdd6;
  --red-600:   #ef4444;
  --red-800:   #b91c1c;

  /* Cool-tinted neutrals (crisp, not warm-beige and not flat gray) */
  --gray-50:   #f7f9fc;
  --gray-100:  #eef1f7;
  --gray-150:  #e4e9f2;
  --gray-200:  #d8deea;
  --gray-300:  #bac3d6;
  --gray-400:  #8793ac;
  --gray-500:  #626e88;
  --gray-600:  #47526b;
  --gray-700:  #323b4f;
  --gray-800:  #202636;
  --gray-900:  #12151f;

  /* Display face — used sparingly, for hero text and key figures only */
  --f-display: 'Outfit', 'Inter', system-ui, sans-serif;

  /* Semantic aliases */
  --c-primary:      var(--green-600);
  --c-primary-dark: var(--green-700);
  --c-primary-bg:   var(--green-50);
  --c-primary-muted:var(--green-100);

  --c-text:    var(--gray-900);
  --c-text-2:  var(--gray-600);
  --c-text-3:  var(--gray-400);

  --c-border:  var(--gray-200);
  --c-surface: #ffffff;
  --c-bg:      var(--gray-50);

  /* Bootstrap theming hooks — repaint every bg-*/btn-*/text-* utility
     class to the same vivid emerald/gold/indigo/red palette, so the
     custom tokens above and Bootstrap's own defaults never disagree. */
  --bs-primary:        var(--blue-600);
  --bs-primary-rgb:    79, 107, 255;
  --bs-success:        var(--green-600);
  --bs-success-rgb:    16, 185, 129;
  --bs-warning:        var(--amber-600);
  --bs-warning-rgb:    245, 162, 0;
  --bs-danger:         var(--red-600);
  --bs-danger-rgb:     239, 68, 68;
  --bs-info:           #06b6d4;
  --bs-info-rgb:       6, 182, 212;
  --bs-secondary:      var(--gray-500);
  --bs-secondary-rgb:  98, 110, 136;
  --bs-dark:           var(--gray-800);
  --bs-dark-rgb:       32, 38, 54;
  --bs-light:          var(--gray-100);
  --bs-light-rgb:      238, 241, 247;
  --bs-body-color:     var(--c-text);
  --bs-body-bg:        var(--c-bg);
  --bs-border-color:   var(--c-border);

  --bs-success-text-emphasis:   var(--green-800);
  --bs-success-bg-subtle:       var(--green-50);
  --bs-success-border-subtle:   var(--green-200);
  --bs-warning-text-emphasis:   var(--amber-800);
  --bs-warning-bg-subtle:       var(--amber-50);
  --bs-warning-border-subtle:   var(--amber-200);
  --bs-danger-text-emphasis:    var(--red-800);
  --bs-danger-bg-subtle:        var(--red-50);
  --bs-danger-border-subtle:    var(--red-100);
  --bs-info-text-emphasis:      #0e7490;
  --bs-info-bg-subtle:          #ecfeff;
  --bs-info-border-subtle:      #a5f3fc;
  --bs-primary-text-emphasis:   var(--blue-800);
  --bs-primary-bg-subtle:       var(--blue-50);
  --bs-primary-border-subtle:   var(--blue-100);
  --bs-secondary-text-emphasis: var(--gray-700);
  --bs-secondary-bg-subtle:     var(--gray-100);
  --bs-secondary-border-subtle: var(--gray-200);

  /* Shape */
  --r-xs: 6px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.03);
  --shadow-md: 0 8px 24px rgba(0,0,0,.10), 0 3px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.13), 0 5px 15px rgba(0,0,0,.06);

  /* Motion */
  --t-fast: 120ms ease;
  --t:      180ms ease;
  --t-slow: 280ms ease;
}

/* ── 2. Base Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  margin-bottom: 0;
  line-height: 1.6;
}

/* ── 3. Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}

h1 { font-size: 2rem;     letter-spacing: -0.04em; }
h2 { font-size: 1.5rem;   letter-spacing: -0.03em; }
h3 { font-size: 1.25rem;  letter-spacing: -0.02em; }
h4 { font-size: 1.0625rem;}
h5 { font-size: 0.9375rem;}
h6 { font-size: 0.875rem; font-weight: 600; }

p { margin-bottom: 0.75rem; }

.lead {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--c-text-2);
  line-height: 1.65;
}

.text-muted { color: var(--c-text-2) !important; }

/* ── 4. Navigation ──────────────────────────────────────────── */
.app-nav {
  background: var(--c-surface) !important;
  border-bottom: 1px solid var(--c-border);
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow var(--t);
}
.app-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.app-nav .navbar-brand {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--c-primary) !important;
  padding: 0.875rem 0;
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
}
.app-nav .navbar-brand:hover { color: var(--c-primary-dark) !important; }

.app-nav .nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-2) !important;
  padding: 0.875rem 0.625rem !important;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.app-nav .nav-link:hover { color: var(--c-text) !important; }
.app-nav .nav-link.active {
  color: var(--c-primary) !important;
  border-bottom-color: var(--c-primary);
}

/* Dropdown */
.app-nav .dropdown-toggle::after { display: none; }
.app-nav .dropdown-toggle { padding-right: 1.125rem !important; }
.app-nav .dropdown-toggle::before {
  content: '';
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  border-top: 4px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.55;
}
.app-nav .dropdown-toggle { position: relative; }

.app-nav .dropdown-menu {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  padding: 0.375rem;
  background: var(--c-surface);
  margin-top: 0.25rem !important;
  min-width: 13rem;
}
.app-nav .dropdown-item {
  border-radius: var(--r-xs);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  color: var(--c-text-2);
  transition: background var(--t-fast), color var(--t-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.app-nav .dropdown-item:hover {
  background: var(--gray-100);
  color: var(--c-text);
}

.app-nav .navbar-toggler {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.375rem 0.5rem;
  color: var(--c-text-2);
}
.app-nav .navbar-toggler:focus { box-shadow: none; outline: none; }
.app-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(75,85,99,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.25rem;
  height: 1.25rem;
}

/* Notification bell (in nav) */
.app-nav .notification-bell .nav-link { border-bottom: none !important; }

/* ── 5. Layout ──────────────────────────────────────────────── */
.app-content {
  padding-top: 1.75rem;
  padding-bottom: 3.5rem;
  min-height: calc(100vh - 57px - 53px);
}

.app-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 0.875rem 0;
  font-size: 0.8125rem;
  color: var(--c-text-3);
}

/* ── 6. Cards ───────────────────────────────────────────────── */
.card {
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  background: var(--c-surface);
}
.card-header {
  border-bottom: 1px solid var(--c-border);
  background: transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.875rem 1.125rem;
  border-top-left-radius: var(--r) !important;
  border-top-right-radius: var(--r) !important;
  color: var(--c-text);
}
.card-body  { padding: 1.125rem; }
.card-footer {
  border-top: 1px solid var(--c-border);
  background: transparent;
  padding: 0.875rem 1.125rem;
  border-bottom-left-radius: var(--r) !important;
  border-bottom-right-radius: var(--r) !important;
}

/* Interactive cards */
.card-interactive {
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t);
}
.card-interactive:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* ── 7. Stat Cards ──────────────────────────────────────────── */
/* Raised 3D tile, same family as the icon badges and buttons: a solid neutral
   "edge" underneath gives the whole card thickness, not just the icon inside it. */
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1.25rem 1.375rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 4px 0 var(--gray-200), 0 1px 2px rgba(16,24,40,.04), 0 12px 24px -10px rgba(16,24,40,.18);
}
/* Same raised edge as a reusable, visual-only utility — add alongside `card` on any
   other page's stat/number tile without needing its layout to match `.stat-card`.
   Deliberately NOT applied to `.card` globally (forms/tables/admin pages don't want
   this) — opt in per tile instead. */
.card-3d {
  box-shadow: 0 4px 0 var(--gray-200), 0 1px 2px rgba(16,24,40,.04), 0 12px 24px -10px rgba(16,24,40,.18);
}
.card-3d.card-interactive:hover {
  box-shadow: 0 5px 0 var(--gray-200), 0 1px 2px rgba(16,24,40,.04), 0 16px 28px -8px rgba(16,24,40,.22);
  transform: translateY(-2px);
}
/* Icon tiles — raised 3D squares, not flat tinted circles: a solid-color "side"
   (the --_lip box-shadow layer) gives the tile real thickness, like a tiny cube
   sitting on the page, matching the chunky 3D buttons elsewhere on the site.
   Each color variant only needs to set --_bg/--_lip; the shape/shadow recipe
   lives once on the base class so it stays consistent everywhere it's used. */
.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  line-height: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--_bg, var(--gray-100)) 100%, white 25%), var(--_bg, var(--gray-100)));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 3px 0 var(--_lip, var(--gray-300)),
    0 7px 10px -3px rgba(16,24,40,.28);
}
.stat-icon--blue  { --_bg: var(--blue-100);  --_lip: #a8b8ff; color: var(--blue-600); }
.stat-icon--green { --_bg: var(--green-100); --_lip: #6fe3b0; color: var(--green-700); }
.stat-icon--amber { --_bg: var(--amber-100); --_lip: #ffd166; color: var(--amber-700); }
.stat-icon--gray  { --_bg: var(--gray-100);  --_lip: var(--gray-300); color: var(--gray-600); }
.stat-icon--red   { --_bg: var(--red-100);   --_lip: #ff9a9a; color: var(--red-600); }
.stat-content { flex: 1; min-width: 0; }
.stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-text-2);
  margin-bottom: 0.25rem;
}
.stat-value {
  font-family: var(--f-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.stat-unit {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-text-3);
}
.stat-delta {
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
}
.stat-delta.positive { color: var(--green-600); }
.stat-delta.negative { color: var(--red-600); }

/* ── 8. Buttons ─────────────────────────────────────────────── */
.btn {
  font-weight: 600;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.btn-lg {
  padding: 0.6875rem 1.375rem;
  font-size: 0.9375rem;
  border-radius: var(--r-sm);
}
.btn-sm {
  padding: 0.3125rem 0.6875rem;
  font-size: 0.8125rem;
  border-radius: var(--r-xs);
}

/* Primary — chunky "pressable" 3D button: a solid lower lip simulates thickness,
   which compresses on :active like a real button being pushed in. */
.btn-success, .btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 0 var(--c-primary-dark), 0 8px 16px -4px rgba(16,185,129,.4);
  transform: translateY(0);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-success:hover, .btn-primary:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 0 var(--c-primary-dark), 0 12px 20px -4px rgba(16,185,129,.45);
  transform: translateY(-1px);
}
.btn-success:active, .btn-primary:active {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 var(--c-primary-dark), 0 2px 6px rgba(16,185,129,.3);
}
.btn-success:focus, .btn-primary:focus { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 0 var(--c-primary-dark), 0 0 0 3px rgba(16,185,129,.25); }

/* Outline success */
.btn-outline-success {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: transparent;
}
.btn-outline-success:hover {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Outline secondary */
.btn-outline-secondary {
  color: var(--c-text-2);
  border-color: var(--c-border);
  background: var(--c-surface);
}
.btn-outline-secondary:hover {
  color: var(--c-text);
  background: var(--gray-100);
  border-color: var(--gray-300);
}

/* Warning / Pro — same chunky 3D treatment as the primary CTA */
.btn-warning {
  background: var(--amber-600);
  border-color: var(--amber-600);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 0 var(--amber-800), 0 8px 16px -4px rgba(245,162,0,.4);
  transform: translateY(0);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-warning:hover {
  background: var(--amber-600);
  border-color: var(--amber-600);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 0 var(--amber-800), 0 12px 20px -4px rgba(245,162,0,.45);
  transform: translateY(-1px);
}
.btn-warning:active {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 var(--amber-800), 0 2px 6px rgba(245,162,0,.3);
}
.btn-outline-warning {
  color: var(--amber-700);
  border-color: var(--amber-600);
}
.btn-outline-warning:hover {
  background: var(--amber-600);
  border-color: var(--amber-600);
  color: #fff;
}

/* Outline danger */
.btn-outline-danger:hover { transform: translateY(-1px); }

/* ── 9. Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  font-size: 0.9375rem;
  padding: 0.5625rem 0.875rem;
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-family: inherit;
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
  outline: none;
}
.form-control::placeholder { color: var(--c-text-3); }

textarea.form-control {
  resize: vertical;
  min-height: 5rem;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--c-text-2);
  margin-bottom: 0.375rem;
}
.form-text {
  font-size: 0.8125rem;
  color: var(--c-text-3);
  margin-top: 0.3rem;
}
.form-check-input:checked {
  background-color: var(--c-primary);
  border-color: var(--c-primary);
}
.form-check-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.form-check-label { font-size: 0.9rem; }

/* Validation */
.text-danger { color: var(--red-600) !important; }
.is-invalid { border-color: var(--red-600) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15) !important; }

/* ── 10. Badges ─────────────────────────────────────────────── */
.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.015em;
  border-radius: 5px;
  padding: 0.28em 0.6em;
}

/* Richer semantic badges */
.badge.bg-success     { background: var(--c-primary) !important; }
.badge.bg-secondary   { background: var(--gray-200) !important; color: var(--gray-700) !important; }
.badge.bg-warning     { background: var(--amber-100) !important; color: var(--amber-800) !important; }
.badge.bg-warning.text-dark { color: var(--amber-800) !important; }
.badge.bg-info        { background: var(--blue-100) !important; color: var(--blue-800) !important; }
.badge.bg-danger      { background: var(--red-100) !important; color: var(--red-800) !important; }
.badge.bg-primary     { background: var(--blue-600) !important; }

/* Plan-specific */
.badge-free    { background: var(--gray-100);   color: var(--gray-600); font-weight: 600; }
.badge-premium { background: var(--green-100);  color: var(--green-800); font-weight: 600; }
.badge-pro     { background: var(--amber-100);  color: var(--amber-800); font-weight: 600; }

/* ── 11. Alerts ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--r-sm);
  border: 0;
  border-left: 3px solid;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
}
.alert-success { background: var(--green-50);   color: var(--green-800); border-color: var(--green-600); }
.alert-info    { background: var(--blue-50);    color: var(--blue-800);  border-color: var(--blue-600); }
.alert-warning { background: var(--amber-50);   color: var(--amber-800); border-color: var(--amber-600); }
.alert-danger  { background: var(--red-50);     color: var(--red-800);   border-color: var(--red-600); }
.alert-link    { color: inherit; font-weight: 700; }

/* ── 12. List Groups ────────────────────────────────────────── */
.list-group-item {
  border-color: var(--c-border);
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  color: var(--c-text);
  transition: background var(--t-fast);
}
.list-group-item-action:hover { background: var(--gray-50); }
.list-group-item:first-child  {
  border-top-left-radius: var(--r) !important;
  border-top-right-radius: var(--r) !important;
}
.list-group-item:last-child {
  border-bottom-left-radius: var(--r) !important;
  border-bottom-right-radius: var(--r) !important;
}

/* ── 13. Tables ─────────────────────────────────────────────── */
.table {
  font-size: 0.9rem;
  color: var(--c-text);
}
.table th {
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border);
  padding: 0.625rem 0.875rem;
}
.table td { padding: 0.75rem 0.875rem; border-color: var(--c-border); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--gray-50); }

/* ── 14. Modals ─────────────────────────────────────────────── */
.modal-content {
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--c-border);
  padding: 1.125rem 1.375rem;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-footer {
  border-top: 1px solid var(--c-border);
  padding: 1rem 1.375rem;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal-body { padding: 1.375rem; }
.modal-title { font-weight: 700; font-size: 1.0625rem; }
.btn-close:focus { box-shadow: none; }

/* ── 15. Page Header ────────────────────────────────────────── */
.page-hdr { margin-bottom: 1.5rem; }
.page-hdr h2 { margin-bottom: 0.25rem; }
.page-hdr p  { color: var(--c-text-2); margin: 0; font-size: 0.9375rem; }

/* Section heading */
.section-hdr {
  font-family: var(--f-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 0.75rem;
}

/* ── 16. Landing Page ───────────────────────────────────────── */
.hero {
  background: linear-gradient(165deg, var(--green-50) 0%, var(--c-surface) 55%);
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(22,163,74,.07) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.5rem, 5.5vw, 3.75rem);
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 1rem;
}
.hero-highlight {
  position: relative;
  display: inline-block;
  z-index: 0;
}
.hero-highlight::before {
  content: '';
  position: absolute;
  left: -0.15em;
  right: -0.15em;
  bottom: 0.08em;
  height: 0.38em;
  background: var(--green-200);
  border-radius: 0.2em;
  z-index: -1;
  transform: rotate(-1deg);
}

@keyframes hero-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
.hero-cta-pulse { animation: hero-pulse 2.2s ease-in-out infinite; }
.hero-sub {
  font-size: 1.125rem;
  color: var(--c-text-2);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.feature-card {
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 1.75rem;
  height: 100%;
  transition: box-shadow var(--t), transform var(--t);
  transform: perspective(800px) rotateX(0) rotateY(0) translateY(0);
  transform-style: preserve-3d;
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: perspective(800px) rotateX(4deg) rotateY(-4deg) translateY(-4px);
}
@media (prefers-reduced-motion: reduce) {
  .feature-card:hover { transform: translateY(-2px); }
}
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: 1rem;
  --_bg: var(--green-100);
  --_lip: #6fe3b0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--_bg) 100%, white 25%), var(--_bg));
  color: var(--c-primary-dark);
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 3px 0 var(--_lip),
    0 7px 10px -3px rgba(16,24,40,.28);
}
.feature-icon--blue   { --_bg: var(--blue-100);  --_lip: #a8b8ff; color: var(--blue-800); }
.feature-icon--amber  { --_bg: var(--amber-100); --_lip: #ffd166; color: var(--amber-800); }
.feature-icon--red    { --_bg: var(--red-100);   --_lip: #ff9a9a; color: var(--red-800); }

/* ── 17. Subscription cards ─────────────────────────────────── */
.pricing-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
  height: 100%;
}
.pricing-card:hover { box-shadow: var(--shadow-md); }
.pricing-card.recommended {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary), var(--shadow);
  transform: translateY(-3px);
}

/* ── 18. Misc components ────────────────────────────────────── */
a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-primary-dark); }

hr { border-color: var(--c-border); opacity: 1; }

.divider { height: 1px; background: var(--c-border); border: 0; margin: 1.5rem 0; }

/* Accordion */
.accordion-button:not(.collapsed) { color: var(--c-primary); background: var(--green-50); box-shadow: none; }
.accordion-button:focus            { box-shadow: none; }
.accordion-item                    { border-color: var(--c-border); }

/* Progress bar */
.progress { border-radius: var(--r-xl); background: var(--gray-100); height: 6px; }
.progress-bar { background: var(--c-primary); border-radius: var(--r-xl); }

/* Nav tabs */
.nav-tabs .nav-link          { color: var(--c-text-2); font-weight: 500; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.nav-tabs .nav-link.active   { color: var(--c-text); font-weight: 600; border-color: var(--c-border) var(--c-border) var(--c-surface); }
.nav-tabs .nav-link:hover    { color: var(--c-text); }
.nav-tabs                    { border-color: var(--c-border); }

/* Notification bell */
.notification-dot {
  position: absolute;
  top: 0.5rem;
  right: 0.25rem;
  width: 8px;
  height: 8px;
  background: var(--red-600);
  border-radius: 50%;
  border: 2px solid var(--c-surface);
}

/* Coach card accent variants */
.coach-accent-danger      { border-left: 3px solid var(--red-600); }
.coach-accent-info        { border-left: 3px solid var(--blue-600); }
.coach-accent-success     { border-left: 3px solid var(--c-primary); }
.coach-accent-warning     { border-left: 3px solid var(--amber-600); }
.coach-accent-locked      { border-left: 3px solid var(--gray-200); }

/* Dev mode banner */
.dev-banner {
  background: repeating-linear-gradient(
    -45deg,
    rgba(220,38,38,.08),
    rgba(220,38,38,.08) 10px,
    rgba(220,38,38,.04) 10px,
    rgba(220,38,38,.04) 20px
  );
  border: 1px solid var(--red-100);
  border-left: 3px solid var(--red-600);
  border-radius: var(--r-sm);
  color: var(--red-800);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--c-text-2);
}
.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--green-100), var(--green-50) 70%);
  color: var(--c-primary-dark);
  font-size: 2rem;
}
.empty-state h5 { color: var(--c-text-2); font-weight: 600; margin-bottom: 0.5rem; }
.empty-state p  { font-size: 0.9rem; margin-bottom: 1.25rem; }

/* Action button group */
.action-group {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Preference badge variants */
.pref-allergy { background: var(--red-100); color: var(--red-800); }
.pref-unwanted { background: var(--amber-100); color: var(--amber-800); }
.pref-avoid { background: var(--gray-100); color: var(--gray-700); }
.pref-preferred { background: var(--green-100); color: var(--green-800); }

/* ── 19. Transitions & hovers ───────────────────────────────── */
.hover-lift {
  transition: transform var(--t), box-shadow var(--t);
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── 20. Print ──────────────────────────────────────────────── */
@media print {
  header, footer, .no-print { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .list-group-item { border: none !important; padding: 2px 0 !important; }
  body { font-size: 11pt; background: white; color: black; -webkit-print-color-adjust: exact; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── 21. Responsive ─────────────────────────────────────────── */
@media (max-width: 576px) {
  .app-content { padding-top: 1.25rem; padding-bottom: 2.5rem; }
  .card-body    { padding: 0.875rem; }
  .card-header  { padding: 0.75rem 0.875rem; }
  .stat-card    { padding: 1rem; }
  .stat-value   { font-size: 1.375rem; }
  h2 { font-size: 1.375rem; }
  .btn-lg { padding: 0.625rem 1.125rem; font-size: 0.9rem; }
}

@media (max-width: 991px) {
  .app-nav .nav-link { padding: 0.625rem 0.75rem !important; border-bottom: none; }
  .app-nav .nav-link.active { background: var(--green-50); color: var(--c-primary) !important; border-radius: var(--r-xs); }
  .app-nav .navbar-collapse { border-top: 1px solid var(--c-border); padding: 0.5rem 0; }
}

/* ── 22. Dark Mode ──────────────────────────────────────────── */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.35rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  color: var(--c-text-2);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.theme-toggle-btn:hover { background: var(--gray-100); }
.theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-dark  { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: inline; }

[data-bs-theme="dark"] {
  --c-surface: #1c1f2e;
  --c-bg:      #13151f;
  --c-border:  rgba(255,255,255,0.09);
  --c-text:    #f1f5f9;
  --c-text-2:  #94a3b8;
  --c-text-3:  #64748b;
  --c-primary-bg: rgba(16,185,129,0.12);
  --c-primary-muted: rgba(16,185,129,0.18);
  --green-50:  rgba(16,185,129,0.1);
  --green-100: rgba(16,185,129,0.18);
  --blue-50:   rgba(79,107,255,0.1);
  --blue-100:  rgba(79,107,255,0.18);
  --amber-50:  rgba(245,162,0,0.1);
  --amber-100: rgba(245,162,0,0.18);
  --red-50:    rgba(239,68,68,0.1);
  --red-100:   rgba(239,68,68,0.18);
  --gray-50:   #1a1d2b;
  --gray-100:  #22273a;
  --gray-150:  #2a2f45;
  --gray-200:  #333854;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.2);
}

[data-bs-theme="dark"] .app-nav { background: var(--c-surface) !important; }
[data-bs-theme="dark"] .app-nav .nav-link.active {
  background: rgba(22,163,74,0.12);
  color: var(--c-primary) !important;
}
[data-bs-theme="dark"] .app-nav .dropdown-menu { background: var(--c-surface); }
[data-bs-theme="dark"] .app-nav .dropdown-item:hover { background: var(--gray-100); }
[data-bs-theme="dark"] .theme-toggle-btn:hover { background: var(--gray-100); }
[data-bs-theme="dark"] .progress { background: var(--gray-200); }
[data-bs-theme="dark"] .notification-dot { border-color: var(--c-surface); }

/* ── 23. Dashboard widgets ──────────────────────────────────── */
.quote-card {
  background: linear-gradient(135deg, var(--green-700), var(--green-800));
  color: #fff;
  border: none;
}
.calorie-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.calorie-ring-svg { transform: rotate(-90deg); overflow: visible; }
.calorie-ring-track { fill: none; stroke: var(--gray-200); stroke-width: 10; }
.calorie-ring-fill  { fill: none; stroke: var(--green-600); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }
[data-bs-theme="dark"] .calorie-ring-track { stroke: var(--gray-200); }
.water-progress { height: 8px; border-radius: var(--r-xl); background: var(--gray-100); }
.water-progress-bar { border-radius: var(--r-xl); background: #0ea5e9; transition: width 0.4s ease; }

/* ── 24. Refresh additions (icons, type/spacing scale, motion, mockups) ── */

/* Bootstrap Icons, vendored inline via Html.Icon() — the vendored SVGs ship fixed
   width="16" height="16" attributes; override with 1em so each icon scales with its
   surrounding font-size by default, and colors via `color` (fill="currentColor"). */
.bi { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; flex-shrink: 0; }
.icon-sm { width: 0.875em !important; height: 0.875em !important; }
.icon-lg { width: 1.5em   !important; height: 1.5em   !important; }
.icon-xl { width: 2rem    !important; height: 2rem    !important; }

:root {
  /* Type scale — for new/refreshed markup; existing h1-h6 rules are untouched. */
  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1.0625rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  clamp(1.75rem, 3vw, 2.25rem);
  --fs-hero: clamp(2.25rem, 5vw, 3.25rem);

  /* Spacing scale — for new/refreshed markup; existing spacing is untouched. */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
}

/* Scroll-reveal: fade + rise, driven by reveal.js (IntersectionObserver). */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Stagger-in for card grids — same mechanics, incremented delay per direct child. */
.stagger > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.stagger.is-visible > * { opacity: 1; transform: none; }
.stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger.is-visible > *:nth-child(2) { transition-delay: 60ms; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 120ms; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 180ms; }
.stagger.is-visible > *:nth-child(5) { transition-delay: 240ms; }
.stagger.is-visible > *:nth-child(6) { transition-delay: 300ms; }
.stagger.is-visible > *:nth-child(n+7) { transition-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > * {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Phone mockup — pure CSS device frame for real app screenshots (landing page only).
   Posed in real 3D (perspective + rotateX/Y) rather than flat-frontal, with a ground
   shadow to sell the depth and an optional mouse-tracked tilt (see reveal.js). */
.phone-mockup-stage {
  perspective: 1400px;
  padding: 2rem 0;
}
.phone-mockup-float {
  width: fit-content;
  margin: 0 auto;
  animation: phone-float 5s ease-in-out infinite;
}
@keyframes phone-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.phone-mockup-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  transform-style: preserve-3d;
  transform: rotateY(-10deg) rotateX(5deg);
  transition: transform 0.2s ease-out;
}
.phone-mockup-wrap::after {
  content: '';
  position: absolute;
  left: 8%;
  right: -4%;
  bottom: -1.5rem;
  height: 2.5rem;
  background: radial-gradient(ellipse 70% 100% at 50% 50%, rgba(16,24,40,.35), transparent 75%);
  transform: translateZ(-40px);
  filter: blur(2px);
}
.phone-mockup {
  position: relative;
  width: 260px;
  max-width: 78vw;
  aspect-ratio: 9 / 19.5;
  border-radius: 2.25rem;
  background: #0d0f14;
  padding: 10px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.06), 24px 32px 48px -12px rgba(16,24,40,.45);
  margin: 0 auto;
}
.phone-mockup__screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 1.6rem;
  display: block;
  background: var(--c-bg);
}
.phone-mockup__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 18px;
  background: #0d0f14;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .phone-mockup-float { animation: none; }
  .phone-mockup-wrap  { transition: none; }
}
