/*
 * Hite Elementary Cross Country — Design Tokens & Base Styles
 *
 * Mobile-first, no framework. Friendly, clean, elementary-school appropriate.
 *
 * Design tokens (CSS custom properties) are defined on :root so Phase 2
 * agents can reuse them without touching this file.
 */

/* ── Tokens ────────────────────────────────────────────────────────── */

:root {
  /* Brand */
  --color-primary: #2563eb;        /* Blue – links, buttons */
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;

  /* Race result treatment (PRD 10.2) */
  --race-bg: #fee2e2;              /* Light red background */
  --race-border: #dc2626;          /* Darker red border */
  --race-text: #991b1b;            /* Dark red text accent */

  /* Practice result treatment (PRD 10.2) */
  --practice-bg: #fef9c3;          /* Light yellow background */
  --practice-border: #ca8a04;      /* Darker yellow border */
  --practice-text: #854d0e;        /* Dark yellow-brown text accent */

  /* Neutral / team meeting / other */
  --neutral-bg: #f3f4f6;
  --neutral-border: #9ca3af;

  /* Status colors */
  --cancelled-bg: #f3f4f6;
  --cancelled-text: #6b7280;
  --postponed-bg: #fff7ed;
  --postponed-text: #9a3412;

  /* Text */
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  /* Surfaces */
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --border: #e5e7eb;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;

  /* Typography */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  /* Radii */
  --radius: 0.375rem;
  --radius-lg: 0.5rem;
}

/* ── Reset / Base ──────────────────────────────────────────────────── */

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-subtle);
}

img { max-width: 100%; height: auto; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 var(--sp-4); line-height: 1.3; }

/* ── Container ─────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ── Header ────────────────────────────────────────────────────────── */

.site-header {
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: var(--sp-3) 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.site-title {
  color: var(--text-inverse);
  font-size: var(--text-lg);
  font-weight: 700;
  white-space: nowrap;
}
.site-title:hover { text-decoration: none; opacity: 0.9; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-inverse);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
  padding: var(--sp-1) var(--sp-2);
}

.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: var(--sp-4);
}

.site-nav a {
  color: var(--text-inverse);
  font-weight: 500;
  opacity: 0.9;
}
.site-nav a:hover { opacity: 1; text-decoration: underline; }

/* Mobile nav */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-2) 0;
  }
}

/* ── Main ──────────────────────────────────────────────────────────── */

main.container { padding-top: var(--sp-6); padding-bottom: var(--sp-8); }

/* ── Footer ────────────────────────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: var(--sp-6) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border-top: 1px solid var(--border);
}

/* ── Cards ─────────────────────────────────────────────────────────── */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}

/* ── Result cards (race / practice / other) ────────────────────────── */

.result-race {
  background: var(--race-bg);
  border-left: 4px solid var(--race-border);
  color: var(--text);
}
.result-race .result-type { color: var(--race-text); font-weight: 600; }

.result-practice {
  background: var(--practice-bg);
  border-left: 4px solid var(--practice-border);
  color: var(--text);
}
.result-practice .result-type { color: var(--practice-text); font-weight: 600; }

.result-other {
  background: var(--neutral-bg);
  border-left: 4px solid var(--neutral-border);
}

/* ── Badges ────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  line-height: 1;
}
.badge-race     { background: var(--race-bg); color: var(--race-text); border: 1px solid var(--race-border); }
.badge-practice { background: var(--practice-bg); color: var(--practice-text); border: 1px solid var(--practice-border); }
.badge-meeting  { background: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--neutral-border); }
.badge-cancelled  { background: var(--cancelled-bg); color: var(--cancelled-text); }
.badge-postponed  { background: var(--postponed-bg); color: var(--postponed-text); }

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  min-height: 44px; /* touch target */
}

