/* ==============================
   ПРОДАКШЕН CSS – Мінімалізм + Ідеально вирівняні іконки (2025)
================================ */
:root {
  --p: #1e40af;
  --s: #3b82f6;
  --g: #10b981;
  --r: #ef4444;
  --bg: #f8fafc;
  --card: #fff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
}

/* БАЗОВІ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 14px;
  line-height: 1.5;
  font-size: 15px;
}

/* ЗАГОЛОВОК */
h1 {
  text-align: center;
  color: var(--p);
  font-size: 1.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}
h1 small {
  display: block;
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}
#meetMeta {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

/* TOOLBAR */
.toolbar {
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

/* УНІФІКОВАНІ КНОПКИ + ІКОНКИ */
button, input[type="file"] {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;                    /* відстань між іконкою і текстом */
  white-space: nowrap;
}
button { background: var(--p); color: #fff; }
button:hover { background: #1e3a8a; transform: translateY(-1px); }
button.g { background: var(--g); }
button.g:hover { background: #059669; }
button.r { background: var(--r); }
button.r:hover { background: #dc2626; }
button.s { height: 36px; font-size: 13.5px; padding: 0 16px; }

/* УСІ ІКОНКИ – однаковий розмір і вирівнювання */
button svg,
button img,
button i,
.modal svg,
.modal i,
.entry-actions svg,
summary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
/* FA іконки — розмір через font-size */
button i,
.modal i { width: auto; height: auto; font-size: 15px; display: inline; }

/* Статус */
#status {
  font-weight: 700;
  color: var(--p);
  font-size: 15px;
  min-width: 180px;
  text-align: center;
}

/* ТАБИ */
.tab {
  display: flex;
  background: var(--p);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(30,64,175,.22);
}
.tab button {
  flex: 1;
  padding: 16px;
  background: none;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 15px;
  transition: .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab button.active {
  background: #1e3a8a;
  box-shadow: inset 0 4px 8px rgba(0,0,0,.2);
}
.tab button svg { width: 19px; height: 19px; }

/* КОНТЕНТ ТАБІВ */
.tabcontent {
  display: none;
  padding: 20px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
}
.tabcontent.active { display: block; }

/* КЛУБИ – випадаючі списки */
.clubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
details {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
summary.club-header {
  background: #f8fafc;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  gap: 10px;
}
summary.club-header::after {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M8.7 6.3l4.65 4.65L18 6.3l1.4 1.4-6.35 6.35L6.7 7.7 8.1 6.3z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .28s ease;
  flex-shrink: 0;
}
details[open] summary.club-header::after {
  transform: rotate(180deg);
}

.club-body { padding: 16px; }
.athlete-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.athlete-name { font-weight: 700; font-size: 15px; }
.athlete-info { font-size: 0.94rem; color: var(--muted); margin-top: 3px; }

/* МОДАЛКА */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 14px;
}
.modal.active { display: flex; }

.modal-content {
  background: #fff;
  border-radius: 14px;
  width: 95%;
  max-width: 740px;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 70px rgba(0,0,0,.42);
}
.modal-header {
  padding: 18px 24px;
  background: var(--p);
  color: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-header h2 svg { width: 22px; height: 22px; }
.close {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  font-size: 22px;
  cursor: pointer;
  opacity: 0.85;
  line-height: 1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: opacity .2s, background .2s;
}
.close:hover { opacity: 1; background: rgba(255,255,255,.15); }

.modal-body { padding: 22px; flex: 1; overflow-y: auto; }
.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}
.modal-footer button {
  min-width: 130px;
  height: 46px;
  padding: 0 28px;
  font-weight: 700;
  border-radius: 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.modal-footer button:first-child { background: var(--s); }
.modal-footer button:last-child { background: #94a3b8; }
.modal-footer button.r,
.modal-footer button.r:first-child,
.modal-footer button.r:last-child { background: var(--r); color: #fff; }
.modal-footer button.r:hover { background: #dc2626; }

/* ФОРМИ В МОДАЛЦІ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 20px;
}
.grid label {
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.grid label svg { width: 17px; height: 17px; opacity: 0.8; }

.grid input, .grid select {
  padding: 11px 14px;
  border: 1.8px solid #cbd5e1;
  border-radius: 9px;
  font-size: 15.5px;
  width: 100%;
  transition: all .2s;
}
.grid input:focus, .grid select:focus, .time-input:focus {
  outline: none;
  border-color: var(--s);
  box-shadow: 0 0 0 4px rgba(59,130,246,.18);
}

/* Дистанції в модалці */
.event-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-top: 8px;
}
.event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.4px solid #e2e8f0;
  font-size: 14px;
  transition: background .2s;
}
.event-row:hover { background: #eef2ff; }
.event-row label {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-row label svg { width: 17px; height: 17px; opacity: 0.85; }
.time-input {
  width: 90px;
  padding: 6px 4px;
  text-align: center;
  border: 1.6px solid #cbd5e1;
  border-radius: 7px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 14.5px;
  color: var(--p);
}

/* ================================
   PILL КНОПКИ — стать і роль тренера
================================ */
.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pill-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}
.pill-btn:hover {
  border-color: var(--s);
  color: var(--s);
  transform: none;
}

/* Стать — активний стан */
.pill-btn--active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--p);
}

/* Стать — гендерні кольори */
.pill-btn--male.pill-btn--active   { background:#eff6ff; border-color:#93c5fd; color:#3b82f6; }
.pill-btn--female.pill-btn--active { background:#fdf2f8; border-color:#f9a8d4; color:#ec4899; }

/* Роль — активні стани з кольорами */
.pill-btn--head.pill-btn--active  { background:#dbeafe; border-color:#93c5fd;  color:#1e40af; }
.pill-btn--coach.pill-btn--active { background:#dcfce7; border-color:#86efac;  color:#15803d; }
.pill-btn--staff.pill-btn--active { background:#fef9c3; border-color:#fde047;  color:#854d0e; }
.pill-btn--doctor.pill-btn--active{ background:#fce7f3; border-color:#f9a8d4;  color:#9d174d; }

/* ================================
   ТРЕНЕРСЬКИЙ ШТАБ — модалка клубу
================================ */

/* Рядок тренера у списку */
.coach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}
.coach-row-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.coach-row-gender {
  font-size: 12px;
  color: var(--muted);
}

/* Бейдж ролі */
.coach-badge {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.coach-badge--headcoach { background: #dbeafe; color: #1e40af; }
.coach-badge--coach     { background: #dcfce7; color: #15803d; }
.coach-badge--staff     { background: #fef9c3; color: #854d0e; }
.coach-badge--doctor    { background: #fce7f3; color: #9d174d; }

/* Форма додавання тренера */
.coach-add-form {
  background: #eff6ff;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.coach-add-form .grid {
  margin-bottom: 10px;
}

/* Рядок: Стать + Роль + кнопка */
.coach-form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.coach-form-row > div { flex: 1; min-width: 100px; }
.coach-form-row > div:last-child { flex: 0 0 auto; }

.coach-form-row select {
  padding: 9px 10px;
  border: 1.8px solid #cbd5e1;
  border-radius: 9px;
  font-size: 14px;
  width: 100%;
  background: var(--card);
  color: var(--text);
}

/* ================================
   ВКЛАДКА ДИСТАНЦІЇ — адаптивна сітка */
.events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* summary — перенос довгого тексту назви дистанції */
details summary {
  white-space: normal;
  word-break: break-word;
}

/* ================================
   ДИСТАНЦІЇ В МОДАЛЦІ — класи
   (замість inline стилів в modal.js)
================================ */

/* Блок сесії у режимі "За програмою" */
.ev-session-block {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ev-session-hdr {
  background: var(--p);
  color: #fff;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ev-session-events {
  padding: 4px 0;
}

/* Двоколоночна сітка у модалці */
.events-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.events-column { min-width: 0; }

/* Група стилів (В.С., БРАС тощо) */
.style-group {
  margin-bottom: 20px;
  break-inside: avoid;
}
.style-header {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.style-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Рядок дистанції */
.event-row {
  display: flex;
  align-items: flex-start; /* badge під назвою — вирівнювання по верху */
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background-color 0.2s;
}
.event-row:hover { background-color: #f0f9ff; }
.event-row.age-warning { background-color: #fef2f2 !important; border-color: #fca5a5 !important; }

.event-row-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
}
.event-row-label input[type="checkbox"] { cursor: pointer; flex-shrink: 0; margin-top: 2px; }
.event-row .time-input { margin-top: 1px; }

/* Колонка: назва дистанції + age-badge під нею */
.ev-name-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.ev-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.event-name-warn { color: #dc2626; }

/* time-input */
.time-input {
  width: 80px;
  padding: 4px 6px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--p);
  flex-shrink: 0;
}
.time-input:focus {
  outline: none;
  border-color: var(--s);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

/* ТАБИ — FA іконки */
.tab button i {
  font-size: 17px;
  flex-shrink: 0;
}
.tab button .tab-text { display: inline; }

/* ================================
   ДОПОМІЖНІ КЛАСИ З index.html
================================ */

/* ================================
   HERO SCREEN — стартова сторінка
================================ */
.hero-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 40%, #3b82f6 100%);
  z-index: 9999;
  padding: 16px;
}

.hero-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(30, 64, 175, 0.30);
  padding: 40px 36px 28px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(59,130,246,.35);
}
.hero-icon i { font-size: 32px; color: #fff; }

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--p);
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--p), var(--s));
  border-radius: 2px;
  margin-bottom: 22px;
}

.hero-hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
  width: 100%;
  text-align: left;
}

.hero-input {
  width: 100%;
  font-size: 16px; /* ≥16px — без автозуму на iOS */
  font-family: inherit;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  margin-bottom: 12px;
}
.hero-input:focus { border-color: var(--s); }

.hero-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s, transform .1s;
  margin-bottom: 20px;
}
.hero-btn:hover  { opacity: .9; transform: translateY(-1px); }
.hero-btn:active { transform: translateY(0); opacity: 1; }

.hero-version {
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 480px) {
  .hero-card { padding: 32px 20px 24px; border-radius: 20px; }
  .hero-title { font-size: 1.3rem; }
}

/* Stats у toolbar */
#stats {
  margin-right: 20px;
  font-weight: 600;
  color: #334155;
  font-size: 14px;
}

/* Бейдж вікової групи — використовується у modal, events tab, stats, schedule */
.age-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  color: var(--muted);
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.5;
}

/* Заголовок секції в модалці */
.modal-section-title {
  margin: 20px 0 8px;
  color: var(--p);
  font-weight: 700;
  font-size: 1rem;
}

/* Модалки зменшеної ширини */
.modal-content--sm { max-width: 480px; }
.modal-content--md { max-width: 520px; }

/* Модалка спортсмена — ширша для видимості вікових груп */
#editModal .modal-content { max-width: 860px; }

/* Input uppercase */
.input-uppercase { text-transform: uppercase; }

/* Список вибору учасника */
.choose-athlete-list {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 14px;
}

/* Кнопка + Позиція в естафеті */
.btn-add-position { margin-top: 10px; }

/* ================================
   ІНВАСПОРТ БЛОК
================================ */
.disability-wrap { margin: 20px 0 0; }

.disability-toggle-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}

.disability-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.disability-radio-label--active { color: var(--p); }

.disability-block {
  display: none;
  margin-top: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
}

.disability-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.disability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.disability-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.disability-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

.disability-toggles-row {
  display: flex;
  gap: 32px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.toggle-shell {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: #cbd5e1;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ================================
   РЕСПОНСИВ — tablet ≤ 768px
================================ */
@media (max-width: 768px) {
  body { padding: 10px; font-size: 14px; }
  h1 { font-size: 1.4rem; }
  h1 small { font-size: 0.85rem; }

  .clubs-grid { grid-template-columns: 1fr; }

  .events-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Дистанції в модалці — 1 колонка на планшеті */
  .events-modal-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tab button {
    font-size: 13px;
    padding: 12px 6px;
    gap: 5px;
  }
  .tab button i { font-size: 16px; }
}

/* ================================
   РЕСПОНСИВ — mobile ≤ 480px
================================ */
@media (max-width: 480px) {
  body { padding: 8px; }
  h1 { font-size: 1.15rem; }
  h1 small { font-size: 0.78rem; }

  /* Toolbar — вертикально */
  .toolbar {
    padding: 10px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar button,
  .toolbar input[type="text"] {
    width: 100%;
    justify-content: center;
  }
  #stats { margin-right: 0; text-align: center; font-size: 13px; }
  #status { min-width: unset; font-size: 13px; }

  /* Таби — іконка + мінімальний підпис */
  .tab button {
    font-size: 9px;
    padding: 10px 4px;
    gap: 3px;
    flex-direction: column;
  }
  .tab button i { font-size: 18px; }
  .tab button .tab-text { font-size: 9px; }

  .tabcontent { padding: 12px 10px; }
  .clubs-grid { grid-template-columns: 1fr; gap: 10px; }
  .events-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Модалка — bottom sheet */
  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 85vh; /* Safari: URL-bar ~60px з'їдає ~6vh, 85 = безпечний ліміт */
    border-radius: 20px 20px 0 0;
  }
  .modal-header {
    padding: 14px 16px;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
  }
  .modal-header h2 { font-size: 1.2rem; }
  .modal-body {
    padding: 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* не передавати скрол на body */
    flex: 1;
  }
  .modal-footer {
    padding: 12px 16px;
    gap: 10px;
    flex-shrink: 0;
  }
  .modal-footer button {
    flex: 1;
    min-width: unset;
    height: 48px;
    padding: 0 12px;
    font-size: 14px;
  }

  /* Форма в модалці — 1 колонка */
  .grid {
    grid-template-columns: 1fr;
    gap: 10px 0;
  }
  .grid input, .grid select {
    font-size: 16px;
    padding: 10px 12px;
  }

  /* Disability на мобільному */
  .disability-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .disability-select { font-size: 13px; padding: 5px 4px; }
  .disability-toggles-row { gap: 20px; }

  /* modal-content--sm і --md на мобільному — повна ширина */
  .modal-content--sm,
  .modal-content--md { max-width: 100%; }

  /* Event grid у модалці — 1 колонка, label перенос */
  .events-modal-grid { grid-template-columns: 1fr; gap: 0; }
  .event-row { padding: 5px 4px; gap: 6px; }
  .event-row-label { font-size: 12.5px; }
  .event-row-label span { white-space: normal; word-break: break-word; }
  .time-input { width: 72px; font-size: 12px; padding: 4px 4px; }

  /* Форма тренера — вертикально на мобільному */
  .coach-form-row { flex-direction: column; gap: 8px; }
  .coach-form-row > div { min-width: unset; width: 100%; }

  button { height: 44px; font-size: 14px; }
  button.s { height: 36px; font-size: 13px; padding: 0 12px; }

  /* Звіти — мобільний */
  .rep-dd-panel { max-height: 200px; }
}

/* ======================================================
   ВКЛАДКА «ЗВІТИ» — картки (стиль club-card, без розкриття)
====================================================== */

/* Картка звіту — дзеркалить details */
.rep-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: visible;          /* dropdown-панель виходить за межі */
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* Заголовок картки — дзеркалить summary.club-header */
.rep-card-header {
  background: #f8fafc;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1.5px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.rep-card-header i { color: var(--s); font-size: 16px; }

/* ── Поле з лейблом ───────────────────────────────── */
.rep-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Рядок master-чекбокс + кнопка Друк ──────────── */
.rep-master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Master-чекбокс ───────────────────────────────── */
.rep-check--master {
  padding: 4px 0;
  flex: 1;
}
.rep-master-row .rep-check--master {
  border-bottom: none;
  margin-bottom: 0;
}

/* ── Грід вкладки Звіти (desktop: 2 картки поруч) ── */
.rep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .rep-grid { grid-template-columns: 1fr; }
}

/* ── Роздільник ───────────────────────────────────── */
.rep-sep {
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* ── Inline-grid чекбоксів ────────────────────────── */
.rep-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 2px 4px;
}
.rep-inline-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ── Окремий чекбокс у гриді ──────────────────────── */
.rep-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background .1s;
}
.rep-check:hover { background: rgba(59,130,246,.07); }
.rep-check input[type="checkbox"] { accent-color: var(--s); flex-shrink: 0; }
.rep-check span { line-height: 1.3; }

/* ── Перемикач-опція (toggle) ─────────────────────── */
.rep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  padding: 5px 0;
}
.rep-toggle input[type="checkbox"] { accent-color: var(--s); width: 16px; height: 16px; }

/* ── Режим клубу: два стовпці ─────────────────────── */
.clubs-grid--full {
  display: block;
  width: 100%;
}
.club-mode-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.club-mode-col {
  padding: 0 16px 16px;
}
.club-mode-col:first-child {
  border-right: 1.5px solid var(--border);
}
.club-mode-col-hdr {
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 6px;
}
@media (max-width: 600px) {
  .club-mode-cols { grid-template-columns: 1fr; }
  .club-mode-col:first-child { border-right: none; border-bottom: 1.5px solid var(--border); }
}

/* ================================
   ТАБЛИЦЯ/КАРТКИ УЧАСНИКІВ
   desktop: таблиця, mobile: картки
================================ */
.ath-table-wrap { display: block; }
.ath-cards-wrap { display: none; }

@media (max-width: 480px) {
  .ath-table-wrap { display: none; }
  .ath-cards-wrap { display: block; }
}

.ath-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ath-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ath-card-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ath-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ath-card-dists { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.ath-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ================================
   Вік не відповідає AGEGROUP
================================ */
.age-warning {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
}
.age-warning:hover {
  background: #fee2e2 !important;
}

/* ================================
   QUEUE — badge на кнопці
================================ */
.queue-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* flex-обгортка заголовку клубу (name + small + badge) */
.club-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.club-header-text {
  flex: 1;
  min-width: 0;
}

/* badge у заголовку <summary> */
.queue-badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* ================================
   QUEUE MODAL — список заявок
================================ */
.queue-club-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-loading,
.queue-empty,
.queue-error {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.queue-error { color: #b91c1c; }

.queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--card);
  transition: opacity .2s;
}
.queue-card-info { flex: 1; min-width: 0; }
.queue-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.q-meta-item { display: inline; }
.q-time { opacity: 0.7; }
.q-entries {
  font-size: 0.75rem;
  color: #3b82f6;
  margin-top: 4px;
  line-height: 1.4;
}

.queue-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.q-btn-approve {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .15s;
}
.q-btn-approve:hover { background: #059669; }

.q-btn-reject {
  height: 34px;
  width: 34px;
  padding: 0;
  font-size: 14px;
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.q-btn-reject:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

@media (max-width: 520px) {
  .queue-card { flex-direction: column; align-items: flex-start; }
  .queue-card-actions { width: 100%; justify-content: flex-end; }
  .q-btn-approve { flex: 1; justify-content: center; }
}

/* ══════════════════════════════════════════════════
   SCHEDULE MODAL — Програма змагань (v2.23)
   ══════════════════════════════════════════════════ */

/* Ширина модалки */
#scheduleDialog .modal-content { max-width: 1100px; }

/* Meet meta info */
.sched-meta {
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.sched-meta-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--p);
  line-height: 1.35;
  margin-bottom: 5px;
}
.sched-meta-sub {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.sched-meta-sub span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Sessions grid — 2 колонки */
.sched-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}

/* Empty state */
.schedule-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}
.schedule-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  opacity: .4;
}

/* Session card */
.sched-session {
  border-radius: 10px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  background: var(--card);
}
.sched-session-hdr {
  background: var(--p);
  color: #fff;
  padding: 8px 12px 7px;
}
.sched-session-hdr-title {
  font-weight: 700;
  font-size: 0.81rem;
  line-height: 1.3;
}
.sched-session-hdr-date {
  font-size: 0.73rem;
  opacity: .82;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Event row */
.sched-ev {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  transition: background .1s;
}
.sched-ev:last-child { border-bottom: none; }
.sched-ev:hover      { background: var(--bg); }

.sched-ev-num    { color: var(--muted); font-size: 0.73rem; font-weight: 700; min-width: 22px; }
.sched-ev-dist   { font-weight: 800; font-size: 0.84rem; min-width: 40px; color: var(--text); }
/* Колонка: назва стилю + вік під нею */
.sched-ev-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sched-ev-stroke { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sched-ev-gender {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.77rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sched-ev-gender.f { color: #ec4899; }
.sched-ev-gender.m { color: #3b82f6; }

.sched-ev-age {
  font-size: 0.7rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Mobile ≤600px: single column */
@media (max-width: 600px) {
  .sched-grid { grid-template-columns: 1fr; }
}
