/* ============================================================
   style.css — Premium Fitness App UI
   ============================================================ */

:root {
  --bg:       #e8eaed;
  --bg2:      #f2f4f7;
  --card:     #ffffff;
  --border:   #dde1e7;
  --shadow:   0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg:0 6px 28px rgba(0,0,0,0.11);
  --green:    #22c55e;
  --green-d:  #16a34a;
  --green-bg: #dcfce7;
  --blue:     #3b82f6;
  --blue-bg:  #dbeafe;
  --purple:   #8b5cf6;
  --purple-bg:#ede9fe;
  --amber:    #f59e0b;
  --amber-bg: #fef3c7;
  --red:      #ef4444;
  --red-bg:   #fee2e2;
  --cyan:     #06b6d4;
  --cyan-bg:  #cffafe;
  --text:     #1a1d23;
  --text2:    #6b7280;
  --text3:    #9ca3af;
  --radius:   16px;
  --radius-sm:10px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #edf0f4 0%, #e4e8ee 40%, #eaedf2 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 0;
  overflow-x: hidden;
  max-width: 100%;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.95rem; }

/* ── LAYOUT ── */
.container { max-width: 860px; margin: 0 auto; padding: 0 14px; }

/* ── CARD ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:active { transform: scale(0.995); }
.card-lg { padding: 22px; }
.card-sm { padding: 12px 14px; }

/* ── TOP NAV ── */
.top-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  transition: transform 0.3s ease;
}
.top-nav.hidden {
  transform: translateY(-110%);
}

/* ── HERO TITLE (μέσα στη μπάρα) ── */
#hero-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--gold, #c9a84c);
  pointer-events: none;
  user-select: none;
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}
.app-title { font-size: 1.05rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.topnav-logo { height: 47px; width: auto; vertical-align: middle; object-fit: contain; }

/* ── APP SHELL (sidebar layout) ── */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}
.app-shell.app-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ── SIDEBAR (desktop) ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.06);
}

.sidebar-logo {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-img {
  height: 70px;
  width: 70px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #f5c842 0%, #ffd700 40%, #b8860b 70%, #f5c842 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 2px rgba(180,140,0,0.35));
}

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(109,40,217,0.3);
  overflow: hidden;
}
.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-user-sub {
  font-size: 0.72rem;
  color: var(--text3);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: none;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-item:hover {
  background: var(--purple-bg);
  color: var(--purple);
}
.sidebar-item.active {
  background: var(--purple-bg);
  color: var(--purple);
  font-weight: 700;
}
.sidebar-icon { font-size: 1.2rem; flex-shrink: 0; }
.sidebar-label { line-height: 1; }

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

/* ── APP CONTENT ── */
.app-content {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── BOTTOM TAB BAR (mobile only — hidden on desktop) ── */
.bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: none; /* hidden on desktop */
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 10px;
  cursor: pointer;
  color: var(--text3);
  font-size: 0.68rem;
  font-weight: 600;
  gap: 3px;
  transition: color var(--transition);
  border: none; background: none;
  -webkit-tap-highlight-color: transparent;
}
.tab-item.active { color: var(--purple); }
.tab-item .tab-icon { font-size: 1.3rem; line-height: 1; }

/* ── MOBILE: hide sidebar, show bottom bar ── */
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .app-content { margin-left: 0; width: 100%; max-width: 100%; overflow-x: hidden; }
  .bottom-bar { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bottom-bar::-webkit-scrollbar { display: none; }
  .tab-item { min-width: 52px; flex-shrink: 0; }
  body { padding-bottom: 80px; }
}

/* ── DESKTOP: hide top-nav (show only on mobile) ── */
@media (min-width: 1024px) {
  .top-nav { display: none; }
  body { padding-bottom: 0; }
}

/* ── PAGES ── */
.page { display: none; padding-top: 12px; }
.page.active { display: block; }

/* ── WEEK PAGE HEADER ── */
.week-page-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 12px;
}
@media (max-width: 600px) {
  .week-page-header { padding: 12px 14px; }
  .week-page-header h1 { font-size: 1.15rem !important; }
}

/* ── WEEK SUMMARY INNER ── */
.week-summary-inner { flex-wrap: wrap; }
@media (max-width: 600px) {
  .week-summary-inner {
    flex-direction: column;
    gap: 12px !important;
  }
  .week-summary-inner > div { min-width: 0 !important; width: 100%; }
}

