/* =============================================
   PROTOCOL APP - Dark Theme CSS
   ============================================= */

:root {
  --bg-primary: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-input: #111111;
  --accent: #00d4ff;
  --accent-hover: #00b8e0;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --green: #00ff88;
  --gold: #ffd700;
  --red: #ff4444;
  --orange: #ff8c00;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border: #2a2a2a;
  --border-accent: #00d4ff44;
  --nav-height: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

/* =============================================
   BASE / RESET
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  transition: var(--transition);
}

input, textarea, select {
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  outline: none;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; }
small { font-size: 0.8em; color: var(--text-muted); }

/* =============================================
   LAYOUT
   ============================================= */
#app-wrapper {
  position: relative;
  min-height: 100vh;
}

.main-content {
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
}

.view {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* =============================================
   BOTTOM NAV
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: #111111;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  background: transparent;
  color: var(--text-muted);
  min-height: 56px;
  transition: var(--transition);
  border-radius: 8px;
}

.nav-btn.active {
  color: var(--accent);
}

.nav-btn.active .nav-icon {
  transform: scale(1.2);
}

.nav-icon {
  font-size: 22px;
  transition: var(--transition);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================
   COMMON COMPONENTS
   ============================================= */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 8px;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.week-badge {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-accent);
}

/* Cards */
.nutrition-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  min-height: 48px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #0080ff);
  color: #000;
  font-weight: 700;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow); }
.btn-accent:disabled { opacity: 0.7; transform: none; }

.btn-success {
  background: var(--green);
  color: #000;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  min-height: 56px;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 36px;
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  font-size: 18px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg-card); color: var(--accent); }

.btn-icon-sm {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  color: var(--text-muted);
}
.btn-icon-sm:hover { color: var(--red); }

/* Progress Bars */
.progress-bar-container {
  background: var(--border);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0080ff);
  border-radius: 8px;
  transition: width 0.5s ease;
}

/* Forms */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  min-height: 48px;
}

.form-input.small {
  width: 100%;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
}

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  min-height: 80px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

.form-section { margin-bottom: 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }

/* Checkboxes and Radio Cards */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

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

.checkbox-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  min-height: 52px;
}

.checkbox-card input[type="checkbox"] { display: none; }
.checkbox-card.checked {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}

.check-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  color: transparent;
  transition: var(--transition);
}
.checkbox-card.checked .check-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.radio-group { display: flex; flex-direction: column; gap: 8px; }

.radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 60px;
}
.radio-card input[type="radio"] { display: none; }
.radio-card div { display: flex; flex-direction: column; gap: 2px; }
.radio-card strong { font-size: 15px; }
.radio-card small { font-size: 12px; color: var(--text-muted); }
.radio-card.checked {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.radio-card.checked .check-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.radio-card.checked strong { color: var(--accent); }

/* Range Input */
.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  border: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); }
.toast-warning { border-color: var(--gold); color: var(--gold); }
.toast-error { border-color: var(--red); color: var(--red); }
.toast-info { border-color: var(--accent); color: var(--accent); }

/* Info/Disclaimer Cards */
.info-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.info-icon { font-size: 20px; flex-shrink: 0; }

.disclaimer-card {
  background: rgba(255, 140, 0, 0.08);
  border: 1px solid rgba(255, 140, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: #ffb74d;
  margin-bottom: 12px;
  line-height: 1.5;
}
.disclaimer-card strong { display: block; margin-bottom: 4px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}
.modal-content {
  position: relative;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  background: var(--bg-card);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-card-hover); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { margin-bottom: 24px; }
.empty-state-sm { color: var(--text-muted); font-size: 14px; padding: 8px 0; }

/* =============================================
   ONBOARDING
   ============================================= */
.onboarding-container {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
}

.onboarding-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), #0080ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.onboarding-step-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.onboarding-content {
  padding-top: 8px;
  padding-bottom: 24px;
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}

