/* ===================================================
   Running Joy - Stylesheet
   Iron-Man / Stark Industries Athletic Tech Theme
   =================================================== */

:root {
  /* Iron Man Palette */
  --iron-red: #A3081E;
  --iron-red-bright: #D90429;
  --iron-red-dark: #64000F;
  --iron-red-gradient: linear-gradient(135deg, #E2252B 0%, #A3081E 60%, #68020F 100%);

  --stark-gold: #FFD700;
  --stark-gold-dark: #C58315;
  --stark-gold-light: #FFF275;
  --stark-gold-gradient: linear-gradient(135deg, #FFD700 0%, #F59E0B 100%);

  --arc-cyan: #00E5FF;
  --arc-cyan-dark: #0088A3;
  --arc-cyan-glow: 0 0 16px rgba(0, 229, 255, 0.45);
  --arc-cyan-gradient: linear-gradient(135deg, #00E5FF 0%, #0077B6 100%);

  /* Neutrals: Gunmetal & Titanium Carbon */
  --bg-dark: #0A0E17;
  --bg-surface: #101726;
  --card-bg: #141C2E;
  --card-header-bg: #19233A;
  --border-tech: #25334D;
  --border-gold: rgba(255, 215, 0, 0.28);
  --border-cyan: rgba(0, 229, 255, 0.35);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* UI Tokens */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --shadow-tech: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow-red: 0 4px 18px rgba(217, 4, 41, 0.35);
  --shadow-glow-gold: 0 4px 18px rgba(255, 215, 0, 0.25);
  --font-family: 'Rajdhani', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', 'Rajdhani', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 0%, rgba(217, 4, 41, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(0, 229, 255, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
    linear-gradient(to bottom, #0A0E17 0%, #0F1422 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px));
  min-height: 100vh;
}

/* App Wrapper */
.app-container {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
}

/* ================= Header ================= */
.app-header {
  margin-bottom: 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(217, 4, 41, 0.35);
  border: 1.5px solid var(--stark-gold);
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--stark-gold);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.reactor-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--arc-cyan);
  box-shadow: var(--arc-cyan-glow);
  animation: reactorPulse 2s infinite ease-in-out;
}

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

.brand-subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--arc-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-right-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-pill {
  background: rgba(20, 28, 46, 0.9);
  border: 1px solid var(--border-cyan);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--arc-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.user-pill:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--arc-cyan);
}

.race-countdown {
  background: var(--iron-red-gradient);
  border: 1.5px solid var(--stark-gold);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  color: white;
  text-align: center;
  box-shadow: var(--shadow-glow-red);
  display: flex;
  flex-direction: column;
}

.countdown-days {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--stark-gold);
}

.countdown-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  background: rgba(16, 23, 38, 0.95);
  padding: 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-tech);
  box-shadow: var(--shadow-tech);
  gap: 4px;
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-tab.active {
  background: var(--iron-red-gradient);
  color: #FFFFFF;
  border: 1px solid var(--stark-gold);
  box-shadow: 0 4px 14px rgba(217, 4, 41, 0.4);
}

.tab-icon {
  font-size: 1.1rem;
}

/* Tab Pane Visibility */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ================= Cards ================= */
.quote-card,
.workout-card,
.log-card,
.calendar-card,
.hero-stats-card,
.sport-stat-card,
.consistency-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-tech);
  border: 1px solid var(--border-tech);
  position: relative;
  overflow: hidden;
}

/* PWA Install Banner */
.pwa-install-banner {
  background: linear-gradient(135deg, #1C263B 0%, #101726 100%);
  border: 1px solid var(--border-cyan);
  color: white;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--arc-cyan-glow);
}

.pwa-install-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-icon {
  font-size: 1.8rem;
}

.pwa-install-info strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--arc-cyan);
  display: block;
}

.pwa-install-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-install-pwa {
  background: var(--stark-gold-gradient);
  color: #0A0E17;
  border: none;
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-glow-gold);
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-install-pwa:hover {
  transform: scale(1.05);
}

.btn-dismiss-pwa {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.btn-dismiss-pwa:hover {
  color: white;
}

/* Motivational Directive Card (Stark HUD) */
.quote-card {
  background: linear-gradient(135deg, #182338 0%, #111827 100%);
  border: 1px solid var(--border-gold);
  padding: 18px 20px;
}

.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.hud-tag {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--stark-gold);
  letter-spacing: 1.2px;
}

.arc-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--arc-cyan);
  box-shadow: var(--arc-cyan-glow);
}