/* ── MOBILE GLOBAL OPTIMIZATIONS ── */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .container { padding: 0 6px; }

  /* Cards — smaller padding on mobile */
  .card { padding: 14px; margin-bottom: 10px; }
  .card-lg { padding: 16px; }
  .card-sm { padding: 10px 12px; }

  /* Bigger touch targets for buttons */
  .btn { padding: 10px 16px; min-height: 42px; }
  .btn-sm { padding: 8px 12px; font-size: 0.78rem; min-height: 36px; }
  .meal-check { width: 36px; height: 36px; }
  .supp-check { width: 32px; height: 32px; }

  /* Meal cards — reduce inner padding */
  .meal-card-header { padding: 12px 12px 8px; gap: 10px; }
  .meal-emoji { font-size: 1.7rem; }
  .meal-name { font-size: 0.85rem; }
  .meal-ingredients { padding: 10px 12px; }
  .meal-actions { padding: 0 12px 12px; gap: 6px; }
  .meal-actions .btn { flex: 1; }

  /* Macros row */
  .macro-chip-val { font-size: 0.88rem; }
  .macro-chip-lbl { font-size: 0.6rem; }

  /* Tab bar */
  .tab-item { font-size: 0.62rem; padding: 6px 2px 8px; }
  .tab-item .tab-icon { font-size: 1.2rem; }

  /* Top nav */
  .top-nav-inner { padding: 8px 12px; }
  #hero-title { font-size: 1.15rem; }

  /* Dashboard grid */
  .dashboard-grid { gap: 8px; }
  .macro-card { padding: 12px; }
  .macro-card-value { font-size: 1.35rem; }

  /* Quote banner — center on mobile */
  .quote-banner { text-align: center; }
  .quote-banner::before { display: none; }

  /* Kcal hero — keep row layout, scale down sizes */
  .kcal-hero { padding: 14px 16px; flex-direction: row; align-items: center; text-align: left; gap: 0; }
  .kcal-hero-left h2 { font-size: 0.7rem; }
  .kcal-hero-left .big-num { font-size: 2.6rem; }
  .kcal-hero-left .sub { font-size: 0.72rem; }
  .kcal-ring { width: 72px; height: 72px; flex-shrink: 0; }

  /* Modal */
  .modal-sheet { padding: 16px 16px 24px; border-radius: 20px 20px 0 0; }
  .modal-title { font-size: 1.05rem; }

  /* Week summary strip — stack vertically */
  .week-summary-inner { flex-direction: column; gap: 12px; }

  /* Segment pills — smaller */
  .segment { padding: 2px; }
  .seg-btn { padding: 6px 4px; font-size: 0.7rem; }

  /* Recipe cards — 2 columns always, padded within ideas page */
  .recipes-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px; }
  .section-title { padding: 0 12px; }
  .recipe-card { padding: 10px; }
  .recipe-card-emoji { font-size: 1.6rem; }
  .recipe-card-name { font-size: 0.7rem; }

  /* FAB — slightly smaller */
  .fab { width: 46px; height: 46px; font-size: 1.3rem; bottom: 84px; right: 12px; }

  /* Toast */
  .toast { bottom: 86px; font-size: 0.78rem; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }

  /* Week days grid header */
  .dplanner-topbar { padding: 10px 14px; }
  .dplanner-topbar-left h2 { font-size: 1rem; }

  h1 { font-size: 1.25rem; }
  h2 { font-size: 1rem; }

  /* ── Ideas page: no container, tabs bar flush to edges ── */
  .ideas-page-wrap { max-width: 100%; padding: 0; }
  .ideas-tabs-bar { padding: 10px 12px 0; }
  .ideas-tabs-bar .segment { margin-bottom: 10px; }
  .foods-wrap { max-width: 100%; padding: 0 12px; }

  /* ── Recipes card: edge-to-edge white card ── */
  .rc-card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 14px 14px 14px;
    margin: 0 0 12px;
  }
  .rc-title { font-size: 1.05rem; }
  .rc-new-btn { border-radius: 8px; padding: 8px 14px; font-size: 0.82rem; }
  .rc-search { margin-bottom: 10px; }
  .rc-search input { box-shadow: none; border-radius: 8px; border-color: var(--border); padding: 9px 14px 9px 38px; }
  .rc-search-icon { color: var(--green-d); width: 16px; height: 16px; left: 12px; }
  .recipe-filter-pills { flex-wrap: wrap; gap: 5px; }
  .recipe-pill { flex-shrink: 0; }
}

/* ── WEEK FOOTER / DEFICIT GRIDS ── */
.week-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.week-deficit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .week-footer-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .week-deficit-grid { grid-template-columns: 1fr; }
}

/* ── PROFILE GRIDS ── */
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.profile-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .profile-stats-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .profile-stats-grid .card { padding: 12px 8px; }
  .profile-body-grid { grid-template-columns: 1fr 1fr; }
}

