/* =======================================
   RECORRIDO DEL GUERRERO
   Warrior Fitness Platform CSS
   ======================================= */

/* === CSS VARIABLES & THEMES === */
:root {
  /* Brand Colors - Calm Warrior Palette */
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --accent: #14B8A6;
  --accent2: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366F1 0%, #14B8A6 100%);
  --gradient-fire: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #14B8A6 100%);
  --gradient-warrior: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
  --gradient-steel: linear-gradient(135deg, #475569 0%, #64748B 100%);
  --gradient-dark: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  --gradient-card: linear-gradient(145deg, rgba(99,102,241,0.06), rgba(20,184,166,0.04));
  --gradient-ember: linear-gradient(135deg, #4F46E5 0%, #6366F1 50%, #14B8A6 100%);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  --shadow-glow: 0 0 20px rgba(99,102,241,0.3);
  --shadow-glow-gold: 0 0 20px rgba(20,184,166,0.3);

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

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-input: #F1F5F9;
  --bg-nav: rgba(255,255,255,0.9);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --border: rgba(15,23,42,0.08);
  --border-focus: var(--primary);
  --card-shadow: 0 2px 12px rgba(15,23,42,0.06);
  --overlay: rgba(15,23,42,0.4);
}

/* Dark Theme — Original warrior style */
[data-theme="dark"] {
  --bg-primary: #0C0505;
  --bg-secondary: #1A0A0A;
  --bg-tertiary: #2D1515;
  --bg-card: #1A0A0A;
  --bg-input: #2D1515;
  --bg-nav: rgba(12,5,5,0.92);
  --text-primary: #F5E6E6;
  --text-secondary: #BEA0A0;
  --text-tertiary: #6B4444;
  --border: rgba(255,200,200,0.08);
  --border-focus: var(--primary-light);
  --card-shadow: 0 2px 12px rgba(0,0,0,0.4);
  --overlay: rgba(0,0,0,0.65);
  /* Override brand colors for dark warrior feel */
  --primary: #DC2626;
  --primary-light: #EF4444;
  --primary-dark: #B91C1C;
  --accent: #F59E0B;
  --accent2: #EA580C;
  --gradient-primary: linear-gradient(135deg, #DC2626 0%, #F59E0B 100%);
  --gradient-fire: linear-gradient(135deg, #DC2626 0%, #EA580C 50%, #F59E0B 100%);
  --gradient-warrior: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --gradient-card: linear-gradient(145deg, rgba(220,38,38,0.08), rgba(245,158,11,0.04));
  --gradient-ember: linear-gradient(135deg, #7F1D1D 0%, #DC2626 50%, #EA580C 100%);
  --shadow-glow: 0 0 20px rgba(220,38,38,0.3);
  --shadow-glow-gold: 0 0 20px rgba(245,158,11,0.3);
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent); }

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

::selection {
  background: rgba(220,38,38,0.3);
  color: var(--text-primary);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* === TYPOGRAPHY === */
h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-gold {
  background: var(--gradient-warrior);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page-content {
  padding: var(--space-lg) 0;
  padding-bottom: 100px;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.grid {
  display: grid;
  gap: var(--space-md);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .md-grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.hidden { display: none !important; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* === TOP HEADER === */
.top-header {
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) var(--space-md);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

[data-theme="dark"] .top-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220,38,38,0.3), rgba(245,158,11,0.3), transparent);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.3rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-fire);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Notification bell */
.notification-bell {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
  position: relative;
}

.notification-bell:hover {
  background: var(--primary);
  color: white;
}

.notification-bell .notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-nav);
  animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* === THEME TOGGLE === */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--primary);
  color: white;
  transform: rotate(180deg);
}

/* === USER AVATAR === */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.user-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.user-avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
  border: 3px solid var(--accent);
}

.user-avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 2rem;
  border: 3px solid var(--accent);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
}

/* === BOTTOM NAVIGATION (Mobile) === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-xs) 0;
  padding-bottom: max(var(--space-xs), env(safe-area-inset-bottom));
  z-index: 100;
}

[data-theme="dark"] .bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220,38,38,0.3), rgba(245,158,11,0.3), transparent);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 56px;
  border: none;
  background: none;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
  line-height: 1;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 6px rgba(220,38,38,0.4));
}

.nav-item:hover {
  color: var(--primary-light);
}

/* Center FAB button */
.nav-fab {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 15px rgba(220,38,38,0.4);
  transition: var(--transition);
  position: relative;
}

.nav-fab::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  opacity: 0;
  z-index: -1;
  filter: blur(8px);
  transition: opacity 0.3s;
}

