/* ============================
   Boulder — Modern Workout Tracker
   Design inspired by Strava, Apple Fitness, Hevy
   ============================ */

/* --- Design Tokens --- */
:root {
  /* Brand — bold, vibrant */
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --primary-glow: rgba(124, 58, 237, 0.35);
  --secondary: #06b6d4;
  --secondary-glow: rgba(6, 182, 212, 0.25);
  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.25);

  /* Surfaces — deep, rich */
  --bg-dark: #07070f;
  --bg-surface: #11111e;
  --bg-card: #18182b;
  --bg-card-hover: #1f1f37;
  --bg-input: #1b1b30;
  --bg-elevated: #232340;

  /* Text — high contrast */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #555577;

  /* Semantic */
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.3);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --info: #3b82f6;

  /* Borders */
  --border: #2a2a48;
  --border-light: #3a3a58;

  /* Radii — more rounded for modern look */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 4px 32px var(--primary-glow);

  /* Animation */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.3s var(--smooth);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --max-width: 480px;
}

/* --- Theme Variants --- */
.theme-blue {
  --primary: #3b82f6; --primary-dark: #2563eb; --primary-light: #93c5fd; --primary-glow: rgba(59, 130, 246, 0.35);
}
.theme-teal {
  --primary: #0d9488; --primary-dark: #0f766e; --primary-light: #5eead4; --primary-glow: rgba(13, 148, 136, 0.35);
}
.theme-green {
  --primary: #22c55e; --primary-dark: #16a34a; --primary-light: #86efac; --primary-glow: rgba(34, 197, 94, 0.35);
}
.theme-orange {
  --primary: #f97316; --primary-dark: #ea580c; --primary-light: #fdba74; --primary-glow: rgba(249, 115, 22, 0.35);
}
.theme-pink {
  --primary: #ec4899; --primary-dark: #db2777; --primary-light: #f9a8d4; --primary-glow: rgba(236, 72, 153, 0.35);
}
.theme-indigo {
  --primary: #6366f1; --primary-dark: #4f46e5; --primary-light: #a5b4fc; --primary-glow: rgba(99, 102, 241, 0.35);
}