/* ── QUOTE BANNER ── */
.quote-banner {
  background: linear-gradient(135deg, #1a1d23 0%, #2d3748 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.quote-banner::before {
  content: '"';
  position: absolute;
  font-size: 8rem;
  font-family: Georgia, serif;
  color: rgba(255,255,255,0.05);
  top: -20px; left: 10px;
  line-height: 1;
}
.quote-text { font-size: 0.88rem; font-style: italic; line-height: 1.55; color: #e2e8f0; position: relative; }
.quote-author { font-size: 0.75rem; color: #94a3b8; margin-top: 8px; font-weight: 600; }
.quote-translation { font-size: 0.78rem; color: #cbd5e1; margin-top: 4px; }

/* ── DASHBOARD RING ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.macro-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.macro-card-label { font-size: 0.7rem; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.macro-card-value { font-size: 1.6rem; font-weight: 800; margin: 4px 0 2px; }
.macro-card-sub { font-size: 0.72rem; color: var(--text3); }
.macro-card-bar { height: 5px; border-radius: 3px; background: var(--border); margin-top: 8px; overflow: hidden; }
.macro-card-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

.kcal-hero {
  background: linear-gradient(135deg, var(--green-d) 0%, #15803d 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(22,163,74,0.25);
}
.kcal-hero-left h2 { font-size: 0.8rem; opacity: 0.85; font-weight: 600; }
.kcal-hero-left .big-num { font-size: 3rem; font-weight: 900; line-height: 1; }
.kcal-hero-left .sub { font-size: 0.8rem; opacity: 0.75; margin-top: 4px; }
.kcal-ring { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.kcal-ring svg { transform: rotate(-90deg); }
.kcal-ring-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 0.75rem; font-weight: 800; color: #fff; text-align: center; line-height: 1.2;
}

/* ── MEAL CARDS ── */
.meal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.meal-card.done-card { opacity: 0.6; }
.meal-card-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  gap: 12px;
}
.meal-emoji { font-size: 2rem; flex-shrink: 0; }
.meal-meta { flex: 1; min-width: 0; }
.meal-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.meal-time-badge {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text2);
}
.meal-name { font-size: 0.88rem; font-weight: 800; color: var(--text); white-space: normal; word-break: break-word; }
.meal-type-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pill-breakfast { background: var(--amber-bg); color: #92400e; }
.pill-lunch     { background: var(--purple-bg); color: #5b21b6; }
.pill-dinner    { background: var(--red-bg);    color: #991b1b; }
.pill-snack      { background: var(--cyan-bg);   color: #0e7490; }
.pill-afternoon  { background: var(--cyan-bg);  color: #0e7490; }

.meal-check {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.meal-check.checked { background: var(--green); border-color: var(--green); color: #fff; }

.meal-macros {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--bg);
  border-bottom: 1px solid var(--bg);
}
.macro-chip {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-right: 1px solid var(--bg);
}
.macro-chip:last-child { border-right: none; }
.macro-chip-val { font-size: 0.95rem; font-weight: 800; }
.macro-chip-lbl { font-size: 0.62rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.4px; }

.meal-ingredients { padding: 12px 16px; }
.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--bg);
}
.ingredient-row:last-child { border-bottom: none; }
.ingredient-name { color: var(--text2); }
.ingredient-qty  { font-weight: 700; color: var(--text); }

.water-note {
  background: var(--blue-bg);
  padding: 8px 16px;
  font-size: 0.78rem;
  color: #1d4ed8;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}

.recipe-expand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 32px);
  margin: 0 16px 4px;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.recipe-expand-btn:hover { background: var(--green-bg); border-color: var(--green); }
.recipe-expand-btn[aria-expanded="true"] { border-color: var(--green); color: var(--green); }
.recipe-expand-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}
.recipe-expand-btn[aria-expanded="true"] .recipe-expand-arrow { transform: rotate(180deg); }

.recipe-expand-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
  margin: 0 16px;
}
.recipe-expand-body.open { grid-template-rows: 1fr; }
.recipe-expand-body > * { overflow: hidden; }

.recipe-instructions {
  padding: 10px 12px 10px;
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.6;
  border-left: 3px solid var(--green);
  background: var(--green-bg);
  border-radius: 0 8px 8px 0;
  margin-bottom: 6px;
}
.recipe-serving {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text2);
  background: var(--amber-bg, #fef3c7);
  border-left: 3px solid var(--amber, #f59e0b);
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
  line-height: 1.5;
}
.recipe-serving-icon { margin-right: 4px; }

.running-kcal {
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.running-kcal strong { color: var(--amber); font-size: 0.88rem; }

.meal-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-green  { background: var(--green-d); color: #fff; }
.btn-green:hover  { background: #15803d; box-shadow: 0 4px 14px rgba(22,163,74,0.3); }
.btn-ghost  { background: var(--bg); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover  { background: var(--border); }
.btn-blue   { background: var(--blue); color: #fff; }
.btn-red    { background: var(--red);  color: #fff; }
.btn-amber  { background: var(--amber); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: 50%; }

/* ── ACTIVITY SECTION ── */
.act-section { margin-bottom: 14px; }
.act-inner-row { padding: 12px 0; }
.act-inner-row:first-of-type { padding-top: 0; }
.act-divider { height: 1px; background: var(--border); margin: 0; }
.act-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.act-header-icon { font-size: 1.3rem; }
.act-header-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text2);
}
.act-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.act-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.act-icon-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.act-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.act-big-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 2px;
}
.act-big-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}
.act-slider {
  width: 100%;
  accent-color: var(--green-d);
  margin: 4px 0 2px;
}
.act-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text3);
  margin-top: 2px;
}
.act-motiv {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.act-motiv-icon { font-size: 2rem; flex-shrink: 0; }

/* ── SUPPLEMENT SECTION ── */
.supp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.supp-item:last-child { border-bottom: none; }
.supp-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.supp-check.checked { background: var(--purple); border-color: var(--purple); color: #fff; }
.supp-time { font-size: 0.7rem; color: var(--amber); font-weight: 800; min-width: 44px; }
.supp-info { flex: 1; }
.supp-name { font-size: 0.88rem; font-weight: 700; }
.supp-note { font-size: 0.72rem; color: var(--text3); }
.supp-qty  { font-size: 0.75rem; font-weight: 700; color: var(--purple); white-space: nowrap; }

.supp-guide {
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 8px 40px;
  font-size: 0.74rem;
}
.supp-guide-row {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.supp-guide-row:last-of-type { border-bottom: none; }
.supp-guide-label {
  color: var(--text2);
  font-weight: 600;
  white-space: nowrap;
  min-width: 90px;
}
.supp-guide-tip {
  margin-top: 7px;
  padding: 6px 8px;
  background: #fffbeb;
  border-left: 3px solid var(--amber);
  border-radius: 0 6px 6px 0;
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.45;
}

/* ── SLIDERS / OPTIMIZATION ── */
.slider-row { margin-bottom: 16px; }
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.slider-label span { font-size: 0.82rem; font-weight: 700; color: var(--text2); }
.slider-label strong { font-size: 0.95rem; color: var(--text); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-d);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-d);
  border: 2px solid #fff;
  cursor: pointer;
}

/* Profile page colored sliders */
.prof-range-amber::-webkit-slider-thumb { background: var(--amber) !important; }
.prof-range-amber::-moz-range-thumb     { background: var(--amber) !important; }
.prof-range-amber { accent-color: var(--amber); }

.prof-range-blue::-webkit-slider-thumb { background: var(--blue) !important; }
.prof-range-blue::-moz-range-thumb     { background: var(--blue) !important; }
.prof-range-blue { accent-color: var(--blue); }

.prof-range-green::-webkit-slider-thumb { background: var(--green-d) !important; }
.prof-range-green::-moz-range-thumb     { background: var(--green-d) !important; }
.prof-range-green { accent-color: var(--green-d); }

.prof-range-purple::-webkit-slider-thumb { background: var(--purple) !important; }
.prof-range-purple::-moz-range-thumb     { background: var(--purple) !important; }
.prof-range-purple { accent-color: var(--purple); }

/* Mode toggle */
.mode-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 24px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 16px;
}
.mode-tab {
  flex: 1;
  padding: 8px 6px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text3);
  transition: all var(--transition);
}
.mode-tab.active { background: var(--card); color: var(--green-d); box-shadow: var(--shadow); }

/* ── SEARCH ── */
.search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.search-wrap input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 11px 18px 11px 48px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}
.search-wrap input:focus { border-color: var(--green-d); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }
.search-wrap input::placeholder { color: var(--text3); }

/* ── FOOD DB TABLE ── */
.food-section { margin-bottom: 20px; }
.food-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 8px;
  padding: 0 4px;
}
.food-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.food-row:hover { border-color: var(--green-d); box-shadow: 0 2px 8px rgba(22,163,74,0.12); }
.food-row-name { font-size: 0.85rem; font-weight: 600; }
.food-row-kcal { font-size: 0.8rem; font-weight: 700; color: var(--green-d); }
.food-row-sub  { font-size: 0.7rem; color: var(--text3); }

/* ── RECIPES GRID ── */
.recipes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 500px) { .recipes-grid { grid-template-columns: repeat(3, 1fr); } }

.recipe-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.recipe-card:hover { border-color: var(--green-d); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.recipe-card.favorite { border-color: var(--amber); }
.recipe-card-emoji { font-size: 2rem; margin-bottom: 6px; }
.recipe-card-name { font-size: 0.75rem; font-weight: 700; line-height: 1.3; }
.recipe-card-kcal { font-size: 0.68rem; color: var(--green-d); font-weight: 700; margin-top: 4px; }
.recipe-card-meal { font-size: 0.62rem; color: var(--text3); text-transform: uppercase; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 20px 30px;
  animation: slideUp 0.25s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 16px;
}
.modal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 16px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 14px; }
label { font-size: 0.8rem; font-weight: 700; color: var(--text2); display: block; margin-bottom: 5px; }
input[type="text"], input[type="number"], input[type="time"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--green-d); background: var(--card); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* ── IDEAS PAGE WRAP ── */
.ideas-page-wrap { max-width: 860px; margin: 0 auto; padding: 0 14px; }
.ideas-tabs-bar { padding: 14px 0 0; }
.ideas-tabs-bar .segment { margin-bottom: 14px; }
.foods-wrap { max-width: 860px; margin: 0 auto; padding: 0 14px; }

/* ── RECIPES CARD ── */
.rc-card { padding: 16px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); margin-bottom: 16px; }
.rc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.rc-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.rc-new-btn {
  background: var(--green-d); color: #fff; border: none; border-radius: 10px;
  padding: 8px 14px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.rc-search {
  position: relative; margin-bottom: 14px;
}
.rc-search input {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; padding: 11px 18px 11px 44px;
  font-size: 0.88rem; color: var(--text); outline: none;
  box-shadow: var(--shadow); transition: border-color var(--transition);
  box-sizing: border-box;
}
.rc-search input:focus { border-color: var(--green-d); }
.rc-search input::placeholder { color: var(--text3); }
.rc-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; pointer-events: none; color: var(--text3);
}
.recipe-filter-pills {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0;
}
.recipe-filter-pills-break {
  width: 100%; height: 0; flex-basis: 100%;
}
.recipe-pill {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 4px 9px; font-size: 0.68rem; font-weight: 600;
  color: var(--text2); background: var(--card); cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
}
.recipe-pill svg { flex-shrink: 0; }
.recipe-pill.active {
  border-color: var(--green-d); color: var(--green-d); background: var(--green-bg);
}

