* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 248, 251, 0) 320px),
    var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

h1, h2, h3 { text-wrap: balance; letter-spacing: -0.025em; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
i { line-height: 1; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(246, 248, 251, 0.94);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; transition: transform 180ms ease; }
.brand:hover { transform: translateY(-1px); }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.nav a, .link-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-muted);
  font: inherit;
  transition: color 180ms ease, transform 180ms ease;
}
.nav a i, .link-button i { color: var(--color-primary); font-size: 0.9rem; transition: transform 180ms ease; }
.nav a.active, .nav a:hover, .link-button:hover { color: var(--color-text); transform: translateY(-1px); }
.nav a:hover i, .link-button:hover i { transform: scale(1.1); }
.nav-cta {
  padding: 10px 14px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  color: var(--color-text) !important;
  background: rgba(239, 125, 34, 0.08);
}
.nav-cta:hover { background: rgba(239, 125, 34, 0.15); }
.inline-form { margin: 0; }
.link-button { border: 0; background: transparent; cursor: pointer; padding: 0; }

.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); transition: transform 180ms ease, border-color 180ms ease; }
.burger:hover { transform: translateY(-1px); border-color: var(--color-primary); }
.burger span { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--color-text); transition: transform 180ms ease; }

.page { min-height: calc(100vh - 130px); }
.hero, .section, .split-section, .choice-page, .auth-page, .article-detail, .error-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-height: 620px;
  padding: 56px 0;
}

.hero h1, .page-title h1, .choice-page h1, .auth-page h1, .article-detail h1, .error-page h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.08;
}

.hero p, .page-title p { color: var(--color-muted); max-width: 720px; }
.eyebrow { margin: 0 0 8px; color: var(--color-primary); font-weight: 700; text-transform: uppercase; font-size: 0.78rem; }
.hero-logo {
  justify-self: center;
  padding: 34px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.hero-logo:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 22px 48px rgba(22, 22, 22, 0.12); }
.hero-logo img { width: 280px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  gap: 8px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.button.primary { background: var(--color-primary); border-color: var(--color-primary); color: #111; }
.button:disabled { cursor: wait; opacity: 0.72; transform: none; box-shadow: none; }
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(22, 22, 22, 0.10); }
.button:active { transform: scale(0.97); }
.button:hover i { transform: translateX(1px) scale(1.05); }
.button i { transition: transform 180ms ease; }
.button.primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: white; }
.button.secondary { background: transparent; }
.button.secondary:hover { border-color: var(--color-primary); background: rgba(239, 125, 34, 0.08); }
.button.danger { color: white; background: var(--color-danger); border-color: var(--color-danger); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: 0.9rem; }
.button.full { width: 100%; }

.section { padding: 42px 0; }
.section > .back-link { display: inline-flex; margin-bottom: 18px; }
.surface-band { border-top: 1px solid var(--color-border); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading h1, .section-heading h2 { margin: 0; }
.section-heading a { color: var(--color-primary-hover); font-weight: 700; }
.section-heading a i, .back-link i, .downloads a i { margin-right: 6px; transition: transform 180ms ease; }
.section-heading a:hover i { transform: translateX(3px); }
.muted, time { color: var(--color-muted); }

.card-grid { display: grid; gap: 20px; }
.news-grid { grid-template-columns: repeat(3, 1fr); }
.card, .person-card, .dashboard-card, .choice-card, .form-card, .info-panel, .list-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card:hover, .person-card:hover, .dashboard-card:hover, .choice-card:hover, .list-item:hover {
  transform: translateY(-4px);
  border-color: rgba(239, 125, 34, 0.45);
  box-shadow: 0 22px 44px rgba(22, 22, 22, 0.12);
}
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--color-border); }
.card-body { padding: 18px; }
.card-body h2, .card-body h3 { margin: 8px 0; font-size: 1.15rem; }

