/* ShotWatch /static/css/components.css */

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg); border-bottom: 1px solid var(--nav-border);
  padding: 0 1.25rem; display: flex; align-items: center;
  height: 56px; gap: 1.5rem;
  transition: background var(--transition-slow), border-color var(--transition-slow);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem;
  font-weight: 700; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--gold-300) 0%, var(--gold-400) 50%, var(--green-300) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  flex: 1;
}
.nav-badge {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green-300);
  background: var(--green-glow); border: 1px solid var(--green-500);
  padding: 0.2rem 0.5rem; border-radius: 4px;
}
.nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--gold-300); border-bottom-color: var(--gold-400); }

/* CARDS */
.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.25rem;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}
.card-raised { background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 1.25rem; }
.card-hover:hover { border-color: var(--border-strong); background: var(--bg-raised); }

/* BUTTONS */
.btn {
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 600;
  padding: 0.65rem 1.25rem; min-height: 44px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--transition);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; line-height: 1; letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; }
.btn-gold { background: var(--gold-400); color: #0C1810; border-color: var(--gold-300); }
.btn-gold:hover { background: var(--gold-300); box-shadow: 0 0 20px var(--gold-glow-strong); }
.btn-green { background: var(--green-500); color: var(--green-100); border-color: var(--green-400); }
.btn-green:hover { background: var(--green-400); box-shadow: 0 0 20px var(--green-glow-strong); }
.btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border-default); }
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-raised); color: var(--text-secondary); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-lg { font-size: 1rem; padding: 0.85rem 2rem; border-radius: var(--radius-lg); }
.btn-sm { font-size: 0.75rem; padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); min-height: 44px; }
.btn-full { width: 100%; }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.4rem;
}
.form-input {
  width: 100%; padding: 0.7rem 0.9rem;
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition);
}
.form-input:focus { outline: none; border-color: var(--green-400); background: var(--bg-card); }
.form-input::placeholder { color: var(--text-ghost); }
.form-select {
  width: 100%; padding: 0.7rem 0.9rem;
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.form-select:focus { outline: none; border-color: var(--green-400); }
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.75rem; color: var(--red); margin-top: 0.3rem; }

/* ALERTS */
.alert { padding: 0.875rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: var(--green-glow); border: 1px solid var(--green-500); color: var(--green-200); }
.alert-error { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.alert-warning { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber); }
.alert-info { background: var(--green-glow); border: 1px solid var(--border-default); color: var(--text-secondary); }

/* SECTION LABEL */
.section-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.75rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border-default); }

/* STAT CARDS */
.stat-card { background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.875rem 1rem; }
.stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.4rem; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-value.gold { color: var(--gold-300); }
.stat-value.green { color: var(--green-300); }
.stat-trend { font-size: 0.7rem; font-weight: 600; margin-top: 0.25rem; color: var(--text-muted); }
.stat-trend.up { color: var(--green-300); }
.stat-trend.down { color: var(--red); }

/* STATUS DOTS */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.live { background: var(--green-300); animation: livePulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
.status-dot.searching { background: var(--amber); animation: searchPulse 1.2s ease-in-out infinite; }
.status-dot.disconnected { background: var(--red); }

/* THEME TOGGLE */
.theme-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: 99px; padding: 0.3rem 0.6rem; cursor: pointer;
  font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition); font-family: 'DM Sans', sans-serif;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }

/* MODE TABS */
.mode-tabs {
  display: flex; background: var(--bg-page); border-radius: var(--radius-md);
  padding: 3px; gap: 2px; border: 1px solid var(--border-default);
}
.mode-tab {
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 0.55rem 1.1rem; min-height: 44px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  color: var(--text-muted); border: none; background: transparent;
  font-family: 'DM Sans', sans-serif;
}
.mode-tab.active {
  background: var(--bg-raised); color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

/* BADGE */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 4px; }
.badge-green { background: var(--green-glow); color: var(--green-300); border: 1px solid var(--green-500); }
.badge-gold { background: var(--gold-glow); color: var(--gold-300); border: 1px solid var(--gold-500); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* TEXT UTILS */
.text-gold { color: var(--gold-300); }
.text-green { color: var(--green-300); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 600; }
.font-display { font-family: 'Barlow Condensed', sans-serif; }

/* Offline bar - hidden by default, shown only by pwa.js when genuinely offline */
.offline-bar { display: none; }
.offline-bar.visible { display: block; }

/* ---------------------------------------------------------------
   Admin user list - TBA number column
   --------------------------------------------------------------- */
.tba-number-cell {
    font-size: 1rem;
    min-width: 80px;
    color: var(--text-secondary);
}
.user-row-name {
    color: var(--text-primary);
}

/* Registration wizard - choice cards */
.card-clickable {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  border: 2px solid transparent;
}
.card-clickable:hover,
.card-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold, #ffd700);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.choice-card .choice-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
  width: 3.2rem;
  text-align: center;
}
.choice-card .choice-body { flex: 1 1 auto; min-width: 0; }
.choice-card .choice-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.15rem;
  line-height: 1.2;
}
.choice-card .choice-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-muted, #8a8a8a);
}
.choice-card .choice-arrow {
  font-size: 2rem;
  color: var(--gold, #ffd700);
  flex-shrink: 0;
  line-height: 1;
}

/* Coach verification status states */
.coach-verified-fields { margin-top: 0.5rem; }
.hidden { display: none !important; }
.status-ok      { color: #2e7d32; font-weight: 600; }
.status-warn    { color: #e65100; font-weight: 500; }
.status-error   { color: #c62828; font-weight: 500; }
.status-info    { color: var(--text-muted, #6a6a6a); font-style: italic; }
.mt-0-5         { margin-top: 0.5rem; }
.mb-1           { margin-bottom: 1rem; }

/* Coach invites */
.invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}
.invite-body { flex: 1 1 14rem; min-width: 0; }
.invite-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.invite-message {
  border-left: 3px solid var(--gold, #ffd700);
  padding: 0.5rem 0.85rem;
  margin: 0.5rem 0;
  font-style: italic;
  color: var(--text-muted, #6a6a6a);
  background: rgba(255, 215, 0, 0.05);
}
.mb-0-25 { margin-bottom: 0.25rem; }
.mb-0-5  { margin-bottom: 0.5rem; }

/* Find athletes results */
.athlete-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  gap: 1rem;
  flex-wrap: wrap;
}
.athlete-result-row:last-child { border-bottom: none; }
.athlete-result-info { flex: 1 1 auto; min-width: 0; }
.athlete-result-actions { flex-shrink: 0; display: flex; gap: 0.5rem; }
.badge-pending  { background: #fff3cd; color: #7a5b00; }
.badge-accepted { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }

/* Coach invite form */
.invite-form-message {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  resize: vertical;
}

/* === Brand logos =================================================== */

/* Top nav brand mark - dark-bg logo, sized to the nav row height. */
.nav-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-right: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 4px;
}
.nav-brand-logo {
  height: 36px;
  max-height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Auth-page hero logo - shown above the page title on every login,
   register and early-access view. Caps to a sensible portrait size. */
.auth-hero-logo {
  display: block;
  margin: 0 auto 1rem auto;
  max-width: 220px;
  width: 60%;
  height: auto;
  user-select: none;
}

@media (min-width: 700px) {
  .auth-hero-logo { max-width: 280px; }
}

/* Centre-align utility used by some auth headers */
.text-center { text-align: center; }


/* Recent-games row: actions cluster */
.game-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.btn-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-icon:hover, .btn-icon:focus {
  color: #ff5252;
  border-color: rgba(255, 82, 82, 0.5);
  background: rgba(255, 82, 82, 0.08);
}


/* Radio-card pattern - large tappable radio rows on mobile. */
.radio-card {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.625rem; margin-bottom: 0.625rem;
  cursor: pointer; transition: border-color 120ms ease, background 120ms ease;
}
.radio-card:has(input:checked) {
  border-color: #d4a017; background: rgba(212, 160, 23, 0.06);
}
.radio-card input[type="radio"] {
  margin-top: 0.25rem; flex-shrink: 0;
  width: 1.1rem; height: 1.1rem; accent-color: #d4a017;
}
.radio-card p { margin: 0.25rem 0 0 0; }
.radio-card strong { display: block; }

/* Form-row puts two form-groups side by side on wider screens. */
.form-row { display: flex; gap: 0.75rem; }
.form-row > .form-group { flex: 1; }
@media (max-width: 540px) { .form-row { flex-direction: column; gap: 0; } }


/* Form toggle - styled checkbox row. */
.form-toggle {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 0.75rem; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem; cursor: pointer;
}
.form-toggle input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; accent-color: #00943f;
}


/* === Time-window picker on spare analytics ============== */
.window-picker { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
                 border-radius: 0.625rem; padding: 0.875rem 1rem; }
.window-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.window-btn { display: inline-flex; align-items: center; justify-content: center;
              padding: 0.45rem 1rem; min-height: 36px; min-width: 44px; border: 1px solid rgba(255,255,255,0.12);
              border-radius: 999px; color: rgba(255,255,255,0.75);
              text-decoration: none; font-size: 0.875rem; font-weight: 500;
              cursor: pointer; background: transparent; }
.window-btn:hover { border-color: #d4a017; color: #f4f1ea; }
.window-btn.active, .window-btn[data-active="true"] {
              background: #d4a017; color: #0a0f08; border-color: #d4a017; }
.custom-range { padding-top: 0.625rem; border-top: 1px dashed rgba(255,255,255,0.08); margin-top: 0.625rem; }

.stat-delta { font-size: 0.75rem; font-weight: 500; margin-top: 0.25rem; letter-spacing: 0.02em; }
.stat-delta.up   { color: #5dd95d; }
.stat-delta.down { color: #ff6b6b; }
.stat-delta.flat { color: rgba(255,255,255,0.45); }


/* Inline sparkline */
.stat-spark { margin-top: 0.4rem; opacity: 0.85; }
.sparkline { display: block; margin: 0 auto; }

@keyframes spark-draw {
  from { stroke-dasharray: 0 1000; }
  to   { stroke-dasharray: 1000 0; }
}
.sparkline path {
  stroke-dasharray: 1000 0;
  animation: spark-draw 900ms ease-out 100ms 1 backwards;
}
.sparkline circle { animation: fade-in 250ms ease-out 950ms backwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }


/* Cohort picker - same shape as the window-picker. */
.cohort-picker {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.625rem; padding: 0.875rem 1rem;
}


/* === Stat tile entrance animations ====================== */

/* Stat card fade-up. JS sets stat-card-prep then stat-card-in
   after a per-card delay. */
.stat-card-prep {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 380ms ease-out, transform 380ms ease-out;
}
.stat-card-in {
  opacity: 1;
  transform: translateY(0);
}

/* Trend arrow / delta chip bounce-in. */
.stat-delta-prep {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 280ms ease-out, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat-delta-in {
  opacity: 1;
  transform: scale(1);
}

/* Respect reduced motion preference. */
@media (prefers-reduced-motion: reduce) {
  .stat-card-prep, .stat-card-in,
  .stat-delta-prep, .stat-delta-in {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .sparkline path { animation: none !important; stroke-dasharray: none !important; }
  .sparkline circle { animation: none !important; }
}


/* Inline SVG inside .choice-icon should sit centred, no font-leak. */
.choice-icon { display: inline-flex; align-items: center; justify-content: center; }
.choice-icon svg { display: block; flex: none; }


/* Locked / readonly form input - shown muted to make it clear it cannot be edited. */
.form-input-locked { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); cursor: not-allowed; border-style: dashed; }
.form-input-locked:focus { outline: none; box-shadow: none; }
.form-row-inline { display: flex; gap: 0.5rem; align-items: stretch; }
.form-row-inline .form-input { flex: 1; }
.btn-inline { white-space: nowrap; padding: 0.5rem 1rem; min-height: 44px; }

.alert-amber { background: rgba(212,160,23,0.12); border: 1px solid rgba(212,160,23,0.4); color: #f4d97a; }
/* === Compact spare analytics ============================ */

.spares-page { max-width: 1100px; }
.page-header.compact { margin-bottom: 0.75rem; }
.page-header.compact h1 { font-size: 1.5rem; margin: 0.1rem 0; line-height: 1.2; }
.page-header.compact .eyebrow { font-size: 0.7rem; margin: 0; }
.page-header.compact .subhead { font-size: 0.8rem; margin: 0.1rem 0; color: rgba(255,255,255,0.55); }

.window-picker.compact { display: flex; align-items: center; gap: 0.4rem;
                          flex-wrap: wrap; margin-bottom: 0.75rem; padding: 0; }
.window-picker.compact .pill-label { font-size: 0.75rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.05em; }
.window-picker.compact .window-btn { padding: 0.4rem 0.85rem; font-size: 0.8rem; min-height: 36px; min-width: 44px; }

.section-heading-tight { font-size: 1rem; font-weight: 700; color: #f4f1ea;
                          margin: 0.875rem 0 0.4rem 0; letter-spacing: 0.02em;
                          text-transform: uppercase; }
.section-heading-tight .section-meta { font-size: 0.7rem; font-weight: 500;
                                       color: rgba(255,255,255,0.45);
                                       text-transform: none; letter-spacing: 0;
                                       margin-left: 0.5rem; }
.section-sub-tight { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.6);
                     margin: 0.25rem 0 0.4rem 0; text-transform: uppercase; letter-spacing: 0.05em; }

.stat-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stat-pill { display: flex; align-items: baseline; gap: 0.5rem;
              background: rgba(255,255,255,0.04);
              border: 1px solid rgba(255,255,255,0.07);
              border-radius: 0.5rem; padding: 0.5rem 0.75rem; flex: 1;
              min-width: 180px; }
.stat-pill .pill-val { font-size: 1.25rem; font-weight: 700; color: #f4f1ea;
                       font-feature-settings: "tnum"; line-height: 1; }
.stat-pill .pill-val-lg { font-size: 1.75rem; }
.stat-pill .pill-key { font-size: 0.78rem; color: rgba(255,255,255,0.7); flex: 1; }
.stat-pill .pill-meta { font-size: 0.7rem; color: rgba(255,255,255,0.4);
                        font-feature-settings: "tnum"; }
.stat-pill .pill-spark { margin-left: 0.5rem; }
.stat-pill.stat-good { border-color: rgba(60,200,100,0.3); }
.stat-pill.stat-good .pill-val { color: #5dd95d; }
.stat-pill.stat-bad { border-color: rgba(255,100,100,0.3); }
.stat-pill.stat-bad .pill-val { color: #ff8a8a; }
.stat-pill.stat-headline { border-color: rgba(212,160,23,0.4);
                            background: rgba(212,160,23,0.06); }
.stat-pill.stat-headline .pill-val { color: #d4a017; }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .grid-2col { grid-template-columns: 1fr; } }

/* Compact data tables */
.data-table { width: 100%; border-collapse: collapse;
               background: rgba(255,255,255,0.02);
               border: 1px solid rgba(255,255,255,0.06);
               border-radius: 0.5rem; overflow: hidden; }
.data-table thead th { text-align: left; padding: 0.4rem 0.625rem;
                       font-size: 0.7rem; text-transform: uppercase;
                       letter-spacing: 0.05em; color: rgba(255,255,255,0.55);
                       font-weight: 600; background: rgba(255,255,255,0.03);
                       border-bottom: 1px solid rgba(255,255,255,0.08); }
.data-table tbody td { padding: 0.35rem 0.625rem; color: rgba(255,255,255,0.85);
                       border-bottom: 1px solid rgba(255,255,255,0.04);
                       font-size: 0.82rem; }
.data-table.tight tbody td { padding: 0.3rem 0.55rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(212,160,23,0.04); }
.data-table .num { text-align: right; font-feature-settings: "tnum"; }
.data-table .bold { font-weight: 700; color: #f4f1ea; }
.data-table .text-center { text-align: center; }

.data-table.sortable thead th[data-sort] { cursor: pointer; user-select: none; }
.data-table.sortable thead th[data-sort]:hover { color: #d4a017; }
.data-table.sortable thead th.sort-active { color: #d4a017; }
.data-table.sortable thead th.sort-active::after { content: " \25BC"; font-size: 0.6em; opacity: 0.7; }
.data-table.sortable thead th.sort-active.sort-asc::after { content: " \25B2"; }

/* Tags inside table cells */
.tag { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px;
       font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
       text-transform: uppercase; background: rgba(255,255,255,0.06);
       color: rgba(255,255,255,0.7); }
.tag-good { background: rgba(60,200,100,0.15); color: #5dd95d; }
.tag-warn { background: rgba(212,160,23,0.15); color: #d4a017; }
.tag-bad  { background: rgba(255,100,100,0.15); color: #ff8a8a; }


/* ============================================================ */
/* MOBILE NAV - hamburger pattern, breakpoint < 768px */
/* ============================================================ */
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  width: 44px; height: 44px;
  margin-left: auto;
  cursor: pointer;
  padding: 0;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.nav-toggle-bar {
  display: block; width: 20px; height: 2px;
  background: var(--text-secondary);
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav-menu {
  display: flex; align-items: center; gap: 1.5rem;
  flex: 1; justify-content: flex-end;
}

@media (max-width: 767px) {
  .nav { gap: 0.75rem; padding: 0 1rem; }
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    border-top: 1px solid var(--nav-border);
    flex-direction: column; align-items: stretch;
    gap: 0; padding: 0.5rem 1rem 1rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu .nav-link {
    width: 100%; padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 44px; display: flex; align-items: center;
    font-size: 1rem;
  }
  .nav-menu .nav-link:last-of-type { border-bottom: none; }
  .nav-menu .theme-toggle {
    margin-top: 0.75rem; align-self: flex-start;
    min-height: 44px; min-width: 88px;
  }
  /* Wider hit area for any inline button on mobile */
  .btn-sm { min-height: 44px; padding: 0.55rem 0.9rem; }
}

/* Slightly larger touch targets for tablet/desktop nav too */
@media (min-width: 768px) {
  .nav-link { padding: 0.6rem 0; }
}


/* Mobile responsive table fallback - prevent slight horizontal overflow */
@media (max-width: 480px) {
  .data-table.tight th, .data-table.tight td { padding: 0.3rem 0.35rem; font-size: 0.78rem; }
  .data-table.sortable { font-size: 0.78rem; }
  .window-buttons { gap: 0.35rem; }
  .window-btn { padding: 0.5rem 0.85rem; min-height: 40px; min-width: 44px; font-size: 0.82rem; }
}

/* Generic data-table escape hatch when content really exceeds viewport */
.data-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }


/* ============================================================ */
/* COACH ATHLETE VIEW - recent games series layout */
/* ============================================================ */
.action-row {
  display: flex; gap: 0.75rem; align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.stat-strip-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.15rem;
  text-align: center;
}
.stat-strip-label {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.stat-strip-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-strip-value-gold { color: var(--gold-300); }

.section-meta {
  font-size: 0.75rem; font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 0.4rem;
}

.series-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.85rem 0.85rem;
  margin-bottom: 0.75rem;
}
.series-block-single {
  padding: 0;
  background: transparent;
  border: none;
}

.series-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.series-date {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-primary);
}
.series-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 0.25rem;
  flex-wrap: wrap;
}

.series-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
}
.game-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px;
  padding: 0.5rem 0.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.game-tile:hover {
  border-color: var(--gold-400);
}
.game-tile-score {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--gold-300);
  line-height: 1;
}
.game-tile-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  text-align: center;
}
.game-tile-solo {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: 0.6rem 0.85rem;
  gap: 0.6rem;
}
.game-tile-solo .game-tile-score { font-size: 1.7rem; }
.game-tile-solo .game-tile-label {
  flex: 1;
  margin: 0;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Pill tags for tracking mode and event type. Saturated, glowing,
   colour-coded per category so a coach can scan a long athlete
   profile and see at a glance which sessions were league, which
   were tournaments, and which were practice. */
.mode-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.mode-tag::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  flex: 0 0 auto;
}
.mode-tag.mode-autotrack {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.22), rgba(0, 122, 58, 0.28));
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 4px 12px -4px rgba(0, 200, 83, 0.45);
}
.mode-tag.mode-manual {
  background: linear-gradient(135deg, rgba(236, 192, 64, 0.22), rgba(196, 138, 20, 0.28));
  color: var(--gold-300);
  border-color: rgba(236, 192, 64, 0.55);
  box-shadow: 0 0 0 1px rgba(236, 192, 64, 0.12), 0 4px 12px -4px rgba(196, 138, 20, 0.45);
}

@media (max-width: 480px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-strip-value { font-size: 1.45rem; }
  .series-games { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .game-tile { min-height: 58px; padding: 0.4rem 0.3rem; }
  .game-tile-score { font-size: 1.35rem; }
}


/* ============================================================ */
/* EVENTS - listing and detail */
/* ============================================================ */
.event-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none; color: inherit;
  transition: background var(--transition);
}
.event-row:hover { background: var(--bg-raised); }
.event-row:last-child { border-bottom: none; }
.event-row-main { flex: 1; min-width: 0; }
.event-row-title { font-weight: 600; color: var(--text-primary); }
.event-row-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }
.event-row-arrow { color: var(--text-muted); font-size: 1.2rem; padding-left: 0.5rem; }

.event-tabs {
  display: flex; gap: 0.5rem; margin: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.event-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 0.6rem 1rem; min-height: 44px;
  color: var(--text-muted);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.event-tab:hover { color: var(--text-primary); }
.event-tab.active {
  color: var(--gold-300);
  border-bottom-color: var(--gold-400);
}

.mode-tag.mode-tournament {
  background: linear-gradient(135deg, rgba(236, 192, 64, 0.28), rgba(196, 138, 20, 0.32));
  color: #f5d35a;
  border-color: rgba(245, 211, 90, 0.6);
  box-shadow: 0 0 0 1px rgba(245, 211, 90, 0.14), 0 4px 14px -4px rgba(196, 138, 20, 0.55);
}
.mode-tag.mode-league {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.28), rgba(37, 99, 235, 0.32));
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.6);
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.14), 0 4px 14px -4px rgba(37, 99, 235, 0.55);
}
.mode-tag.mode-practice {
  background: linear-gradient(135deg, rgba(180, 188, 200, 0.18), rgba(120, 130, 145, 0.22));
  color: #c8d0dc;
  border-color: rgba(200, 208, 220, 0.45);
  box-shadow: 0 0 0 1px rgba(200, 208, 220, 0.1), 0 4px 12px -4px rgba(120, 130, 145, 0.4);
}
.mode-tag.mode-other {
  background: linear-gradient(135deg, rgba(192, 132, 224, 0.25), rgba(140, 80, 180, 0.32));
  color: #d8a4f0;
  border-color: rgba(216, 164, 240, 0.55);
  box-shadow: 0 0 0 1px rgba(216, 164, 240, 0.14), 0 4px 14px -4px rgba(140, 80, 180, 0.5);
}

/* Chip row plus tournament-category badge */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}
.chip-row-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #c8d0dc);
  margin-right: 0.25rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 208, 220, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text, #e8eef6);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1;
}
.chip:hover {
  border-color: rgba(245, 211, 90, 0.6);
  color: #f5d35a;
}
.chip.chip-active {
  background: linear-gradient(135deg, rgba(245, 211, 90, 0.22), rgba(196, 138, 20, 0.28));
  color: #f5d35a;
  border-color: rgba(245, 211, 90, 0.65);
}
.mode-tag.mode-tournament-cat {
  background: linear-gradient(135deg, rgba(64, 196, 132, 0.22), rgba(36, 140, 92, 0.3));
  color: #6fe6a8;
  border-color: rgba(111, 230, 168, 0.5);
  box-shadow: 0 0 0 1px rgba(111, 230, 168, 0.12), 0 4px 12px -4px rgba(36, 140, 92, 0.5);
}


.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.roster-check {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition);
  position: relative;
  padding-left: 2.25rem;
}
.roster-check:hover { border-color: var(--gold-400); }
.roster-check input[type="checkbox"] {
  position: absolute; left: 0.75rem; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
}
.roster-check-name { font-weight: 600; color: var(--text-primary); }
.roster-check-meta { font-size: 0.7rem; color: var(--text-muted); }

@media (max-width: 480px) {
  .roster-grid { grid-template-columns: 1fr; }
  .event-tab { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
}


.form-select-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  min-height: 36px;
}
.d-inline-flex { display: inline-flex; align-items: center; }

/* ============================================================ */
/* AutoTrack setup - selected event banner                       */
/* ============================================================ */
.event-banner {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
}
.event-banner-name {
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.event-banner-practice {
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================================ */
/* AUTOTRACK SESSION TYPE PICKER - segmented control            */
/* ============================================================ */
.type-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.type-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 180ms ease;
  user-select: none;
}
.type-option input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.type-option:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.type-option:has(input:checked) {
  color: var(--text-primary);
  transform: translateY(-1px);
}
.type-option.type-practice:has(input:checked) {
  background: linear-gradient(135deg, rgba(180, 188, 200, 0.22), rgba(120, 130, 145, 0.26));
  border-color: rgba(200, 208, 220, 0.65);
  box-shadow: 0 0 0 1px rgba(200, 208, 220, 0.18), 0 6px 18px -6px rgba(120, 130, 145, 0.55);
  color: #e6ebf2;
}
.type-option.type-league:has(input:checked) {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.32), rgba(37, 99, 235, 0.36));
  border-color: rgba(147, 197, 253, 0.7);
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.2), 0 8px 22px -6px rgba(37, 99, 235, 0.6);
  color: #dbeafe;
}
.type-option.type-tournament:has(input:checked) {
  background: linear-gradient(135deg, rgba(236, 192, 64, 0.32), rgba(196, 138, 20, 0.36));
  border-color: rgba(245, 211, 90, 0.7);
  box-shadow: 0 0 0 1px rgba(245, 211, 90, 0.2), 0 8px 22px -6px rgba(196, 138, 20, 0.6);
  color: #fef3c7;
}
.type-option:focus-within {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
}
@media (max-width: 380px) {
  .type-option { font-size: 0.78rem; padding: 0.55rem 0.3rem; }
}

.user-row-link { text-decoration: none; color: inherit; }
.user-row-link:hover .user-row-name {
  color: var(--gold-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================ */
/* CLICKABLE GAME TILES on coach athlete view                   */
/* ============================================================ */
a.game-tile-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: border-color 160ms ease, transform 100ms ease, box-shadow 160ms ease, background 160ms ease;
}
a.game-tile-link:hover {
  border-color: var(--gold-300);
  background: linear-gradient(135deg, rgba(236, 192, 64, 0.08), rgba(196, 138, 20, 0.12));
  box-shadow: 0 6px 18px -8px rgba(196, 138, 20, 0.5);
  transform: translateY(-1px);
}
a.game-tile-link:active {
  transform: translateY(0);
  box-shadow: none;
}
a.game-tile-link:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
}
a.game-tile-link .game-tile-score {
  transition: color 160ms ease;
}
a.game-tile-link:hover .game-tile-score {
  color: var(--gold-200, #f0d178);
}

/* ============================================================ */
/* COACH GAME DETAIL PAGE                                       */
/* ============================================================ */
.game-detail-back { margin: 0.5rem 0 0.85rem; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.6rem 0.4rem 0;
  min-height: 44px;
  transition: color 160ms ease;
}
.back-link:hover { color: var(--gold-300); }
.back-link:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; border-radius: 4px; }

.pill-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 0.6rem;
}

.stat-strip-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
@media (max-width: 380px) {
  .stat-strip-3 .stat-strip-value { font-size: 1.35rem; }
}

/* Per-event-type breakdown card (used by athlete + coach views) ===== */
.breakdown-card {
  position: relative;
  background: linear-gradient(135deg,
    rgba(20, 30, 24, 0.85) 0%,
    rgba(12, 20, 14, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.breakdown-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.breakdown-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.85rem;
  position: relative;
}
.breakdown-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-300);
}
.breakdown-meta {
  font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  position: relative;
}
.breakdown-cell {
  position: relative;
  background: rgba(8, 14, 10, 0.6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.7rem 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.breakdown-cell:hover { transform: translateY(-2px); }

.breakdown-cell-practice { border-color: rgba(150, 170, 155, 0.35); }
.breakdown-cell-practice:hover { box-shadow: 0 4px 18px rgba(150, 170, 155, 0.18); }
.breakdown-cell-practice .breakdown-dot {
  background: #a8b8ad; box-shadow: 0 0 8px rgba(168, 184, 173, 0.6);
}

.breakdown-cell-league { border-color: rgba(60, 130, 220, 0.4); }
.breakdown-cell-league:hover { box-shadow: 0 4px 18px rgba(60, 130, 220, 0.25); }
.breakdown-cell-league .breakdown-dot {
  background: #4a90e2; box-shadow: 0 0 8px rgba(74, 144, 226, 0.7);
}

.breakdown-cell-tournament { border-color: rgba(212, 175, 55, 0.45); }
.breakdown-cell-tournament:hover { box-shadow: 0 4px 18px rgba(212, 175, 55, 0.3); }
.breakdown-cell-tournament .breakdown-dot {
  background: var(--gold-400); box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}

.breakdown-cell-empty { opacity: 0.45; }
.breakdown-cell-empty:hover { transform: none; box-shadow: none; }

.breakdown-cell-head {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.55rem;
}
.breakdown-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.breakdown-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}
.breakdown-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.05rem 0.4rem; border-radius: 999px;
  min-width: 1.4rem; text-align: center;
}
.breakdown-cell-body { display: flex; gap: 0.6rem; }
.breakdown-stat {
  flex: 1; display: flex; flex-direction: column; gap: 0.05rem;
}
.breakdown-stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.breakdown-stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.breakdown-stat-high { color: var(--gold-300); }

@media (max-width: 480px) {
  .breakdown-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .breakdown-cell { padding: 0.55rem 0.7rem 0.65rem; }
  .breakdown-cell-body { gap: 1rem; }
  .breakdown-stat-value { font-size: 1.35rem; }
}

/* AutoTrack schedule cards ===================================== */
.schedule-list { display: flex; flex-direction: column; gap: 0.75rem; }
.schedule-card {
  background: rgba(8, 14, 10, 0.7);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.schedule-card:hover { border-color: var(--gold-500); box-shadow: 0 4px 18px rgba(212, 175, 55, 0.12); }
.schedule-card-paused { opacity: 0.65; }
.schedule-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.schedule-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.schedule-state .pill {
  font-size: 0.6rem; letter-spacing: 0.15em;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-weight: 700; text-transform: uppercase;
}
.pill-green { background: rgba(0,148,63,0.15); color: var(--green-300); border: 1px solid rgba(0,148,63,0.4); }
.pill-muted { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.schedule-body { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.65rem; }
.schedule-row { display: flex; gap: 0.75rem; font-size: 0.825rem; line-height: 1.4; }
.schedule-row-label {
  flex: 0 0 7.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding-top: 0.15rem;
}
.schedule-row-value { flex: 1; color: var(--text-primary); }
.schedule-row-value code {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold-200);
  padding: 0.1rem 0.4rem; border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}
.schedule-actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
}
.btn-sm { font-size: 0.75rem; padding: 0.35rem 0.7rem; }
.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-state p { margin-bottom: 1rem; color: var(--text-muted); }
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.4; }
.form-stack { display: flex; flex-direction: column; gap: 0.85rem; }

@media (max-width: 480px) {
  .schedule-row { flex-direction: column; gap: 0.05rem; }
  .schedule-row-label { flex: 1; }
}

/* AutoTrack schedule cards (athlete schedules list) ================== */
.schedule-list { display: flex; flex-direction: column; gap: 0.85rem; }

.schedule-card {
  position: relative;
  background: linear-gradient(135deg,
    rgba(20, 30, 24, 0.85) 0%,
    rgba(12, 20, 14, 0.95) 100%);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.schedule-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(0, 148, 63, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
.schedule-card:hover {
  box-shadow: 0 4px 18px rgba(0, 148, 63, 0.15);
}
.schedule-card-paused {
  border-left-color: rgba(180, 180, 180, 0.4);
  opacity: 0.65;
}
.schedule-card-paused::before {
  background: none;
}

.schedule-card-head {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-bottom: 0.85rem;
  position: relative;
}
.schedule-card-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
}
.schedule-card-title h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  color: var(--text-primary); margin: 0;
  letter-spacing: -0.01em;
}
.schedule-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.status-dot-on  { background: var(--green-300); box-shadow: 0 0 8px rgba(0, 200, 100, 0.7); }
.status-dot-off { background: rgba(180, 180, 180, 0.5); }

.schedule-card-meta {
  font-size: 0.85rem; color: var(--text-secondary);
}

.schedule-card-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  position: relative;
}
.schedule-stat {
  display: flex; flex-direction: column; gap: 0.1rem;
  background: rgba(8, 14, 10, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.55rem;
}
.schedule-stat-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.schedule-stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.1;
}
.schedule-stat-name { color: var(--gold-300); }

.schedule-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}
.schedule-foot-left {
  display: flex; flex-direction: column; gap: 0.1rem;
  font-size: 0.85rem;
}
.schedule-foot-left strong {
  color: var(--gold-300);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.schedule-foot-right {
  display: flex; gap: 0.4rem; align-items: center;
}
.schedule-last-status {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-top: 0.1rem;
  width: fit-content;
}
.schedule-last-started        { background: rgba(0, 148, 63, 0.18); color: var(--green-300); }
.schedule-last-no_match_yet   { background: rgba(212, 175, 55, 0.15); color: var(--gold-300); }
.schedule-last-timeout_no_match { background: rgba(220, 90, 90, 0.18); color: #e88; }
.schedule-last-ambiguous      { background: rgba(220, 130, 60, 0.18); color: #ea7; }
.schedule-last-error          { background: rgba(220, 90, 90, 0.22); color: #f99; }

@media (max-width: 640px) {
  .schedule-card-body { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .schedule-card-body { grid-template-columns: 1fr; }
  .schedule-card-foot { flex-direction: column; align-items: flex-start; }
  .schedule-foot-right { width: 100%; justify-content: flex-end; }
}

/* form helpers used by schedule form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Schedule run history panel ===================================== */
.schedule-runs {
  margin: 0.6rem -1rem -1rem;
  padding: 0.6rem 1rem 0.8rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.schedule-runs > summary {
  cursor: pointer;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  list-style: none;
  user-select: none;
  padding: 0.1rem 0;
}
.schedule-runs > summary::-webkit-details-marker { display: none; }
.schedule-runs > summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
  color: var(--gold-400);
}
.schedule-runs[open] > summary::before { transform: rotate(90deg); }
.schedule-runs-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.schedule-run {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 0.5rem 0.7rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}
.schedule-run-when {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.schedule-run-outcome {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}
.schedule-run-lane {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.schedule-run-detail {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  line-height: 1.35;
}

.schedule-run-launched { border-left-color: rgba(212, 175, 55, 0.55); }
.schedule-run-launched .schedule-run-outcome {
  background: rgba(212, 175, 55, 0.12); color: var(--gold-300);
}
.schedule-run-matched { border-left-color: rgba(0, 148, 63, 0.7); }
.schedule-run-matched .schedule-run-outcome {
  background: rgba(0, 148, 63, 0.18); color: var(--green-300);
}
.schedule-run-multiple_matches { border-left-color: rgba(220, 160, 60, 0.7); }
.schedule-run-multiple_matches .schedule-run-outcome {
  background: rgba(220, 160, 60, 0.18); color: #f0b860;
}
.schedule-run-timeout, .schedule-run-no_match {
  border-left-color: rgba(180, 70, 70, 0.6);
}
.schedule-run-timeout .schedule-run-outcome,
.schedule-run-no_match .schedule-run-outcome {
  background: rgba(180, 70, 70, 0.18); color: #e89090;
}


/* Game-detail action bar */
.game-actions {
  display: flex; gap: 0.6rem; align-items: center; justify-content: flex-end;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle);
}
.game-actions .btn-sm { padding: 0.45rem 0.9rem; font-size: 0.78rem; letter-spacing: 0.08em; }
@media (max-width: 480px) {
  .game-actions { flex-direction: column-reverse; align-items: stretch; }
  .game-actions .btn-sm { width: 100%; }
}


/* Coach roster - activity row layout =============================== */
.athlete-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.athlete-row:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.athlete-row-avatar {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold-300);
}
.athlete-row-body { flex: 1; min-width: 0; }
.athlete-row-name {
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.athlete-row-meta {
  display: flex; align-items: center; gap: 0.45rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.athlete-row-when { font-variant-numeric: tabular-nums; }
.athlete-row-when-live { color: var(--green-300); font-weight: 600; }
.athlete-row-when-never { font-style: italic; }
.athlete-row-chevron {
  flex-shrink: 0;
  font-size: 1.4rem;
  color: var(--text-muted);
  font-weight: 300;
  padding: 0 0.2rem;
  transition: transform 0.15s ease, color 0.15s ease;
}
.athlete-row:hover .athlete-row-chevron {
  color: var(--gold-300);
  transform: translateX(2px);
}

/* Activity dot states ============================================== */
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.activity-dot-live,
.activity-dot-tracking {
  background: var(--green-300);
  box-shadow: 0 0 8px rgba(0, 200, 100, 0.7);
  animation: pulse-live 2s ease-in-out infinite;
}
.activity-dot-searching,
.activity-dot-waiting {
  background: var(--gold-300);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
  animation: pulse-live 1.5s ease-in-out infinite;
}
.activity-dot-recent {
  background: var(--green-300);
  box-shadow: 0 0 6px rgba(0, 200, 100, 0.4);
}
.activity-dot-stale {
  background: #d4a93a;
  box-shadow: 0 0 6px rgba(212, 169, 58, 0.35);
}
.activity-dot-dormant { background: #6a6a6a; }
.activity-dot-never { background: transparent; border: 1px solid #555; }
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.15); }
}

.athlete-row.activity-tracking,
.athlete-row.activity-live { border-left: 3px solid var(--green-300); }
.athlete-row.activity-searching,
.athlete-row.activity-waiting { border-left: 3px solid var(--gold-300); }
.athlete-row.activity-recent { border-left: 3px solid rgba(0, 200, 100, 0.4); }
.athlete-row.activity-stale { border-left: 3px solid rgba(212, 169, 58, 0.35); }
.athlete-row.activity-dormant { border-left: 3px solid #444; }
.athlete-row.activity-never { border-left: 3px solid transparent; }