.nav-fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(220,38,38,0.5);
}

.nav-fab:hover::after {
  opacity: 0.5;
}

/* Floating action button (standalone) */
.fab {
  position: fixed;
  bottom: 88px;
  right: var(--space-md);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(220,38,38,0.4);
  transition: var(--transition);
  z-index: 50;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(220,38,38,0.5);
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  color: var(--text-primary);
}

button.card {
  color: var(--text-primary);
  font-family: var(--font);
  text-align: left;
}

.card:hover {
  border-color: rgba(var(--primary-rgb, 99,102,241),0.2);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .card:hover {
  border-color: rgba(220,38,38,0.2);
}

.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-gradient {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-warrior {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.card-warrior::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-fire);
}

.card-warrior::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(220,38,38,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-fire);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(220,38,38,0.1);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-fire);
  color: white;
  box-shadow: 0 4px 15px rgba(220,38,38,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220,38,38,0.4);
}

.btn-warrior {
  background: var(--gradient-warrior);
  color: #1A0A0A;
  box-shadow: 0 4px 15px rgba(245,158,11,0.3);
  font-weight: 700;
}
.btn-warrior:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,158,11,0.4);
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-outline-gold {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline-gold:hover {
  background: var(--accent);
  color: #1A0A0A;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* === INPUTS & FORMS === */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B5555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--gradient-fire);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Slider / Range */
.range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-fire);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(220,38,38,0.3);
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 10px rgba(220,38,38,0.5);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-fire);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(220,38,38,0.3);
}

/* === TAGS & BADGES === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  gap: 4px;
}

.tag-primary { background: rgba(220,38,38,0.15); color: var(--primary); }
.tag-success { background: rgba(22,163,74,0.15); color: var(--success); }
.tag-warning { background: rgba(245,158,11,0.15); color: #D97706; }
.tag-danger { background: rgba(220,38,38,0.15); color: var(--danger); }
.tag-info { background: rgba(59,130,246,0.15); color: var(--info); }
.tag-gold { background: rgba(245,158,11,0.15); color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-gold {
  background: var(--gradient-warrior);
  color: #1A0A0A;
}

/* === PROGRESS BARS === */
.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-fire);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-bar-lg { height: 12px; }

.progress-fill-gold {
  background: var(--gradient-warrior);
}

.progress-fill-green {
  background: linear-gradient(90deg, #16A34A, #4ADE80);
}

/* Circular Progress Indicator */
.circular-progress {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress .progress-track {
  fill: none;
  stroke: var(--bg-tertiary);
}

.circular-progress .progress-value {
  fill: none;
  stroke: url(#warrior-gradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-progress .progress-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.3s;
  padding: 16px;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  padding: var(--space-lg);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@media (min-width: 769px) {
  .modal-overlay { align-items: center; }
  .modal {
    max-width: 560px;
  }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--primary);
  color: white;
}

/* === EXERCISE LIST ITEM === */
.exercise-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.exercise-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--primary);
}

.exercise-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.exercise-info {
  flex: 1;
  min-width: 0;
}

.exercise-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exercise-meta {
  display: flex;
  gap: var(--space-sm);
  margin-top: 2px;
  flex-wrap: wrap;
}

/* === ROUTINE CARD === */
.routine-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.routine-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-fire);
  opacity: 0;
  transition: opacity 0.3s;
}

.routine-card:hover::before { opacity: 1; }
.routine-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(220,38,38,0.08);
}

.routine-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
}

/* === WORKOUT SET ROW === */
.set-row {
  display: grid;
  grid-template-columns: 40px 1fr 1fr 1fr 50px;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.set-row:last-child { border-bottom: none; }

.set-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.set-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.set-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(220,38,38,0.15);
}

.set-check {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
  color: transparent;
  font-size: 1rem;
}

.set-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
  animation: checkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* === MUSCLE MAP === */
.muscle-map {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.muscle-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: var(--transition);
}

.muscle-group-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.muscle-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.muscle-strength {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
  overflow: hidden;
}

.muscle-strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s;
}

.muscle-strong { background: var(--success); }
.muscle-balanced { background: var(--accent); }
.muscle-weak { background: var(--danger); }

/* === DIET PLAN === */
.meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: var(--transition);
}

.meal-card:hover {
  border-color: var(--accent);
}

.meal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.meal-macros {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
}

.macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.macro-value {
  font-weight: 700;
  font-family: var(--font-mono);
}

.macro-label {
  color: var(--text-tertiary);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.macro-protein .macro-value { color: #DC2626; }
.macro-carbs .macro-value { color: #F59E0B; }
.macro-fat .macro-value { color: #3B82F6; }

/* Meal logging */
.meal-log-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.meal-log-item:last-child { border-bottom: none; }

/* === CHART CONTAINER === */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 200px;
}

/* === DONUT CHART (CSS) === */
.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.donut-center {
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

/* === ACHIEVEMENT / BADGES === */
.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.achievement-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement-card.unlocked {
  border-color: var(--accent);
}

.achievement-card.unlocked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(245,158,11,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.achievement-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.achievement-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.achievement-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.achievement-xp {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

/* Badge display grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.badge-item.earned {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(245,158,11,0.15);
}

.badge-item .badge-icon {
  font-size: 2rem;
}

.badge-item .badge-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

/* === LEVEL / XP BAR === */
.level-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.level-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-fire);
}

.level-badge {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.level-info { flex: 1; }

.level-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === SECTION HEADER === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* === TABS === */
.tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  padding: 3px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  border: none;
  background: transparent;
  font-family: var(--font);
}

.tab.active {
  background: var(--gradient-fire);
  color: white;
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.tab:hover:not(.active) {
  color: var(--text-primary);
}

/* Underline tabs variant */
.tabs-underline {
  display: flex;
  gap: var(--space-lg);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs-underline::-webkit-scrollbar { display: none; }

.tab-underline {
  padding: var(--space-sm) 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  font-family: var(--font);
  position: relative;
  transition: var(--transition);
}

.tab-underline.active {
  color: var(--primary);
}

.tab-underline.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-fire);
  border-radius: var(--radius-full);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.empty-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  top: 70px;
  right: var(--space-md);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  transition: opacity 0.3s;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
.toast-warning { border-left: 4px solid var(--warning); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === AUTH SCREENS === */
.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(220,38,38,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(245,158,11,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo .logo-icon {
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  margin: 0 auto var(--space-md);
  box-shadow: 0 4px 20px rgba(220,38,38,0.3);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
}

.auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-top: var(--space-xs);
  font-size: 0.9rem;
}

.auth-switch {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover {
  color: var(--accent);
}

/* === FILTER CHIPS === */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-xs) 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: var(--font);
}

.chip.active {
  background: var(--gradient-fire);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}

.chip:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

/* === TIMER === */
.timer-display {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timer-display-lg {
  font-size: 4.5rem;
  letter-spacing: 0.05em;
}

/* Meditation timer circular */
.meditation-timer {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meditation-timer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--bg-tertiary);
}

.meditation-timer-progress {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  transition: transform 1s linear;
}

.meditation-timer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  z-index: 1;
}

.meditation-timer .timer-display {
  font-size: 2.5rem;
}

.meditation-timer-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Meditation session card */
.meditation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.meditation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  opacity: 0;
  transition: opacity 0.3s;
}

.meditation-card:hover::before { opacity: 1; }
.meditation-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* === SEARCH === */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

/* === HABIT CHECKLIST === */
.habit-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.habit-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.habit-item:hover {
  border-color: var(--accent);
}

.habit-item.completed {
  border-color: var(--success);
  background: rgba(22,163,74,0.05);
}

.habit-check {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-bounce);
  color: transparent;
  font-size: 0.9rem;
}

.habit-item.completed .habit-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
  animation: habitCheckBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes habitCheckBounce {
  0% { transform: scale(0.5) rotate(-10deg); }
  50% { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.habit-info {
  flex: 1;
  min-width: 0;
}

.habit-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.habit-item.completed .habit-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.habit-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.habit-streak.active {
  animation: streakPulse 2s infinite;
}

@keyframes streakPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Habit daily summary */
.habit-summary {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

.habit-summary-ring {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

/* === CALENDAR HEAT MAP === */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-tertiary);
  transition: var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 1;
}

.heatmap-cell[data-level="1"] { background: rgba(220,38,38,0.2); }
.heatmap-cell[data-level="2"] { background: rgba(220,38,38,0.4); }
.heatmap-cell[data-level="3"] { background: rgba(220,38,38,0.6); }
.heatmap-cell[data-level="4"] { background: rgba(220,38,38,0.8); }
.heatmap-cell[data-level="5"] { background: var(--primary); }

.heatmap-cell[data-level="5"]::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(220,38,38,0.4);
}

.heatmap-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.heatmap-legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* === JOURNAL === */
.journal-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition);
  position: relative;
}

.journal-entry::before {
  content: '';
  position: absolute;
  top: var(--space-lg);
  bottom: var(--space-lg);
  left: 0;
  width: 3px;
  background: var(--gradient-fire);
  border-radius: var(--radius-full);
}

.journal-entry:hover {
  border-color: var(--primary);
}

.journal-date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journal-content {
  margin-top: var(--space-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.journal-mood {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* === WIKI / NOTION-LIKE BLOCKS === */
.wiki-page {
  max-width: 768px;
  margin: 0 auto;
}

.wiki-cover {
  width: 100%;
  height: 200px;
  background: var(--gradient-dark);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
  position: relative;
}

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

.wiki-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-lg);
  line-height: 1.3;
}

.wiki-block {
  margin-bottom: var(--space-md);
}

.wiki-block-text {
  line-height: 1.8;
  color: var(--text-secondary);
}

.wiki-block-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--border);
}

.wiki-block-heading2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.wiki-block-callout {
  background: rgba(245,158,11,0.08);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-sm);
}

