/* ═══════════════════════════════════════════════════════════════
   RowElite Design System — v20260627
   Aesthetic: elite sport technology (Garmin · WHOOP · F1)
   Dark-first. Monospace for all performance data.
   ═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ───────────────────────────────────────────── */
:root {
  /* Backgrounds — three levels of depth */
  --bg-base:    #08121f;
  --bg-surface: #0d1c2e;
  --bg-card:    #111f32;
  --bg-raised:  #162639;
  --bg-hover:   rgba(255,255,255,.035);

  /* Aliases kept for backward compat */
  --navy:       #08121f;
  --navy-mid:   #0d1c2e;
  --navy-light: #162639;
  --surface:    #162639;
  --surface2:   #1d2f44;
  --card-bg:    #111f32;
  --input-bg:   #162639;

  /* Borders — transparent overlays, not solid colours */
  --border:       rgba(255,255,255,.08);
  --border-light: rgba(255,255,255,.05);
  --border-focus: #0891b2;

  /* Brand accent — teal/cyan */
  --teal:       #0891b2;
  --teal-dark:  #0e7490;
  --teal-light: #22d3ee;

  /* Status */
  --accent:  #f59e0b;
  --green:   #10b981;
  --red:     #ef4444;
  --orange:  #f97316;
  --purple:  #8b5cf6;

  /* GMT tier colours — semantic only, never decorative */
  --gmt-world:  #f59e0b;
  --gmt-elite:  #22d3ee;
  --gmt-high:   #10b981;
  --gmt-dev:    #a78bfa;
  --gmt-emerg:  #94a3b8;

  /* Text — three tones */
  --text:       #dce8f0;
  --text-muted: #7a9bb5;
  --text-dim:   #4d6a82;

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

  /* Layout */
  --sidebar-w: 240px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --radius-xl: 14px;
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0a1626 0%, #0d1d30 60%, #08121f 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 32px rgba(0,0,0,.45);
}

/* Teal edge accent */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(8,145,178,.5) 30%,
    rgba(34,211,238,.3) 70%,
    transparent 100%
  );
  pointer-events: none;
}

