/* ==========================================================================
   JENNYS NÄHRSTOFFE - SCIENTIFIC WELLNESS DESIGN SYSTEM
   Modern, klinisch-präzise Ästhetik & wissenschaftlich fundiertes Layout
   ========================================================================== */

:root {
  /* Helle, wissenschaftliche & neutrale Farbpalette */
  --bg-app: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-input: #FFFFFF;

  /* Neutrale Graustufen für Text & Linien */
  --border-color: #E2E8F0;
  --border-color-hover: #CBD5E1;
  --border-color-focus: #0F172A;

  --text-main: #0F172A;       /* Tiefes, klares Slate-Schwarz für Überschriften & Zahlen */
  --text-body: #334155;       /* Gut lesbares Slate-Grau für Fließtext */
  --text-muted: #64748B;      /* Sekundäres Slate-Grau für Labels */
  --text-subtle: #94A3B8;     /* Zartes Grau für Fußnoten */

  /* Wissenschaftliche Status- & Akzentfarben */
  --accent-slate: #0F172A;    /* Dark Navy/Slate für aktive Filter & Buttons */
  
  --emerald: #059669;         /* Optimaler Versorgungsstatus */
  --emerald-bg: #ECFDF5;
  --emerald-border: #A7F3D0;

  --amber: #D97706;           /* Hochdosierter Status / Warnung */
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;

  --cyan: #0284C7;            /* Dosierungs-Pills */
  --cyan-bg: #F0F9FF;
  --cyan-border: #BAE6FD;

  --rose-soft: #BE185D;
  --rose-soft-bg: #FDF2F8;

  /* Typografie */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radien & Schatten */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* App Container Layout */
.app-layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ==========================================================================
   TOP HERO HEADER
   ========================================================================== */

.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-subtle);
  position: sticky;
  top: 16px;
  z-index: 40;
  transition: all var(--transition-smooth);
}