/* ── SEGMENT PILLS ── */
.segment { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg-btn {
  flex: 1; padding: 7px; border-radius: 8px;
  font-size: 0.75rem; font-weight: 700; text-align: center;
  cursor: pointer; border: none; background: none; color: var(--text3);
  transition: all var(--transition);
}
.seg-btn.active { background: var(--card); color: var(--green-d); box-shadow: var(--shadow); }

/* ── CHIP TAGS ── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text2);
}
.chip-green { background: var(--green-bg); color: var(--green-d); border-color: transparent; }
.chip-blue  { background: var(--blue-bg);  color: var(--blue);    border-color: transparent; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 10px;
}

/* ── ANIMATIONS ── */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.slide-in { animation: slideIn 0.25s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #1a1d23; color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 300;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.88rem; }

/* ── PROGRESS BAR ── */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

/* ── WEEK GRID ── */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
@media (max-width: 480px) {
  .week-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .week-day-btn { padding: 8px 2px; font-size: 0.65rem; }
  .week-day-btn .wday { font-size: 0.9rem; }
}

/* ── 7-DAY WEEK PAGE GRID (Εβδομαδιαίο tab) ── */
.week-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: start;
}
@media (max-width: 900px) {
  .week-days-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .week-days-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
@media (max-width: 380px) {
  .week-days-grid { grid-template-columns: 1fr; }
}

/* ── WEEK OVERVIEW (Εβδομαδιαίο tab) ── */
.week-overview-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: start;
}
.week-col-card { background: var(--card); box-shadow: var(--shadow); }
@media (max-width: 900px) {
  .week-overview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .week-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
.week-day-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text2);
}
.week-day-btn.active { background: var(--green-d); color: #fff; border-color: var(--green-d); box-shadow: 0 2px 10px rgba(22,163,74,0.3); }
.week-day-btn .wday { font-size: 0.82rem; margin-bottom: 1px; }

/* ── FAB ── */
.fab {
  position: fixed; bottom: 88px; right: 18px;
  width: 52px; height: 52px;
  background: var(--green-d);
  color: #fff;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(22,163,74,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  transition: all var(--transition);
}
.fab:hover { transform: scale(1.08); }

/* ── SWAP MEAL MODAL ── */
.swap-search-wrap {
  margin-bottom: 10px;
}
.swap-search {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.88rem;
  background: var(--bg2);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.swap-search:focus { border-color: var(--green-d); }
.swap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.swap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition);
  gap: 10px;
}
.swap-row:hover, .swap-row:active {
  border-color: var(--green-d);
  background: var(--green-bg);
}
.swap-row-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.swap-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.swap-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}
.swap-items {
  font-size: 0.7rem;
  color: var(--text2);
  line-height: 1.4;
}
.swap-note {
  font-size: 0.68rem;
  color: var(--text3);
  font-style: italic;
  margin-top: 2px;
}
.swap-kcal {
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--green-d);
  flex-shrink: 0;
  min-width: 44px;
}
.swap-kcal span {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text3);
  display: block;
}
.selected-builder {
  border-color: var(--green-d) !important;
  background: var(--green-bg) !important;
}