.people-grid, .dashboard-grid, .choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.person-card { padding: 18px; display: grid; gap: 8px; }
.person-card img { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; border: 1px solid var(--color-border); }
.person-card span { color: var(--color-muted); }
.dashboard-card, .choice-card { padding: 24px; font-weight: 700; min-height: 110px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.dashboard-card > i, .choice-card > i {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(239, 125, 34, 0.12);
  color: var(--color-primary-hover);
  font-size: 1.2rem;
  transition: transform 200ms ease, background 200ms ease;
}
.dashboard-card:hover > i, .choice-card:hover > i {
  transform: scale(1.08) rotate(-4deg);
  background: rgba(239, 125, 34, 0.2);
}
.choice-grid { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; }
.choice-page, .auth-page, .error-page { min-height: 68vh; display: grid; place-content: center; padding: 48px 0; }
.choice-page h1 { text-align: center; }
.choice-card small { color: var(--color-muted); font-weight: 400; }
.split-section { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; padding: 72px 0; }
.info-panel { padding: 24px; }
.info-panel ul { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.info-panel li { display: flex; align-items: center; gap: 10px; }
.info-panel li i { color: var(--color-primary-hover); width: 20px; }

.form-card { width: min(100%, 760px); padding: 24px; display: grid; gap: 16px; }
.form-card-large { width: min(100%, 920px); }
.auth-page.wide { display: block; padding: 42px 0; }
.auth-page.wide .form-card { margin: 0 auto; }
label { display: grid; gap: 7px; font-weight: 600; }
input, textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  background: var(--color-control);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(239, 125, 34, 0.14);
}
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; min-height: 18px; }
.permissions { border: 1px solid var(--color-border); border-radius: var(--radius); display: grid; gap: 8px; padding: 14px; background: rgba(255, 255, 255, 0.58); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.category-chip {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.category-chip:hover { transform: translateY(-1px); border-color: rgba(239, 125, 34, 0.45); }
.category-chip input:checked + span { color: var(--color-primary-hover); font-weight: 800; }

.custom-select { position: relative; }
.custom-select select { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.custom-select-search {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 42px 10px 12px;
  background: white;
  text-align: left;
  font: inherit;
}
.custom-select::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 13px;
  color: var(--color-primary-hover);
}
.custom-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  animation: pop-in 140ms ease;
}
.custom-select-panel[hidden] { display: none; }
.custom-select-list { max-height: 220px; overflow: auto; display: grid; gap: 6px; }
.custom-select-option {
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}
.custom-select-option:hover { background: rgba(239, 125, 34, 0.11); }

.custom-check-list .custom-options { max-height: 340px; overflow: auto; display: grid; gap: 8px; padding-right: 4px; }
.custom-option {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.custom-option:hover { transform: translateY(-1px); border-color: rgba(239, 125, 34, 0.45); background: rgba(239, 125, 34, 0.07); }
.custom-option input { width: 18px; min-height: 18px; }
.custom-option small { display: block; color: var(--color-muted); font-weight: 400; }
.custom-option em { display: block; margin-top: 3px; color: var(--color-primary-hover); font-style: normal; font-size: 0.82rem; font-weight: 700; }
.answer-row { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 10px; }
.answer-row input[type="radio"] { width: 18px; min-height: 18px; }

.toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-bottom: 18px; }
.compact-toolbar { grid-template-columns: minmax(220px, 320px) auto auto; justify-content: start; }
.match-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.match-filter-panel .check { min-height: 46px; }
.match-list-tools { margin: 0 0 18px; }
.match-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.notice.warning, .club-warning { color: #8a4b08; }
.notice.warning { padding: 14px 16px; border: 1px solid rgba(239, 125, 34, .35); border-radius: var(--radius); background: #fff7ef; font-weight: 600; }
.club-warning { display: block; margin-top: 5px; font-weight: 700; }
.club-account-fields { margin-top: 6px; }
.match-report-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; color: #8a4b08; font-size: .86rem; font-weight: 700; }
.match-report-link.resolved { color: var(--color-success); }
.staff-report-form { margin-top: 22px; }
.report-list .list-item { align-items: flex-start; }
.report-item.resolved { box-shadow: none; background: #f7faf8; }
.report-item.resolved > div { opacity: .68; }
.report-resolved-check { min-height: 44px; white-space: nowrap; color: var(--color-success); }
.import-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 320px) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.import-panel span { display: block; color: var(--color-muted); font-size: 0.9rem; }
.file-picker { margin: 0; min-width: 0; }
.file-picker input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.file-picker span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}
.import-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 4px;
}
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.progress-meta strong { color: var(--color-primary-hover); }
.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), #16a085);
  transition: width 420ms ease;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); }
