:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #23232f;
  --border: #2e2e3e;
  --primary: #6c63ff;
  --primary-dim: rgba(108,99,255,0.15);
  --green: #43b89c;
  --green-dim: rgba(67,184,156,0.15);
  --gold: #f5a623;
  --gold-dim: rgba(245,166,35,0.2);
  --text: #e8e8f0;
  --muted: #8888a0;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

nav {
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-brand { font-size: 1.1rem; font-weight: 700; }

main { max-width: 700px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* CHECK-IN BUTTONS */
.checkin-wrap { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.checkin-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}
.checkin-btn:hover { background: var(--primary-dim); }
.checkin-btn.checked { background: var(--primary); color: #fff; }

.cardio-btn {
  border-color: var(--green);
  color: var(--green);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}
.cardio-btn:hover { background: var(--green-dim); }
.cardio-btn.checked-cardio { background: var(--green); color: #fff; }

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h2 { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* LEGEND */
.legend { display: flex; gap: 1.25rem; margin-bottom: 1rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-dot.gym { background: var(--primary); }
.legend-dot.cardio { background: var(--green); }
.legend-dot.both { background: var(--gold); }

/* CALENDAR */
#calendar-container { overflow-x: auto; }
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; margin-bottom: 0.25rem; }
.cal-day-name { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 0.25rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.cal-month-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; margin: 0.75rem 0 0.25rem; }
.cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface2);
  min-width: 32px;
}
.cal-cell.empty { background: transparent; }
.cal-cell:not(.empty):not(.future) { cursor: pointer; }
.cal-cell:not(.empty):not(.future):hover { opacity: 0.75; outline: 2px solid var(--primary); }
.cal-cell.has-workout { background: var(--primary); color: #fff; font-weight: 600; }
.cal-cell.has-cardio { background: var(--green); color: #fff; font-weight: 600; }
.cal-cell.both { background: var(--gold); color: #1a1100; font-weight: 600; }
.cal-cell.today { outline: 2px solid var(--primary); }
.cal-cell.future { opacity: 0.25; cursor: default; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.modal-buttons { display: flex; flex-direction: column; gap: 0.6rem; }
.modal-btn {
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.modal-btn:hover { opacity: 0.85; }
.gym-btn { background: var(--gold); color: #1a1100; }
.gym-only-btn { background: var(--primary); color: #fff; }
.modal-cancel {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem;
}
.modal-cancel:hover { color: var(--text); }
