/*
 * TKD Roussin - shared design system (mobile-first).
 * Rolled out page by page; index.php is the first to use it.
 */

:root {
  --tkd-ink: #161412;
  --tkd-ink-soft: #38332a;
  --tkd-beige: #f4ecdf;
  --tkd-beige-mid: #e6d8bd;
  --tkd-beige-dark: #c9b48c;
  --tkd-cream: #fbf7ee;
  --tkd-red: #c1272d;
  --tkd-red-dark: #971f24;
  --tkd-blue: #1d4e89;

  --font-heading: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1140px;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(22, 20, 18, 0.08);
  --shadow-md: 0 12px 32px rgba(22, 20, 18, 0.16);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--tkd-beige);
  color: var(--tkd-ink);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.site-row {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  box-shadow: var(--shadow-sm);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  text-decoration: none;
  color: var(--tkd-beige);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.55;
  filter: grayscale(40%);
  transition: opacity 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.lang-switch__item svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lang-switch__item:hover {
  opacity: 1;
  filter: grayscale(0%);
  background: rgba(244, 236, 223, 0.1);
}

.lang-switch__item.is-active {
  opacity: 1;
  filter: grayscale(0%);
  box-shadow: inset 0 0 0 2px var(--tkd-red);
}

.brand img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: var(--tkd-cream);
}

.nav-toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--tkd-beige);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--tkd-ink);
  border-top: 1px solid rgba(244, 236, 223, 0.12);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-toggle-checkbox:checked ~ .nav-links {
  max-height: 400px;
}

.nav-links a {
  padding: 0.9rem 1.25rem;
  text-decoration: none;
  color: var(--tkd-beige);
  font-weight: 500;
  border-top: 1px solid rgba(244, 236, 223, 0.08);
}

.nav-links a:first-child { border-top: none; }

.nav-links a:hover,
.nav-links a.active {
  background: rgba(244, 236, 223, 0.08);
  color: var(--tkd-cream);
}

.nav-links a.active {
  box-shadow: inset 3px 0 0 var(--tkd-red);
}

@media (min-width: 768px) {
  .nav-toggle-label { display: none; }

  .nav-links {
    position: static;
    flex-direction: row;
    max-height: none;
    overflow: visible;
    background: transparent;
    border-top: none;
  }

  .nav-links a {
    border-top: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
  }

  .nav-links a.active { box-shadow: none; }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(244, 236, 223, 0.1);
  }
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 3rem 1.25rem 3.5rem;
}

.hero__logo {
  width: 150px;
  margin-inline: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(var(--shadow-md));
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw + 1rem, 3rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--tkd-ink);
}

.hero p.tagline {
  font-size: clamp(1rem, 1vw + 0.85rem, 1.2rem);
  color: var(--tkd-ink-soft);
  max-width: 42ch;
  margin: 0 auto 2rem;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 320px;
  margin-inline: auto;
}

@media (min-width: 500px) {
  .cta-row {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--tkd-red);
  color: var(--tkd-cream);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover { background: var(--tkd-red-dark); }

.btn--outline {
  background: transparent;
  color: var(--tkd-ink);
  border: 2px solid var(--tkd-ink);
}

.btn--outline:hover { background: var(--tkd-ink); color: var(--tkd-cream); }

/* ---------- Social section ---------- */

.social {
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  background: var(--tkd-beige-mid);
}

.social p {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--tkd-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tkd-ink);
  color: var(--tkd-cream);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease;
}

.social-link:hover {
  background: var(--tkd-blue);
  transform: translateY(-2px);
}

.social-link svg { width: 26px; height: 26px; fill: currentColor; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--tkd-ink);
  color: var(--tkd-beige-dark);
  text-align: center;
  padding: 1.75rem 1.25rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--tkd-cream);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

/* ---------- Interior page hero (dojang / equipe / contact) ---------- */

.page-hero {
  background: var(--tkd-ink);
  color: var(--tkd-cream);
  text-align: center;
  padding: 2.75rem 1.25rem;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw + 1rem, 2.4rem);
  margin: 0 0 0.5rem;
}

.page-hero p {
  color: var(--tkd-beige-dark);
  max-width: 50ch;
  margin: 0 auto;
}

/* ---------- Carousel (dojang.php) ---------- */

.carousel {
  max-width: 900px;
  margin: 2.5rem auto;
  padding-inline: 1.25rem;
}

.carousel__track {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
  background: var(--tkd-beige-mid);
}

.carousel__slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__slide.is-active { display: block; }

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 20, 18, 0.55);
  color: var(--tkd-cream);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.carousel__arrow--prev { left: 0.75rem; }
.carousel__arrow--next { right: 0.75rem; }
.carousel__arrow:hover { background: var(--tkd-red); }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tkd-beige-dark);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel__dot.is-active { background: var(--tkd-red); }

/* ---------- Team grid (equipe.php) ---------- */

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2.5rem 1.25rem 3rem;
  max-width: var(--container);
  margin-inline: auto;
}

@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

.team-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.team-card__name {
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.9rem 0.75rem 0.3rem;
  margin: 0;
  font-size: 1.02rem;
}

