:root {
  --bg: linear-gradient(140deg, #f3f6ff, #fff4f2);
  --card: #ffffffcc;
  --text: #111827;
  --accent: #111827;
  --muted: #475569;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page { width: min(1050px, 100% - 2rem); margin: 1rem auto; }
.card { padding: 1rem; background: var(--card); border-radius: 12px; margin-bottom: 1rem; box-shadow: 0 8px 18px rgb(15 23 42 / 10%); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stacked-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem; }
.stacked-form label { display: flex; flex-direction: column; gap: 0.35rem; color: #334155; }
.stacked-form input { min-width: 220px; }
.login-toggle { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
input, button, select, textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.2;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
button,
select,
textarea {
  min-height: 44px;
}

select {
  height: 44px;
}
input.field-required,
select.field-required,
textarea.field-required {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgb(220 38 38 / 12%);
  background: #fff7f7;
}
button { background: #111827; color: white; border-color: #111827; cursor: pointer; }
button.active { background: #0f172a; }
button.secondary { background: #475569; border-color: #475569; }
button.danger { background: #b91c1c; border-color: #991b1b; }
button:disabled,
button[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn { padding: 0.35rem 0.5rem; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.match-actions:not(td) { display: inline-flex; gap: 0.4rem; }
td.match-actions {
  white-space: nowrap;
}
td.match-actions > * + * {
  margin-left: 0.4rem;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 40;
}
.modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 1rem;
  box-shadow: 0 18px 38px rgb(15 23 42 / 25%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.modal-head h3 { margin: 0; }
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.modal-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #334155;
}
.modal-grid label.required::after {
  content: 'Pflichtfeld';
  font-size: 0.72rem;
  font-weight: 700;
  color: #b91c1c;
}
.availability-card {
  width: min(250px, 100%);
  padding: 0.6rem;
  border-radius: 8px;
  position: fixed;
  margin: 0;
  z-index: 60;
}
.availability-card .modal-head {
  margin-bottom: 0.45rem;
}
.availability-card .modal-head h3 {
  font-size: 1rem;
}
.availability-card .icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}
.availability-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.availability-option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  font-weight: 600;
}
.availability-can {
  background: #16a34a;
  border-color: #15803d;
  color: #ffffff;
}
.availability-maybe {
  background: rgb(255, 225, 150);
  border-color: rgb(230, 200, 125);
  color: #111827;
}
.availability-no {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}
.availability-option:hover {
  filter: brightness(0.95);
}
.availability-backdrop {
  background: transparent;
  padding: 0;
  z-index: 50;
}
.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.admin-nav {
  background: #f8fafc;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: sticky;
  top: 1rem;
}
.admin-nav button { width: 100%; text-align: left; background: #1f2937; border-color: #1f2937; }
.admin-nav button.active { background: #0f172a; }
.admin-meta { margin: 0 0 0.5rem; color: var(--muted); }
#whoami { display: block; margin-bottom: 0.75rem; word-break: break-word; }
#whoamiRef { display: block; margin-bottom: 0.75rem; word-break: break-word; }
.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.public-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.public-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.public-tabs button {
  background: #1f2937;
  border-color: #1f2937;
}
.public-tabs button.active {
  background: #0f172a;
}
.public-view { display: none; }
.public-view.active { display: block; }
.match-filter { margin-bottom: 1rem; }
.admin-content {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 0.9rem;
  min-height: 260px;
  min-width: 0;
}
.admin-view { display: none; }
.admin-view.active { display: block; }
.admin-view h2 { margin-top: 0; }
.stats-view { display: none; }
.stats-view.active { display: block; }

#result {
  display: none;
}

.muted { color: var(--muted); }
.is-hidden { display: none; }
.mb-07 { margin-bottom: 0.7rem; }
.mb-09 { margin-bottom: 0.9rem; }
.mb-05 { margin-bottom: 0.5rem; }
.mt-05 { margin-top: 0.5rem; }
.mt-06 { margin-top: 0.6rem; }
.mt-07 { margin-top: 0.7rem; }
.mt-08 { margin-top: 0.8rem; }
.mt-09 { margin-top: 0.9rem; }
.table-wrap-spaced { margin-top: 0.9rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.ok {
  background: #dcfce7;
  color: #166534;
}
.status-pill.warning {
  background: #fef3c7;
  color: #92400e;
}
.status-pill.muted {
  background: #e2e8f0;
  color: #334155;
}
.status-pill.danger {
  background: #fee2e2;
  color: #991b1b;
}
.swap-detail-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.swap-offer-list {
  display: grid;
  gap: 0.55rem;
}
.swap-offer-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.swap-card {
  gap: 0.7rem;
}
.maintenance-actions {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}
.maintenance-actions .login-toggle {
  align-items: flex-start;
}
.template-box,
.review-panel {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}
.template-box {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}
.template-box.is-hidden,
.review-panel.is-hidden {
  display: none;
}
.template-box p {
  margin: 0.2rem 0 0;
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.review-stat {
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.review-stat strong {
  display: block;
  font-size: 1.25rem;
}
.club-logo-nav {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 0.35rem;
}
.club-logo-profile {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 0.5rem;
}
.logs-output {
  margin-top: 0.9rem;
  max-height: 32rem;
  overflow: auto;
}
.modal-card-medium {
  width: min(700px, 100%);
}
.modal-card-narrow {
  width: min(480px, 100%);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: flex;
  justify-content: flex-end;
  background: rgb(15 23 42 / 32%);
}
.drawer-backdrop.is-hidden {
  display: none;
}
.detail-drawer {
  width: min(440px, 100%);
  height: 100%;
  overflow: auto;
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  box-shadow: -18px 0 38px rgb(15 23 42 / 20%);
  padding: 1rem;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}
.drawer-head h3 {
  margin: 0.12rem 0 0;
  font-size: 1.35rem;
}
.drawer-eyebrow {
  margin: 0;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.drawer-section {
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.drawer-section h4 {
  margin: 0 0 0.7rem;
  color: #0f172a;
}
.drawer-details {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.55rem 0.8rem;
  margin: 0;
}
.drawer-details dt {
  color: #64748b;
  font-size: 0.85rem;
}
.drawer-details dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}
.drawer-actions {
  display: grid;
  gap: 0.5rem;
}
.drawer-actions button {
  width: 100%;
  text-align: left;
}
.password-rules {
  margin-top: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}
.password-status {
  margin-top: 0.5rem;
  font-weight: 700;
}
.password-status.valid {
  color: #15803d;
}
.password-status.invalid {
  color: #b91c1c;
}
.password-rules strong {
  display: block;
  margin-bottom: 0.35rem;
}
.password-rules ul {
  margin: 0;
  padding-left: 1.1rem;
}
.password-rules li {
  color: #64748b;
  margin: 0.18rem 0;
}
.password-rules li.valid {
  color: #15803d;
}
.password-rules li.invalid {
  color: #b91c1c;
}

.referee-toolbar {
  justify-content: space-between;
  align-items: center;
}

.referee-form-panel {
  margin-top: 0.9rem;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.table-wrap {
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ref-table th,
.ref-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.6rem 0.7rem;
  text-align: left;
}

.ref-table th { background: #f8fafc; font-size: 0.85rem; color: #334155; }
.ref-table tr:nth-child(even) { background: #fbfdff; }
.club-row {
  cursor: pointer;
}
.club-row:focus {
  outline: 3px solid rgb(37 99 235 / 26%);
  outline-offset: -3px;
}
.club-row:hover td,
.club-row:focus td {
  background: #eef6ff;
}
.account-row {
  cursor: pointer;
}
.account-row:hover td,
.account-row:focus td {
  background: #eef6ff;
}
.account-row:focus {
  outline: 3px solid rgb(37 99 235 / 26%);
  outline-offset: -3px;
}
.account-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.account-detail-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem;
}
.account-detail-grid span,
.account-detail-grid strong {
  display: block;
}
.account-detail-grid strong {
  margin-top: 0.2rem;
}
.account-login-table {
  min-width: 0;
}
.account-login-table th {
  width: 55%;
}
.ref-table .hall-group-row td {
  background: #eaf2ff;
  color: #1e3a8a;
  font-weight: 700;
}
.fee-group-row td {
  padding: 0;
}
.fee-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.fee-group-toggle::after {
  content: '▾';
  color: #1e3a8a;
  font-size: 0.95rem;
  transition: transform 0.18s ease;
}
.fee-group-toggle[aria-expanded='false']::after {
  transform: rotate(-90deg);
}
.fee-group-entry.is-hidden {
  display: none;
}
.ref-table .hall-entry-row td:first-child {
  padding-left: 1.6rem;
}
.poll-form,
.poll-card {
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.poll-form {
  display: grid;
  gap: 0.65rem;
}
.poll-modal-form {
  padding: 0;
  border: 0;
  background: transparent;
}
.poll-form h3 {
  margin: 0;
}
.poll-form label {
  display: grid;
  gap: 0.35rem;
  color: #334155;
  font-size: 0.9rem;
}
.poll-form textarea,
.poll-form input,
.poll-form select {
  width: 100%;
}
.poll-modal-toggle {
  align-self: end;
  min-height: 44px;
}
.poll-modal-toggle input {
  width: 18px;
  min-height: 0;
}
.poll-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.poll-toolbar {
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.poll-options-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.poll-options-head h4 {
  margin: 0;
}
.poll-options-table-wrap {
  max-height: 260px;
  overflow: auto;
}
.poll-options-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.poll-options-table {
  min-width: 420px;
}
.poll-options-table th:last-child,
.poll-options-table td:last-child {
  width: 84px;
}
.poll-option-input {
  width: 100%;
}
.poll-list {
  display: grid;
  gap: 0.8rem;
}
.poll-card {
  background: #ffffff;
}
.poll-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}
.poll-card-head h3 {
  margin: 0 0 0.25rem;
}
.poll-card-head p {
  margin: 0;
}
.poll-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin: 0.8rem 0;
}
.poll-meta-grid div {
  min-width: 0;
}
.poll-meta-grid dt {
  color: #64748b;
  font-size: 0.78rem;
}
.poll-meta-grid dd {
  margin: 0.15rem 0 0;
  word-break: break-word;
}
.poll-results {
  display: grid;
  gap: 0.55rem;
}
.poll-result-label {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.9rem;
}
.poll-result-label span {
  min-width: 0;
  word-break: break-word;
}
.poll-result-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.poll-result-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}
.poll-voters {
  margin-top: 0.35rem;
  font-size: 0.86rem;
}
.poll-voters summary {
  cursor: pointer;
  color: #475569;
  font-weight: 700;
}
.poll-voters ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
.poll-voters li {
  margin: 0.2rem 0;
}
.poll-voters p {
  margin: 0.35rem 0 0;
}
.poll-anonymous-note {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
}
.poll-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.poll-summary div {
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.poll-summary strong {
  display: block;
  font-size: 1.15rem;
}
.poll-summary span {
  color: #64748b;
  font-size: 0.78rem;
}
.poll-pending {
  margin-top: 0.7rem;
}
.poll-actions {
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.hall-link,
.hall-link:visited,
.hall-link:hover,
.hall-link:active {
  color: #0f172a;
  text-decoration: underline;
}

.site-footer {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding: 0.25rem 0 1.5rem;
}

.app-footer {
  width: min(1280px, 100% - 2rem);
  margin: 0 auto 1.25rem;
  border-radius: 8px;
  background: linear-gradient(180deg, #111820, #202832);
  color: #d9e2ec;
  box-shadow: 0 18px 46px rgb(23 29 37 / 10%);
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
}

.app-footer p {
  margin: 0;
  font-size: 0.84rem;
}

.app-footer-brandline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.app-footer-brand,
.app-footer-brand:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  text-decoration: none;
}

.app-footer-brand:hover {
  text-decoration: none;
}

.app-footer-logo {
  display: block;
  width: auto;
  height: 24px;
}

.app-footer-brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
}

.app-footer-brand-text .accent {
  color: #12c7ff;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.app-footer a,
.app-footer a:visited {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

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

.app-footer .app-footer-brand:hover {
  text-decoration: none;
}

.site-footer a,
.legal-links-bar a,
.legal-topbar a {
  color: #0f172a;
  font-weight: 600;
}

.legal-links-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: min(100% - 1.5rem, 32rem);
  padding: 0.7rem 0.9rem;
  border: 1px solid rgb(148 163 184 / 35%);
  border-radius: 999px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 14px 32px rgb(15 23 42 / 14%);
  backdrop-filter: blur(12px);
  z-index: 70;
}

.legal-links-bar a {
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.legal-links-bar a[aria-current='page'] {
  background: #0f172a;
  color: #fff;
}

.legal-page {
  width: min(860px, 100% - 2rem);
  padding: 1rem 0 2rem;
}

.legal-topbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.legal-card {
  background: rgba(255, 255, 255, 0.96);
}

.legal-card h1 {
  margin-top: 0.1rem;
  margin-bottom: 1rem;
}

.legal-card h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-card p,
.legal-card li {
  line-height: 1.6;
}

.legal-kicker {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legal-note {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

.legal-list {
  padding-left: 1.25rem;
}

@media (max-width: 640px) {
  .legal-links-bar {
    bottom: 0.75rem;
    width: calc(100% - 1rem);
    padding: 0.75rem;
  }

  .app-footer {
    width: calc(100% - 1rem);
    margin-bottom: 0.75rem;
  }

  .app-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

.referee-page {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1f2933;
  --accent: #f47a20;
  --accent-strong: #e53935;
  --ink: #202832;
  --line: #dfe5eb;
  --muted: #56616f;
  background:
    radial-gradient(circle at 16% 10%, rgb(244 122 32 / 12%), transparent 24rem),
    radial-gradient(circle at 80% 18%, rgb(32 40 50 / 8%), transparent 28rem),
    #f5f5f5;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.referee-page .page {
  width: min(1180px, 100% - 2rem);
  margin: 1.25rem auto 2.5rem;
}

.referee-page h1,
.referee-page h2,
.referee-page h3,
.referee-page p {
  letter-spacing: 0;
}

.referee-page h1 {
  margin: 0;
  max-width: 620px;
  color: #171d25;
  font-size: clamp(2.45rem, 5vw, 4.65rem);
  line-height: 0.98;
  font-weight: 850;
}

.referee-page h2 {
  margin: 0;
  color: #171d25;
  font-size: 1.55rem;
  line-height: 1.18;
}

.referee-page h3 {
  margin: 0;
  color: #1f2933;
  font-size: 1rem;
}

.referee-page input,
.referee-page select,
.referee-page button {
  min-height: 44px;
  border-radius: 8px;
  font-family: inherit;
}

.referee-page input,
.referee-page select {
  background: #fff;
  border-color: var(--line);
}

.referee-page button,
.referee-page .primary-link {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 750;
}

.referee-page button.secondary,
.referee-page .secondary-link {
  background: #fff;
  border: 1px solid #cfd7df;
  color: #1f2933;
  font-weight: 750;
}

.referee-hero {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(223 229 235 / 85%);
  border-radius: 8px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 24px 70px rgb(23 29 37 / 9%);
}

.brand-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 3vw, 2.4rem);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #151b22;
  text-decoration: none;
  font-weight: 850;
}

.brand-ball {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: url("/assets/brand-icon-34.png") center / contain no-repeat;
  box-shadow: none;
}

.brand-links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 2rem);
  font-size: 0.9rem;
}

.brand-links a {
  color: #1f2933;
  text-decoration: none;
  font-weight: 650;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: 2.8rem clamp(1rem, 4vw, 3rem) 4rem;
}

.hero-copy {
  display: grid;
  gap: 1.4rem;
}

.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgb(244 122 32 / 12%);
  color: #e05f00;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-copy h1 {
  text-wrap: balance;
}

.hero-copy h1 span {
  color: var(--accent);
}

.hero-copy h1::selection {
  background: rgb(244 122 32 / 20%);
}

.hero-lede {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
}

.hero-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.hero-ball {
  width: min(360px, 72vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 25%, rgb(255 255 255 / 28%), transparent 19%),
    linear-gradient(30deg, transparent 44%, #202832 45% 52%, transparent 53%),
    linear-gradient(105deg, transparent 44%, #202832 45% 52%, transparent 53%),
    radial-gradient(circle at 48% 50%, #f47a20 0 58%, #202832 59% 74%, transparent 75%);
  box-shadow: 0 26px 42px rgb(32 40 50 / 18%);
}

.whistle-card,
.calendar-card {
  position: absolute;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(207 215 223 / 80%);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgb(32 40 50 / 18%);
}

.whistle-card {
  left: 4%;
  bottom: 18%;
  width: 210px;
  height: 108px;
  transform: rotate(-18deg);
}

.whistle-card::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 22px;
  width: 82px;
  height: 66px;
  border-radius: 42px 24px 24px 42px;
  background: linear-gradient(145deg, #eef2f6, #b8c2cf);
  box-shadow: inset -9px -7px 0 rgb(32 40 50 / 12%);
}

.whistle-card::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 26px;
  width: 105px;
  height: 56px;
  border-radius: 10px 16px 16px 8px;
  background: linear-gradient(145deg, #f3f6fa, #c8d2df);
  clip-path: polygon(0 12%, 100% 0, 88% 100%, 0 86%);
}

.whistle-ring {
  position: absolute;
  right: 65px;
  top: 40px;
  z-index: 2;
  width: 58px;
  height: 15px;
  border-radius: 99px;
  background: #202832;
}

.whistle-mouth {
  position: absolute;
  right: 28px;
  bottom: 20px;
  z-index: 2;
  width: 42px;
  height: 10px;
  border-radius: 99px;
  background: #202832;
}

.calendar-card {
  right: 5%;
  top: 18%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 132px;
  padding: 18px 14px 14px;
}

.calendar-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  border-radius: 8px 8px 0 0;
  background: var(--accent-strong);
}

.calendar-card span,
.calendar-card strong {
  position: relative;
  z-index: 1;
  height: 20px;
  border-radius: 3px;
  background: #d8dee6;
}

.calendar-card strong {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
}

.calendar-card i {
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 48px;
  height: 24px;
  border-right: 8px solid var(--accent-strong);
  border-bottom: 8px solid var(--accent-strong);
  transform: rotate(40deg);
}

.login-dashboard {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.5fr);
  gap: 1.2rem;
  align-items: end;
  padding: 1.5rem clamp(1rem, 3vw, 2.4rem);
  border-top: 1px solid #eef1f4;
  background: #fbfcfd;
}

.login-dashboard .muted {
  margin-bottom: 0;
  line-height: 1.5;
}

.login-row {
  justify-content: flex-end;
  align-items: center;
}

.login-row input,
.login-row select {
  flex: 1 1 160px;
}

.login-club-combobox {
  position: relative;
  width: 100%;
  min-width: 0;
  color-scheme: light;
}

.login-row .login-club-combobox {
  flex: 1 1 160px;
}

.login-club-combobox input {
  width: 100%;
}

.login-club-combobox .login-club-input-with-clear {
  padding-right: 2.45rem;
}

.login-club-combobox .login-club-clear {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  min-height: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: #d9d9d9;
  color: #6b7280;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

.login-club-combobox .login-club-clear:hover,
.login-club-combobox .login-club-clear:focus-visible {
  background: #cfcfcf;
  color: #111827;
}

.login-club-combobox .login-club-clear[hidden] {
  display: none;
}

.login-club-options {
  position: absolute;
  z-index: 90;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 13.5rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 32px rgb(15 23 42 / 18%);
}

.login-club-options[hidden] {
  display: none;
}

.login-club-option {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0.58rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login-club-option:hover,
.login-club-option.active {
  background: #eef2f7;
  color: #0f172a;
}

.feature-band {
  padding: 2.4rem clamp(0.25rem, 2vw, 1rem) 2rem;
  text-align: center;
}

.feature-band .eyebrow {
  margin: 0 auto 0.6rem;
}

.feature-band h2 {
  margin-bottom: 1.35rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article {
  min-height: 150px;
  padding: 1.2rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgb(23 29 37 / 6%);
  text-align: left;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 1rem;
  border: 2px solid rgb(244 122 32 / 72%);
  border-radius: 8px;
  color: #f47a20;
  font-size: 0.76rem;
  font-weight: 900;
}

.feature-grid p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.unified-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.unified-login-home {
  flex: 1 0 auto;
  display: grid;
  align-items: center;
}

.unified-login {
  width: min(440px, 100%);
  margin: 0 auto;
  overflow: visible;
  padding: 0;
  border: 1px solid rgb(223 229 235 / 85%);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 24px 70px rgb(23 29 37 / 10%);
}

.unified-login-brand {
  justify-content: center;
  padding: 1.45rem 1.2rem 0.95rem;
}

.unified-login-brand .brand-mark {
  gap: 0.5rem;
  font-size: 1.02rem;
  line-height: 1;
}

.unified-login-brand .brand-ball {
  width: 34px;
  height: 34px;
  background: url("/assets/brand-icon-34.png") center / 34px 34px no-repeat;
  box-shadow: none;
}

.unified-login-card {
  padding: 0 1.2rem 1.25rem;
}

.unified-login-card .login-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  justify-content: stretch;
}

.unified-login-card input,
.unified-login-card select,
.unified-login-card button {
  width: 100%;
  min-height: 44px;
}

.unified-login-card .login-toggle {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 0.55rem;
  align-items: center;
  justify-self: start;
  min-height: 24px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.unified-login-card .login-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 4px;
}

.unified-login-card #pubLoginMsg {
  margin: 0.75rem 0 0;
  text-align: center;
}

.referee-dashboard {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgb(23 29 37 / 10%);
}

.referee-dashboard.is-hidden {
  display: none;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem;
  background: linear-gradient(180deg, #111820, #202832);
  color: #fff;
}

.dashboard-sidebar .brand-mark {
  color: #fff;
  font-size: 0.78rem;
}

.dashboard-sidebar .brand-ball {
  width: 34px;
  height: 34px;
}

.dashboard-sidebar .public-tabs {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
}

.dashboard-sidebar .public-tabs button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  border-color: transparent;
  color: #d9e2ec;
}

.dashboard-sidebar .public-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.dashboard-logout {
  margin-top: auto;
  width: 100%;
}

.dashboard-main {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.8rem);
  background: #fbfcfd;
}

.dashboard-main .public-header {
  margin-bottom: 1.2rem;
}

.dashboard-main .public-header h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  max-width: none;
  margin: 0.15rem 0 0.25rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.dashboard-main #whoamiRef {
  display: inline;
  margin: 0;
}

.dashboard-card {
  padding: 1rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(23 29 37 / 5%);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-card .row {
  align-items: center;
  margin-bottom: 0.9rem;
}

.ref-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.ref-dashboard-kpi {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  min-height: 92px;
  padding: 0.9rem;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background: #fff;
  color: #202832;
  text-align: left;
  box-shadow: 0 8px 18px rgb(23 29 37 / 5%);
}

.ref-dashboard-kpi:not(.static):hover {
  border-color: var(--accent);
}

.ref-dashboard-kpi.static {
  cursor: default;
}

.ref-dashboard-kpi span {
  color: #556170;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.ref-dashboard-kpi strong {
  font-size: 1.7rem;
  line-height: 1.1;
}

.ref-dashboard-kpi.warning strong {
  color: #b45309;
}

.ref-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 1rem;
}

.ref-dashboard-panel {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.ref-dashboard-panel-wide {
  grid-row: span 2;
}

.ref-dashboard-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.ref-dashboard-panel .table-wrap {
  margin-top: 0.75rem;
  background: #fff;
}

.referee-page .table-wrap {
  border-radius: 8px;
  border-color: #e4e9ee;
  box-shadow: inset 0 1px 0 #fff;
}

.referee-page .ref-table th {
  background: #f6f8fa;
  color: #556170;
  font-size: 0.78rem;
  text-transform: none;
}

.referee-page .ref-table td {
  color: #202832;
}

.referee-page .ref-table {
  min-width: 900px;
}

.referee-page .compact-stack {
  display: grid;
  gap: 0.15rem;
}

.referee-page .compact-stack span {
  color: #556170;
  font-size: 0.9rem;
  line-height: 1.2;
}

.referee-page .match-actions {
  display: flex;
  align-items: center;
  min-width: 8.5rem;
}

.referee-page .match-actions button {
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.public-poll-list {
  display: grid;
  gap: 0.85rem;
}

.public-poll-card {
  padding: 0.9rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fff;
}

.public-poll-card.is-closed {
  background: #f8fafc;
}

.public-poll-card.is-closed .public-poll-option {
  opacity: 0.72;
}

.public-poll-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.public-poll-head h3 {
  margin: 0 0 0.25rem;
}

.public-poll-head p {
  margin: 0;
}

.public-poll-options {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.public-poll-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.public-poll-option input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
}

.public-poll-option span {
  min-width: 0;
  word-break: break-word;
}

.public-poll-actions {
  margin-top: 0.8rem;
}

.club-event-response-grid,
.public-club-event-meta {
  display: grid;
  gap: 0.65rem;
}

.club-event-response-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.85rem;
}

.club-event-response-grid details,
.public-club-event-meta div {
  padding: 0.65rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.club-event-response-grid summary {
  cursor: pointer;
  font-weight: 700;
}

.club-event-response-grid ul {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
}

.public-club-event-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.75rem;
}

.public-club-event-meta dt {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.public-club-event-meta dd {
  margin: 0.2rem 0 0;
  word-break: break-word;
}

.public-club-event-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.public-club-event-response-btn {
  display: grid;
  gap: 0.15rem;
  min-height: 58px;
  padding: 0.6rem 0.7rem;
  background: #fff;
  border: 2px solid #d8e0e8;
  color: #202832;
  line-height: 1.15;
}

.public-club-event-response-btn strong {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}

.public-club-event-response-btn[data-club-event-availability="CAN"].active {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.public-club-event-response-btn[data-club-event-availability="MAYBE"].active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

.public-club-event-response-btn[data-club-event-availability="NO"].active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

@media (max-width: 760px) {
  .club-event-response-grid,
  .public-club-event-meta {
    grid-template-columns: 1fr;
  }

  .public-club-event-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .brand-nav,
  .hero-grid,
  .login-dashboard {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 1.5rem;
  }

  .hero-visual {
    min-height: 300px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .referee-dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
  }

  .dashboard-sidebar .public-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .referee-page .page {
    width: min(100% - 1rem, 1180px);
    margin-top: 0.5rem;
  }

  .brand-nav {
    align-items: flex-start;
  }

  .brand-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.7rem;
  }

  .hero-grid {
    padding-bottom: 2rem;
  }

  .whistle-card {
    left: 0;
    width: 180px;
  }

  .calendar-card {
    right: 0;
  }

  .login-dashboard,
  .dashboard-main {
    padding: 1rem;
  }

  .ref-dashboard-grid,
  .ref-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .ref-dashboard-panel-wide {
    grid-row: auto;
  }

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

  .dashboard-sidebar .public-tabs {
    grid-template-columns: 1fr;
  }
}

.admin-page {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1f2933;
  --accent: #f47a20;
  --accent-strong: #e53935;
  --ink: #202832;
  --line: #dfe5eb;
  --muted: #56616f;
  background:
    radial-gradient(circle at 14% 10%, rgb(244 122 32 / 12%), transparent 24rem),
    radial-gradient(circle at 88% 16%, rgb(32 40 50 / 9%), transparent 30rem),
    #f5f5f5;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.admin-page .page {
  width: min(1280px, 100% - 2rem);
  margin: 1.25rem auto 2.5rem;
}

.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page p {
  letter-spacing: 0;
}

.admin-page h1 {
  margin: 0;
  color: #171d25;
  font-size: clamp(2.3rem, 4.5vw, 4.1rem);
  line-height: 1.02;
  font-weight: 850;
}

.admin-page h2 {
  margin-top: 0;
  color: #171d25;
  font-size: 1.55rem;
  line-height: 1.18;
}

.admin-page h3 {
  color: #202832;
}

.admin-page input,
.admin-page select,
.admin-page textarea,
.admin-page button {
  border-radius: 8px;
  font-family: inherit;
}

.admin-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.admin-page select {
  min-height: 44px;
}

.admin-page select {
  height: 44px;
}

.admin-page input,
.admin-page select,
.admin-page textarea {
  border-color: var(--line);
  background: #fff;
}

.admin-page button {
  min-height: 42px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 750;
}

.admin-page button.secondary {
  background: #fff;
  border-color: #cfd7df;
  color: #1f2933;
}

.admin-page button.danger {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}

.admin-page button.table-link-btn {
  min-height: 0;
  padding: 0.28rem 0.5rem;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 750;
}

.admin-page button.table-link-btn:hover {
  background: rgb(255 121 26 / 10%);
  border-color: rgb(255 121 26 / 18%);
}

.referee-page .login-club-option,
.admin-page .login-club-option {
  min-height: 0;
  padding: 0.58rem 0.65rem;
  border: 0;
  background: transparent;
  color: #111827;
  text-align: left;
  font: inherit;
  font-weight: 700;
}

.referee-page .login-club-option:hover,
.referee-page .login-club-option.active,
.admin-page .login-club-option:hover,
.admin-page .login-club-option.active {
  background: #eef2f7;
  color: #0f172a;
}

.admin-page button:disabled,
.admin-page button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-login {
  overflow: visible;
  padding: 0;
  border: 1px solid rgb(223 229 235 / 85%);
  border-radius: 8px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 24px 70px rgb(23 29 37 / 9%);
}

.admin-page #loginPanel {
  display: none;
}

.admin-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: center;
  padding: 2.6rem clamp(1rem, 4vw, 3rem) 3.2rem;
}

.admin-login-card {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: 0 18px 42px rgb(23 29 37 / 8%);
}

.admin-login-card .login-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  justify-content: stretch;
}

.admin-login-card input,
.admin-login-card select,
.admin-login-card button {
  width: 100%;
}

.admin-login-card .login-toggle {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 0.55rem;
  align-items: center;
  justify-self: start;
  min-height: 24px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.admin-login-card .login-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 4px;
}

.admin-dashboard {
  overflow: hidden;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgb(23 29 37 / 10%);
}

.admin-dashboard.is-hidden {
  display: none;
}

.admin-page .admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.admin-page .admin-nav {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: none;
  min-height: 0;
  overflow: auto;
  padding: 1.2rem;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #111820, #202832);
  color: #fff;
}

.admin-page .admin-nav .brand-mark {
  margin-bottom: 0.75rem;
  color: #fff;
  font-size: 0.78rem;
}

.admin-page .admin-nav .brand-ball {
  width: 34px;
  height: 34px;
}

.admin-page .admin-meta,
.admin-page .admin-nav .muted {
  color: #aeb8c5;
}

.admin-page #whoami {
  margin-bottom: 0.75rem;
  color: #fff;
  font-size: 0.88rem;
}

.admin-page .admin-nav button {
  width: 100%;
  justify-content: flex-start;
  min-height: 39px;
  padding: 0.62rem 0.7rem;
  border-color: transparent;
  background: transparent;
  color: #d9e2ec;
  text-align: left;
}

.admin-page .admin-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-page .admin-nav button.muted {
  color: #6f7b8a;
}

.admin-page #logoutBtn {
  margin-top: 0.75rem;
  background: #fff;
  border-color: #fff;
  color: #202832;
}

.admin-page .admin-content {
  min-width: 0;
  min-height: 0;
  padding: clamp(1rem, 2.6vw, 1.8rem);
  border: 0;
  border-radius: 0;
  background: #fbfcfd;
}

.admin-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.admin-content-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.admin-page .admin-view {
  padding: 1rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(23 29 37 / 5%);
}

.admin-page .admin-view[hidden] {
  display: none;
}

.admin-page .admin-view h2 {
  margin-bottom: 0.45rem;
}

.admin-page .admin-view > .row {
  align-items: center;
  margin-top: 0.8rem;
}

.admin-page .invoice-form-row {
  align-items: flex-end;
}

.admin-page .invoice-form-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #556170;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-page .invoice-form-row input {
  min-width: 150px;
}

.admin-page .table-wrap {
  border-radius: 8px;
  border-color: #e4e9ee;
}

.admin-page .ref-table th {
  background: #f6f8fa;
  color: #556170;
  font-size: 0.78rem;
}

.admin-page .ref-table td {
  color: #202832;
}

.dashboard-admin-head,
.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.dashboard-admin-head {
  margin-bottom: 1rem;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-kpi {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  min-height: 96px;
  padding: 0.95rem;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background: #fff;
  color: #202832;
  text-align: left;
  box-shadow: 0 8px 18px rgb(23 29 37 / 5%);
}

.admin-kpi:hover {
  border-color: var(--accent);
}

.admin-kpi span {
  color: #556170;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.admin-kpi strong {
  font-size: 2rem;
  line-height: 1;
}

.admin-kpi.warning strong {
  color: #b45309;
}

.dashboard-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.dashboard-panel {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid #e4e9ee;
  border-radius: 8px;
  background: #fbfcfd;
}

.dashboard-panel-wide {
  grid-row: auto;
}

.dashboard-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-panel .table-wrap {
  margin-top: 0.75rem;
  background: #fff;
}

.dashboard-panel .ref-table {
  min-width: min(760px, 100%);
}

.admin-toast {
  position: fixed;
  right: 1.25rem;
  top: 1.25rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  min-height: 44px;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.72rem 0.95rem;
  border: 1px solid #d8e0e8;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  color: #202832;
  box-shadow: 0 18px 42px rgb(23 29 37 / 16%);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.success {
  border-left-color: #22c55e;
}

.admin-toast.error {
  border-left-color: #ef3935;
}

.cookie-notice {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgb(15 23 42 / 18%);
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice strong {
  display: block;
  margin-bottom: 0.2rem;
}

.cookie-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-notice a {
  color: #111827;
  font-weight: 700;
}

.cookie-notice button {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .admin-login-grid,
  .admin-page .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-nav {
    min-height: auto;
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-panel-wide {
    grid-column: 1 / -1;
  }

  .admin-page .admin-nav button {
    min-height: 42px;
  }
}

@media (max-width: 640px) {
  .admin-page .page {
    width: min(100% - 1rem, 1280px);
    margin-top: 0.5rem;
  }

  .admin-login-grid,
  .admin-page .admin-content {
    padding: 1rem;
  }

  .admin-content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-dashboard-grid,
  .dashboard-admin-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-admin-head,
  .dashboard-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .poll-date-grid {
    grid-template-columns: 1fr;
  }

  .cookie-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-notice button {
    width: 100%;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
}

.theme-toggle-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: inset -5px -2px 0 rgb(255 255 255 / 75%);
}

.theme-toggle-sidebar {
  width: 100%;
  margin-top: auto;
  background: transparent;
  border-color: rgb(255 255 255 / 20%);
  color: #e5e5e5;
}

.dashboard-sidebar .theme-toggle-sidebar + .dashboard-logout,
.admin-page .theme-toggle-sidebar + #logoutBtn {
  margin-top: 0;
}

.referee-page .theme-toggle,
.admin-page .theme-toggle {
  min-height: 36px;
  border: 1px solid #cfd7df;
  background: #fff;
  color: #1f2933;
  font-weight: 750;
}

.brand-links .theme-toggle {
  color: #1f2933;
}

.dashboard-sidebar .theme-toggle-sidebar,
.admin-page .admin-nav .theme-toggle-sidebar {
  border-color: rgb(255 255 255 / 20%);
  background: transparent;
  color: #e5e5e5;
}

.settings-section {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid #e4e9ee;
}

.settings-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.settings-section h3 {
  margin: 0;
}

.theme-preference-group {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  width: min(100%, 420px);
  padding: 0.25rem;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #f6f8fa;
}

.theme-preference-group label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

.theme-preference-group input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.theme-preference-group label:has(input:checked) {
  border-color: rgb(244 122 32 / 36%);
  background: #ffffff;
  color: #1f2933;
  box-shadow: 0 8px 18px rgb(23 29 37 / 7%);
}

html[data-theme="dark"] .referee-page,
html[data-theme="dark"] .admin-page {
  --bg: #1e1f22;
  --card: #202c31;
  --text: #e5e5e5;
  --accent: #f47a20;
  --accent-strong: #e53935;
  --ink: #e5e5e5;
  --line: #343840;
  --muted: #aeb8c5;
  background:
    radial-gradient(circle at 14% 9%, rgb(244 122 32 / 16%), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgb(229 57 53 / 10%), transparent 28rem),
    linear-gradient(135deg, #090d11 0%, #11171b 44%, #070a0d 100%);
  color: var(--text);
}

html[data-theme="dark"] .referee-page h1,
html[data-theme="dark"] .referee-page h2,
html[data-theme="dark"] .referee-page h3,
html[data-theme="dark"] .admin-page h1,
html[data-theme="dark"] .admin-page h2,
html[data-theme="dark"] .admin-page h3 {
  color: #f3f4f6;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .admin-meta,
html[data-theme="dark"] .hero-lede,
html[data-theme="dark"] .feature-grid p,
html[data-theme="dark"] .ref-dashboard-kpi span,
html[data-theme="dark"] .admin-kpi span,
html[data-theme="dark"] .referee-page .compact-stack span,
html[data-theme="dark"] .public-club-event-meta dt,
html[data-theme="dark"] .poll-meta-grid dt,
html[data-theme="dark"] .poll-summary span {
  color: #aeb8c5;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .referee-hero,
html[data-theme="dark"] .unified-login,
html[data-theme="dark"] .admin-login,
html[data-theme="dark"] .referee-dashboard,
html[data-theme="dark"] .admin-dashboard,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .admin-page .admin-view,
html[data-theme="dark"] .feature-grid article,
html[data-theme="dark"] .admin-login-card,
html[data-theme="dark"] .ref-dashboard-kpi,
html[data-theme="dark"] .admin-kpi,
html[data-theme="dark"] .ref-dashboard-panel,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .public-poll-card,
html[data-theme="dark"] .poll-card,
html[data-theme="dark"] .poll-form,
html[data-theme="dark"] .swap-detail-panel,
html[data-theme="dark"] .swap-offer-row,
html[data-theme="dark"] .maintenance-actions,
html[data-theme="dark"] .template-box,
html[data-theme="dark"] .review-panel,
html[data-theme="dark"] .review-stat,
html[data-theme="dark"] .poll-summary div,
html[data-theme="dark"] .public-poll-option,
html[data-theme="dark"] .club-event-response-grid details,
html[data-theme="dark"] .public-club-event-meta div,
html[data-theme="dark"] .account-detail-grid > div,
html[data-theme="dark"] .password-rules,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .detail-drawer,
html[data-theme="dark"] .cookie-notice,
html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .legal-note {
  border-color: rgb(229 229 229 / 12%);
  background: linear-gradient(180deg, rgb(32 44 49 / 94%), rgb(18 24 29 / 96%));
  color: #e5e5e5;
  box-shadow: 0 22px 70px rgb(0 0 0 / 32%);
}

html[data-theme="dark"] .settings-section {
  border-color: rgb(229 229 229 / 10%);
}

html[data-theme="dark"] .theme-preference-group {
  border-color: rgb(229 229 229 / 14%);
  background: #151a1f;
}

html[data-theme="dark"] .theme-preference-group label {
  color: #c6ced8;
}

html[data-theme="dark"] .theme-preference-group label:has(input:checked) {
  border-color: rgb(244 122 32 / 46%);
  background: #1e1f22;
  color: #f3f4f6;
  box-shadow: 0 8px 18px rgb(0 0 0 / 18%);
}

html[data-theme="dark"] .dashboard-main,
html[data-theme="dark"] .admin-page .admin-content,
html[data-theme="dark"] .login-dashboard,
html[data-theme="dark"] .admin-content,
html[data-theme="dark"] .public-poll-card.is-closed {
  background: #11171b;
}

html[data-theme="dark"] .dashboard-sidebar,
html[data-theme="dark"] .admin-page .admin-nav,
html[data-theme="dark"] .app-footer {
  background: linear-gradient(180deg, #0b0f13, #151c20);
  border-color: rgb(229 229 229 / 10%);
}

html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .brand-links a,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .legal-links-bar a,
html[data-theme="dark"] .legal-topbar a,
html[data-theme="dark"] .hall-link,
html[data-theme="dark"] .hall-link:visited,
html[data-theme="dark"] .hall-link:hover,
html[data-theme="dark"] .hall-link:active {
  color: #f3f4f6;
}

html[data-theme="dark"] .eyebrow {
  background: rgb(244 122 32 / 16%);
  color: #ff9a3d;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .referee-page input,
html[data-theme="dark"] .referee-page select,
html[data-theme="dark"] .admin-page input,
html[data-theme="dark"] .admin-page select,
html[data-theme="dark"] .admin-page textarea {
  border-color: #343840;
  background: #151a1f;
  color: #e5e5e5;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #7d8794;
}

html[data-theme="dark"] input.field-required,
html[data-theme="dark"] select.field-required,
html[data-theme="dark"] textarea.field-required {
  border-color: #e53935;
  background: rgb(229 57 53 / 12%);
  box-shadow: 0 0 0 3px rgb(229 57 53 / 18%);
}

html[data-theme="dark"] .referee-page button.secondary,
html[data-theme="dark"] .referee-page .secondary-link,
html[data-theme="dark"] .admin-page button.secondary,
html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .admin-page #logoutBtn {
  border-color: rgb(229 229 229 / 16%);
  background: #1e1f22;
  color: #e5e5e5;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .brand-links .theme-toggle {
  border-color: rgb(229 229 229 / 16%);
  background: #1e1f22;
  color: #e5e5e5;
}

html[data-theme="dark"] .theme-toggle-icon {
  box-shadow: inset -5px -2px 0 #1e1f22;
}

html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .referee-page .table-wrap,
html[data-theme="dark"] .admin-page .table-wrap,
html[data-theme="dark"] .dashboard-panel .table-wrap,
html[data-theme="dark"] .ref-dashboard-panel .table-wrap {
  border-color: rgb(229 229 229 / 12%);
  background: #12181d;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 4%);
}

html[data-theme="dark"] .ref-table th,
html[data-theme="dark"] .referee-page .ref-table th,
html[data-theme="dark"] .admin-page .ref-table th {
  border-bottom-color: rgb(229 229 229 / 10%);
  background: #1e1f22;
  color: #c6ced8;
}

html[data-theme="dark"] .ref-table td,
html[data-theme="dark"] .referee-page .ref-table td,
html[data-theme="dark"] .admin-page .ref-table td {
  border-bottom-color: rgb(229 229 229 / 8%);
  color: #e5e5e5;
}

html[data-theme="dark"] .ref-table tr:nth-child(even) {
  background: rgb(255 255 255 / 2%);
}

html[data-theme="dark"] .club-row:hover td,
html[data-theme="dark"] .club-row:focus td,
html[data-theme="dark"] .account-row:hover td,
html[data-theme="dark"] .account-row:focus td {
  background: rgb(244 122 32 / 12%);
}

html[data-theme="dark"] .ref-table .hall-group-row td {
  background: rgb(244 122 32 / 10%);
  color: #ffb067;
}

html[data-theme="dark"] .login-club-combobox {
  color-scheme: dark;
}

html[data-theme="dark"] .login-club-combobox .login-club-clear {
  background: #3a3f46;
  color: #cbd5e1;
}

html[data-theme="dark"] .login-club-combobox .login-club-clear:hover,
html[data-theme="dark"] .login-club-combobox .login-club-clear:focus-visible {
  background: #4b5563;
  color: #fff;
}

html[data-theme="dark"] .login-club-options {
  border-color: #343840;
  background: #151a1f;
  box-shadow: 0 18px 32px rgb(0 0 0 / 34%);
}

html[data-theme="dark"] .referee-page .login-club-option,
html[data-theme="dark"] .admin-page .login-club-option,
html[data-theme="dark"] .login-club-option {
  color: #e5e5e5;
}

html[data-theme="dark"] .referee-page .login-club-option:hover,
html[data-theme="dark"] .referee-page .login-club-option.active,
html[data-theme="dark"] .admin-page .login-club-option:hover,
html[data-theme="dark"] .admin-page .login-club-option.active,
html[data-theme="dark"] .login-club-option:hover,
html[data-theme="dark"] .login-club-option.active {
  background: rgb(244 122 32 / 14%);
  color: #fff;
}

html[data-theme="dark"] .whistle-card,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .club-logo-nav,
html[data-theme="dark"] .club-logo-profile {
  border-color: rgb(229 229 229 / 14%);
  background: #e5e5e5;
}

html[data-theme="dark"] .status-pill.ok {
  background: rgb(34 197 94 / 14%);
  color: #72e39a;
}

html[data-theme="dark"] .status-pill.warning {
  background: rgb(244 122 32 / 15%);
  color: #ffb067;
}

html[data-theme="dark"] .status-pill.danger {
  background: rgb(229 57 53 / 16%);
  color: #ff8a85;
}

html[data-theme="dark"] .status-pill.muted {
  background: rgb(229 229 229 / 10%);
  color: #c6ced8;
}

html[data-theme="dark"] .public-club-event-response-btn {
  border-color: rgb(229 229 229 / 14%);
  background: #151a1f;
  color: #e5e5e5;
}

html[data-theme="dark"] .public-club-event-response-btn[data-club-event-availability="CAN"].active {
  background: rgb(34 197 94 / 15%);
  color: #72e39a;
}

html[data-theme="dark"] .public-club-event-response-btn[data-club-event-availability="MAYBE"].active {
  background: rgb(244 122 32 / 18%);
  color: #ffb067;
}

html[data-theme="dark"] .public-club-event-response-btn[data-club-event-availability="NO"].active {
  background: rgb(229 57 53 / 17%);
  color: #ff8a85;
}

html[data-theme="dark"] .poll-result-bar {
  background: #343840;
}

html[data-theme="dark"] .poll-result-bar span {
  background: var(--accent);
}

html[data-theme="dark"] .drawer-head,
html[data-theme="dark"] .drawer-section {
  border-color: rgb(229 229 229 / 10%);
}

html[data-theme="dark"] .drawer-eyebrow,
html[data-theme="dark"] .admin-page button.table-link-btn {
  color: #ff9a3d;
}

html[data-theme="dark"] .modal-backdrop {
  background: rgb(0 0 0 / 62%);
}

html[data-theme="dark"] .availability-backdrop {
  background: transparent;
}

html[data-theme="dark"] .legal-links-bar {
  border-color: rgb(229 229 229 / 14%);
  background: rgb(17 23 27 / 90%);
}

html[data-theme="dark"] .legal-links-bar a[aria-current='page'] {
  background: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .cookie-notice a {
  color: #fff;
}