/* ── Logo area ── */
.sidebar-logo {
  padding: 26px 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: white;
  flex-shrink: 0;
  box-shadow: 0 3px 14px rgba(8,145,178,.35);
}
.logo-text { line-height: 1.15; }
.logo-text .brand { font-size: 14px; font-weight: 800; color: #f0f6ff; letter-spacing: .01em; }
.logo-text .sub   { font-size: 9px; color: #3d6080; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; }

/* ── Nav sections ── */
.nav-section { padding: 4px 0; }
.nav-label {
  padding: 14px 20px 4px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Nav links ── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 9px 11px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.nav-link:hover {
  background: rgba(8,145,178,.1);
  color: #e0f0ff;
  transform: translateX(2px);
  border-left-color: rgba(34,211,238,.3);
}
.nav-link.active {
  background: rgba(8,145,178,.16);
  color: var(--teal-light);
  font-weight: 700;
  border-left-color: var(--teal-light);
  border-radius: 0 9px 9px 0;
}

/* ── Icons — SVG stroke ── */
.nav-svg {
  width: 15px; height: 15px; flex-shrink: 0;
  opacity: .4; transition: opacity .15s;
}
.nav-link:hover .nav-svg  { opacity: .85; }
.nav-link.active .nav-svg { opacity: 1; }

/* ── Training Center tint ── */
.nav-label-tc { color: rgba(139,92,246,.55); }
.nav-link-tc  { color: #a78bfa; }
.nav-link-tc:hover {
  background: rgba(139,92,246,.08);
  color: #c4b5fd;
  border-left-color: rgba(139,92,246,.3);
}
.nav-link-tc.active {
  background: rgba(139,92,246,.14);
  color: #c4b5fd;
  border-left-color: #8b5cf6;
}

/* ── Footer ── */
.sidebar-footer {
  margin-top: auto;
  padding: 10px 0 12px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .nav-link { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.sidebar-footer .nav-link:hover { color: #e0f0ff; }

/* ══════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════ */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 700; flex: 1; letter-spacing: -.1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-content { padding: 24px; flex: 1; }

/* ══════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}
.card-body { padding: 18px; }

/* ── Stat cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s;
}
.stat-card:hover { border-color: rgba(255,255,255,.14); }
.stat-card .label  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.stat-card .value  { font-size: 30px; font-weight: 900; font-family: var(--font-data); color: var(--text); line-height: 1.1; margin: 2px 0; }
.stat-card .sub    { font-size: 11px; color: var(--text-muted); }
/* Colour-coded top accent */
.stat-card.teal   { border-top: 3px solid var(--teal); }
.stat-card.green  { border-top: 3px solid var(--green); }
.stat-card.orange { border-top: 3px solid var(--accent); }
.stat-card.accent { border-top: 3px solid var(--purple); }

/* ══════════════════════════════════════════
   GRID LAYOUTS
   ══════════════════════════════════════════ */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; }

/* ══════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 9px 12px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table a { color: var(--teal-light); text-decoration: none; }
.data-table a:hover { color: #fff; }

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md); border: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn-primary   { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--bg-raised); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,.06); }
.btn-danger    { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.16); background: var(--bg-hover); }
.btn-sm        { padding: 5px 10px; font-size: 11px; border-radius: 5px; }
.btn-lg        { padding: 11px 22px; font-size: 14px; border-radius: var(--radius-lg); }
.btn-accent    { background: var(--accent); color: #0f172a; }
.btn-accent:hover { background: #d97706; }
.btn-green     { background: rgba(16,185,129,.15); color: var(--green); border: 1px solid rgba(16,185,129,.25); }
.btn-green:hover { background: rgba(16,185,129,.25); }

/* ══════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 3px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* Legacy colour classes */
.badge-blue   { background: rgba(8,145,178,.15);   color: var(--teal-light); border: 1px solid rgba(8,145,178,.25); }
.badge-green  { background: rgba(16,185,129,.12);  color: #34d399;           border: 1px solid rgba(16,185,129,.2); }
.badge-red    { background: rgba(239,68,68,.12);   color: #f87171;           border: 1px solid rgba(239,68,68,.2); }
.badge-orange { background: rgba(245,158,11,.12);  color: #fbbf24;           border: 1px solid rgba(245,158,11,.2); }
.badge-grey   { background: rgba(100,116,139,.1);  color: var(--text-muted); border: 1px solid rgba(100,116,139,.15); }
.badge-yellow { background: rgba(245,158,11,.12);  color: #fbbf24;           border: 1px solid rgba(245,158,11,.2); }

/* GMT tier badges — semantic */
.badge-gmt-world { background: rgba(245,158,11,.18);  color: var(--gmt-world); border: 1px solid rgba(245,158,11,.3); }
.badge-gmt-elite { background: rgba(34,211,238,.12);  color: var(--gmt-elite); border: 1px solid rgba(34,211,238,.22); }
.badge-gmt-high  { background: rgba(16,185,129,.12);  color: var(--gmt-high);  border: 1px solid rgba(16,185,129,.2); }
.badge-gmt-dev   { background: rgba(139,92,246,.1);   color: var(--gmt-dev);   border: 1px solid rgba(139,92,246,.2); }
.badge-gmt-emerg { background: rgba(100,116,139,.08); color: var(--gmt-emerg); border: 1px solid rgba(100,116,139,.12); }

/* PB / achievement */
.badge-pb       { background: rgba(245,158,11,.2); color: var(--accent); border: 1px solid rgba(245,158,11,.35); }
.badge-improved { background: rgba(16,185,129,.12); color: var(--green); border: 1px solid rgba(16,185,129,.2); }
.badge-regressed{ background: rgba(239,68,68,.1);  color: #f87171;       border: 1px solid rgba(239,68,68,.18); }

/* Athlete status */
.badge-status-active   { background: rgba(16,185,129,.1); color: var(--green); }
.badge-status-injured  { background: rgba(239,68,68,.1);  color: #f87171; }
.badge-status-inactive { background: rgba(100,116,139,.1);color: var(--text-muted); }

/* Boat type */
.badge-boat-scull { background: rgba(8,145,178,.12); color: var(--teal-light); border: 1px solid rgba(8,145,178,.2); }
.badge-boat-sweep { background: rgba(245,158,11,.12); color: var(--accent); border: 1px solid rgba(245,158,11,.2); }

/* ══════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 10px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .06em;
}
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 13.5px;
  font-family: var(--font-ui);
  transition: border-color .15s; outline: none;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: var(--teal);
  background: rgba(8,145,178,.05);
}
textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.5; }
/* Data inputs — times, watts, splits */
.form-control.data-input { font-family: var(--font-data); font-size: 14px; font-weight: 700; }

.form-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--teal-light);
  padding: 10px 0 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.form-row   { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ══════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #0d1d30 0%, var(--bg-base) 70%);
}
.login-box {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 40px; margin-bottom: 8px; }
.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--text); }
.login-logo p  { font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════════
   ATHLETE PROFILE
   ══════════════════════════════════════════ */
.profile-header {
  background: linear-gradient(125deg, #08121f 0%, #0e2a3a 55%, rgba(8,145,178,.25) 140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 240px at 90% -20%, rgba(8,145,178,.18), transparent 60%);
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: white;
  flex-shrink: 0; position: relative;
}
.profile-name { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.3px; }
.profile-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 16px; flex-wrap: wrap; }
.profile-meta span { display: flex; align-items: center; gap: 4px; }
.profile-stats { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
.profile-stat { text-align: center; }
.profile-stat .val { font-size: 20px; font-weight: 900; font-family: var(--font-data); color: var(--teal-light); }
.profile-stat .lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }

/* ══════════════════════════════════════════
   PERFORMANCE CHARTS
   ══════════════════════════════════════════ */
.chart-container    { position: relative; height: 220px; }
.chart-container-lg { position: relative; height: 300px; }

/* ══════════════════════════════════════════
   TREND INDICATORS
   ══════════════════════════════════════════ */
.trend-up   { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--text-dim); }

/* ══════════════════════════════════════════
   RANK NUMBERS
   ══════════════════════════════════════════ */
.rank-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-raised); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--font-data);
  flex-shrink: 0;
}
.rank-1 { background: rgba(245,158,11,.2); color: var(--accent); border: 1px solid rgba(245,158,11,.3); }
.rank-2 { background: rgba(148,163,184,.12); color: #c0ccd8; }
.rank-3 { background: rgba(180,83,9,.12); color: #d97706; }

/* ══════════════════════════════════════════
   SEARCH / FILTERS
   ══════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar .form-control, .filter-bar .form-select {
  flex: 1; min-width: 130px; max-width: 220px;
}

/* ══════════════════════════════════════════
   TABS
   ══════════════════════════════════════════ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-btn {
  padding: 8px 16px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--teal-light); border-bottom-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ══════════════════════════════════════════
   NOTES BLOCKS
   ══════════════════════════════════════════ */
.notes-block {
  background: rgba(8,145,178,.06);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 14px; margin-top: 6px;
  font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.6;
}
.notes-block.warning { border-left-color: var(--orange); background: rgba(249,115,22,.06); }
.notes-block.danger  { border-left-color: var(--red);    background: rgba(239,68,68,.06); }
.notes-block.neutral { border-left-color: var(--text-dim); background: rgba(100,116,139,.06); }

/* ══════════════════════════════════════════
   REVIEW CARD
   ══════════════════════════════════════════ */
.review-section { margin-bottom: 20px; }
.review-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--teal); margin-bottom: 6px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(8,145,178,.2);
}
.review-content { font-size: 13.5px; color: var(--text); white-space: pre-wrap; line-height: 1.7; }

/* ══════════════════════════════════════════
   STAR RATING
   ══════════════════════════════════════════ */
.star-rating { color: var(--accent); font-size: 16px; letter-spacing: 2px; }

/* ══════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state .icon { font-size: 36px; margin-bottom: 12px; opacity: .6; }
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════
   PROGRESS BAR
   ══════════════════════════════════════════ */
.progress-bar {
  height: 5px; background: var(--bg-raised);
  border-radius: 3px; overflow: hidden; margin-top: 6px;
}
.progress-fill { height: 100%; border-radius: 3px; background: var(--teal); transition: width .4s ease; }

/* ══════════════════════════════════════════
   ALERTS / FLASH
   ══════════════════════════════════════════ */
.alert {
  padding: 10px 16px; border-radius: var(--radius-md);
  margin-bottom: 16px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  border-left: 3px solid;
}
.alert-success { background: rgba(16,185,129,.07); border-color: var(--green);  color: #34d399; border-right: 1px solid rgba(16,185,129,.2); border-top: 1px solid rgba(16,185,129,.2); border-bottom: 1px solid rgba(16,185,129,.2); }
.alert-error   { background: rgba(239,68,68,.07);  border-color: var(--red);    color: #f87171; border-right: 1px solid rgba(239,68,68,.2); border-top: 1px solid rgba(239,68,68,.2); border-bottom: 1px solid rgba(239,68,68,.2); }
.alert-warning { background: rgba(245,158,11,.07); border-color: var(--accent); color: #fbbf24; border-right: 1px solid rgba(245,158,11,.2); border-top: 1px solid rgba(245,158,11,.2); border-bottom: 1px solid rgba(245,158,11,.2); }
.alert-info    { background: rgba(8,145,178,.07);  border-color: var(--teal);   color: var(--teal-light); border-right: 1px solid rgba(8,145,178,.2); border-top: 1px solid rgba(8,145,178,.2); border-bottom: 1px solid rgba(8,145,178,.2); }

/* ══════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════ */
.skeleton {
  background: var(--bg-raised); border-radius: 3px;
  overflow: hidden; position: relative;
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Page-level loading bar */
.page-loading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9999;
  background: transparent; pointer-events: none;
}
.page-loading-bar::after {
  content: '';
  position: absolute; left: 0; top: 0; height: 100%;
  width: 60%; background: var(--teal-light);
  border-radius: 1px;
  animation: pageLoad 1.8s ease-in-out infinite;
}
@keyframes pageLoad { 0% { left: 0; width: 0; } 50% { left: 0; width: 60%; } 100% { left: 100%; width: 0; } }

/* ══════════════════════════════════════════
   GMT RING (for athlete profiles)
   ══════════════════════════════════════════ */
.gmt-ring-container { display: flex; gap: 20px; flex-wrap: wrap; }
.gmt-ring { text-align: center; }
.gmt-ring svg { display: block; margin: 0 auto; }
.gmt-ring .gmt-value { font-family: var(--font-data); font-size: 15px; font-weight: 800; margin-top: 4px; }
.gmt-ring .gmt-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

/* ══════════════════════════════════════════
   DATA DISPLAY UTILITIES
   ══════════════════════════════════════════ */
/* Monospace for all performance data */
.data-value { font-family: var(--font-data); font-weight: 700; color: var(--teal-light); }
.data-value-sm { font-family: var(--font-data); font-size: 12px; }

/* ══════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════ */
.text-muted  { color: var(--text-muted) !important; }
.text-teal   { color: var(--teal-light) !important; }
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-accent { color: var(--accent) !important; }
.text-dim    { color: var(--text-dim) !important; }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 900; }
.mono        { font-family: var(--font-data); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.flex { display: flex; } .flex-center { align-items: center; } .flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

/* ══════════════════════════════════════════
   RESPONSIVE SIDEBAR
   ══════════════════════════════════════════ */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px; padding: 6px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer; flex-shrink: 0;
}
.sidebar-toggle span {
  display: block; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .grid-2, .grid-7-5 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   TOM SELECT — dark theme overrides
   ══════════════════════════════════════════ */
.ts-wrapper { min-width: 0; }
.ts-control {
  background: var(--bg-raised) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text) !important;
  font-size: 13px !important; font-family: var(--font-ui) !important;
  padding: 7px 10px !important;
  box-shadow: none !important;
  min-height: 38px !important;
  cursor: pointer;
}
.ts-control input { color: var(--text) !important; font-size: 13px !important; }
.ts-control input::placeholder { color: var(--text-muted) !important; }
.ts-dropdown {
  background: var(--bg-raised) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.5) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  margin-top: 2px !important;
  z-index: 9999 !important;
}
.ts-dropdown .ts-dropdown-content { max-height: 240px; }
.ts-dropdown .option { padding: 8px 12px !important; cursor: pointer; }
.ts-dropdown .option:hover,
.ts-dropdown .option.active  { background: rgba(8,145,178,.18) !important; color: var(--teal-light) !important; }
.ts-dropdown .option.selected { background: rgba(8,145,178,.1) !important; }
.ts-wrapper.focus .ts-control,
.ts-wrapper .ts-control:focus-within { border-color: var(--teal) !important; outline: none !important; }
.ts-wrapper .ts-control .item { color: var(--text) !important; }
.ts-wrapper .clear-button { color: var(--text-muted) !important; }

/* ── Morning Brief ─────────────────────────────────────────────── */

/* Context strip */
.mb-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.mb-strip-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 0;
}
.mb-strip-cell--alert { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.06); }
.mb-strip-cell--warn  { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.05); }
.mb-strip-cell--dim   { opacity: .55; }
.mb-strip-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 4px; }
.mb-strip-value { font-size: 28px; font-weight: 700; font-family: var(--font-data); color: var(--text); line-height: 1; }
.mb-strip-sub   { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* Alert banners */
.mb-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.mb-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
}
.mb-alert--birthday {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.35);
  color: var(--accent);
}

/* Yesterday compliance */
.mb-compliance-grid { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mb-compliance-row  { display: grid; grid-template-columns: 140px 1fr 54px 36px; align-items: center; gap: 10px; }
.mb-compliance-squad { font-size: 12px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-compliance-bar-wrap { height: 5px; background: var(--bg-raised); border-radius: 3px; overflow: hidden; }
.mb-compliance-bar  { height: 100%; border-radius: 3px; transition: width .4s ease; }
.mb-compliance-stat { font-size: 12px; font-family: var(--font-data); text-align: right; }
.mb-compliance-pct  { font-size: 11px; text-align: right; }

/* PB chips */
.mb-pb-chip {
  display: inline-flex; align-items: center;
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 20px;
  padding: 4px 10px;
}

/* Session rows */
.mb-session-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.mb-session-row:last-child { border-bottom: none; }
.mb-session-type {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mb-session-type--erg   { background: rgba(8,145,178,.15); color: var(--teal-light); }
.mb-session-type--water { background: rgba(34,211,238,.12); color: #67e8f9; }
.mb-session-type--sc    { background: rgba(167,139,250,.15); color: var(--gmt-dev); }
.mb-session-type--cross { background: rgba(245,158,11,.12); color: var(--accent); }

/* Competition countdown card */
.mb-countdown { text-align: center; padding: 20px 16px; }
.mb-countdown--red   { border-color: rgba(239,68,68,.5);  background: rgba(239,68,68,.06); }
.mb-countdown--amber { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.05); }
.mb-countdown-days  { font-size: 48px; font-weight: 800; font-family: var(--font-data); color: var(--text); line-height: 1; }
.mb-countdown-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin: 4px 0 10px; }
.mb-countdown-name  { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mb-countdown-date  { font-size: 11px; color: var(--text-muted); }

/* ── Global dropdown overlay ─────────────────────────────────────────────── */
/* Use .dp-sugg on any custom autocomplete/suggestion panel.                  */
/* Position is set via positionDropdown() in base.html JS.                   */
.dp-sugg {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dp-sugg > div {
  padding: 8px 14px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.4;
}
.dp-sugg > div:last-child { border-bottom: none; }
.dp-sugg > div:hover { background: #f5f3ff; color: #6d28d9; }

/* Chip & day menus — cap at 5 items before scrolling */
.chip-menu-drop,
.day-menu-drop {
  max-height: calc(5 * 38px + 8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