th, td { padding: 13px; text-align: left; border-bottom: 1px solid var(--color-border); }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.badge.ok { background: #e9f6ed; color: var(--color-success); }
.badge.off { background: #f7e8e6; color: var(--color-danger); }

.list-stack { display: grid; gap: 12px; }
.list-group-title {
  margin: 12px 0 0;
  padding-top: 8px;
  color: var(--color-primary-hover);
  font-size: 1rem;
}
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; }
.list-item.compact { padding: 13px; }
.list-item span { display: block; color: var(--color-muted); }
.match-row-main, .referee-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.match-state-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  position: relative;
  display: inline-block;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f1f5f9;
  color: var(--color-muted);
  line-height: 1;
  text-align: center;
}
.match-state-icon i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  margin: 0;
  width: auto;
  height: auto;
  line-height: 1;
  transform: translate(-50%, -50%) !important;
  transition: none;
}
.match-state-icon.complete {
  border-color: rgba(19, 115, 51, 0.22);
  background: #e9f6ed;
  color: var(--color-success);
}
.match-state-icon.pending {
  border-color: rgba(239, 125, 34, 0.28);
  background: rgba(239, 125, 34, 0.1);
  color: var(--color-primary-hover);
}
.referee-filter-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px);
}
.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.58);
}

.article-detail { padding: 42px 0; }
.article-hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); margin: 24px 0; background: var(--color-surface); }
.rich-content { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.observation-detail .page-title { margin: 18px 0 22px; }
.observation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.observation-grid .info-panel p, .observation-columns .info-panel p { margin-bottom: 0; }
.observation-columns { margin-bottom: 16px; }
.observation-file { display: grid; justify-items: start; gap: 14px; margin-top: 20px; }
.observation-file-preview { width: min(100%, 780px); max-height: 620px; object-fit: contain; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); box-shadow: var(--shadow); }
.downloads { margin-top: 24px; display: grid; gap: 10px; }
.downloads a, .back-link { color: var(--color-primary-hover); font-weight: 700; }
.downloads a:hover i, .back-link:hover i { transform: translateX(-3px); }

.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 26px;
  margin: 16px 0 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.profile-hero h1 { margin-bottom: 6px; }
.stats-grid, .detail-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}
.stats-grid .info-panel strong { display: block; font-size: 2rem; line-height: 1; color: var(--color-primary-hover); }
.stats-grid .info-panel span { color: var(--color-muted); }
.detail-columns { grid-template-columns: repeat(2, 1fr); align-items: start; }
.section-inner { margin-top: 28px; }