/* ── BUILDER PAGE ── */
.builder-type-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  margin: 16px 0 8px;
}
.builder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.builder-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px 10px;
  cursor: pointer;
  position: relative;
  transition: border-color .18s, box-shadow .18s, transform .12s;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.builder-card:active { transform: scale(0.97); }
.builder-card-sel {
  border-color: var(--green);
  background: rgba(79,176,119,.08);
  box-shadow: 0 0 0 3px rgba(79,176,119,.18);
}
.builder-card-emoji { font-size: 1.6rem; line-height: 1; margin-bottom: 2px; }
.builder-card-name  { font-size: 0.82rem; font-weight: 700; color: var(--text1); line-height: 1.25; }
.builder-card-kcal  { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.builder-card-badge { font-size: 0.68rem; color: var(--text3); margin-top: auto; }
.builder-card-check {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.builder-sel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.builder-sel-row:last-child { border-bottom: none; }

/* ══════════════════════════════════════════════
   DAY PLANNER BUILDER — 3-column desktop layout
   ══════════════════════════════════════════════ */

#page-builder.active {
  display: flex;
  flex-direction: column;
  padding-top: 0;
  height: calc(100vh);
  overflow: hidden;
}

.dplanner-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Top header bar */
.dplanner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}
.dplanner-topbar-left h2 { font-size: 1.2rem; font-weight: 900; }
.dplanner-topbar-left p  { font-size: 0.72rem; color: var(--text3); margin-top: 1px; }
.dplanner-topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 3-column grid */
.dplanner-cols {
  display: grid;
  grid-template-columns: minmax(0, 38%) 1fr minmax(0, 22%);
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Each column */
.dplanner-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-height: 0;
  overflow: hidden;
}
.dplanner-col:last-child { border-right: none; }

