/* ============================================================
   KESTREL CLUB CHALLENGE — Stylesheet
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f9;
  color: #1a2636;
  min-height: 100vh;
}

/* ---- Header ---- */
.kc-header {
  background: linear-gradient(135deg, #1a2636 0%, #2d4a6b 100%);
  color: #fff;
  padding: 0;
}
.kc-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.kc-logo-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  overflow: hidden;
}
.kc-logo-ring svg { width: 36px; height: 36px; }
.kc-logo-ring img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}
.kc-header-text h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.kc-header-text p {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Nav tabs ---- */
.kc-nav {
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.kc-nav ul {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  list-style: none;
  display: flex;
  gap: 4px;
}
.kc-nav li a {
  display: block;
  padding: 10px 18px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.kc-nav li a:hover,
.kc-nav li a.active {
  color: #f0d060;
  border-bottom-color: #f0d060;
}

/* ---- Main content ---- */
.kc-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ---- Search / filter bar ---- */
.kc-search-bar {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.kc-search-bar label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 5px;
}
.kc-search-bar input,
.kc-search-bar select {
  border: 1.5px solid #d0d7e3;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 0.95rem;
  color: #1a2636;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.kc-search-bar input:focus,
.kc-search-bar select:focus { border-color: #2d4a6b; }
.kc-search-bar input[type="text"] { min-width: 240px; }
.kc-search-bar .kc-btn { align-self: flex-end; }

/* ---- Buttons ---- */
.kc-btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}
.kc-btn:active { transform: scale(0.97); }
.kc-btn-primary { background: #1a2636; color: #fff; }
.kc-btn-primary:hover { background: #2d4a6b; color: #fff; }
.kc-btn-gold { background: linear-gradient(135deg, #c9a83c, #f0d060); color: #3a2800; }
.kc-btn-gold:hover { background: linear-gradient(135deg, #b8942a, #e0c040); color: #3a2800; }
.kc-btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.kc-btn-outline {
  background: transparent;
  border: 2px solid #1a2636;
  color: #1a2636;
}
.kc-btn-outline:hover { background: #1a2636; color: #fff; }

/* ---- Stats grid (top summary) ---- */
.kc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kc-stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  text-align: center;
}
.kc-stat-card .kc-stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a2636;
  line-height: 1;
}
.kc-stat-card .kc-stat-label {
  font-size: 0.76rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* ---- Badge panels strip (KestrelChallenge) ---- */
.kc-badge-panels {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: nowrap;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 20px;
  overflow-x: auto;
}
.kc-badge-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 90px;
  padding: 12px 8px;
  border-right: 1px solid #f0f0f0;
}
.kc-badge-panel:last-child { border-right: none; }
.kc-badge-panel img { width: 62px; height: 62px; object-fit: contain; display: block; }
.kc-badge-panel-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a2636;
  line-height: 1;
}
.kc-badge-panel-name {
  font-size: 0.62rem;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ---- Athlete table ---- */
.kc-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  margin-bottom: 24px;
}
.kc-card-header {
  background: #1a2636;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kc-card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.kc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.kc-table thead th {
  background: #f0f3f8;
  color: #444;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #e0e5ee;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kc-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.kc-table tbody tr:last-child td { border-bottom: none; }
.kc-table tbody tr:hover td { background: #f8faff; }
.kc-table .kc-athlete-name {
  font-weight: 700;
  color: #1a2636;
}
.kc-table td.kc-td-name {
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .kc-table td.kc-td-name {
    white-space: normal;
    width: 26%;
    word-break: break-word;
  }
}
.kc-table .kc-athlete-name a {
  color: #1a2636;
  text-decoration: none;
}
.kc-table .kc-athlete-name a:hover {
  color: #c9a83c;
  text-decoration: underline;
}

/* ---- Medal badges ---- */
.medal {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.medal-Gold    { background: linear-gradient(135deg, #c9a83c, #f0d060); color: #3a2800; }
.medal-Silver  { background: linear-gradient(135deg, #a0a0a0, #d0d0d0); color: #1a1a1a; }
.medal-Bronze  { background: linear-gradient(135deg, #a0522d, #cd7f32); color: #fff; }
.medal-Green   { background: #2e7d32; color: #fff; }
.medal-Red     { background: #c62828; color: #fff; }
.medal-Blue    { background: #1565c0; color: #fff; }
.medal-Orange  { background: #e65100; color: #fff; }
.medal-none    { background: #e0e0e0; color: #999; }

/* Badge (larger version for athlete profile) */
.kc-badge-large {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.kc-badge-large .kc-badge-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.kc-badge-large .kc-badge-text h3 {
  font-size: 1.5rem;
  font-weight: 800;
}
.kc-badge-large .kc-badge-text p {
  font-size: 0.82rem;
  opacity: 0.85;
  margin-top: 2px;
}
.badge-bg-Gold   { background: linear-gradient(135deg, #c9a83c, #f0d060); color: #3a2800; }
.badge-bg-Silver { background: linear-gradient(135deg, #8a8a8a, #d0d0d0); color: #111; }
.badge-bg-Bronze { background: linear-gradient(135deg, #8b4513, #cd7f32); color: #fff; }
.badge-bg-Green  { background: linear-gradient(135deg, #1b5e20, #2e7d32); color: #fff; }
.badge-bg-Red    { background: linear-gradient(135deg, #7f0000, #c62828); color: #fff; }
.badge-bg-Blue   { background: linear-gradient(135deg, #0d2e6e, #1565c0); color: #fff; }
.badge-bg-Orange { background: linear-gradient(135deg, #8b2200, #e65100); color: #fff; }
.badge-bg-Sorry  { background: #e0e0e0; color: #555; }

/* ---- Badge star (athlete table — overall badge only) ---- */
.kc-badge-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  clip-path: polygon(
    50% 0%,
    64.6% 14.6%, 85.4% 14.6%,
    85.4% 35.4%, 100% 50%,
    85.4% 64.6%, 85.4% 85.4%,
    64.6% 85.4%, 50% 100%,
    35.4% 85.4%, 14.6% 85.4%,
    14.6% 64.6%, 0% 50%,
    14.6% 35.4%, 14.6% 14.6%,
    35.4% 14.6%
  );
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}
.kc-badge-star-Gold   { background: #c9a83c; color: #fff; }
.kc-badge-star-Silver { background: #8a9ab0; color: #fff; }
.kc-badge-star-Bronze { background: #a0673a; color: #fff; }
.kc-badge-star-Green  { background: #2e7d32; color: #fff; }
.kc-badge-star-Red    { background: #c62828; color: #fff; }
.kc-badge-star-Blue   { background: #1565c0; color: #fff; }
.kc-badge-star-Orange { background: #e65100; color: #fff; }

/* ---- Badge dot (athlete table — category medals) ---- */
.kc-badge-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}
.kc-badge-dot-Gold   { background: #c9a83c; color: #fff; }
.kc-badge-dot-Silver { background: #8a9ab0; color: #fff; }
.kc-badge-dot-Bronze { background: #a0673a; color: #fff; }
.kc-badge-dot-Green  { background: #2e7d32; color: #fff; }
.kc-badge-dot-Red    { background: #c62828; color: #fff; }
.kc-badge-dot-Blue   { background: #1565c0; color: #fff; }
.kc-badge-dot-Orange { background: #e65100; color: #fff; }

/* ---- Badge image in athlete header ---- */
.kc-athlete-badge-img {
  flex-shrink: 0;
}
.kc-athlete-badge-img img {
  width: 75px;
  height: 75px;
  object-fit: contain;
  display: block;
}

/* ---- Athlete profile page ---- */
.kc-athlete-header {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.kc-athlete-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2636, #2d4a6b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  flex-shrink: 0;
}
.kc-athlete-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a2636;
}
.kc-athlete-info .kc-meta {
  font-size: 0.83rem;
  color: #888;
  margin-top: 4px;
}
.kc-athlete-info .kc-meta span { margin-right: 14px; }
.kc-athlete-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Category sections ---- */
.kc-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kc-category-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
}
.kc-category-card .kc-cat-header {
  padding: 10px 14px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kc-cat-header-sprinting  { background: #1a2636; color: #fff; }
.kc-cat-header-distance   { background: #1b5e20; color: #fff; }
.kc-cat-header-jumping    { background: #1565c0; color: #fff; }
.kc-cat-header-throwing   { background: #7b1fa2; color: #fff; }
.kc-cat-header-overall    { background: linear-gradient(135deg, #c9a83c, #f0d060); color: #3a2800; }
.kc-category-card .kc-cat-medal {
  margin-left: auto;
}
/* Column header inside category cards */
.kc-event-col-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 5px 14px;
  background: #f9fafb;
  border-bottom: 1px solid #eef0f5;
  gap: 10px;
}
.kc-event-col-header span {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
}
.kc-event-col-header span:nth-child(2) { text-align: right; }
.kc-event-col-header span:nth-child(3) { text-align: right; min-width: 54px; }
/* Event rows — 3-column grid */
.kc-event-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid #f5f5f5;
  gap: 10px;
}
.kc-event-row:last-child { border-bottom: none; }
.kc-event-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: #444;
}
.kc-event-pb {
  font-weight: 800;
  font-size: 0.92rem;
  color: #1a2636;
  text-align: right;
  white-space: nowrap;
}
.kc-event-medal {
  text-align: right;
  min-width: 54px;
}
.kc-no-result {
  color: #bbb;
  font-size: 0.78rem;
  font-style: italic;
  text-align: right;
}

/* ---- Standards table ---- */
.kc-standards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.kc-standards-table th {
  padding: 9px 12px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e0e5ee;
  text-align: center;
}
.kc-standards-table th:first-child { text-align: left; }
.kc-standards-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  font-weight: 700;
}
.kc-standards-table td:first-child { text-align: left; font-weight: 600; color: #333; }
.kc-standards-table .th-gold   { color: #a07800; }
.kc-standards-table .th-silver { color: #707070; }
.kc-standards-table .th-bronze { color: #a0522d; }
.kc-standards-table .th-green  { color: #2e7d32; }
.kc-standards-table .th-red    { color: #c62828; }
.kc-standards-table .th-blue   { color: #1565c0; }
.kc-standards-table .th-orange { color: #e65100; }
.kc-standards-table .td-gold   { color: #a07800; }
.kc-standards-table .td-silver { color: #606060; }
.kc-standards-table .td-bronze { color: #a0522d; }
.kc-standards-table .td-green  { color: #2e7d32; }
.kc-standards-table .td-red    { color: #c62828; }
.kc-standards-table .td-blue   { color: #1565c0; }
.kc-standards-table .td-orange { color: #e65100; }
.kc-standards-table .cat-row td {
  background: #f0f3f8;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #444;
  text-align: left;
  padding: 7px 12px;
}

/* ---- CERTIFICATE ---- */
@media screen {
  .kc-cert-wrapper {
    background: #e8e8e8;
    padding: 40px 20px;
    min-height: 100vh;
  }
}

.kc-certificate {
  background: #fff;
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
  border: 8px solid #1a2636;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
}

/* decorative corner lines */
.kc-certificate::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 2px solid rgba(201,168,60,0.4);
  border-radius: 2px;
  pointer-events: none;
}

.kc-cert-top {
  background: linear-gradient(135deg, #1a2636 0%, #2d4a6b 100%);
  color: #fff;
  text-align: center;
  padding: 36px 40px 28px;
  position: relative;
}
.kc-cert-top .kc-cert-club {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.kc-cert-top h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f0d060;
  margin-bottom: 0;
}
.kc-cert-top .kc-cert-subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

.kc-cert-athlete {
  text-align: center;
  padding: 28px 40px 18px;
  border-bottom: 2px solid #f0f0f0;
}
.kc-cert-athlete .kc-cert-name {
  font-size: 2rem;
  font-weight: 900;
  color: #1a2636;
  letter-spacing: 0.02em;
}
.kc-cert-athlete .kc-cert-tagline {
  font-size: 0.9rem;
  color: #666;
  margin-top: 6px;
  font-style: italic;
}

.kc-cert-badge-strip {
  text-align: center;
  padding: 14px 40px;
  border-bottom: 2px solid #f0f0f0;
}
.kc-cert-badge-strip .kc-cert-badge-pill {
  display: inline-block;
  padding: 8px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kc-cert-body {
  padding: 22px 30px 28px;
}
.kc-cert-section {
  margin-bottom: 18px;
}
.kc-cert-section-title {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1.5px solid #eee;
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.kc-cert-events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kc-cert-event-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8f9fc;
  border: 1.5px solid #e8eaf0;
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 130px;
}
.kc-cert-event-chip .kc-chip-event {
  font-size: 0.78rem;
  color: #555;
  font-weight: 600;
}
.kc-cert-event-chip .kc-chip-value {
  font-size: 0.95rem;
  font-weight: 900;
  color: #1a2636;
}
.kc-cert-event-chip .kc-chip-medal { margin-left: auto; }

.kc-cert-footer {
  background: #f8f8f8;
  border-top: 2px solid #eee;
  padding: 16px 40px;
  text-align: center;
  font-size: 0.72rem;
  color: #999;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Print styles ---- */
@media print {
  body { background: white; }
  .kc-cert-wrapper { background: white; padding: 0; }
  .kc-no-print { display: none !important; }
  .kc-certificate {
    border: 6px solid #1a2636;
    max-width: 100%;
    page-break-inside: avoid;
  }
  .kc-cert-top h1 { color: #c9a83c; }
}

/* ---- Leaderboard ---- */
.kc-rank { font-weight: 800; color: #888; font-size: 0.9rem; }
.kc-rank-1 { color: #c9a83c; }
.kc-rank-2 { color: #909090; }
.kc-rank-3 { color: #a0522d; }

/* ---- Utility ---- */
.kc-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a2636;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e5ee;
}
.kc-empty { text-align: center; padding: 40px; color: #aaa; font-style: italic; }
.kc-tag {
  display: inline-block;
  background: #e8ecf5;
  color: #3a4a6b;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 4px;
}
.kc-cert-issued {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---- Forms (shared by login, account, athlete edit) ---- */
.kc-form-group { margin-bottom: 18px; }
.kc-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.kc-form-group input[type="text"],
.kc-form-group input[type="email"],
.kc-form-group input[type="password"],
.kc-form-group input[type="date"],
.kc-form-group input[type="tel"],
.kc-form-group select,
.kc-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d0d7e3;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #1a2636;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.kc-form-group input:focus,
.kc-form-group select:focus,
.kc-form-group textarea:focus { border-color: #1a2636; }
.kc-form-group textarea { resize: vertical; min-height: 70px; }

/* ---- Parent Login ---- */
.kc-login-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 0 48px;
}

.kc-flash-ok {
  background: #e8f5e9;
  border: 1.5px solid #2e7d32;
  color: #1b5e20;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
}

.kc-flash-err {
  background: #ffebee;
  border: 1.5px solid #c62828;
  color: #b71c1c;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
}

/* Nav: push login link to right */
.kc-nav ul li[style*="margin-left:auto"] {
  margin-left: auto;
}

/* Account picker cards */
.kc-picker-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px;
}

/* ============================================================
   RESPONSIVE NAVIGATION
   Breakpoints: < 768px = mobile (hamburger)
                768px–1023px = tablet (full nav, compact)
                1024px+ = desktop (full nav)
   Touch target minimum: 44×44px (WCAG 2.5.5 / Apple HIG)
   ============================================================ */

/* Hamburger button — hidden on tablet/desktop */
.kc-hamburger {
  display: none;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.kc-hamburger:hover {
  border-color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.08);
}
.kc-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
  pointer-events: none;
}
/* Animate to × when open */
.kc-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.kc-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.kc-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Category grid: 4 → 2 → 1 columns ---- */
@media (max-width: 899px) {
  .kc-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 499px) {
  .kc-category-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile (< 768px) ---- */
@media (max-width: 767px) {
  .kc-header-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .kc-logo-ring {
    width: 36px;
    height: 36px;
  }
  .kc-header-text h1 {
    font-size: 0.95rem;
  }
  .kc-header-text p {
    display: none;
  }
  .kc-hamburger {
    display: flex;
  }
  /* Nav collapses — animates open via max-height */
  .kc-nav {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
  }
  .kc-nav.is-open {
    max-height: 600px;
  }
  .kc-nav ul {
    flex-direction: column;
    max-width: none;
    padding: 6px 0 10px;
    gap: 0;
  }
  .kc-nav li {
    width: 100%;
  }
  .kc-nav li a {
    padding: 12px 20px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.93rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .kc-nav li a:hover,
  .kc-nav li a.active {
    border-bottom-color: transparent;
    border-left-color: #f0d060;
    background: rgba(255,255,255,0.06);
  }
  /* Right-aligned group: cancel margin-left:auto, add separator */
  .kc-nav li[style*="margin-left:auto"],
  .kc-nav li[style*="margin-left: auto"] {
    margin-left: 0 !important;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 6px;
    padding-top: 6px;
  }
  .kc-main {
    padding: 18px 16px 48px;
  }
  /* Search bar — kill the min-width that blows out layout on narrow phones */
  .kc-search-bar {
    padding: 14px;
    gap: 8px;
  }
  .kc-search-bar input[type="text"],
  .kc-search-bar select {
    min-width: 0;
    width: 100%;
  }
  /* Stats grid — 2 columns, compact cards */
  .kc-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .kc-stat-card {
    padding: 12px 10px;
  }
  .kc-stat-card .kc-stat-number {
    font-size: 1.5rem;
  }
  .kc-stat-card .kc-stat-label {
    font-size: 0.68rem;
  }
  /* Compact athlete table */
  .kc-table thead th,
  .kc-table tbody td {
    padding: 7px 2px;
  }
  /* Abbreviate column headers — full text hidden, short label via ::after */
  .kc-table thead th:nth-child(n+2) {
    font-size: 0;
  }
  .kc-table thead th:nth-child(2)::after { content: "Day"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(3)::after { content: "Spr"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(4)::after { content: "Dis"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(5)::after { content: "Jmp"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(6)::after { content: "Thr"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(7)::after { content: "All"; font-size: 0.68rem; }
  .kc-table thead th:nth-child(8)::after { content: "Ev";  font-size: 0.68rem; }
  /* Shrink medal dots and overall star */
  .kc-badge-dot {
    width: 20px;
    height: 20px;
    font-size: 0.58rem;
  }
  .kc-badge-star {
    width: 20px;
    height: 20px;
    font-size: 0.58rem;
  }
  /* Tighter session tags globally */
  .kc-tag {
    padding: 1px 4px;
    font-size: 0.7rem;
  }
  /* Standards table: tighter padding + abbreviated medal headers */
  .kc-standards-table th,
  .kc-standards-table td {
    padding: 7px 5px;
    font-size: 0.78rem;
  }
  .kc-standards-table th:first-child,
  .kc-standards-table td:first-child { padding-left: 10px; }
  .kc-standards-table .th-gold,
  .kc-standards-table .th-silver,
  .kc-standards-table .th-bronze,
  .kc-standards-table .th-green,
  .kc-standards-table .th-red,
  .kc-standards-table .th-blue,
  .kc-standards-table .th-orange { font-size: 0; }
  .kc-standards-table .th-gold::after   { content: "G";  font-size: 0.68rem; }
  .kc-standards-table .th-silver::after { content: "S";  font-size: 0.68rem; }
  .kc-standards-table .th-bronze::after { content: "B";  font-size: 0.68rem; }
  .kc-standards-table .th-green::after  { content: "Gr"; font-size: 0.68rem; }
  .kc-standards-table .th-red::after    { content: "R";  font-size: 0.68rem; }
  .kc-standards-table .th-blue::after   { content: "Bl"; font-size: 0.68rem; }
  .kc-standards-table .th-orange::after { content: "O";  font-size: 0.68rem; }
  /* Day column: stack tags vertically so column stays narrow */
  .kc-table tbody td:nth-child(2) .kc-tag {
    display: block;
    width: fit-content;
    margin-right: 0;
    margin-bottom: 2px;
  }
  .kc-table tbody td:nth-child(2) .kc-tag:last-child {
    margin-bottom: 0;
  }
  /* Badge panels strip — 4-column grid, compact images */
  .kc-badge-panels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e8e8e8;
    overflow-x: visible;
  }
  .kc-badge-panel {
    background: #fff;
    border-right: none;
    min-width: 0;
    padding: 8px 4px;
  }
  .kc-badge-panel img {
    width: 36px;
    height: 36px;
  }
  .kc-badge-panel-count {
    font-size: 1.1rem;
  }
  /* Statistics — hide category filter pills (All Events / Sprinting etc.) on mobile */
  .kc-cat-tabs { display: none !important; }
  /* KestrelAthleteAdmin — hide day session columns so Save button is reachable */
  table.ka-table th.th-day,
  table.ka-table td.td-day {
    display: none;
  }
}

/* ---- Tablet (768px – 1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Ensure nav is always visible (overrides any JS-applied state) */
  .kc-nav {
    max-height: none !important;
    overflow: visible !important;
  }
  .kc-nav li a {
    padding: 10px 12px;
    font-size: 0.83rem;
  }
  .kc-header-text h1 {
    font-size: 1.45rem;
  }
  .kc-main {
    padding: 22px 20px 60px;
  }
}

/* ---- Desktop (1024px+) ---- */
@media (min-width: 1024px) {
  .kc-nav {
    max-height: none !important;
    overflow: visible !important;
  }
}

