/* Accredited coach / referee registers (JWA-style, SW tokens) */
.register-section__intro { max-width: 42rem; margin-bottom: 1.25rem; }

.register-toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
  margin-bottom: 1rem; padding: 1rem 1.25rem;
  background: var(--cream, #f7f4ef); border-radius: var(--radius, 8px);
  border: 1px solid rgba(0,0,0,.06);
}
.register-toolbar--wide .register-toolbar__field { flex: 1 1 10rem; }
.register-toolbar__field { display: flex; flex-direction: column; gap: .35rem; min-width: 10rem; }
.register-toolbar__toggle { display: flex; align-items: center; gap: .5rem; font-size: .9rem; padding-bottom: .35rem; }
.register-toolbar .form-control { width: 100%; padding: .5rem .65rem; border: 2px solid var(--line, #e5e2dc); border-radius: 8px; font: inherit; }
.register-muted { color: var(--muted, #5c626e); }

.coach-register {
  border: 1px solid var(--line, #e5e2dc); border-radius: 12px; overflow: hidden; background: #fff;
}
.coach-register__head {
  display: none;
  grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 1.4fr) minmax(10rem, auto);
  gap: 1rem; padding: .65rem 1.25rem;
  background: var(--ink, #16181d); color: #fff;
  font-family: var(--font-display, inherit); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
}
.coach-register__head--referees {
  grid-template-columns: minmax(0, 1.2fr) minmax(10rem, 1fr) minmax(6rem, auto);
}
@media (min-width: 768px) { .coach-register__head { display: grid; } }

.coach-register__body { list-style: none; margin: 0; padding: 0; }
.coach-register__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem 1rem; padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line, #e5e2dc); align-items: center;
}
.coach-register__row:last-child { border-bottom: none; }
.coach-register__row--expired { background: rgba(120,95,60,.08); }
.coach-register__row--clickable { cursor: pointer; }
.coach-register__row--clickable:hover { background: rgba(0,0,0,.025); }

@media (min-width: 768px) {
  .coach-register:not(.coach-register--coaches) .coach-register__row--referees,
  .coach-register__head--referees + .coach-register__body .coach-register__row--referees {
    grid-template-columns: minmax(0, 1.2fr) minmax(10rem, 1fr) minmax(6rem, auto);
  }
  .coach-register--coaches .coach-register__row {
    grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 1.4fr) minmax(10rem, auto);
  }
}

.coach-register__name { font-weight: 600; font-size: 1.05rem; display: block; }
.coach-register__col--date { font-size: .95rem; color: var(--muted); }

.coach-history-trigger {
  display: inline-flex; align-items: center; max-width: 100%; margin: -.2rem; padding: .2rem;
  border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.coach-history-trigger:hover { background: rgba(0,0,0,.04); }

.coach-accreditation { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; }
.coach-accreditation__badge { width: 2rem; height: auto; object-fit: contain; flex-shrink: 0; }
.coach-accreditation__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.coach-accreditation__level { font-size: .9rem; font-weight: 600; line-height: 1.25; }
.coach-accreditation__dates { display: flex; flex-wrap: wrap; gap: .15rem .75rem; font-size: .72rem; color: var(--muted); }

.ijf-academy { display: inline-flex; align-items: center; gap: .45rem; }
.ijf-academy__logo { height: 2.75rem; width: auto; object-fit: contain; }
.ijf-academy__text { display: flex; flex-direction: column; gap: .1rem; }
.ijf-academy__label { font-size: .75rem; font-weight: 600; }
.ijf-academy__date { font-size: .72rem; color: var(--muted); }

.coach-status {
  display: inline-flex; margin-top: .25rem; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.coach-status--active { background: rgba(34,120,58,.12); color: #1f5c2e; }
.coach-status--expiring { background: rgba(184,118,12,.14); color: #8a5a05; }
.coach-status--expired { background: rgba(160,40,40,.12); color: #8a2222; }
.coach-status--unknown { background: #f0f0f0; color: var(--muted); }

.referee-licence { display: inline-flex; align-items: center; gap: .5rem; }
.referee-licence__badge { width: 2.5rem; height: 2.5rem; object-fit: contain; }
.referee-licence__label { font-weight: 600; font-size: .9rem; }

.coach-register__no-results { padding: 1.25rem; text-align: center; color: var(--muted); margin: 0; }

/* History modal */
body.referee-history-modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(22,24,29,.55);
  display: grid; place-items: center; padding: 1rem;
}
.modal-overlay[hidden] { display: none !important; }
.modal-overlay--open { display: grid !important; }
.modal {
  background: #fff; border-radius: 14px; max-width: 28rem; width: 100%;
  max-height: 85vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.modal__header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 1.15rem; margin: 0; }
.modal__close { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.referee-history-modal__meta { margin: .25rem 0 0; font-size: .85rem; color: var(--muted); }
.modal__body { padding: 1rem 1.25rem 1.25rem; }
.referee-history-list { list-style: none; margin: 0; padding: 0; }
.referee-history-list__item {
  display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--line);
}
.referee-history-list__item:last-child { border-bottom: none; }
.referee-history-list__licence { display: flex; gap: .65rem; align-items: flex-start; }
.referee-history-list__badge { width: 2.25rem; height: auto; object-fit: contain; flex-shrink: 0; }
.referee-history-list__badge--logo { height: 2.5rem; width: auto; }
.referee-history-list__text { display: flex; flex-direction: column; gap: .2rem; }
.referee-history-list__text strong { font-size: .95rem; }
.referee-history-list__date { font-size: .8rem; color: var(--muted); }
.referee-history-empty { color: var(--muted); margin: 0; }