.btn-primary {
  background: var(--color-primary);
  color: var(--text-inverse);
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-danger {
  background: #dc2626;
  color: var(--text-inverse);
}
.btn-danger:hover { background: #b91c1c; }

/* ── Forms ─────────────────────────────────────────────────────────── */

.form-group { margin-bottom: var(--sp-4); }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  min-height: 44px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.form-error {
  color: #dc2626;
  font-size: var(--text-sm);
  margin-top: var(--sp-1);
}

/* ── Tables ────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
th { font-weight: 600; background: var(--bg-subtle); }

/* Stack table on mobile */
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack tr {
    display: block;
    border-bottom: 2px solid var(--border);
    padding: var(--sp-2) 0;
  }
  .table-stack td {
    display: block;
    border: none;
    padding: var(--sp-1) var(--sp-3);
  }
  .table-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    min-width: 6em;
  }
}

/* ── Utilities ─────────────────────────────────────────────────────── */

.text-muted { color: var(--text-muted); }
.text-sm    { font-size: var(--text-sm); }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

.empty-state {
  text-align: center;
  padding: var(--sp-8);
  color: var(--text-muted);
}

.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.alert-error { background: var(--race-bg); color: var(--race-text); border: 1px solid var(--race-border); }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.alert-warning { background: var(--practice-bg); color: var(--practice-text); border: 1px solid var(--practice-border); }

/* ── Time display ──────────────────────────────────────────────────── */

.time-display {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════
   PUBLIC PAGES — added by public-router agent
   Styles for /, /students, /students/{slug}
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Visually hidden (accessible) ─────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Home: hero intro card ─────────────────────────────────────────────── */

.pub-hero {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
}

.pub-hero__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-2);
}

.pub-hero__intro {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 auto;
}

/* ── Shared: search row ────────────────────────────────────────────────── */

.pub-search-row {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
  flex-wrap: wrap;
}

.pub-search-input {
  flex: 1 1 200px;
  min-width: 0;
}

.pub-search-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.pub-grade-select {
  flex: 0 0 auto;
  width: auto;
}

/* ── Home: upcoming-events list ────────────────────────────────────────── */

.pub-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-event-item {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.pub-event-item:last-child { border-bottom: none; }

.pub-event-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.pub-event-name {
  font-weight: 600;
  font-size: var(--text-lg);
}

.pub-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pub-event-meta dt { display: none; }  /* visual-only; screen readers get visually-hidden */
.pub-event-meta dd { margin: 0; }

.pub-event-links {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Student directory ─────────────────────────────────────────────────── */

.pub-students-filter { }

.pub-student-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-student-item {
  border-bottom: 1px solid var(--border);
}
.pub-student-item:last-child { border-bottom: none; }

.pub-student-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-2);
  color: var(--text);
  text-decoration: none;
  gap: var(--sp-4);
}
.pub-student-link:hover {
  background: var(--bg-subtle);
  text-decoration: underline;
}

.pub-student-name {
  font-weight: 500;
  font-size: var(--text-lg);
}

.pub-student-grade {
  white-space: nowrap;
}

/* ── Student detail: header ────────────────────────────────────────────── */

.pub-student-header {
  padding: var(--sp-6);
}

.pub-student-hero-name {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-1);
}

.pub-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin: var(--sp-4) 0 0;
}

.pub-summary-item dt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pub-summary-item dd {
  margin: var(--sp-1) 0 0;
  font-size: var(--text-xl);
  font-weight: 700;
}

/* ── Progress graph ────────────────────────────────────────────────────── */