.step-header {
  text-align: center;
  padding: 24px 0 28px;
}
.step-icon { font-size: 48px; margin-bottom: 12px; }
.step-header h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.step-header p { color: var(--text-muted); font-size: 15px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.facility-icon { font-size: 24px; margin-bottom: 2px; }

.injury-card { justify-content: center; text-align: center; flex-direction: column; }

/* Review Step */
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.review-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.review-value { font-size: 14px; font-weight: 600; color: var(--accent); }

/* =============================================
   DASHBOARD
   ============================================= */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 12px;
}
.greeting-text { font-size: 16px; color: var(--text-muted); margin-bottom: 4px; }
.dashboard-date { font-size: 22px; font-weight: 800; line-height: 1.2; }
.week-progress-badge {
  text-align: center;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 10px 14px;
}
.week-num { font-size: 22px; font-weight: 900; color: var(--accent); }
.week-of { font-size: 11px; color: var(--text-muted); }

.program-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.progress-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.progress-pct { font-size: 12px; color: var(--accent); margin-top: 6px; text-align: right; }

/* Dashboard Cards */
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  active-transform: none;
}
.dashboard-card:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.dashboard-card:active { transform: scale(0.98); }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.card-icon { font-size: 20px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.card-badge-complete { background: rgba(0,255,136,0.15); color: var(--green); padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }

.card-body { margin-bottom: 10px; }
.card-main-text { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.card-sub-text { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

.exercise-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ex-chip {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.card-action { font-size: 13px; color: var(--accent); font-weight: 500; }

.mini-progress-bar {
  background: var(--border);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
  margin: 8px 0;
}
.mini-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0080ff);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.macro-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.macro-chip {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.macro-chip.protein { background: rgba(0,212,255,0.1); color: var(--accent); }
.macro-chip.carbs { background: rgba(0,255,136,0.1); color: var(--green); }
.macro-chip.fat { background: rgba(255,215,0,0.1); color: var(--gold); }

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.stat-item:hover { border-color: var(--accent); }
.stat-icon { font-size: 24px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* =============================================
   WORKOUT TRACKER
   ============================================= */
.workout-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.workout-name { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.workout-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-muted); }
.completed-badge { background: rgba(0,255,136,0.15); color: var(--green); padding: 6px 14px; border-radius: 20px; display: inline-block; font-weight: 600; margin-top: 10px; }
.completed-badge-large { text-align: center; font-size: 18px; font-weight: 700; color: var(--green); padding: 16px; }

/* Timer */
.timer-section {
  text-align: center;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.timer-display {
  font-size: 40px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.timer-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Rest Timer */
.rest-timer-section { margin-bottom: 12px; }
.rest-timer-bar {
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rest-label { font-size: 13px; font-weight: 700; color: var(--gold); }
.rest-countdown { font-size: 20px; font-weight: 900; color: var(--gold); flex: 1; }

/* Exercise Cards */
.exercises-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.exercise-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.exercise-info { flex: 1; }
.exercise-name { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.exercise-meta { font-size: 13px; color: var(--text-muted); }
.exercise-actions { display: flex; gap: 4px; }

/* Sets Table */
.sets-table { display: flex; flex-direction: column; gap: 4px; }

.sets-header {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 1fr 48px;
  gap: 6px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 1fr 48px;
  gap: 6px;
  align-items: center;
  padding: 6px 4px;
  border-radius: 8px;
  transition: var(--transition);
}

.set-row.set-completed {
  background: rgba(0,255,136,0.05);
  opacity: 0.8;
}

.set-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.set-target { font-size: 12px; color: var(--text-muted); text-align: center; }

.set-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 15px;
  text-align: center;
  min-height: 44px;
  width: 100%;
  color: var(--text-primary);
}
.set-input:focus { border-color: var(--accent); }
.set-input:disabled { opacity: 0.5; }

.set-complete-btn {
  background: var(--border);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  transition: var(--transition);
}
.set-complete-btn.set-done {
  background: var(--green);
  color: #000;
}

.add-set-btn {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  font-size: 13px;
  transition: var(--transition);
}
.add-set-btn:hover { border-color: var(--accent); color: var(--accent); }

.workout-notes-section { margin-bottom: 16px; }

.workout-actions { margin-bottom: 24px; }

/* Swap Modal */
.swap-current {
  padding: 16px 20px 0;
}
.swap-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.swap-exercise-name { font-size: 16px; font-weight: 700; color: var(--text-muted); padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.swap-list { padding: 0; }
.swap-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.swap-option:hover { background: var(--bg-card); }
.swap-opt-name { font-size: 16px; font-weight: 600; flex: 1; }
.swap-opt-meta { font-size: 13px; color: var(--text-muted); }
.swap-chevron { color: var(--accent); }

/* Rest Day */
.rest-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}
.rest-day-icon { font-size: 56px; margin-bottom: 16px; }
.rest-day-card h2 { font-size: 24px; margin-bottom: 8px; }
.rest-day-card p { color: var(--text-muted); margin-bottom: 24px; }
.rest-suggestions { text-align: left; }
.rest-suggestions h3 { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.rest-item { padding: 8px 0; color: var(--text-secondary); font-size: 15px; border-bottom: 1px solid var(--border); }

/* =============================================
   NUTRITION TRACKER
   ============================================= */
.macro-overview {
  text-align: center;
  padding: 20px;
}
.calorie-display { margin-bottom: 16px; }
.calorie-remaining { font-size: 48px; font-weight: 900; color: var(--accent); line-height: 1; }
.calorie-label { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.calorie-bar-wrap { max-width: 300px; margin: 0 auto; }
.calorie-bar {
  background: var(--border);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.calorie-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0080ff);
  transition: width 0.5s ease;
}
.calorie-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.macros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.macro-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.macro-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.macro-value { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.macro-unit { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.macro-bar {
  background: var(--border);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}
.macro-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Water */
.water-tracker { display: flex; flex-direction: column; gap: 8px; }
.water-display { font-size: 18px; font-weight: 700; color: #4fc3f7; }
.water-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Glucose Timing */
.timing-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.timing-item:last-child { border-bottom: none; }
.timing-header { font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.timing-rec { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.timing-note { font-size: 12px; color: var(--text-muted); }

/* Food Search */
.food-search-wrap { margin-bottom: 8px; }
#food-search-results { max-height: 250px; overflow-y: auto; }
.food-result {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.food-result:hover { background: var(--bg-card-hover); }
.food-result-name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.food-result-macros { font-size: 12px; color: var(--text-muted); }
.no-results { color: var(--text-muted); font-size: 14px; padding: 12px; }

/* Manual Entry */
.manual-entry-form { padding-top: 12px; }
.manual-macros-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0;
}
.manual-macros-row label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; display: block; }

/* Meal Entry */
.meal-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.meal-entry:last-child { border-bottom: none; }
.meal-info { flex: 1; }
.meal-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.meal-macros { font-size: 12px; color: var(--text-muted); }

/* Supplements */
.supplement-item {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.supplement-item:last-child { border-bottom: none; }

/* =============================================
   PEPTIDE TRACKER
   ============================================= */
.peptide-schedule { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

.time-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.time-block-header {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.peptide-dose-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.peptide-dose-row:last-child { border-bottom: none; }
.peptide-dose-row.dose-logged { background: rgba(0,255,136,0.04); }

.peptide-dose-info { flex: 1; }
.peptide-dose-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.peptide-dose-amount { font-size: 13px; color: var(--text-muted); }
.dose-time { font-size: 12px; color: var(--green); margin-top: 2px; }

.peptide-dose-actions { display: flex; align-items: center; gap: 4px; }

.dose-btn {
  background: var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  min-width: 60px;
  transition: var(--transition);
}
.dose-btn:hover { border: 1px solid var(--accent); color: var(--accent); }
.dose-btn.dose-btn-done {
  background: rgba(0,255,136,0.2);
  color: var(--green);
}

/* Synergy Note */
.synergy-note {
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.synergy-note:last-child { border-bottom: none; }

/* Peptide Reference */
.peptide-ref-card {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.peptide-ref-card:last-child { border-bottom: none; }
.peptide-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  cursor: pointer;
}
.peptide-ref-header strong { font-size: 15px; }
.expand-icon { color: var(--text-muted); transition: transform 0.2s; }
.peptide-ref-card.expanded .expand-icon { transform: rotate(180deg); }
.peptide-ref-details { display: none; padding-bottom: 14px; }
.peptide-ref-card.expanded .peptide-ref-details { display: block; }
.ref-row { font-size: 13px; padding: 3px 0; color: var(--text-secondary); }
.ref-label { color: var(--accent); font-weight: 600; }
.ref-notes { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.ref-warning { font-size: 12px; color: var(--orange); margin-top: 8px; }

/* Cycle Tracking */
.cycle-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cycle-item:last-child { border-bottom: none; }
.cycle-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.cycle-name { font-size: 15px; font-weight: 600; }
.cycle-week { font-size: 13px; color: var(--accent); }
.cycle-bar {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}
.cycle-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0080ff);
  border-radius: 4px;
}
.cycle-start { font-size: 11px; color: var(--text-muted); }

/* Dose History */
.history-day {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.history-day:last-child { border-bottom: none; }
.history-date { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.history-doses { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.history-detail { display: flex; flex-wrap: wrap; gap: 4px; }
.dose-tag {
  background: rgba(0,212,255,0.1);
  color: var(--accent);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
}

/* =============================================
   RECOVERY TRACKER
   ============================================= */
.checkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.checkin-row:last-child { border-bottom: none; }
.checkin-label { font-size: 14px; font-weight: 500; }

.rating-buttons { display: flex; gap: 6px; }
.rating-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}
.rating-btn.rating-active {
  background: var(--accent);
  color: #000;
}

/* Protocol Steps */
.protocol-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.protocol-timing { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.science-note {
  background: rgba(0,212,255,0.05);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 12px;
  line-height: 1.5;
}
.protocol-steps { display: flex; flex-direction: column; gap: 8px; }
.protocol-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-badge {
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-info { flex: 1; }
.step-activity { font-size: 15px; font-weight: 600; }
.step-detail { font-size: 13px; color: var(--accent); margin-bottom: 2px; }
.step-note { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Log Session */
.log-session-form { display: flex; flex-direction: column; gap: 8px; }
.session-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Recovery Session Item */
.recovery-session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.recovery-session-item:last-child { border-bottom: none; }
.recovery-session-info { flex: 1; }
.recovery-session-type { font-size: 15px; font-weight: 600; }
.recovery-session-meta { font-size: 13px; color: var(--text-muted); }

/* Injury Notes */
.injury-note-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.injury-note-item:last-child { border-bottom: none; }
.injury-area { font-size: 14px; color: var(--red); margin-bottom: 4px; }
.injury-advice { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* =============================================
   SETTINGS
   ============================================= */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row span:last-child { color: var(--accent); font-weight: 500; }

.macro-adjust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.macro-adjust-row:last-of-type { border-bottom: none; }
.macro-adjust-row label { font-size: 14px; flex: 1; }
.macro-adjust-row input { max-width: 100px; }

/* Week Overview Modal */
.week-overview-row {
  display: grid;
  grid-template-columns: 50px 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.week-overview-row:last-child { border-bottom: none; }
.week-row-today { background: var(--accent-glow); border-radius: 8px; padding: 12px 8px; margin: 0 -8px; }
.week-day-name { font-weight: 700; color: var(--accent); }
.week-workout-name { font-size: 14px; color: var(--text-secondary); }
.week-status { text-align: right; font-size: 18px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (min-width: 500px) {
  .view { padding: 20px; }
  .checkbox-grid { grid-template-columns: repeat(3, 1fr); }
  .manual-macros-row { gap: 12px; }
  .stats-grid { gap: 14px; }
}

@media (max-width: 380px) {
  .sets-header, .set-row {
    grid-template-columns: 32px 0.8fr 1fr 1fr 44px;
  }
  .nav-label { display: none; }
  .nav-icon { font-size: 24px; }
  .nav-btn { min-height: 56px; }
}

/* PWA safe areas */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
  .main-content {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
  }
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }
* { -webkit-overflow-scrolling: touch; }