.team-card__rank {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Contact form (contact.php) ---------- */

.contact-section {
  max-width: 640px;
  margin: 2.5rem auto;
  padding: 0 1.25rem 3rem;
}

.contact-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.contact-card h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}

.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label { font-weight: 600; font-size: 0.92rem; color: var(--tkd-ink-soft); }

.form-group input[type=text],
.form-group input[type=email],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--tkd-beige);
  color: var(--tkd-ink);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--tkd-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.captcha-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.captcha-row img {
  width: 160px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid var(--tkd-beige-dark);
}

.captcha-row input[type=text] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--tkd-beige);
  color: var(--tkd-ink);
}

.captcha-row input[type=text]:focus {
  outline: none;
  border-color: var(--tkd-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.captcha-refresh { font-size: 0.85rem; color: var(--tkd-ink-soft); }
.captcha-refresh a { color: var(--tkd-blue); font-weight: 600; text-decoration: none; }
.captcha-refresh a:hover { text-decoration: underline; }

.form-status {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.form-status--ok { background: #e4f3e6; color: #1e6b2e; }
.form-status--error { background: #fbe6e6; color: var(--tkd-red-dark); }

.btn--block {
  width: 100%;
  border: none;
  cursor: pointer;
}

/* ---------- Small form utilities (login / reset / create-new-pass) ---------- */

.form-group--inline { flex-direction: row; align-items: center; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--tkd-ink-soft);
  cursor: pointer;
}

.checkbox-label input[type=checkbox] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--tkd-red);
}

.form-footnote {
  text-align: center;
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
}

.form-footnote a { color: var(--tkd-blue); font-weight: 600; text-decoration: none; }
.form-footnote a:hover { text-decoration: underline; }

/* ---------- Plain data table (admin-only debug views) ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--tkd-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--tkd-beige-dark);
  text-align: left;
}

.data-table th {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  font-family: var(--font-heading);
  font-weight: 600;
}

.data-table tr:last-child td { border-bottom: none; }

/* ==================== Admin area ==================== */

.admin-container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ---------- Toolbar (search / add / reset / status) ---------- */

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

/*
 * A plain button/hidden-inputs form (e.g. "Reset registrations") needs to
 * disappear as a box so its button sits inline with its toolbar siblings.
 * :not(.admin-search) is required here: .admin-search sets its own
 * `display: flex` (a single class, lower specificity than this compound
 * selector), so without the exclusion this rule silently overrode it -
 * the search input's flex:1 then applied against the whole toolbar
 * instead of just the search form, which only broke visibly once the
 * toolbar ran out of horizontal room (i.e. on mobile, not desktop).
 */
.admin-toolbar form:not(.admin-search) { display: contents; }

.admin-search {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex: 1 1 220px;
}

.admin-search input[type=text] {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--tkd-beige);
  color: var(--tkd-ink);
}

.admin-search input[type=text]:focus {
  outline: none;
  border-color: var(--tkd-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.btn--sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.92rem;
}

.btn--ghost {
  background: transparent;
  color: var(--tkd-ink-soft);
  border: 1px solid var(--tkd-beige-dark);
}

.btn--ghost:hover { background: var(--tkd-beige-mid); color: var(--tkd-ink); }

.toolbar-msg {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
}

.toolbar-msg--ok { background: #e4f3e6; color: #1e6b2e; }
.toolbar-msg--warn { background: #fbe6e6; color: var(--tkd-red-dark); }

/* ---------- Full-page alert banner (form errors, duplicate warnings) ---------- */

.banner-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.banner-alert__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.banner-alert__message {
  margin: 0;
  line-height: 1.45;
}

.banner-alert__close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.65;
}

.banner-alert__close:hover { opacity: 1; }

.banner-alert--warn { background: #fbe6e6; color: var(--tkd-red-dark); }
.banner-alert--ok { background: #e4f3e6; color: #1e6b2e; }
.banner-alert--info { background: #e6edf7; color: var(--tkd-blue); }

/* ---------- Pagination ---------- */

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 8px;
  background: var(--tkd-cream);
  color: var(--tkd-ink);
  text-decoration: none;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.pagination a:hover { background: var(--tkd-beige-mid); }
.pagination a.active { background: var(--tkd-ink); color: var(--tkd-beige); }

.pagination a.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  box-shadow: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--tkd-ink-soft);
}

.pagination-info {
  display: inline-flex;
  align-items: center;
  padding: 0 0.4rem;
  font-size: 0.85rem;
  color: var(--tkd-ink-soft);
  white-space: nowrap;
}

.per-page-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--tkd-ink-soft);
}

.per-page-form select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 8px;
  background: var(--tkd-cream);
  color: var(--tkd-ink);
}

/* ---------- Admin data table ---------- */

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--tkd-cream);
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--tkd-beige-dark);
  text-align: left;
  white-space: nowrap;
}

.admin-table td.wrap { white-space: normal; }