/* --- Theme Picker --- */
.theme-picker { display: flex; flex-wrap: wrap; gap: 12px; }
.theme-swatch {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; outline: none;
  transition: all 0.3s var(--spring); position: relative;
}
.theme-swatch:hover { transform: scale(1.2); }
.theme-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--bg-dark), 0 0 0 5px var(--primary);
}
.theme-swatch.theme-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.theme-swatch.theme-blue { background: linear-gradient(135deg, #3b82f6, #93c5fd); }
.theme-swatch.theme-teal { background: linear-gradient(135deg, #0d9488, #5eead4); }
.theme-swatch.theme-green { background: linear-gradient(135deg, #22c55e, #86efac); }
.theme-swatch.theme-orange { background: linear-gradient(135deg, #f97316, #fdba74); }
.theme-swatch.theme-pink { background: linear-gradient(135deg, #ec4899, #f9a8d4); }
.theme-swatch.theme-indigo { background: linear-gradient(135deg, #6366f1, #a5b4fc); }

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; height: 100%; }
body {
  font-family: var(--font); background: var(--bg-dark); color: var(--text-primary);
  min-height: 100%; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* --- Ambient glow --- */
body::before {
  content: ''; position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -15%, var(--primary-glow), transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 85%, var(--secondary-glow), transparent 60%),
    radial-gradient(ellipse 30% 30% at 20% 90%, var(--accent-orange-glow), transparent 50%);
  pointer-events: none; z-index: 0;
}
#app { position: relative; z-index: 1; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* --- App Shell --- */
.app-container {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0 20px 110px;
  min-height: 100vh; position: relative;
}

/* --- Header --- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 16px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 7, 15, 0.8);
  backdrop-filter: blur(20px) saturate(2);
  -webkit-backdrop-filter: blur(20px) saturate(2);
}
.logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -0.04em;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.header-actions { display: flex; gap: 6px; }

/* ============================
   BUTTONS — Bold & pill-like
   ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none;
  border-radius: var(--radius-full);
  font-family: var(--font); font-size: 0.875rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; text-decoration: none;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.95); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 24px var(--primary-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 40px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-card); color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover); border-color: var(--primary);
  box-shadow: 0 0 24px var(--primary-glow);
}

.btn-ghost {
  background: transparent; color: var(--text-secondary); padding: 8px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-sm { padding: 8px 18px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; box-shadow: 0 4px 20px var(--danger-glow); }
.btn-success { background: linear-gradient(135deg, var(--success), #16a34a); color: white; box-shadow: 0 4px 20px var(--success-glow); }

/* ============================
   CARDS — Glass-morphism
   ============================ */
.card {
  background: rgba(24, 24, 43, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(42, 42, 72, 0.6);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.card:hover {
  border-color: rgba(58, 58, 88, 0.8);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.card-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* ============================
   FORMS
   ============================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 14px 18px;
  background: rgba(27, 27, 48, 0.8);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font); font-size: 0.9rem;
  transition: all var(--transition); outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: rgba(24, 24, 43, 0.9);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2394a3b8' d='M7 9.825L2.175 5 3.238 3.938 7 7.7 10.763 3.937 11.825 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px;
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ============================
   TABS — Pill-style
   ============================ */
.tabs {
  display: flex; gap: 4px;
  background: rgba(17, 17, 30, 0.8);
  border-radius: var(--radius-full);
  padding: 4px; margin-bottom: 24px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 1; padding: 10px 20px; border: none;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  border-radius: var(--radius-full); cursor: pointer;
  transition: all var(--transition); white-space: nowrap; text-align: center;
}
.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.tab:hover:not(.active) { color: var(--text-primary); background: var(--bg-input); }

/* ============================
   VIEWS / ANIMATIONS
   ============================ */
.view { display: none; animation: fadeIn 0.4s var(--smooth) both; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================
   ONBOARDING
   ============================ */
.welcome-screen { text-align: center; padding: 60px 0 24px; }
.welcome-title {
  font-size: 3rem; font-weight: 900; letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary), var(--accent-orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 12px;
}
.welcome-sub { color: var(--text-secondary); font-size: 1rem; margin-bottom: 40px; line-height: 1.7; }
.onboarding-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
.onboarding-step {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 20px;
  background: rgba(24, 24, 43, 0.6);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left; transition: all var(--transition);
}
.onboarding-step:hover { border-color: var(--border-light); transform: translateX(6px); }
.step-number {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.step-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }
.step-text strong { color: var(--text-primary); }

/* ============================
   AVATAR
   ============================ */
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: white; flex-shrink: 0;
  box-shadow: 0 4px 24px var(--primary-glow);
}
.avatar-lg { width: 96px; height: 96px; font-size: 2.4rem; }

/* ============================
   STATS GRID — Like Apple Fitness rings section
   ============================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: rgba(24, 24, 43, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 20px 14px; text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-value { font-size: 2rem; font-weight: 900; color: var(--primary-light); letter-spacing: -0.04em; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ============================
   PLAN CARDS
   ============================ */
.plan-card {
  background: rgba(24, 24, 43, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: all var(--transition); cursor: pointer;
}
.plan-card:hover {
  border-color: var(--primary); transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--primary-glow);
}
.plan-card-body { padding: 24px; }
.plan-card-header {
  display: flex; align-items: start; justify-content: space-between; margin-bottom: 12px;
}
.plan-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; }
.plan-badge {
  display: inline-block; padding: 4px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  box-shadow: 0 2px 12px var(--primary-glow);
}
.plan-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.plan-meta {
  display: flex; gap: 20px; margin-top: 14px;
  font-size: 0.78rem; color: var(--text-muted);
}
.plan-meta span { display: flex; align-items: center; gap: 6px; }

/* ============================
   EXERCISE ITEMS
   ============================ */
.exercise-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: rgba(27, 27, 48, 0.6);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.exercise-item:hover { border-color: var(--border-light); transform: translateX(4px); }

.exercise-icon {
  width: 48px; height: 48px; border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0; font-weight: 700;
}
.exercise-icon.chest { background: rgba(124, 58, 237, 0.15); color: var(--primary-light); }
.exercise-icon.back { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.exercise-icon.legs { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.exercise-icon.shoulders { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.exercise-icon.arms { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.exercise-icon.core { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.exercise-icon.fullbody { background: rgba(124, 58, 237, 0.12); color: var(--primary-light); }
.exercise-icon.cardio { background: rgba(249, 115, 22, 0.15); color: #fb923c; }

.exercise-info { flex: 1; min-width: 0; }
.exercise-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.exercise-details { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.exercise-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ============================
   SET TRACKER — Modern card-style rows
   ============================ */
.set-row {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 42px;
  gap: 10px; align-items: center;
  padding: 12px 14px;
  background: rgba(17, 17, 30, 0.6);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.set-row:hover { background: rgba(27, 27, 48, 0.6); }

.set-number {
  color: var(--text-muted); font-weight: 700; text-align: center; font-size: 0.8rem;
}

.set-input {
  width: 100%; padding: 8px 10px;
  background: rgba(24, 24, 43, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-mono); font-size: 0.85rem;
  text-align: center; outline: none;
  transition: all var(--transition);
}
.set-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.set-checkbox {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s var(--spring);
  background: transparent; color: transparent;
  margin: 0 auto;
}
.set-checkbox:hover { border-color: var(--success); transform: scale(1.1); }
.set-checkbox.done {
  background: linear-gradient(135deg, var(--success), #16a34a);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px var(--success-glow);
}

/* Set header */
.set-row-header {
  display: grid;
  grid-template-columns: 32px 1fr 1fr 42px;
  gap: 10px; align-items: center;
  padding: 8px 14px 10px;
  font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

/* ============================
   REST TIMER — Apple Fitness style
   ============================ */
.rest-timer-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 7, 15, 0.95);
  backdrop-filter: blur(30px) saturate(2);
  -webkit-backdrop-filter: blur(30px) saturate(2);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
}
.rest-timer-overlay.active { display: flex; animation: scaleIn 0.3s var(--spring); }

.rest-timer-display {
  font-size: 6rem; font-weight: 900;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  text-shadow: 0 0 80px var(--primary-glow);
}
.rest-timer-label {
  font-size: 0.9rem; color: var(--text-muted); margin-top: 12px;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
}
.rest-timer-controls { display: flex; gap: 20px; margin-top: 32px; }
.rest-timer-presets { display: flex; gap: 10px; margin-top: 24px; }
.rest-preset-btn {
  padding: 10px 24px;
  background: rgba(24, 24, 43, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font); font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
}
.rest-preset-btn:hover {
  border-color: var(--primary); color: var(--primary-light);
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 0 24px var(--primary-glow);
  transform: translateY(-2px);
}

/* ============================
   ACTIVE WORKOUT
   ============================ */
.active-workout-header { text-align: center; padding: 20px 0; }
.active-workout-timer {
  font-size: 3.2rem; font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--primary-light);
  letter-spacing: -0.05em;
  text-shadow: 0 0 60px var(--primary-glow);
}
.active-workout-label {
  font-size: 0.78rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  margin-top: 6px;
}

.exercise-section { margin-bottom: 28px; }
.exercise-section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.exercise-section-title h3 {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.03em;
}

/* ============================
   QUICK STATS — Like Strava
   ============================ */
.quick-stats {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 0 20px;
  -webkit-overflow-scrolling: touch;
}
.quick-stat {
  flex-shrink: 0; padding: 14px 22px;
  background: rgba(24, 24, 43, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center; min-width: 90px;
}
.quick-stat-value { font-size: 1.3rem; font-weight: 800; color: var(--primary-light); letter-spacing: -0.03em; }
.quick-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; font-weight: 600; }

/* ============================
   VIDEO
   ============================ */
.video-container {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: var(--radius-sm); margin-bottom: 14px;
  background: var(--bg-dark); box-shadow: var(--shadow-sm);
}
.video-container iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none; border-radius: var(--radius-sm);
}

/* ============================
   PROGRESS BAR — Thinner, glowing
   ============================ */
.progress-bar {
  height: 6px;
  background: rgba(27, 27, 48, 0.8);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--smooth);
  box-shadow: 0 0 12px var(--primary-glow);
}
.progress-stats {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted); margin-top: 8px;
}

/* ============================
   CHARTS
   ============================ */
.chart-container {
  background: rgba(24, 24, 43, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.chart-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================
   BOTTOM NAV — Pill-style active
   ============================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(24, 24, 43, 0.9);
  backdrop-filter: blur(20px) saturate(2);
  -webkit-backdrop-filter: blur(20px) saturate(2);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
  max-width: var(--max-width); margin: 0 auto;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  color: var(--text-muted);
  font-family: var(--font); font-size: 0.6rem; cursor: pointer;
  padding: 6px 16px; transition: all var(--transition);
  position: relative; text-transform: uppercase; font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
}
.nav-item .nav-icon { font-size: 1.4rem; transition: all var(--transition); }
.nav-item.active {
  color: var(--primary-light);
  background: rgba(124, 58, 237, 0.1);
}
.nav-item.active .nav-icon { transform: scale(1.15); }

/* ============================
   MODAL — Bottom sheet style
   ============================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: rgba(24, 24, 43, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: var(--max-width);
  max-height: 85vh; overflow-y: auto;
  padding: 28px 24px env(safe-area-inset-bottom, 28px);
  animation: slideUp 0.4s var(--spring);
  border-top: 1px solid var(--border);
  position: relative;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px;
}
.modal-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; }
.modal-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.5rem; cursor: pointer;
  width: 38px; height: 38px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }

/* ============================
   EMPTY STATES
   ============================ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state-text { font-size: 0.9rem; margin-bottom: 20px; line-height: 1.6; }

/* ============================
   TAGS
   ============================ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 14px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
}
.tag-beginner { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.tag-intermediate { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.tag-advanced { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.tag-strength { background: rgba(124, 58, 237, 0.12); color: var(--primary-light); }
.tag-hypertrophy { background: rgba(6, 182, 212, 0.12); color: var(--secondary); }
.tag-endurance { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.tag-weight-loss { background: rgba(34, 197, 94, 0.12); color: var(--success); }

/* ============================
   TOOLTIP
   ============================ */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); padding: 6px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xs); font-size: 0.72rem;
  color: var(--text-secondary); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s var(--smooth);
}
.tooltip:hover::after { opacity: 1; }

/* ============================
   TOAST
   ============================ */
.toast {
  animation: slideUp 0.4s var(--spring), fadeOut 0.4s var(--smooth) 2.6s forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 400px) {
  .app-container { padding: 0 14px 100px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 16px 10px; }
  .stat-value { font-size: 1.5rem; }
  .plan-card-body { padding: 18px; }
  .btn { padding: 10px 20px; font-size: 0.85rem; }
}
@media (min-width: 768px) {
  .app-container { padding: 0 24px 100px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================
   UTILITIES
   ============================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ============================
   SKELETON LOADING
   ============================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%; animation: shimmer 1.8s infinite; border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ============================
   TOGGLE SWITCH
   ============================ */
.toggle {
  width: 50px; height: 28px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  position: relative; cursor: pointer; transition: background 0.3s var(--smooth);
  border: none; flex-shrink: 0;
}
.toggle.active { background: var(--primary); box-shadow: 0 0 16px var(--primary-glow); }
.toggle::after {
  content: ''; width: 24px; height: 24px; background: white;
  border-radius: 50%; position: absolute; top: 2px; left: 2px;
  transition: transform 0.3s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle.active::after { transform: translateX(22px); }

/* ============================
   OFFLINE BANNER
   ============================ */
.offline-banner {
  display: none; background: linear-gradient(90deg, var(--warning), #d97706);
  color: #1a1a1a; text-align: center;
  padding: 10px 16px; font-size: 0.78rem; font-weight: 700;
}
.offline-banner.visible { display: block; }

/* ============================
   MOTIVATION
   ============================ */
.motivation-banner { animation: fadeIn 0.6s var(--smooth); }

/* ============================
   WORKOUT SUMMARY
   ============================ */
.workout-summary-section { margin-bottom: 24px; }
.workout-summary-section h3 {
  font-size: 0.85rem; font-weight: 700; margin-bottom: 14px;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.workout-summary-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* ============================
   WEEK CALENDAR
   ============================ */
.week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.day-cell {
  text-align: center; padding: 10px 4px;
  border-radius: var(--radius-xs);
  background: rgba(27, 27, 48, 0.6);
  font-size: 0.72rem; color: var(--text-muted);
  transition: all var(--transition);
}
.day-cell.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}
.day-cell.has-workout { border: 1px solid var(--primary); }
