/* ═══════════════════════════════════════════════
   Transformación Max Albert — Design System
   Dark Mode Premium · 16-Week Tracker
═══════════════════════════════════════════════ */

:root {
  /* Colors */
  --bg:         #0a0b0f;
  --surface:    #12141c;
  --card:       #191c28;
  --card-hover: #1e2234;
  --border:     #252840;
  --border-subtle: #1d2033;

  /* Brand */
  --primary:    #6366f1;
  --primary-d:  #4f46e5;
  --primary-glow: rgba(99,102,241,.3);
  --accent:     #06d6a0;
  --accent-d:   #059669;
  --accent-glow: rgba(6,214,160,.2);

  /* Status */
  --yellow:     #f59e0b;
  --red:        #ef4444;
  --orange:     #f97316;
  --blue:       #3b82f6;
  --purple:     #a855f7;

  /* Phase Colors */
  --phase1:     #6366f1;
  --phase2:     #f59e0b;
  --phase3:     #ef4444;
  --phase4:     #06d6a0;

  /* Text */
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim:   #64748b;

  /* Layout */
  --sidebar-w:  240px;
  --topbar-h:   56px;
  --bottom-nav-h: 64px;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  18px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ═══ SIDEBAR ═══ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 13px; font-weight: 800; color: var(--text); }
.logo-sub { font-size: 11px; color: var(--text-muted); }

.nav-list { list-style: none; padding: 12px 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  transition: all .18s;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.15), rgba(99,102,241,.05));
  color: var(--primary);
  border-left: 3px solid var(--primary);
}
.nav-icon { font-size: 17px; width: 22px; text-align: center; }
.nav-label { font-size: 14px; }

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.btn-weigh-in {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-weigh-in:hover { opacity: .9; transform: translateY(-1px); }

/* ═══ TOPBAR (mobile) ═══ */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  z-index: 150;
  gap: 12px;
}
.hamburger {
  background: none; border: none; color: var(--text);
  font-size: 20px; cursor: pointer; padding: 4px;
}
.topbar-center { flex: 1; font-size: 14px; font-weight: 700; text-align: center; }
.topbar-right {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
}

/* ═══ BOTTOM NAV (mobile) ═══ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-around;
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; text-decoration: none;
  color: var(--text-muted); font-size: 10px; font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: all .18s;
  flex: 1;
}
.bn-item.active { color: var(--primary); }
.bn-icon { font-size: 20px; }
.bn-label { font-size: 9px; font-weight: 600; }

/* ═══ SIDEBAR OVERLAY ═══ */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px;
  max-width: 900px;
}