.wiki-block-callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.wiki-block-quote {
  border-left: 3px solid var(--primary);
  padding-left: var(--space-md);
  font-style: italic;
  color: var(--text-secondary);
}

.wiki-block-code {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
}

.wiki-block-list {
  padding-left: var(--space-lg);
  line-height: 1.8;
  color: var(--text-secondary);
}

.wiki-block-list li {
  margin-bottom: var(--space-xs);
}

.wiki-block-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wiki-block-toggle summary {
  padding: var(--space-md);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.wiki-block-toggle[open] summary {
  border-bottom: 1px solid var(--border);
}

.wiki-block-toggle .toggle-content {
  padding: var(--space-md);
}

.wiki-block-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}

.wiki-block-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-md) 0;
}

.wiki-block-image img {
  width: 100%;
  display: block;
}

.wiki-block-image figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  padding: var(--space-sm);
}

.wiki-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.wiki-toc-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.wiki-toc-list {
  list-style: none;
  padding: 0;
}

.wiki-toc-list li {
  padding: 4px 0;
}

.wiki-toc-list a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.wiki-toc-list a:hover {
  color: var(--primary);
}

/* === 12-WEEK PROGRAM === */
.program-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.program-week {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.program-week.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow);
}

.program-week.completed {
  border-color: var(--success);
}

.program-week.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.program-week-number {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.program-week.current .program-week-number {
  background: var(--gradient-fire);
  color: white;
}

.program-week.completed .program-week-number {
  background: var(--success);
  color: white;
}

.program-week-info { flex: 1; }

.program-week-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.program-week-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.program-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}

/* === COMMUNITY / FORUM === */
.community-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.community-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition);
}

.community-post:hover {
  border-color: rgba(220,38,38,0.2);
}

.community-post-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.community-post-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-fire);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.community-post-author {
  font-weight: 600;
  font-size: 0.95rem;
}

.community-post-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.community-post-body {
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.community-post-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.community-post-image img {
  width: 100%;
  display: block;
}

.community-post-actions {
  display: flex;
  gap: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.community-action {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  background: none;
  border: none;
  font-family: var(--font);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.community-action:hover {
  color: var(--primary);
  background: rgba(220,38,38,0.08);
}

.community-action.liked {
  color: var(--primary);
}

.community-action-icon {
  font-size: 1.1rem;
}

/* Timeline/Feed layout */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 10px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-primary);
}

.timeline-item.completed::before {
  background: var(--success);
}

/* === CONTENT / PHILOSOPHY === */
.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.quote-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-warrior);
}

.quote-text {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.quote-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.philosophy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition);
  cursor: pointer;
}

.philosophy-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow-gold);
}