.pub-graph-controls {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.pub-graph-controls .form-group {
  margin-bottom: 0;
  flex: 1 1 160px;
}

.pub-graph-wrap {
  position: relative;
  width: 100%;
  max-height: 400px;
  margin-bottom: var(--sp-4);
}

.pub-graph-table-toggle {
  margin: var(--sp-2) 0 var(--sp-4);
}

/* ── Result cards ──────────────────────────────────────────────────────── */

.pub-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-result-card {
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  /* left border provided by .result-race / .result-practice / .result-other */
}

.pub-result-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.pub-result-type {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pub-result-date {
  margin-left: auto;
}

.pub-result-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.pub-result-event {
  flex: 1 1 auto;
}

.pub-result-event-link {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}
.pub-result-event-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.pub-result-time {
  font-size: var(--text-2xl);
  white-space: nowrap;
}

.pub-result-status {
  font-size: var(--text-sm);
}

.pub-result-extra {
  margin-top: var(--sp-2);
}

/* Mobile tweaks for result cards */
@media (max-width: 480px) {
  .pub-result-body {
    flex-direction: column;
  }
  .pub-result-date {
    margin-left: 0;
    order: -1;
  }
||||||| 2e9fee3
/* ═══════════════════════════════════════════════════════════════════
   EVENTS / CALENDAR PAGES  (app/routers/events.py)
   Added by events agent — Phase 2.  All new selectors are prefixed
   .event-*, .cal-*, .agenda-*, .filter-* to avoid collisions.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page header row (title + action button side-by-side) ─────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.page-header h1 { margin: 0; }

/* ── Section headings ─────────────────────────────────────────────── */

.section-heading {
  font-size: var(--text-xl);
  border-bottom: 2px solid var(--border);
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-4);
}

/* ── Filter bar (type / view chips) ──────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.filter-bar--secondary { margin-top: calc(-1 * var(--sp-2)); }

.filter-chip {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  min-height: 36px;
  line-height: 1.8;
}
.filter-chip:hover { background: var(--bg-subtle); text-decoration: none; }
.filter-chip.active {
  background: var(--color-primary);
  color: var(--text-inverse);
  border-color: var(--color-primary);
}
.filter-chip--sm {
  font-size: calc(var(--text-sm) - 0.05rem);
  padding: var(--sp-1) var(--sp-2);
  min-height: 32px;
}

/* ── Filter form (event list dropdowns) ──────────────────────────── */

.filter-form { margin-bottom: var(--sp-6); }
.filter-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}
.filter-label {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.filter-form select {
  width: auto;
  min-width: 10rem;
}
.filter-clear { font-size: var(--text-sm); }

/* ── Event card (used on /upcoming and /calendar agenda) ─────────── */

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.event-card--cancelled {
  opacity: 0.75;
  border-color: var(--neutral-border);
  background: var(--neutral-bg);
}

.event-card--postponed {
  border-color: var(--postponed-text);
  background: var(--postponed-bg);
}

/* Compact card for agenda rows */
.event-card--compact {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
}

.event-status-banner {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-3);
}
.banner-cancelled { background: var(--cancelled-bg); color: var(--cancelled-text); }
.banner-postponed { background: var(--postponed-bg); color: var(--postponed-text); }

.event-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.event-name {
  font-size: var(--text-lg);
  font-weight: 700;
  flex: 1;
}

/* ── Event meta dl ────────────────────────────────────────────────── */

.event-meta { margin: 0; }

.event-meta-row {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.event-meta-row:last-child { border-bottom: none; }

.event-meta dt {
  min-width: 6rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.event-meta dd { margin: 0; }

.event-meta-notes dt,
.event-meta-notes dd { align-self: flex-start; }

/* Larger meta on detail page */
.event-meta--detail .event-meta-row { font-size: var(--text-base); }
.event-meta--detail dt { min-width: 8rem; }

/* ── Event detail page ────────────────────────────────────────────── */

.event-detail-header {
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
}

.event-detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.event-detail-title { margin: 0; flex: 1; }

.event-cancellation-notice,
.event-postponed-notice {
  margin-bottom: var(--sp-4);
  font-size: var(--text-base);
}

.event-detail-info {
  margin-bottom: var(--sp-6);
}

.map-link { font-size: var(--text-sm); }

/* Results table */
.event-results-section { margin-top: var(--sp-6); }
.event-results-table .time-display { font-size: var(--text-base); }

.results-divider td {
  text-align: center;
  padding: var(--sp-2);
  background: var(--bg-subtle);
  font-style: italic;
}

.row-cancelled td { color: var(--text-muted); text-decoration: line-through; }
.row-postponed td { color: var(--postponed-text); }

/* ── Agenda view (calendar page) ──────────────────────────────────── */

.agenda-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3rem;
  text-align: center;
  flex-shrink: 0;
}

.agenda-month {
  font-size: var(--text-sm);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

.agenda-day {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.2;
}

.agenda-body { flex: 1; }

.agenda-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
  font-size: var(--text-sm);
}

.agenda-time { color: var(--text-muted); }

/* ── Calendar month section header & navigation ──────────────────── */

.cal-section-title {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-4);
}

.cal-month-section { margin-bottom: var(--sp-8); }

.cal-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.cal-month-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: var(--text-xl);
}