.app-header.is-scrolled {
  padding: 14px 24px;
  box-shadow: var(--shadow-hover);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

/* Left Brand Block */
.header-brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.badge-routine {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.jenny-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.15;
  transition: font-size var(--transition-fast);
}

.app-header.is-scrolled .page-title {
  font-size: 20px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.4;
  transition: opacity var(--transition-fast);
}

.app-header.is-scrolled .page-subtitle {
  display: none;
}

/* 3-Stat KPI Summary Box */
.stats-summary-widget {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-top: 14px;
  gap: 16px;
  transition: margin-top var(--transition-fast);
}

.app-header.is-scrolled .stats-summary-widget {
  margin-top: 8px;
  padding: 6px 14px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-num.highlight-stat {
  color: var(--emerald);
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 1px;
}

.stat-divider {
  width: 1px;
  height: 26px;
  background: var(--border-color);
}

/* Right Controls Block */
.header-controls-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.dosage-switcher-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.switcher-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.switcher-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.switcher-heading {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dosage-mode-switch-wrap {
  display: inline-flex;
  padding: 3.5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  gap: 4px;
}

.dosage-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  user-select: none;
}

.dosage-switch-btn:hover {
  color: var(--text-main);
}

.dosage-switch-btn.active {
  background: var(--accent-slate);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.switch-icon {
  font-size: 14px;
}

.switch-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.switch-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.switch-sub {
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.8;
}

.active-mode-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.active-mode-caption strong {
  color: var(--text-main);
}

.app-header.is-scrolled .active-mode-caption {
  display: none;
}

/* ==========================================================================
   2-COLUMN DASHBOARD GRID
   ========================================================================== */

.dashboard-body {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 28px;
  align-items: start;
}

/* Section Header Typography */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.count-pill {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   LEFT COLUMN: TÄGLICHE SUPPLEMENTS
   ========================================================================== */

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Daytime Filter Tabs */
.time-filter-row {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-full);
}

.time-pill {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.time-pill:hover {
  color: var(--text-main);
}

.time-pill.active {
  background: var(--accent-slate);
  color: #FFFFFF;
}

/* Product Cards Stack */
.supplements-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.product-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.product-card.is-paused {
  opacity: 0.55;
  background: #F8FAFC;
}

.product-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Square 60x60 Product Packshot Box */
.product-thumb-wrap {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-thumb-img {
  transform: scale(1.06);
}

.product-thumb-fallback {
  font-size: 24px;
}

.product-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-brand-label {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timing-pill {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 2.5px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.product-title-link {
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.25;
  transition: color var(--transition-fast);
}

.product-title-link:hover {
  color: var(--emerald);
}

.external-arrow {
  font-size: 11px;
  color: var(--text-muted);
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

.dosage-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-body);
}

.product-meta-col {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-badge-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-bg);
  border: 1px solid var(--cyan-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.toggle-pause-btn {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.toggle-pause-btn:hover {
  background: var(--accent-slate);
  color: #FFFFFF;
  border-color: var(--accent-slate);
}

.empty-sidebar-note {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   RIGHT COLUMN: NÄHRSTOFF-MENGEN & TAGESBEDARF
   ========================================================================== */

.main-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.main-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.main-title-wrap {
  display: flex;
  flex-direction: column;
}

/* Search Bar */
.search-wrap {
  position: relative;
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-main);
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-slate);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.search-input::placeholder {
  color: var(--text-subtle);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

.search-clear-btn:hover {
  background: var(--accent-slate);
  color: #FFFFFF;
}

/* Category Filter Tabs Row */
.category-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.category-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

.category-pill-btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-main);
}

.category-pill-btn.active {
  background: var(--accent-slate);
  color: #FFFFFF;
  border-color: var(--accent-slate);
}

.category-pill-count {
  font-size: 11.5px;
  opacity: 0.75;
}

/* ==========================================================================
   2-COLUMN SCIENTIFIC NUTRIENT GRID
   ========================================================================== */

.nutrients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.nutrient-scientific-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nutrient-scientific-card:hover {
  border-color: var(--emerald);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.nutrient-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nutrient-title-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nutrient-card-title {
  font-family: var(--font-heading);
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.nutrient-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.nutrient-brands-col {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.brand-tag-pill {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.brand-tag-pill.empty-tag {
  color: var(--text-subtle);
  font-style: italic;
}

/* Metric Row */
.nutrient-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.nutrient-value-display {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.val-number {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1;
}

.val-unit {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Status Reference Pill */
.status-reference-pill {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-block;
  white-space: nowrap;
}

.status-pill-optimal,
.status-pill-standard {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.status-pill-high {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

/* Solid Continuous Progress Line */
.nutrient-progress-wrap {
  width: 100%;
}

.nutrient-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.nutrient-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill-green {
  background: var(--emerald);
}

.bar-fill-amber {
  background: var(--amber);
}

/* Reference Note Footer */
.nutrient-card-footer {
  display: flex;
  justify-content: flex-end;
}

.reference-note-text {
  font-size: 11px;
  color: var(--text-muted);
}

.reference-note-text strong {
  color: var(--text-body);
}

/* Empty State */
.empty-state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   SCIENTIFIC DETAIL MODAL
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.25);
  max-width: 660px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 28px 30px;
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-smooth);
}

.modal-backdrop.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-slate);
  color: #FFFFFF;
}

.modal-header-block {
  margin-bottom: 20px;
}

.modal-kicker {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-main-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.modal-main-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-mode-badge {
  color: var(--emerald);
  font-weight: 700;
}

/* 4-Stat Box Matrix */
.modal-stat-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-matrix-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-matrix-label {
  font-family: var(--font-heading);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-matrix-val {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.stat-matrix-val.highlight-val {
  color: var(--accent-slate);
}

.stat-matrix-val.green-val {
  color: var(--emerald);
}

.stat-matrix-val.text-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
}

/* Modal Sections */
.modal-section {
  margin-bottom: 18px;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-text-box {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.55;
  background: #F8FAFC;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.modal-text-box.warning-box {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: #92400E;
}

.modal-text-box.tip-box {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: #065F46;
}

/* Checklist */
.modal-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #F8FAFC;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.modal-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-body);
}

.check-bullet {
  color: var(--emerald);
  font-weight: 800;
  font-size: 12px;
  margin-top: 1px;
}

/* Modal Sources Stack */
.modal-sources-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.source-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-thumb {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
}

.source-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.source-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.source-amount {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: var(--emerald);
}

.source-empty-note {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 8px 0;
}

/* External Scientific Reference Card */
.modal-ref-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
}

.ref-link-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-badge {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--emerald);
  letter-spacing: 0.05em;
}

.ref-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
}

.ref-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.ref-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent-slate);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.ref-open-btn:hover {
  background: var(--emerald);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-ref-text {
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */

@media (max-width: 1140px) {
  .dashboard-body {
    grid-template-columns: 380px 1fr;
    gap: 20px;
  }
}

@media (max-width: 980px) {
  .app-layout {
    padding: 16px 14px 40px;
    gap: 20px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-controls-block {
    align-items: stretch;
  }

  .dosage-switcher-card {
    align-items: stretch;
  }

  .dosage-mode-switch-wrap {
    width: 100%;
    display: flex;
  }

  .dosage-switch-btn {
    flex: 1;
    justify-content: center;
  }

  .dashboard-body {
    grid-template-columns: 1fr;
  }

  .main-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-wrap {
    width: 100%;
  }

  .nutrients-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 16px;
    top: 8px;
  }

  .app-header.is-scrolled {
    padding: 10px 14px;
  }

  .page-title {
    font-size: 22px;
  }

  .stats-summary-widget {
    width: 100%;
    justify-content: space-between;
  }

  .modal-stat-matrix {
    grid-template-columns: 1fr;
  }

  .modal-ref-link-card {
    flex-direction: column;
    align-items: stretch;
  }

  .ref-open-btn {
    justify-content: center;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