.video-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  margin: 22px 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: #111;
  box-shadow: var(--shadow);
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-quiz { margin-top: 20px; }
.video-quiz h2 { margin: 0; font-size: 1.25rem; }
.quiz-answer {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.quiz-answer:hover { transform: translateX(3px); border-color: var(--color-primary); }
.quiz-answer.correct { border-color: var(--color-success); background: #e9f6ed; }
.quiz-answer.wrong { border-color: var(--color-danger); background: #f7e8e6; }
.quiz-result {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(239, 125, 34, 0.1);
  animation: pop-in 180ms ease;
}

.availability-panel, .availability-table {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.availability-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 16px 18px;
  background: rgba(239, 125, 34, 0.12);
  color: var(--color-text);
  font-weight: 700;
}
.availability-panel-title span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.availability-week { display: grid; }
.availability-subtitle {
  padding: 16px 28px;
  background: #fff7ef;
  color: var(--color-primary-hover);
  font-weight: 700;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.availability-day-row h2 {
  margin: 0;
  padding: 16px 28px;
  background: #fff3e6;
  color: #121212;
  font-size: 1.08rem;
  font-weight: 800;
  text-transform: capitalize;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
}
.availability-day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 14px 24px;
  background: #fff3e6;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
}
.availability-day-title h2 {
  padding: 0;
  background: transparent;
  border: 0;
}
.availability-day-row h2 span {
  margin-left: 6px;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.availability-slots, .modal-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 28px;
  background: var(--color-bg);
}
.slot-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  font-weight: 500;
}
.slot-check small { color: var(--color-muted); font-weight: 400; }
.slot-check input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--color-primary);
}
.availability-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 28px 22px;
  background: var(--color-bg);
}
.availability-table { margin-top: 26px; }
.availability-table td[colspan] { text-align: center; color: var(--color-muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: 8vh 16px 24px;
  background: rgba(0, 0, 0, 0.52);
}
.modal-backdrop[hidden] { display: none; }
.availability-modal {
  width: min(1000px, 100%);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
  animation: pop-in 160ms ease;
}
.modal-title, .modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(239, 125, 34, 0.12);
  color: var(--color-text);
}
.modal-title button {
  width: 42px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--color-primary-hover);
  cursor: pointer;
  font-size: 1.6rem;
}
.modal-body {
  display: grid;
  gap: 18px;
  padding: 20px 28px 26px;
}
.availability-date-builder {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.availability-date-builder .muted {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}
.availability-selected-dates {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(19, 115, 51, 0.28);
  border-radius: var(--radius);
  background: #e9f6ed;
  color: #0b4f26;
  font-weight: 700;
}
.date-chip button {
  width: 26px;
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(19, 115, 51, 0.12);
  color: #0b4f26;
  cursor: pointer;
}
.availability-range-fallback {
  padding: 12px 14px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: #fbfcfe;
}
.availability-range-fallback summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-primary-hover);
}
.availability-range-fallback .form-grid { margin-top: 12px; }
.availability-slot-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.modal-slots { padding: 10px 0; background: transparent; }
.modal-footer { justify-content: end; }

.availability-staff-page, .availability-calendar-page { width: min(1280px, calc(100% - 32px)); }
.availability-heading { align-items: end; }
.availability-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.availability-filter-actions {
  display: flex;
  gap: 8px;
}
.availability-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.availability-stat {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}
.availability-stat span, .availability-stat small {
  display: block;
  color: var(--color-muted);
  font-size: 0.86rem;
}
.availability-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
  line-height: 1.1;
}
.availability-referee-list {
  display: grid;
  gap: 16px;
}
.availability-referee-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.availability-referee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: rgba(239, 125, 34, 0.10);
}
.availability-referee-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
.availability-referee-header p { margin: 4px 0 0; color: var(--color-muted); }
.availability-referee-columns {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 18px;
  padding: 18px;
}
.availability-referee-columns h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
}
.availability-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.availability-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(239, 125, 34, 0.32);
  border-radius: var(--radius);
  background: #fff7ef;
  font-weight: 700;
}
.availability-mini-table {
  display: grid;
  gap: 8px;
}
.availability-mini-table div {
  display: grid;
  grid-template-columns: 120px 130px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fbfcfe;
}
.availability-mini-table small { color: var(--color-muted); }

.availability-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.availability-calendar-toolbar form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.availability-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}
.availability-calendar-head {
  padding: 12px;
  background: rgba(239, 125, 34, 0.12);
  font-weight: 800;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.availability-calendar-day {
  min-height: 150px;
  padding: 10px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: #fff;
}
.availability-calendar-day.outside {
  background: #f3f6f9;
  color: var(--color-muted);
}
.availability-calendar-day header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 800;
}
.availability-calendar-day header small { color: var(--color-muted); font-weight: 600; }
.calendar-slot {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 7px 8px;
  border-radius: var(--radius);
  font-size: 0.82rem;
}
.calendar-slot.permanent {
  border: 1px solid rgba(19, 115, 51, 0.24);
  background: #e9f6ed;
}
.calendar-slot.temporary {
  border: 1px solid rgba(239, 125, 34, 0.28);
  background: #fff7ef;
}
.calendar-slot span, .calendar-slot small { color: var(--color-muted); }