.cal-nav-btn {
  padding: var(--sp-1) var(--sp-3);
  min-height: 36px;
  font-size: var(--text-lg);
  line-height: 1.4;
}

.cal-today-btn { font-size: var(--text-sm); }

/* ── Calendar grid ────────────────────────────────────────────────── */

.cal-grid {
  table-layout: fixed;
  min-width: 22rem;
}

.cal-grid th {
  text-align: center;
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-1);
  background: var(--bg-subtle);
}

.cal-day {
  vertical-align: top;
  height: 5rem;
  padding: var(--sp-1);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
}

.cal-day--empty { background: var(--bg-subtle); }

.cal-day--today { background: var(--color-primary-light); }
.cal-day--today .cal-day-num { font-weight: 700; color: var(--color-primary); }

.cal-day-num {
  display: block;
  text-align: right;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-1);
  color: var(--text-muted);
}

.cal-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Event chips inside calendar cells */
.cal-event-chip {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px var(--sp-1);
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  text-decoration: none;
}
.cal-event-chip:hover { opacity: 0.85; text-decoration: underline; }

.cal-chip-race    { background: var(--race-bg); border-left: 3px solid var(--race-border); color: var(--race-text); }
.cal-chip-practice { background: var(--practice-bg); border-left: 3px solid var(--practice-border); color: var(--practice-text); }
.cal-chip-other   { background: var(--neutral-bg); border-left: 3px solid var(--neutral-border); }
.cal-chip-cancelled { opacity: 0.55; text-decoration: line-through; }

/* ── Responsive: month grid hidden on small screens ──────────────── */
/*
 * Design: agenda is the default for small screens (phones).
 * When view=month, the month grid is shown; the agenda is hidden on wide.
 * On narrow screens (< 640 px), the month grid is ALWAYS hidden
 * regardless of ?view= param to keep it readable.
 */

/* "cal-hidden-on-small" = show on wide, hidden on mobile */
@media (max-width: 640px) {
  .cal-hidden-on-small { display: none !important; }
}

/* "cal-hidden-on-wide" = show on mobile, hidden on desktop (when view=month) */
@media (min-width: 641px) {
  .cal-hidden-on-wide { display: none !important; }
}

/* ── Utility additions ────────────────────────────────────────────── */
.mt-8 { margin-top: var(--sp-8); }
/* Screen-reader only (used for accessible badge labels) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════════════════════════════════════
   COACH ADMIN AREA — appended by admin agent
   All rules below are scoped to admin-specific classes. No existing
   rules above were modified.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Admin button size variants ─────────────────────────────────────── */

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-sm);
  min-height: 36px;
}

.btn-xs {
  padding: 2px var(--sp-2);
  font-size: var(--text-sm);
  min-height: 28px;
}

.btn-lg {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-lg);
  min-height: 52px;
}

.btn-full { width: 100%; }

/* ── Admin page header row ──────────────────────────────────────────── */

.admin-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.admin-header h1 { margin-bottom: 0; }

.admin-header-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-left: auto;
}

/* ── Admin sections ─────────────────────────────────────────────────── */

.admin-section { margin-bottom: var(--sp-8); }
.admin-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--border);
}

/* ── Dashboard action grid ──────────────────────────────────────────── */

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.admin-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  text-align: center;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: background 0.1s;
}
.admin-action-card:hover { background: var(--color-primary-light); text-decoration: none; }
.admin-action-icon { font-size: 2rem; }

/* ── Dashboard event rows ───────────────────────────────────────────── */

.admin-event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-3);
}

.admin-event-meta { color: var(--text-muted); font-size: var(--text-sm); }

.admin-event-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-left: auto;
}

/* ── Admin table row actions ────────────────────────────────────────── */

.admin-row-actions {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  align-items: center;
}

.row-inactive { opacity: 0.6; }

/* ── Admin form layout ──────────────────────────────────────────────── */