/* === NOTIFICATIONS PAGE === */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.notification-item.unread {
  border-left: 3px solid var(--primary);
  background: rgba(220,38,38,0.03);
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notification-body { flex: 1; }

.notification-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* === PROFILE PAGE === */
.profile-header {
  text-align: center;
  padding: var(--space-xl) 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-section {
  margin-top: var(--space-lg);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.profile-menu-item:hover {
  background: var(--bg-tertiary);
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-icon {
  font-size: 1.2rem;
  width: 32px;
  text-align: center;
}

.profile-menu-text {
  flex: 1;
  font-weight: 500;
}

.profile-menu-arrow {
  color: var(--text-tertiary);
}

/* === ANIMATION CLASSES === */
.fade-in {
  animation: fadeIn 0.4s ease;
}

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

.slide-up {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
  animation: slideInLeft 0.4s ease;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRightAnim 0.4s ease;
}

@keyframes slideInRightAnim {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.glow-pulse {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(220,38,38,0.2); }
  50% { box-shadow: 0 0 20px rgba(220,38,38,0.4), 0 0 40px rgba(220,38,38,0.1); }
}

.fire-flicker {
  animation: fireFlicker 3s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% { text-shadow: 0 0 4px rgba(220,38,38,0.4); }
  25% { text-shadow: 0 0 8px rgba(234,88,12,0.6); }
  50% { text-shadow: 0 0 4px rgba(245,158,11,0.4); }
  75% { text-shadow: 0 0 8px rgba(220,38,38,0.6); }
  100% { text-shadow: 0 0 4px rgba(234,88,12,0.4); }
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* === SIMPLE CHART (CSS-only bar chart) === */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding: var(--space-sm) 0;
}

.bar {
  flex: 1;
  background: var(--gradient-fire);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-width: 8px;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.bar:hover {
  opacity: 0.8;
  box-shadow: 0 -2px 8px rgba(220,38,38,0.3);
}

.bar::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  white-space: nowrap;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.bar:hover::after {
  opacity: 1;
}

/* === SKELETON LOADING === */
.skeleton {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
  width: 80%;
}

.skeleton-text-short {
  width: 40%;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-md);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
}

/* === PULL TO REFRESH === */
.pull-indicator {
  text-align: center;
  padding: var(--space-md);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s;
}

.pull-indicator.visible {
  max-height: 60px;
}

.pull-indicator .pull-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* === CALCULATOR RESULT === */
.calc-result {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  margin-top: var(--space-md);
}

.calc-result .big-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* === ONBOARDING STEPS === */
.onboard-step {
  text-align: center;
  padding: var(--space-xl);
}

.onboard-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.onboard-option {
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.onboard-option:hover,
.onboard-option.selected {
  border-color: var(--primary);
  background: rgba(220,38,38,0.08);
}

.onboard-option .option-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

/* === PR INDICATOR === */
.pr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gradient-warrior);
  color: #1A0A0A;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
}

/* === LOADING SPINNER === */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: var(--space-xl) auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Large spinner variant */
.spinner-lg {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

/* === SWIPE HINT (Mobile) === */
@media (max-width: 768px) {
  .swipe-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .swipe-container::-webkit-scrollbar { display: none; }
  .swipe-container > * {
    scroll-snap-align: start;
  }
}

/* === DIVIDER === */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
}

.divider-warrior {
  height: 2px;
  background: var(--gradient-fire);
  margin: var(--space-md) 0;
  border-radius: var(--radius-full);
  opacity: 0.3;
}

/* === PHOTO GRID (Progress photos) === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.photo-grid-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.photo-grid-item:hover {
  border-color: var(--primary);
  transform: scale(1.03);
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.photo-compare-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .card { padding: var(--space-md); }
  .stat-value { font-size: 1.5rem; }
  .auth-card { padding: var(--space-lg); }
  .set-row { grid-template-columns: 32px 1fr 1fr 40px; gap: 4px; }
  .timer-display { font-size: 2.5rem; }
  .meditation-timer { width: 200px; height: 200px; }
  .wiki-title { font-size: 1.5rem; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .heatmap { gap: 2px; }
  .community-post { padding: var(--space-md); }
  .profile-stats { gap: var(--space-lg); }
}

@media (min-width: 769px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .muscle-map { grid-template-columns: repeat(3, 1fr); }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* === DESKTOP-ONLY VISIBILITY === */
.desktop-only { display: none; }

@media (min-width: 1024px) {
  /* --- Show desktop-only nav items --- */
  .desktop-only { display: flex; }

  /* --- Sidebar Navigation --- */
  .bottom-nav {
    top: 60px;
    bottom: auto;
    left: 0;
    right: auto;
    width: 220px;
    flex-direction: column;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: var(--space-md) var(--space-sm);
    height: calc(100vh - 60px);
    justify-content: flex-start;
    gap: var(--space-xs);
    overflow-y: auto;
  }
  .bottom-nav::before { display: none; }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-sm);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    min-width: unset;
    width: 100%;
    text-transform: none;
    letter-spacing: 0;
  }
  .nav-item .nav-icon { font-size: 1.2rem; }
  .nav-item.active {
    background: rgba(220,38,38,0.08);
  }
  [data-theme="light"] .nav-item.active {
    background: rgba(99,102,241,0.08);
  }
  .nav-item:hover {
    background: var(--bg-tertiary);
  }

  .nav-fab {
    margin-top: 0;
    width: 100%;
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
  }
  .nav-fab:hover { transform: none; box-shadow: 0 6px 20px rgba(220,38,38,0.5); }

  /* --- Layout --- */
  .page-content {
    margin-top: 60px;
    padding-bottom: var(--space-xl);
  }
  .container {
    margin-left: 236px;
    max-width: 1100px;
    padding: 0 var(--space-xl);
  }
  .top-header {
    padding-left: var(--space-lg);
    padding-right: var(--space-xl);
  }
  .fab {
    bottom: var(--space-lg);
    right: var(--space-xl);
  }

  /* --- Typography scale-up --- */
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.35rem; }

  /* --- Dashboard grids --- */
  .dashboard-stats {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: var(--space-lg);
  }
  .dashboard-actions {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: var(--space-lg);
  }

  /* --- Blog posts grid --- */
  .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  .blog-post-card { margin-bottom: 0; }

  /* --- More menu grid --- */
  .more-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* --- Exercises category grid --- */
  .exercises-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* --- Routines grid --- */
  .routines-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* --- Habits grid --- */
  .habits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* --- Profile stats grid --- */
  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--space-lg);
  }

  /* --- Community feed centering --- */
  .community-feed {
    max-width: 680px;
    margin: 0 auto;
  }

  /* --- Wiki page width --- */
  .wiki-page {
    padding: 0 var(--space-lg);
    max-width: 800px;
    margin: 0 auto;
  }

  /* --- Cards hover enhancement --- */
  .card:hover {
    transform: translateY(-2px);
  }
  .stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(220,38,38,0.12);
  }

  /* --- Modals centered on desktop --- */
  .modal-overlay { align-items: center; }
  .modal { max-width: 560px; }

  /* --- Forms max-width on desktop --- */
  .auth-card { max-width: 440px; }

  /* --- Chart container better height --- */
  .chart-canvas { height: 280px; }

  /* --- Toast positioning --- */
  .toast-container { right: var(--space-xl); }

  /* --- Achievement grid optimized --- */
  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  /* --- Program timeline 2-col on desktop --- */
  .program-timeline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