@media print {
  body { background: white; }
  .no-print, .site-header, .site-footer, .flash { display: none !important; }
  .page { min-height: 0; }
  .section, .availability-staff-page, .availability-calendar-page { width: 100%; padding: 0; }
  .availability-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .availability-referee-card, .availability-calendar, .availability-stat {
    box-shadow: none;
    break-inside: avoid;
  }
  .availability-calendar-day { min-height: 112px; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.flash { width: min(1120px, calc(100% - 32px)); margin: 16px auto 0; padding: 12px 14px; border-radius: var(--radius); font-weight: 600; }
.flash.success { background: #e9f6ed; color: var(--color-success); }
.flash.error { background: #f7e8e6; color: var(--color-danger); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 56px);
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
}

/* File de traitement des candidatures */
.candidature-heading { align-items: end; }
.candidature-heading h1 { margin: 0; }
.candidature-heading .muted { margin: 4px 0 0; }
.result-count { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; background: rgba(239, 125, 34, 0.1); color: var(--color-primary-hover); font-size: 0.86rem; }
.result-count strong { font-variant-numeric: tabular-nums; }
.account-default-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; padding: 14px; border-radius: var(--radius-large); background: rgba(239, 125, 34, 0.09); box-shadow: inset 0 0 0 1px rgba(239, 125, 34, 0.16); }
.account-default-copy { display: flex; align-items: center; gap: 12px; }
.account-default-copy strong, .account-default-copy span { display: block; }
.account-default-copy span { color: var(--color-muted); font-size: 0.86rem; }
.account-default-icon { display: grid !important; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: var(--radius); background: var(--color-surface); color: var(--color-primary-hover) !important; box-shadow: 0 1px 3px rgba(22, 22, 22, 0.08); }
.account-default-panel label { flex: 0 0 210px; }
.account-default-panel select { min-height: 42px; background: var(--color-surface); font-weight: 600; }
.candidature-filters { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 14px; border-radius: var(--radius-large); background: var(--color-surface); box-shadow: var(--shadow); }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field > i { position: absolute; z-index: 1; left: 14px; top: 50%; color: var(--color-muted); transform: translateY(-50%); pointer-events: none; }
.search-field input { padding-left: 40px; }
.toggle-check { position: relative; display: flex; grid-template-columns: none; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; transition: background-color 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.toggle-check:hover { background: rgba(239, 125, 34, 0.08); }
.toggle-check input { width: 20px; min-height: 20px; accent-color: var(--color-primary); }
.candidature-list { display: grid; gap: 16px; }
.candidature-card { overflow: hidden; border-radius: var(--radius-large); background: var(--color-surface); box-shadow: var(--shadow); animation: content-in 240ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.candidature-card:nth-child(2) { animation-delay: 35ms; }
.candidature-card:nth-child(3) { animation-delay: 70ms; }
.candidature-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; }
.candidature-card h2 { margin: 0 0 5px; font-size: 1.12rem; }
.candidature-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--color-muted); font-size: 0.88rem; }
.candidature-meta i { width: 16px; color: var(--color-primary-hover); }
.candidature-meta a:hover { color: var(--color-text); }
.candidature-badges { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.badge.status { background: #f0f3f7; color: #475467; }
.candidature-message { margin: 0 20px 16px; padding: 12px 14px; border-left: 3px solid var(--color-primary); border-radius: 0 var(--radius) var(--radius) 0; background: var(--color-surface-soft); color: #344054; }
.candidature-actions { padding: 16px 20px 18px; background: var(--color-surface-soft); border-top: 1px solid rgba(102, 112, 133, 0.13); }
.candidature-update-form { display: grid; grid-template-columns: 170px minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.candidature-update-form label { font-size: 0.82rem; color: var(--color-muted); }
.candidature-update-form input, .candidature-update-form select { min-height: 42px; background: var(--color-surface); }
.candidature-account-actions { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(102, 112, 133, 0.13); }
.create-account-form { display: flex; align-items: end; gap: 8px; }
.create-account-form input { min-height: 40px; background: var(--color-surface); }
.button.danger.ghost { color: var(--color-danger); background: transparent; border-color: transparent; box-shadow: none; }
.button.danger.ghost:hover { background: #fdf0ef; border-color: rgba(180, 35, 24, 0.16); }
.candidature-empty { display: grid; justify-items: center; gap: 4px; padding: 40px 20px; text-align: center; }
.candidature-empty > i { margin-bottom: 6px; color: var(--color-success); font-size: 1.7rem; }
.candidature-empty span { color: var(--color-muted); }

@keyframes content-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
