@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;1,9..144,300&family=DM+Sans:wght@400;500&display=swap');

:root {
  --ink:      #0f0e0d;
  --ink2:     #3d3b38;
  --ink3:     #7a786f;
  --ink4:     #b8b5ac;
  --surface:  #faf9f7;
  --card:     #ffffff;
  --border:   #e8e5de;
  --accent:   #d4522a;
  --accent2:  #2a6dd4;
  --teal:     #1a8f6e;
  --amber:    #c47f1a;
  --purple:   #5a3fc0;
  --r:        10px;
  --r-lg:     16px;
  --mono:     'DM Mono', monospace;
  --serif:    'Fraunces', serif;
  --sans:     'DM Sans', sans-serif;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar nav ── */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--surface);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.sidebar-logo span { color: var(--accent); font-style: italic; }

.sidebar-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

.nav-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-left: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: var(--ink4);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,0.07); color: var(--surface); }
.nav-link.active { background: var(--accent); color: #fff; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}
.athlete-row {
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 500; color: #fff;
  flex-shrink: 0;
}
.athlete-name { font-size: 13px; font-weight: 500; color: var(--surface); }
.athlete-plan { font-size: 11px; color: var(--ink3); }
.logout-link {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  text-decoration: none;
  transition: color 0.15s;
}
.logout-link:hover { color: var(--surface); }

/* ── Main content ── */
.main {
  margin-left: 220px;
  flex: 1;
  padding: 36px 40px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-title em { font-style: italic; color: var(--accent); }
.page-sub {
  font-size: 14px;
  color: var(--ink3);
  margin-top: 4px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* ── Stat metric cards ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 8px;
}
.metric-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.metric-unit {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink3);
  margin-left: 4px;
}
.metric-delta {
  font-size: 12px;
  margin-top: 4px;
}
.delta-up   { color: var(--teal); }
.delta-warn { color: var(--amber); }

/* ── Badge ── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
}
.badge-easy     { background: #e1f5ee; color: #085041; }
.badge-tempo    { background: #eeedfe; color: #3c3489; }
.badge-long     { background: #faece7; color: #712b13; }
.badge-interval { background: #faeeda; color: #633806; }
.badge-rest     { background: #f1efe8; color: #7a786f; }
.badge-cross    { background: #e6f1fb; color: #0c447c; }

/* ── Utility ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mt-sm  { margin-top: 16px; }
.mt-md  { margin-top: 24px; }
.section-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 14px;
}

/* ── Fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.4s ease both; }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.10s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.20s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.30s; }
.fade-up:nth-child(7) { animation-delay: 0.35s; }
