/* Colours: change these to match your club. */
:root {
  /* Tournament Central palette (tournaments.mississaugamajors.net) */
  --bg: #f3f4f7; --surface: #ffffff; --ink: #171c2e; --muted: #5a6177; --line: #d9dce6;
  --accent: #23305e; --accent-ink: #ffffff; --band: #1f2a52; --band-ink: #f1f3fa; --brand-red: #cf312e; --brand-bg: #d5d7df;
  --ok: #1d7340; --ok-bg: #e1f1e6; --warn: #8f5300; --warn-bg: #fbedd2; --bad: #a8271f; --bad-bg: #f9e1de;
  /* names used through this stylesheet */
  --field: var(--accent); --field-tint: #e4e8f4; --warn-tint: var(--warn-bg); --danger: var(--bad); --danger-tint: var(--bad-bg);
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", "Segoe UI", Helvetica, Arial, sans-serif;
  --r: 7px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #0f1220; --surface: #181c2e; --ink: #e9ecf6; --muted: #9aa2bb; --line: #2c3350;
  --accent: #a9b8ee; --accent-ink: #0d1330; --band: #161d3d; --band-ink: #eef1fb; --brand-red: #e0504c;
  --ok: #74d39a; --ok-bg: #16382a; --warn: #f0bd6a; --warn-bg: #3d2f12; --bad: #f29a92; --bad-bg: #431d1a; --field-tint: #232c52; } }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
a:hover { color: var(--brand-red); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.05; margin: 0 0 .4em; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; }
.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
main.wrap { padding-block: 1.5rem 3rem; min-height: 60vh; }

/* Header: banner strip, navy band, uppercase nav (as on Tournament Central) */
.site-head { color: var(--band-ink); }
.brand { background: var(--brand-bg); border-top: 2px solid var(--brand-red); border-bottom: 3px solid var(--brand-red); }
.brand .wrap { padding: 0; }
.brand img { height: 88px; width: auto; max-width: 100%; display: block;
  -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
@media (max-width: 660px) { .brand img { height: auto; width: 100%; -webkit-mask-image: none; mask-image: none; } }
.band { background: var(--band); }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 10px; }
.t-name { display: block; font: 700 28px/1 var(--display); letter-spacing: .01em; color: var(--band-ink); text-decoration: none; }
.t-name:hover { color: var(--band-ink); }
.t-meta { font-size: 14px; opacity: .8; margin-top: 4px; }
.site-head nav { display: flex; gap: 4px; overflow-x: auto; }
.site-head nav a { font: 600 16px var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--band-ink); opacity: .72;
  text-decoration: none; padding: 9px 10px; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-head nav a.on { opacity: 1; border-color: var(--brand-red); }
.site-head nav a:hover { opacity: 1; color: var(--band-ink); }
.role-pill { color: var(--band-ink) !important; border: 1px solid currentColor; background: transparent !important; font-size: 13px; padding: 5px 12px; text-decoration: none; }
.role-pill:hover { color: var(--band-ink); opacity: .85; }

/* Hero */
.hero { padding-block: .5rem 1.25rem; max-width: 46rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0; }
.hero p { font-size: 1rem; color: var(--muted); margin: .3rem 0 0; }

/* Date tile: the scoreboard block used on lists and detail */
.datetile { flex: none; width: 4.2rem; background: var(--band); border-bottom: 3px solid var(--brand-red); color: #fff; border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .35rem 0 .45rem;
  font-family: var(--display); font-weight: 700; line-height: 1; }
.datetile .m { font-size: .95rem; color: #ffb3b0; text-transform: uppercase; letter-spacing: .04em; }
.datetile .d { font-size: 2.1rem; }
.datetile-lg { width: 5.4rem; }
.datetile-lg .d { font-size: 2.9rem; }

/* Public clinic list */
.clinic-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); background: var(--surface); border-radius: 0 0 10px 10px; }
.clinic-row { display: flex; gap: 1.1rem; align-items: center; padding: 1.1rem .5rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; }
.clinic-row:hover { background: var(--field-tint); color: inherit; }
.clinic-row:hover .title { text-decoration: underline; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.title { font-family: var(--display); font-size: 1.55rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.meta { display: flex; flex-wrap: wrap; gap: .1rem 1rem; color: var(--muted); font-size: .95rem; }
.summary { font-size: .97rem; }
@media (max-width: 640px) {
  .clinic-row { flex-wrap: wrap; align-items: flex-start; }
  .clinic-row .pill { margin-left: 5.3rem; }
}

/* Status pills */
.pill { flex: none; display: inline-block; font-size: .85rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; white-space: nowrap; }
.pill-open { background: var(--ok-bg); color: var(--ok); }
.pill-soon { background: var(--warn-tint); color: var(--warn); }
.pill-full { background: var(--danger-tint); color: var(--danger); }
.pill-closed { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* Detail */
.back { margin: 0 0 1rem; font-size: .95rem; }
.back a::before { content: "‹ "; }
.clinic-head { display: flex; gap: 1.25rem; align-items: flex-start; padding-bottom: 1.25rem; border-bottom: 2px solid var(--ink); margin-bottom: 1.5rem; }
.clinic-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 .6rem; max-width: 40rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
.prose { max-width: 42rem; }
.facts { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .4rem 1.1rem; }
.facts > div { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.facts-wide { max-width: 40rem; }

/* Registration */
.regform, .confirm { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.regform form { max-width: 46rem; }
.confirm { background: var(--ok-bg); border: 0; border-left: 6px solid var(--ok); padding: 1.25rem 1.5rem; border-radius: var(--r); }
.confirm-muted { background: var(--surface); border-left-color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Forms */
fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
legend { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--ink); padding: 0; margin-bottom: .5rem; }
label { display: block; font-weight: 600; margin-bottom: .9rem; font-size: .97rem; }
label .hint { display: block; font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; color: inherit;
  padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--field-tint); }
textarea { resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.row > label { flex: 1 1 14rem; }
.row > label.narrow { flex: 0 1 11rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: .35rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.err { display: block; color: var(--danger); font-weight: 600; font-size: .9rem; margin-top: .25rem; }
label:has(.err) input, label:has(.err) textarea { border-color: var(--danger); }

/* Buttons */
.btn { display: inline-block; font: 600 .95rem var(--body); padding: .55rem 1.1rem; border-radius: var(--r); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--band); border-color: var(--band); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .88rem; }

/* Flash messages */
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.flash-err { background: var(--bad-bg); color: var(--bad); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }

.empty { padding: 2.5rem 0; max-width: 34rem; }
.empty p { color: var(--muted); }

/* Admin */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem; margin-bottom: 1.5rem; }
.narrow-panel { max-width: 30rem; margin: 2rem auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.toolbar h1 { margin: 0; }
.toolbar-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem 0; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand-red); }
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.5rem; }
.grid { width: 100%; border-collapse: collapse; font-size: .95rem; }
.grid th { text-align: left; font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .8rem; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.grid td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.is-off td { opacity: .55; }
.actions form, form.inline { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
form.inline input, form.inline select { width: auto; margin: 0; padding: .3rem .5rem; font-size: .9rem; }
.status { font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-published, .status-registered { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.status-draft, .status-waitlist { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.status-cancelled { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.danger-zone { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }

/* Footer */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1.2rem; }
.foot a { color: var(--muted); }

.print-only { display: none; }
@media print {
  .site-head, .toolbar-links, .tabs, .back, .btn { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 11pt; }
  .table-scroll { border: 0; overflow: visible; }
  .grid a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Payment tracking */
.pay-paid { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pay-unpaid { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pay-partial { background: var(--warn-tint); color: var(--warn); }
.pay-waived, .pay-refunded { background: #e6e8eb; color: var(--muted); }
.pay-cell { min-width: 11rem; }
.quickpay { margin-top: .4rem; }
.money { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; margin: 0 0 1.25rem; padding: .9rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.money dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.money dd { margin: 0; font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .92rem; color: var(--muted); margin: -.25rem 0 1rem; }
.filters a { text-decoration: none; }
.filters a[aria-current="page"] { font-weight: 700; color: var(--ink); text-decoration: underline; }
@media print { .quickpay, .filters { display: none !important; } }

/* Registration workflow (same steps as the tournament platform) */
.reg-pending { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.reg-approved { background: var(--field-tint); color: var(--accent); border-color: transparent; }
.reg-paid { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.reg-placed { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.reg-waitlist { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.reg-declined { color: var(--muted); }
.pill-waitlist { background: var(--warn-bg); color: var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin: 0 0 .9rem; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; text-decoration: none; color: var(--muted); font-size: .88rem; line-height: 1.25; }
.tile b { display: block; font-family: var(--display); font-size: 2rem; color: var(--ink); line-height: 1; margin-bottom: .2rem; }
.tile.warn { border-color: var(--line); background: var(--surface); }
.tile.warn b { color: var(--bad); }
.tile:hover { border-color: var(--ink); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.chips a { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; font-weight: 500; background: var(--surface); }
.chips a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rk { color: var(--muted); font-weight: 700; }
.nowrap { white-space: nowrap; }
.small { font-size: .9rem; }
td.actions { min-width: 13rem; }
td.actions form.inline { margin: 0 0 .3rem; }
td.actions { display: table-cell; }
.needs a { display: block; font-size: .9rem; white-space: nowrap; }
.steps { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 1.25rem; }
.steps .hint { margin: 0; }
.inline-label { display: flex; align-items: center; gap: .4rem; margin: 0; }
.inline-label select { width: auto; margin: 0; }
.conf { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.sub-h { font-size: 1.3rem; margin-top: 1.5rem; }
.hist { margin: 0; padding-left: 1.1rem; font-size: .93rem; }
.hist li { margin-bottom: .3rem; }
.maillog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .7rem 1rem; margin-bottom: .5rem; }
.maillog summary { cursor: pointer; }
.maillog pre { white-space: pre-wrap; font: inherit; background: var(--bg); padding: .8rem; border-radius: var(--r); }
.err { color: var(--danger); }
@media print { .noprint, .chips, .tiles, .steps { display: none !important; } }

/* Reports */
.report .rhead { border-bottom: 2px solid var(--ink); margin-bottom: 1rem; padding-bottom: .6rem; }
.report .rhead h2 { margin: 0; }
.report .rhead p { margin: .15rem 0 0; }
.tiles div.tile { cursor: default; }
.grid .num { text-align: right; white-space: nowrap; }
.grid tfoot th { border-top: 2px solid var(--line); padding: .6rem .8rem; color: var(--ink); font-size: .95rem; }
.pay-unpaid { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.check-col { width: 3.5rem; text-align: center; }
.box { display: inline-block; width: 1.1rem; height: 1.1rem; border: 1.5px solid var(--ink); border-radius: 3px; }
@media print {
  .report .tiles { display: grid !important; grid-template-columns: repeat(3, 1fr); }
  .tile { border: 1px solid #999; }
  .grid { font-size: 9.5pt; }
  .grid tr { break-inside: avoid; }
  .tile.warn { background: none; }
}

/* Footer: copyright and version */
.foot-in p { margin: 0; line-height: 1.5; }
.foot .copy { max-width: 40rem; }
.foot .ver { text-align: right; }
@media (max-width: 640px) { .foot .ver { text-align: left; } }
@media print { .foot { display: block !important; border: 0; font-size: 8pt; } .foot .ver a { display: none; } }

/* Site settings: pictures and notes */
.home-pic { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: 10px; margin: 0 0 1.25rem; }
.clinic-pic { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin: 0 0 1.5rem; }
.notes { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-red); border-radius: 10px; padding: .9rem 1.1rem; margin: 0 0 1.25rem; max-width: 52rem; font-size: .95rem; }
.form-note { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: .6rem .9rem; font-weight: 500; max-width: 46rem; }
.pic-field { margin-bottom: 1rem; }
.pic-label { display: block; font-weight: 600; font-size: .97rem; }
.pic-preview { display: block; max-width: 100%; max-height: 180px; border: 1px solid var(--line); border-radius: 8px; margin: .4rem 0 .5rem; background: var(--bg); }
.pic-field input[type=file], label input[type=file] { border: 0; padding: .3rem 0; background: none; }