.dplanner-col-head {
  padding: 14px 16px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dplanner-col-head h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 6px; }

.dplanner-col-body {
  padding: 12px;
  background: var(--bg);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.dplanner-col-body::-webkit-scrollbar { width: 4px; }
.dplanner-col-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── LEFT: meal library section headers ── */
.dplanner-lib-section-header {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 6px;
}
.dplanner-lib-section-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.dplanner-lib-section-icon.breakfast { background: #fef3c7; }
.dplanner-lib-section-icon.snack     { background: #dcfce7; }
.dplanner-lib-section-icon.lunch     { background: #dbeafe; }
.dplanner-lib-section-icon.afternoon { background: #cffafe; }
.dplanner-lib-section-icon.dinner    { background: #ede9fe; }
.dplanner-lib-section-label {
  font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.6px; color: var(--text3);
}

/* ── LEFT: meal library ── */
.dplanner-search-wrap {
  position: relative;
}
.dplanner-search-wrap input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
}
.dplanner-search-wrap input:focus { border-color: var(--green-d); }
.dplanner-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: 0.85rem; pointer-events: none;
}

.dplanner-filter-row {
  display: flex; gap: 5px; flex-wrap: nowrap; margin-top: 8px; overflow-x: auto;
}
.dplanner-filter-row::-webkit-scrollbar { display: none; }
.dplanner-filter-btn {
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 0.68rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.dplanner-filter-btn.active {
  background: var(--green-d); color: #fff; border-color: var(--green-d);
}

.dplanner-lib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.dplanner-meal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px;
  margin-bottom: 0;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.dplanner-meal-card:hover {
  border-color: var(--green-d);
  box-shadow: 0 2px 8px rgba(22,163,74,0.10);
}
.dplanner-meal-card:hover .dplanner-add-btn { opacity: 1; }
.dplanner-meal-card.selected-dp {
  border-color: var(--green-d);
  background: var(--green-bg);
}
.dplanner-meal-emoji {
  font-size: 1.3rem; flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.dplanner-meal-info  { flex: 1; min-width: 0; }
.dplanner-meal-name  { font-size: 0.78rem; font-weight: 700; line-height: 1.3; }
.dplanner-meal-meta  { font-size: 0.67rem; color: var(--text3); margin-top: 2px; }
.dplanner-meal-kcal  {
  font-size: 0.72rem; font-weight: 600; color: var(--text2);
  white-space: nowrap; flex-shrink: 0;
  align-self: flex-start;
}
.dplanner-add-btn {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-d); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  opacity: 0; transition: opacity var(--transition); flex-shrink: 0;
}
.dplanner-add-btn--visible { opacity: 1; }
.dplanner-meal-card.selected-dp .dplanner-add-btn { opacity: 1; background: var(--red); }

/* ── MIDDLE: day plan ── */
.dplanner-day-nav {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.dplanner-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 0.85rem;
  transition: all var(--transition);
}
.dplanner-nav-btn:hover { background: var(--green-bg); border-color: var(--green-d); }
.dplanner-day-label {
  flex: 1; text-align: center; font-size: 0.85rem; font-weight: 700;
}

.dplanner-slot {
  margin-bottom: 16px;
}
.dplanner-slot-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.dplanner-slot-left { display: flex; align-items: center; gap: 8px; }
.dplanner-slot-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.dplanner-slot-icon.breakfast { background: #fef3c7; }
.dplanner-slot-icon.snack     { background: #dcfce7; }
.dplanner-slot-icon.lunch     { background: #dbeafe; }
.dplanner-slot-icon.afternoon { background: #cffafe; }
.dplanner-slot-icon.dinner    { background: #ede9fe; }
.dplanner-slot-title { font-size: 0.88rem; font-weight: 800; }
.dplanner-slot-time  { font-size: 0.68rem; color: var(--text3); }
.dplanner-slot-kcal  { font-size: 0.88rem; font-weight: 800; }

.dplanner-entry {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
  margin-bottom: 4px; font-size: 0.82rem;
}
.dplanner-entry-emoji { font-size: 1.2rem; flex-shrink: 0; }
.dplanner-entry-name  { flex: 1; font-weight: 600; color: var(--text); }
.dplanner-entry-kcal  { font-size: 0.8rem; font-weight: 700; color: var(--green-d); white-space: nowrap; }
.dplanner-entry-rm    {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: 1rem; padding: 2px 4px; border-radius: 4px;
  transition: color var(--transition); flex-shrink: 0;
}
.dplanner-entry-rm:hover { color: var(--red); }

.dplanner-add-slot-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 6px 10px;
  font-size: 0.75rem; color: var(--text3);
  background: none; border: 1px dashed var(--border); border-radius: 8px;
  cursor: pointer; text-align: left; transition: all var(--transition);
}
.dplanner-add-slot-btn:hover {
  color: var(--green-d); border-color: var(--green-d); background: var(--green-bg);
}

/* ── RIGHT: summary ── */
.dplanner-donut-wrap {
  position: relative; width: 130px; height: 130px; margin: 0 auto 12px;
}
.dplanner-donut-wrap svg { transform: rotate(-90deg); }
.dplanner-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.2;
}
.dplanner-donut-kcal { font-size: 1.6rem; font-weight: 900; color: var(--text); }
.dplanner-donut-lbl  { font-size: 0.65rem; color: var(--text3); font-weight: 700; }

.dplanner-legend { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.dplanner-legend-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem;
}
.dplanner-legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 6px; flex-shrink: 0;
}

.dplanner-mbar { margin-bottom: 10px; }
.dplanner-mbar-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; font-weight: 600; margin-bottom: 4px;
}
.dplanner-mbar-label span:last-child { color: var(--text3); font-weight: 400; font-size: 0.72rem; }
.dplanner-mbar-track { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.dplanner-mbar-fill  { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.dplanner-quality {
  background: var(--green-bg); border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 10px;
}
.dplanner-quality-icon { font-size: 1.4rem; flex-shrink: 0; }
.dplanner-quality-title { font-size: 0.82rem; font-weight: 800; color: var(--green-d); margin-bottom: 2px; }
.dplanner-quality-desc  { font-size: 0.7rem; color: #166534; line-height: 1.4; }

.dplanner-stat { display: flex; flex-direction: column; gap: 0; }
.dplanner-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.77rem; color: var(--text2);
  padding: 5px 0; border-bottom: 1px solid var(--border);
}
.dplanner-stat-row:last-child { border-bottom: none; }
.dplanner-stat-row strong { color: var(--text); font-weight: 700; }

/* ── Templates section ── */
.dplanner-tpl-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; margin-bottom: 6px;
}
.dplanner-tpl-name { font-size: 0.85rem; font-weight: 700; }
.dplanner-tpl-meta { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }

/* ── RESPONSIVE: mobile → single column ── */
@media (max-width: 1023px) {
  #page-builder.active { display: block; height: auto; overflow: visible; }
  .dplanner-wrap       { overflow: visible; }
  .dplanner-cols       { display: block; }
  .dplanner-col        { border-right: none; border-bottom: 1px solid var(--border); overflow: visible; }
  .dplanner-col-body   { max-height: 380px; overflow-y: auto; }
}

/* ── TOGGLE SWITCH ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── PROFILE PAGE ── */
.profile-stat-box {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--border);
}
.profile-stat-val {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
}
.profile-stat-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 2px;
}
.profile-stat-sub {
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: 2px;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}
.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--green-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  overflow: hidden;
  border: 3px solid var(--green);
  cursor: pointer;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-btn {
  position: absolute; bottom: 0; right: 0;
  background: var(--green-d); color: white;
  border: 2px solid white;
  border-radius: 50%; width: 30px; height: 30px;
  font-size: 0.8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}

/* ── INPUT FIELD STYLES ── */
input[type="number"], input[type="text"], select, textarea {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text);
  transition: border-color var(--transition);
}
input[type="number"]:focus, input[type="text"]:focus,
select:focus, textarea:focus {
  border-color: var(--green-d);
  outline: none;
  background: #fff;
}

/* ── RESPONSIVE ── */
@media (min-width: 600px) {
  body { font-size: 16px; }
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
  .card-lg { padding: 26px; }
  .meal-card-header { padding: 18px 20px 12px; }
}

@media (max-width: 360px) {
  .week-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .week-day-btn { padding: 7px 2px; font-size: 0.62rem; }
  .recipes-grid { grid-template-columns: 1fr 1fr; }
}

/* ── PRINT ── */
@media print {
  body { background: white !important; padding: 0 !important; font-size: 12px; }
  .bottom-bar, .top-nav, .fab, .modal-overlay, .toast, .btn { display: none !important; }
  .page { display: none !important; }
  #print-view {
    display: block !important;
    font-family: -apple-system, 'Segoe UI', sans-serif;
    color: #1a1d23;
  }
  @page { margin: 15mm 12mm; size: A4; }
}

/* ── AUTH SCREEN ── */
:root {
  --gold:    #b8860b;
  --gold-lt: #f5c842;
  --gold-bg: #fdf8ee;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: url('back.png') center center / cover no-repeat;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: transparent;
  border-radius: 0;
  padding: 40px 36px 32px;
  box-shadow: none;
  border: none;
}

/* ── Logo area ── */
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo-img {
  height: 200px;
  margin-bottom: 10px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.auth-brand {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.32em;
  color: #1a1d23;
}
.auth-tagline {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 5px;
}
.auth-tagline em {
  font-style: normal;
  color: var(--gold);
  font-weight: 600;
}

/* ── Tab switcher ── */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid #ebebeb;
  margin-bottom: 26px;
  gap: 0;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  transition: color 0.18s;
  font-family: inherit;
}
.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s;
  border-radius: 2px 2px 0 0;
}
.auth-tab.active {
  color: #1a1d23;
}
.auth-tab.active::after {
  transform: scaleX(1);
}
.auth-tab svg { flex-shrink: 0; }

/* ── Form layout ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.03em;
}

/* Input with icon */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.auth-input-icon {
  position: absolute;
  left: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}
.auth-input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 11px 13px 11px 42px;
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  background: #fafafa;
  color: #1a1d23;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.auth-input:focus {
  border-color: var(--gold);
  background: #fff;
}
.auth-input-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 0;
}
.auth-input-toggle:hover { color: #6b7280; }

/* ── Primary button ── */
.auth-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: #1a1d23;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.auth-btn svg { flex-shrink: 0; }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-btn:not(:disabled):hover { opacity: 0.88; }
.auth-btn:not(:disabled):active { transform: scale(0.98); }

/* ── Forgot password link ── */
.auth-footer-row {
  text-align: center;
  margin-top: 4px;
}
.auth-link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  color: #9ca3af;
}
.auth-link-btn span { color: var(--gold); font-weight: 600; text-decoration: underline; }
.auth-link-btn:hover span { color: var(--gold-lt); }

/* ── Messages ── */
.auth-error {
  background: #fff0f0;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.84rem;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.auth-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.84rem;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.auth-success {
  background: #f0fff4;
  color: #15803d;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 0.84rem;
}
.auth-hint {
  font-size: 0.84rem;
  color: #6b7280;
  margin: 0 0 4px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .auth-card { padding: 20px 14px 20px; }
  .auth-logo-img { height: 140px; }
  .auth-input { font-size: 16px; }
}

/* Hide native date picker icon so all input wrappers stay the same height */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"]::-webkit-inner-spin-button { display: none; }
input[type="date"] { -webkit-appearance: none; appearance: none; }
/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