.admin-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.admin-form legend {
  font-weight: 700;
  padding: 0 var(--sp-2);
  color: var(--text);
}

.form-row {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 160px; }

.form-group-sm { max-width: 160px; }

.form-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-4);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.field-hint { color: var(--text-muted); font-size: var(--text-sm); font-weight: 400; }
small.field-hint { display: block; margin-top: var(--sp-1); }

.required { color: #dc2626; font-weight: 700; }

.error-list {
  margin: var(--sp-2) 0 0;
  padding-left: var(--sp-6);
}
.error-list li { margin-bottom: var(--sp-1); }

/* ── Admin search ───────────────────────────────────────────────────── */

.admin-search-form { margin-bottom: var(--sp-4); }

.admin-search-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.admin-search-input { flex: 1; min-width: 200px; }

/* ── Admin danger confirm page ──────────────────────────────────────── */

.admin-danger-confirm h2 {
  margin-bottom: var(--sp-4);
  color: #991b1b;
}

.admin-hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: var(--sp-6) 0;
}

/* ── Admin login ────────────────────────────────────────────────────── */

.admin-login-wrap {
  max-width: 400px;
  margin: var(--sp-8) auto;
}

.admin-login-wrap h1 { text-align: center; }

/* ── Admin badge variants ───────────────────────────────────────────── */

.badge-active   { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.badge-inactive { background: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--neutral-border); }
.badge-completed { background: #dbeafe; color: #1d4ed8; border: 1px solid var(--color-primary); }
.badge-other    { background: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--neutral-border); }

/* ── Event meta summary bar ─────────────────────────────────────────── */

.event-meta {
  margin-bottom: var(--sp-4);
  background: var(--bg-subtle);
  border-color: var(--border);
}
.event-meta p { margin: 0; }

/* ── Result entry table (bulk entry screen) ─────────────────────────── */

.result-entry-wrap {
  margin-bottom: var(--sp-4);
}

.result-entry-table {
  min-width: 600px;
}

/* Compact row cells for the entry table */
.result-entry-table td,
.result-entry-table th {
  padding: var(--sp-1) var(--sp-2);
  vertical-align: middle;
}

.result-student-name {
  min-width: 140px;
  font-weight: 600;
}

.row-error-msg {
  display: block;
  color: #dc2626;
  font-size: var(--text-sm);
  font-weight: 400;
}

.result-row-error {
  background: #fff1f2;
}

/* Time inputs — big touch targets, fixed width */
.result-time-input {
  width: 64px;
  text-align: center;
  min-height: 48px;
  font-size: var(--text-lg);
  padding: var(--sp-1) var(--sp-2);
}

.result-time-cell { width: 72px; }

/* Status select — wide enough to read */
.result-status-select {
  min-width: 140px;
  font-size: var(--text-sm);
  min-height: 48px;
}

.result-status-cell { min-width: 160px; }

/* Placement input */
.result-place-input {
  width: 56px;
  text-align: center;
  min-height: 48px;
  padding: var(--sp-1);
}
.result-place-cell { width: 64px; }

/* Notes input — grows as needed */
.result-notes-input {
  min-width: 120px;
  font-size: var(--text-sm);
  min-height: 48px;
}
.result-notes-cell { min-width: 140px; }

.result-actions-cell { white-space: nowrap; }

/* Footer save bar */
.result-entry-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) 0;
}

.unsaved-indicator {
  color: var(--practice-text);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--practice-bg);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  border: 1px solid var(--practice-border);
}

/* ── Screen-reader-only utility ─────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Admin responsive: mobile ───────────────────────────────────────── */

@media (max-width: 640px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  .admin-header-actions { margin-left: 0; }

  .admin-action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-group-sm { max-width: 100%; }

  .admin-row-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Result entry: make table scroll horizontally */
  .result-entry-wrap { -webkit-overflow-scrolling: touch; }

  .result-time-input { width: 56px; min-height: 52px; font-size: var(--text-xl); }
  .result-status-select { min-height: 52px; }

  .result-entry-footer { flex-direction: column; align-items: flex-start; }
  .result-entry-footer .btn-lg { width: 100%; }
}