/* === EXTRA-WIDE SCREENS (1440px+) === */
@media (min-width: 1440px) {
  .container {
    max-width: 1200px;
    padding: 0 var(--space-2xl);
  }
  .blog-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .more-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .exercises-category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 1023px) {
  .page-content { margin-top: 60px; }

  /* Mobile defaults for new grid classes */
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: var(--space-lg);
  }
  .dashboard-actions {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: var(--space-lg);
  }
  .blog-posts-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }
  .more-menu-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .exercises-category-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .routines-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .habits-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--space-lg);
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === BLOG CONTENT === */
.blog-content h1 { font-size: 1.5rem; margin: 24px 0 12px; color: var(--text-primary); }
.blog-content h2 { font-size: 1.3rem; margin: 20px 0 10px; color: var(--text-primary); }
.blog-content h3 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--text-primary); }
.blog-content p { margin: 0 0 16px; color: var(--text-secondary); }
.blog-content ul, .blog-content ol { padding-left: 24px; margin: 0 0 16px; color: var(--text-secondary); }
.blog-content li { margin-bottom: 6px; line-height: 1.7; }
.blog-content strong { color: var(--text-primary); }
.blog-content em { color: var(--accent); }
.blog-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 16px 0;
  background: rgba(245,158,11,0.05);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}
.blog-content a { color: var(--primary-light); text-decoration: underline; }
.blog-content img { max-width: 100%; border-radius: var(--radius-md); margin: 16px 0; }
.blog-content pre, .blog-content code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.blog-content pre { padding: 16px; overflow-x: auto; margin: 16px 0; }

/* Audio player styling */
audio {
  width: 100%;
  border-radius: 8px;
  outline: none;
}
audio::-webkit-media-controls-panel { background: var(--bg-tertiary); }

/* === PRINT === */
@media print {
  .top-header, .bottom-nav, .fab, .toast-container { display: none; }
  .page-content { padding: 0; margin: 0; }
  .container { margin: 0; max-width: 100%; }
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}