/* ═══ PAGE ═══ */
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.page-header {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.page-title {
  font-size: 28px; font-weight: 900;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-sub { font-size: 14px; color: var(--text-muted); margin-top: 3px; }

.phase-badge-large {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
}

/* ═══ HERO GRID ═══ */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.hero-num {
  font-size: 36px; font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.hero-num.small { font-size: 18px; color: var(--text); }
.hero-num.emoji { font-size: 32px; color: unset; }
.hero-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ═══ CARDS ═══ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-warmup { border-left: 3px solid var(--orange); }

/* ═══ SUMMARY CARDS ═══ */
.summary-grid {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
}
.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.summary-header {
  display: flex; align-items: center; gap: 12px;
}
.summary-icon { font-size: 22px; }
.summary-info { flex: 1; }
.summary-title { font-size: 14px; font-weight: 700; }
.summary-status { font-size: 12px; color: var(--text-muted); }
.btn-go {
  background: var(--border);
  border: none;
  color: var(--text);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.btn-go:hover { background: var(--primary); }

.summary-detail {
  margin-top: 8px;
  font-size: 12px; color: var(--text-muted);
}
.cardio-pills {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.cardio-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
}
.cardio-pill.done { border-color: var(--accent); color: var(--accent); }

.macro-mini-row {
  display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.macro-mini {
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  text-align: center;
}
.macro-mini-val { font-size: 15px; font-weight: 800; color: var(--primary); display: block; }
.macro-mini-label { color: var(--text-muted); }

/* ═══ WEEK STRIP ═══ */
.week-days-strip {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.wds-day {
  flex: 1; min-width: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
}
.wds-day-name { color: var(--text-muted); font-weight: 600; font-size: 10px; text-transform: uppercase; }
.wds-day-icon { font-size: 16px; margin: 3px 0; }
.wds-day.done { border-color: var(--accent); background: rgba(6,214,160,.06); }
.wds-day.today { border-color: var(--primary); background: rgba(99,102,241,.08); }
.wds-day.today .wds-day-name { color: var(--primary); }

/* ═══ CTA CARD ═══ */
.cta-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(6,214,160,.05));
  border-color: rgba(99,102,241,.3);
}
.cta-icon { font-size: 28px; }
.cta-text { flex: 1; }
.cta-text strong { display: block; font-size: 15px; }
.cta-text span { font-size: 13px; color: var(--text-muted); }

/* ═══ ALERT CARDS ═══ */
.alert-card {
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alert-yellow {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  color: var(--yellow);
}
.alert-red {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  color: var(--red);
}
.alert-green {
  background: rgba(6,214,160,.08);
  border: 1px solid rgba(6,214,160,.25);
  color: var(--accent);
}
.alert-blue {
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.25);
  color: var(--blue);
}

/* ═══ WORKOUT ═══ */
.wk-type-badge {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 800; letter-spacing: .1em;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
}

.rest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  margin-bottom: 16px;
}
.rest-icon { font-size: 52px; margin-bottom: 14px; }
.rest-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.rest-sub { color: var(--text-muted); font-size: 14px; }
.rest-cardio-note { margin-top: 16px; font-size: 13px; color: var(--accent); font-weight: 600; }

.check-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.check-row:last-child { border-bottom: none; }
.check-row input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.warmup-items { display: flex; flex-direction: column; }

/* DTP Legend */
.dtp-legend {
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,214,160,.04));
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.dtp-legend-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dtp-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.dtp-legend-title { font-size: 14px; font-weight: 700; }
.dtp-legend-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.dtp-pyramid-viz {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-end;
}
.dtp-pyramid-bar {
  border-radius: 4px 4px 0 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 3px;
  font-size: 10px; font-weight: 700;
  color: #fff;
  min-width: 28px;
  background: linear-gradient(180deg, var(--primary), var(--primary-d));
  transition: height .3s;
}

/* Exercise Block */
.exercise-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.exercise-header {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px;
}
.ex-number {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.ex-info { flex: 1; }
.ex-name { font-size: 15px; font-weight: 700; }
.ex-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ex-dtp-tag {
  background: rgba(99,102,241,.15);
  color: var(--primary);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px; font-weight: 800;
}
.ex-superset-tag {
  background: rgba(245,158,11,.15);
  color: var(--yellow);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px; font-weight: 800;
}
.ex-tip {
  background: rgba(255,255,255,.03);
  border-left: 2px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

/* Sets Grid */
.sets-grid {
  display: flex; flex-direction: column; gap: 6px;
}
.set-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
}
.set-row:hover { border-color: var(--primary); }
.set-row.logged { border-color: var(--accent); background: rgba(6,214,160,.04); }
.set-num {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.set-row.logged .set-num { background: var(--accent); color: var(--bg); }
.set-target { font-size: 13px; font-weight: 600; flex: 1; }
.set-logged-info {
  font-size: 11px; color: var(--accent); font-weight: 700;
}
.set-rpe-badge {
  font-size: 10px; color: var(--text-muted);
  background: var(--border);
  padding: 2px 6px; border-radius: 4px;
}

/* DTP Set (pyramid) */
.dtp-sets-scroll {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin;
}
.dtp-set-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  min-width: 52px;
}
.dtp-set-chip:hover { border-color: var(--primary); }
.dtp-set-chip.logged { border-color: var(--accent); background: rgba(6,214,160,.08); }
.dtp-chip-reps { font-size: 16px; font-weight: 800; color: var(--primary); }
.dtp-set-chip.logged .dtp-chip-reps { color: var(--accent); }
.dtp-chip-label { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.dtp-chip-weight { font-size: 11px; color: var(--text); font-weight: 600; }

/* Circuit block */
.circuit-list { display: flex; flex-direction: column; gap: 8px; }
.circuit-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.circuit-check { accent-color: var(--accent); width: 16px; height: 16px; }
.circuit-name { font-size: 13px; font-weight: 600; flex: 1; }
.circuit-target { font-size: 12px; color: var(--text-muted); }

.btn-complete-workout {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(6,214,160,.25);
}
.btn-complete-workout:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(6,214,160,.35); }

.complete-banner {
  background: linear-gradient(135deg, rgba(6,214,160,.12), rgba(6,214,160,.04));
  border: 1px solid rgba(6,214,160,.3);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-size: 16px; font-weight: 700;
  color: var(--accent);
  margin-top: 14px;
}

/* ═══ CARDIO ═══ */
.cardio-session-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}
.cardio-session-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.cardio-session-badge {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
  flex-shrink: 0;
}
.badge-am { background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(245,158,11,.05)); color: var(--yellow); }
.badge-pm { background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(99,102,241,.05)); color: var(--primary); }
.cardio-session-meta { flex: 1; }
.csm-title { font-size: 16px; font-weight: 800; }
.csm-detail { font-size: 12px; color: var(--text-muted); }
.btn-cardio-done {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-cardio-done.done { border-color: var(--accent); color: var(--accent); background: rgba(6,214,160,.06); }
.cardio-options {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cardio-type-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.cardio-type-btn.selected { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.08); }

.cardio-guide-grid { display: flex; flex-direction: column; gap: 8px; }
.cardio-guide-item {
  display: flex; gap: 12px;
  padding: 10px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cguid-name { font-size: 12px; font-weight: 800; color: var(--primary); min-width: 65px; }
.cguid-desc { font-size: 12px; color: var(--text-muted); }

.cardio-streak-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cs-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 10px;
}
.cs-day-name { color: var(--text-muted); font-size: 9px; font-weight: 700; }
.cs-day-dots { display: flex; gap: 2px; margin-top: 2px; }
.cs-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.cs-dot.done { background: var(--accent); }

/* ═══ NUTRITION ═══ */
.refeed-badge {
  background: linear-gradient(135deg, var(--orange), #ef4444);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px; font-weight: 800;
}
.fitia-badge {
  background: rgba(6,214,160,.12);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}
.btn-refeed-toggle {
  background: none; border: 1px solid var(--orange);
  color: var(--orange);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  font-family: inherit;
}

.macro-circles-row {
  display: flex; gap: 12px; justify-content: center;
  margin-bottom: 18px; flex-wrap: wrap;
}
.macro-circle {
  text-align: center; position: relative;
}
.macro-circle-svg { display: block; }
.mc-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.mc-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.mc-val-num { font-size: 18px; font-weight: 900; display: block; }
.mc-val-unit { font-size: 10px; color: var(--text-muted); }

.macro-bars-detail {
  display: flex; flex-direction: column; gap: 10px;
}
.macro-bar-row { }
.mbr-header {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-bottom: 5px;
}
.mbr-name { font-weight: 600; }
.mbr-val { color: var(--text-muted); }
.mbr-track {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.mbr-fill {
  height: 100%; border-radius: 3px;
  transition: width .4s ease;
}

.nut-log-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.nut-input-group label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.nut-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  transition: border-color .2s;
}
.nut-input:focus { outline: none; border-color: var(--primary); }

.nut-extras-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.nut-extra-item { }
.nut-extra-label { font-size: 12px; font-weight: 600; display: block; margin-bottom: 7px; }
.water-glasses { display: flex; gap: 6px; flex-wrap: wrap; }
.water-glass {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: all .18s;
}
.water-glass.filled { border-color: var(--blue); background: rgba(59,130,246,.12); }

.meal-plan-list { display: flex; flex-direction: column; gap: 8px; }
.meal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.mi-header {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 7px;
}
.mi-time { font-size: 11px; color: var(--text-muted); font-weight: 700; min-width: 42px; }
.mi-icon { font-size: 18px; }
.mi-name { font-size: 13px; font-weight: 700; flex: 1; }
.mi-kcal {
  font-size: 12px; color: var(--text-muted);
  background: var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}
.mi-foods { display: flex; flex-direction: column; gap: 3px; }
.mi-food {
  font-size: 12px; color: var(--text-muted);
  padding-left: 14px; position: relative;
}
.mi-food::before { content: '·'; position: absolute; left: 4px; color: var(--primary); font-weight: 900; }

.phase-targets-table {
  overflow-x: auto;
}
.pt-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.pt-table th {
  text-align: left; padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em;
}
.pt-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.pt-table tr:last-child td { border-bottom: none; }
.pt-row-current { background: rgba(99,102,241,.05); }
.pt-row-current td:first-child { color: var(--primary); font-weight: 700; }

/* ═══ PROGRESS ═══ */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 18px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
}
.stat-val { font-size: 28px; font-weight: 900; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.stat-delta { font-size: 12px; font-weight: 700; margin-top: 5px; }
.delta-pos { color: var(--accent); }
.delta-neg { color: var(--red); }

.chart-card { padding: 20px; }
.chart-wrap { position: relative; height: 240px; }

.pr-list { display: flex; flex-direction: column; gap: 7px; }
.pr-item {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px; gap: 10px;
}
.pr-icon { font-size: 18px; }
.pr-name { flex: 1; font-size: 13px; font-weight: 600; }
.pr-weight {
  font-size: 16px; font-weight: 900;
  color: var(--yellow);
}
.pr-reps { font-size: 11px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table tr:last-child td { border-bottom: none; }
.td-change-pos { color: var(--accent); font-weight: 700; }
.td-change-neg { color: var(--red); font-weight: 700; }

/* ═══ PROGRAM CALENDAR ═══ */
.phase-legend-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
}
.pl-item {
  display: flex; align-items: center; gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px; font-weight: 600;
}
.pl-dot { width: 10px; height: 10px; border-radius: 50%; }

.program-week {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.pw-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.pw-num {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
  flex-shrink: 0;
}
.pw-info { flex: 1; }
.pw-title { font-size: 14px; font-weight: 700; }
.pw-sub { font-size: 11px; color: var(--text-muted); }
.pw-badges { display: flex; gap: 6px; }
.pw-badge {
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 800;
}
.badge-deload { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-refeed { background: rgba(239,68,68,.15); color: var(--red); }
.badge-current { background: rgba(99,102,241,.15); color: var(--primary); }

.pw-days {
  display: flex; gap: 5px;
}
.pw-day {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 4px;
  text-align: center;
  font-size: 10px;
}
.pw-day-name { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: 9px; }
.pw-day-type { font-size: 15px; margin: 3px 0; }
.pw-day-label { font-size: 9px; color: var(--text-muted); }
.pw-day.training { border-color: rgba(99,102,241,.3); background: rgba(99,102,241,.04); }
.pw-day.done { border-color: var(--accent); background: rgba(6,214,160,.06); }
.pw-day.today { border-color: var(--primary); background: rgba(99,102,241,.1); }
.pw-day.today .pw-day-name { color: var(--primary); }

/* ═══ MODALS ═══ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
.modal-set { max-width: 400px; }
@keyframes modalIn { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.modal-header h2 { font-size: 18px; font-weight: 800; }
.modal-close {
  background: var(--border); border: none; color: var(--text);
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px;
}
.modal-week-label {
  padding: 0 20px 8px;
  font-size: 13px; color: var(--text-muted);
}
.modal-body { padding: 16px 20px; }
.modal-inputs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-input-group { display: flex; flex-direction: column; gap: 5px; }
.modal-input-group.full { grid-column: 1 / -1; }
.modal-input-group label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.modal-input-group input, .modal-input-group textarea {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text); font-family: inherit; font-size: 14px;
}
.modal-input-group input:focus, .modal-input-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.modal-input-group textarea { min-height: 70px; resize: vertical; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.set-info-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 14px;
  font-size: 13px;
}

.rest-timer-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.rest-timer-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.rest-timer-display {
  font-size: 32px; font-weight: 900; text-align: center;
  color: var(--primary); margin-bottom: 10px;
}
.rest-timer-btns { display: flex; gap: 7px; }
.btn-timer {
  flex: 1;
  background: var(--border);
  border: none; color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .18s; font-family: inherit;
}
.btn-timer:hover { background: var(--primary); }
.btn-timer.active { background: var(--primary); }

/* ═══ BUTTONS ═══ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-secondary {
  background: var(--border); color: var(--text); border: none;
  border-radius: var(--radius-sm); padding: 11px 20px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.btn-secondary:hover { background: var(--card-hover); }

/* ═══ TOAST ═══ */
#toast-container {
  position: fixed; bottom: 80px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  animation: toastIn .25s ease;
  min-width: 200px;
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--red);   color: var(--red); }
.toast.info    { border-color: var(--blue);  color: var(--blue); }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .topbar { display: flex; }
  .bottom-nav { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: calc(var(--topbar-h) + 16px);
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
  }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-card:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-inputs { grid-template-columns: 1fr; }
  .nut-log-row { grid-template-columns: 1fr; }
  #toast-container { bottom: calc(var(--bottom-nav-h) + 12px); right: 12px; }
  .pw-days { flex-wrap: wrap; }
  .pw-day { min-width: 40px; flex: 0 0 calc(14% - 4px); }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .main-content { padding: 20px 22px; }
}