.admin-table th {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  font-family: var(--font-heading);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.admin-table tr:last-child td { border-bottom: none; }

/*
 * Hover tint goes on the row, not each cell: a <td> with its own
 * background (the status colors below) always paints over its row's
 * background, so status-coded cells keep their color on hover while
 * plain cells still get the subtle highlight.
 */
.admin-table tr:hover { background: var(--tkd-beige-mid); }

.admin-table a { color: var(--tkd-blue); text-decoration: none; font-weight: 600; }
.admin-table a:hover { text-decoration: underline; }

.row-btn {
  border: none;
  background: var(--tkd-ink);
  color: var(--tkd-cream);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.row-btn:hover { background: var(--tkd-blue); }

/*
 * At-a-glance status colors for the athlete table (staff rely on
 * these to scan a page quickly): orange/green/blue = registration
 * status, blue/pink = gender, yellow = missing info, red = missing
 * info that's required for an unregistered athlete.
 */
.cell-orange { background: #ffcc80; }
.cell-green  { background: #a5d6a7; }
.cell-blue   { background: #90caf9; }
.cell-pink   { background: #f48fb1; }
.cell-yellow { background: #fff59d; }
.cell-red    { background: #ef9a9a; }

.admin-table td.cell-orange,
.admin-table td.cell-green,
.admin-table td.cell-blue,
.admin-table td.cell-pink,
.admin-table td.cell-yellow,
.admin-table td.cell-red {
  color: #1a1a1a;
}

.admin-table td.cell-orange a,
.admin-table td.cell-green a,
.admin-table td.cell-blue a,
.admin-table td.cell-pink a,
.admin-table td.cell-yellow a,
.admin-table td.cell-red a {
  color: #1a1a1a;
}

/* ---------- Status badges ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--green { background: #e4f3e6; color: #1e6b2e; }
.badge--orange { background: #fdead2; color: #96591c; }
.badge--blue { background: #dfeaf7; color: var(--tkd-blue); }
.badge--red { background: #fbe6e6; color: var(--tkd-red-dark); }
.badge--yellow { background: #fdf6d8; color: #8a6d00; }
.badge--neutral { background: var(--tkd-beige-mid); color: var(--tkd-ink-soft); }

/* ---------- Admin form grid (add/edit athlete) ---------- */

.admin-form-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.5rem;
}

@media (min-width: 700px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}

.form-grid .form-group { min-width: 0; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------- Photo picker (add/edit athlete) ---------- */

.photo-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.photo-picker__frame {
  position: relative;
  flex: 0 0 auto;
}

.photo-picker__preview {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--tkd-beige-dark);
  background: var(--tkd-beige);
}

.photo-picker__camera-btn {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--tkd-cream);
  border-radius: 50%;
  background: var(--tkd-red);
  color: var(--tkd-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-picker__camera-btn:hover { background: var(--tkd-red-dark); }

.photo-picker__camera-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ---------- Student detail card ---------- */

.student-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.student-card__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--tkd-beige-mid);
  color: var(--tkd-ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.student-card__close:hover { background: var(--tkd-red); color: var(--tkd-cream); }

.student-card__top {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .student-card__top { flex-direction: row; align-items: flex-start; }
}

.student-card__photo {
  flex: 0 0 auto;
  text-align: center;
}

.student-card__photo img.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--tkd-beige-dark);
}

.student-card__photo h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0.75rem 0 0.5rem;
}

.student-card__photo img.qr {
  width: 90px;
  margin-top: 0.5rem;
}

.student-card__info {
  flex: 1;
  min-width: 0;
}

.student-card__info dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 0.9rem;
  margin: 0;
  font-size: 0.94rem;
}

.student-card__info dt { color: var(--tkd-ink-soft); font-weight: 600; }
.student-card__info dd { margin: 0; }

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--tkd-beige-mid);
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--tkd-red);
  border-radius: 999px;
}

/* ---------- Two-column admin layout (sidebar + main) ---------- */

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 900px) {
  .admin-layout { flex-direction: row; }
  .admin-layout__sidebar { flex: 0 0 260px; }
  .admin-layout__main { flex: 1; min-width: 0; width: 100%; }
}

.admin-layout__sidebar,
.admin-layout__main {
  width: 100%;
}

.sidebar-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-card__header {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  padding: 0.9rem 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
}

.sidebar-card__body {
  padding: 1.1rem;
}

/* ---------- Stats grid (distribution reports: grade/group/age/gender) ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-panel {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
  min-width: 0;
}

.stat-panel h4 {
  font-family: var(--font-heading);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.stat-panel .admin-table-wrap { box-shadow: none; }
.stat-panel .admin-table { min-width: 0; font-size: 0.85rem; }

.stat-panel div[id^="piechart"] {
  margin: 0.75rem auto 0;
  max-width: 100%;
  overflow: hidden;
}

.piechart-clickable {
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.piechart-clickable:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-sm);
}

/* ---------- Chart zoom modal ---------- */

.chart-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(22, 20, 18, 0.75);
}

.chart-modal__panel {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 3.25rem 1.25rem 1.25rem;
}

.chart-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--tkd-beige-mid);
  color: var(--tkd-ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-modal__close:hover { background: var(--tkd-red); color: var(--tkd-cream); }

.chart-modal__body {
  width: 100%;
  min-height: 280px;
}