.quote-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.quote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quote-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--arc-cyan);
}

.quote-refresh-btn {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid var(--stark-gold);
  color: var(--stark-gold);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.quote-refresh-btn:hover {
  background: var(--stark-gold);
  color: #0B0F19;
}

/* Date Navigator */
.date-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--border-tech);
}

.date-nav-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-tech);
  color: var(--stark-gold);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.date-nav-btn:hover {
  background: var(--iron-red-bright);
  color: white;
  border-color: var(--iron-red-bright);
}

.date-display {
  text-align: center;
  flex: 1;
}

.date-headline {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.date-subline {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--arc-cyan);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.btn-jump-today {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid var(--arc-cyan);
  color: var(--arc-cyan);
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-jump-today:hover {
  background: var(--arc-cyan);
  color: #0A0E17;
}

/* Workout Card */
.workout-card {
  border-left: 4px solid var(--iron-red-bright);
}

.workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sport-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 800;
  color: white;
  background: var(--iron-red-gradient);
  border: 1px solid var(--stark-gold);
  box-shadow: var(--shadow-glow-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sport-badge.sport-run { background: var(--iron-red-gradient); border-color: var(--stark-gold); }
.sport-badge.sport-walk { background: var(--stark-gold-gradient); color: #0A0E17; border-color: #FFFFFF; }
.sport-badge.sport-cross { background: var(--arc-cyan-gradient); border-color: #FFFFFF; }
.sport-badge.sport-rest { background: linear-gradient(135deg, #334155 0%, #1E293B 100%); border-color: #475569; }
.sport-badge.sport-race { background: linear-gradient(135deg, #FFD700 0%, #E2252B 100%); border-color: var(--arc-cyan); }

.phase-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 215, 0, 0.1);
  color: var(--stark-gold);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.workout-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.3;
}

/* Targets */
.workout-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.target-item {
  background: var(--bg-surface);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-tech);
  display: flex;
  flex-direction: column;
}

.target-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.target-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--stark-gold);
}

/* Coach Description */
.workout-description {
  background: var(--bg-surface);
  border-left: 3px solid var(--arc-cyan);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 14px;
}

.desc-heading {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--arc-cyan);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.workout-description p {
  font-size: 0.95rem;
  color: #CBD5E1;
  line-height: 1.5;
}

/* Log Status Banner */
.log-status-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.log-status-banner.visible {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.log-status-icon {
  font-size: 1.3rem;
}

.log-status-text {
  font-size: 0.92rem;
  font-weight: 800;
  color: #34D399;
}

/* ================= Log Card Form ================= */
.log-card-header {
  margin-bottom: 16px;
}

.log-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--stark-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.log-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Custom Checkbox */
.custom-checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  background: var(--bg-surface);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-tech);
  transition: all 0.2s;
}

.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 22px;
  height: 22px;
  background-color: var(--card-bg);
  border: 2px solid var(--stark-gold);
  border-radius: 6px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.custom-checkbox-container input:checked ~ .checkmark {
  background-color: var(--iron-red-bright);
  border-color: var(--stark-gold);
}

.checkmark::after {
  content: "✔";
  color: #FFFFFF;
  font-size: 14px;
  display: none;
}

.custom-checkbox-container input:checked ~ .checkmark::after {
  display: block;
}

/* Inputs & Select */
input[type="number"],
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-family);
  font-size: 1rem;
  border: 1.5px solid var(--border-tech);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--arc-cyan);
  box-shadow: var(--arc-cyan-glow);
}

/* Duration Inputs */
.duration-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.duration-field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.duration-field input {
  text-align: center;
  padding-right: 32px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--stark-gold);
}

.duration-unit {
  position: absolute;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  pointer-events: none;
  text-transform: uppercase;
}

.duration-colon {
  font-weight: 900;
  color: var(--stark-gold);
  font-size: 1.3rem;
}

/* Effort Selector */
.effort-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.effort-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-tech);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
  color: var(--text-secondary);
}

.effort-btn:hover {
  border-color: var(--stark-gold);
  transform: translateY(-2px);
}

.effort-btn.selected {
  border-color: var(--stark-gold);
  background: rgba(255, 215, 0, 0.12);
  color: var(--stark-gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.effort-emoji {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.effort-text {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Form Action Buttons */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary {
  flex: 1;
  background: var(--iron-red-gradient);
  border: 1.5px solid var(--stark-gold);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-glow-red);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(217, 4, 41, 0.55);
}

.btn-secondary {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #F87171;
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-secondary:hover {
  background: #DC2626;
  color: white;
}

/* ================= Calendar Tab ================= */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-tech);
  color: var(--stark-gold);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  background: var(--stark-gold);
  color: #0A0E17;
}

.cal-month-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--stark-gold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

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

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-tech);
  color: var(--text-secondary);
  padding: 5px 14px;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-transform: uppercase;
}

.chip.active {
  background: var(--iron-red-gradient);
  color: white;
  border-color: var(--stark-gold);
  box-shadow: 0 2px 10px rgba(217, 4, 41, 0.4);
}

/* Calendar Grid */
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--arc-cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.cal-day {
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-tech);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 48px;
}

.cal-day:hover {
  border-color: var(--arc-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}

.cal-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.cal-day.selected {
  border-color: var(--stark-gold);
  box-shadow: 0 0 0 2px var(--stark-gold);
}

.cal-day.today-highlight {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--stark-gold);
}

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cal-sport-emoji {
  font-size: 1rem;
  line-height: 1;
}

.cal-dist-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--stark-gold);
  line-height: 1;
}

/* Badge for completed workout */
.cal-completed-check {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #10B981;
  color: white;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-tech);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-run { background: var(--iron-red-bright); }
.dot-walk { background: var(--stark-gold); }
.dot-cross { background: var(--arc-cyan); }
.dot-rest { background: #64748B; }
.dot-done { background: #10B981; }

/* ================= Stats Tab ================= */
.hero-stats-card {
  background: linear-gradient(135deg, #A3081E 0%, #161F30 75%, #0B0F19 100%);
  border: 1.5px solid var(--stark-gold);
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
}

.hero-stats-icon {
  font-size: 2.6rem;
}

.hero-stats-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--stark-gold);
  text-transform: uppercase;
}

.hero-stats-date {
  font-size: 0.82rem;
  color: #E2E8F0;
  margin-bottom: 8px;
}

.hero-stats-counter {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-cyan);
  color: var(--arc-cyan);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  display: inline-block;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-tech);
  box-shadow: var(--shadow-tech);
  display: flex;
  flex-direction: column;
}

.stat-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--stark-gold);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Discipline Cards */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--stark-gold);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sport-stat-card {
  margin-bottom: 12px;
  padding: 16px;
  background: var(--bg-surface);
}

.card-run { border-left: 5px solid var(--iron-red-bright); }
.card-bike { border-left: 5px solid var(--arc-cyan); }

.sport-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sport-stat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sport-stat-emoji {
  font-size: 1.6rem;
}

.sport-stat-title h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
}

.sport-baseline-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--arc-cyan);
}

.sport-stat-miles {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--stark-gold);
}

.sport-stat-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card-bg);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-tech);
}

.detail-col {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Consistency Card */
.progress-bar-container {
  height: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-tech);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--iron-red-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
  box-shadow: var(--shadow-glow-red);
}

.consistency-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-secondary);
}

/* ================= Modal ================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  border: 1.5px solid var(--border-tech);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-sport-icon {
  font-size: 1.8rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--stark-gold);
}

.modal-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: white;
}

.modal-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-target-badge,
.modal-phase-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-tech);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--stark-gold);
}

.modal-desc {
  font-size: 0.95rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border-tech);
  margin: 14px 0;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--stark-gold);
  text-transform: uppercase;
}

.modal-log-details {
  background: var(--bg-surface);
  border: 1px solid var(--border-tech);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.modal-actions {
  display: flex;
}

/* Authentication Modal */
.auth-modal-content {
  text-align: center;
  border: 2px solid var(--stark-gold);
  box-shadow: 0 12px 36px rgba(217, 4, 41, 0.35);
  max-width: 400px;
}

.auth-icon-wrap {
  font-size: 3rem;
  margin-bottom: 8px;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--stark-gold);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.auth-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-error-msg {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid #DC2626;
  color: #FCA5A5;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  text-align: center;
}

.auth-submit-btn {
  margin-top: 6px;
  width: 100%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0B0F19;
  border: 1.5px solid var(--stark-gold);
  color: var(--stark-gold);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive tweaks */
@media (max-width: 420px) {
  .app-container {
    padding: 8px 10px;
  }
  .workout-targets {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
