@font-face {
  font-family: "Eudoxus Sans";
  src: url("/fonts/eudoxus-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Eudoxus Sans";
  src: url("/fonts/eudoxus-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Eudoxus Sans";
  src: url("/fonts/eudoxus-700.ttf") format("truetype");
  font-weight: 600 700;
  font-display: swap;
}

@font-face {
  font-family: "Eudoxus Sans";
  src: url("/fonts/eudoxus-800.ttf") format("truetype");
  font-weight: 800 900;
  font-display: swap;
}

/* Glass palette: navy #071321, lime #c0ea6c, ink #1c2111 (see glass-backend landing/tournaments). */
:root {
  --navy: #071321;
  --lime: #c0ea6c;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --ink: #1c2111;
  --muted: #62665a;
  --line: #e6e7e3;
  --line-strong: #d2d4cd;
  --brand: #071321;
  --brand-ink: #ffffff;
  --accent: #c0ea6c;
  --accent-ink: #1c2111;
  --focus: #6f9a22;
  --link: #4a7410;
  --danger: #b91c1c;
  --danger-bg: #fdeeee;
  --ok: #15803d;
  --pending-bg: #fff4e6;
  --pending-ink: #c2570c;
  --approved-bg: #eefaf0;
  --approved-ink: #15803d;
  --closed-bg: #eff0ed;
  --closed-ink: #62665a;
  --selected-bg: #071321;
  --selected-ink: #ffffff;
  --check-bg: #c0ea6c;
  --check-ink: #1c2111;
  --shadow: 0 1px 2px rgba(28, 33, 17, 0.05);
  --radius: 14px;
  --modal-bg: #ffffff;
  --modal-line: #d2d4cd;
  --modal-inset: #f3f4f0;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071321;
    --surface: #0d1b2a;
    --surface-2: #112233;
    --ink: #eef1ea;
    --muted: #94a0ad;
    --line: #1d2c3c;
    --line-strong: #2b3c4e;
    --brand: #040c16;
    --focus: #c0ea6c;
    --link: #c0ea6c;
    --danger: #ff8d78;
    --danger-bg: #3a1a14;
    --ok: #86d06b;
    --pending-bg: #3a2810;
    --pending-ink: #f5b867;
    --approved-bg: #14321f;
    --approved-ink: #8fe0a6;
    --closed-bg: #18263a;
    --closed-ink: #94a0ad;
    --selected-bg: #c0ea6c;
    --selected-ink: #1c2111;
    --check-bg: #071321;
    --check-ink: #c0ea6c;
    --shadow: none;
    --modal-bg: #182a3e;
    --modal-line: #2f4560;
    --modal-inset: #11202f;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Eudoxus Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

/* Hero: Glass header language (navy, lime, outlined rotated squares) */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #ffffff;
}

.hero__deco span {
  position: absolute;
  border: 2px solid rgba(192, 234, 108, 0.12);
  border-radius: 28px;
  pointer-events: none;
}

.hero__deco span:first-child {
  top: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  transform: rotate(12deg);
}

.hero__deco span:last-child {
  bottom: -70px;
  left: 38%;
  width: 140px;
  height: 140px;
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  transform: rotate(-12deg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 36px;
}

.hero__logo {
  display: block;
  line-height: 0;
}

.hero__logo img {
  width: 104px;
  height: auto;
}

.hero__tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lime);
  color: #1c2111;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero__eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.hero__title {
  max-width: 14ch;
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero__dates {
  margin: 10px 0 0;
  font-size: clamp(20px, 3.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--lime);
}

.hero__intro {
  max-width: 540px;
  margin: 16px 0 0;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hero__facts li {
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 720px) {
  .hero__inner {
    padding: 24px 16px 72px;
  }

  .hero__top {
    margin-bottom: 52px;
  }

  .hero__logo img {
    width: 122px;
  }
}

/* Layout */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 140px;
}

.stepper {
  display: flex;
  gap: 8px;
  margin: -22px 0 28px;
  padding: 8px;
  list-style: none;
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.stepper__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.stepper__num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 13px;
}

.stepper__item.is-active {
  color: var(--ink);
}

.stepper__item.is-active .stepper__num {
  border-color: var(--selected-bg);
  background: var(--selected-bg);
  color: var(--selected-ink);
}

.stepper__item.is-done .stepper__num {
  border-color: var(--ok);
  color: var(--ok);
}

@media (max-width: 420px) {
  .stepper__item:not(.is-active) .stepper__label {
    display: none;
  }
}

.step__head {
  margin-bottom: 18px;
}

.step__head h2 {
  font-size: clamp(24px, 4vw, 30px);
}

.step__hint {
  margin: 6px 0 0;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend strong {
  color: var(--ink);
}

.legend__title {
  font-weight: 600;
}

.notice {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.notice--error {
  border-style: solid;
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

/* Days & slots */

.days {
  display: grid;
  gap: 16px;
}

.day {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.day__title {
  font-size: 18px;
}

.day__title span {
  font-weight: 500;
  color: var(--muted);
}

.day__count {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ok);
}

.day__count.is-full {
  color: var(--muted);
}

.day__full {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.period {
  margin-top: 14px;
}

.period__label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 72px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.slot:hover {
  border-color: var(--ink);
}

.slot:active {
  transform: scale(0.98);
}

.slot__time {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.slot__meta {
  font-size: 13px;
  color: var(--muted);
}

.slot__check {
  position: absolute;
  top: -8px;
  right: -8px;
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--check-bg);
}

.slot[aria-pressed="true"] {
  background: var(--selected-bg);
  border-color: var(--selected-bg);
  color: var(--selected-ink);
}

.slot[aria-pressed="true"] .slot__meta {
  color: inherit;
  opacity: 0.85;
}

.slot[aria-pressed="true"] .slot__check {
  display: grid;
}

.slot[aria-pressed="true"] .slot__check::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid var(--check-ink);
  border-bottom: 2px solid var(--check-ink);
  transform: rotate(-45deg);
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}

.tag--pending {
  background: var(--pending-bg);
  color: var(--pending-ink);
}

.tag--approved {
  background: var(--approved-bg);
  color: var(--approved-ink);
}

.tag--rejected,
.tag--cancelled {
  background: var(--closed-bg);
  color: var(--closed-ink);
}

/* Cards, form, summary */

.card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 19px;
}

.details {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 860px) {
  .details {
    grid-template-columns: minmax(0, 1fr) 330px;
    grid-template-areas: "form summary";
  }

  .details .form {
    grid-area: form;
  }

  .details .summary {
    grid-area: summary;
    position: sticky;
    top: 16px;
  }
}

.summary__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.summary__per {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

.summary__note {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lines {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.lines li:first-child {
  border-top: 0;
  padding-top: 0;
}

.lines__when {
  display: block;
  font-weight: 600;
}

.lines__type {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.lines__price {
  flex: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-weight: 600;
}

.total strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.form h2 {
  margin-bottom: 18px;
}

.field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-row {
  display: grid;
  gap: 0 14px;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field label,
.field legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}

.field legend .muted {
  font-weight: 400;
  font-size: 14px;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 16px;
}

.field input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(192, 234, 108, 0.45);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field__error {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--danger);
}

.field__error:empty {
  display: none;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 560px) {
  .choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 10px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.15s, background-color 0.15s;
}

.choice__label {
  font-weight: 700;
}

.choice__price {
  font-size: 13px;
  color: var(--muted);
}

.choice:hover .choice__box {
  border-color: var(--ink);
}

.choice input:checked + .choice__box {
  background: var(--selected-bg);
  border-color: var(--selected-bg);
  color: var(--selected-ink);
}

.choice input:checked + .choice__box .choice__price {
  color: inherit;
  opacity: 0.85;
}

.choice input:focus-visible + .choice__box {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.clubs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 560px) {
  .clubs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.club {
  position: relative;
  display: block;
  cursor: pointer;
}

.club input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.club__box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  padding: 10px 12px 10px 40px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  position: relative;
}

.club__box::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.club__name {
  font-weight: 600;
}

.club__area {
  font-size: 13px;
  color: var(--muted);
}

.club input:checked + .club__box {
  border-color: var(--selected-bg);
  box-shadow: inset 0 0 0 1px var(--selected-bg);
}

.club input:checked + .club__box::before {
  border-color: var(--selected-bg);
  background: var(--selected-bg);
}

.club input:checked + .club__box::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 6px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--selected-ink);
  border-bottom: 2px solid var(--selected-ink);
  transform: rotate(45deg);
}

.club input:focus-visible + .club__box {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 15px;
}

.form__actions {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  gap: 10px;
}

.form__actions .btn--primary {
  flex: 1 1 220px;
}

.form__note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.foot a {
  line-height: 0;
}

.foot__logo {
  width: 76px;
  height: auto;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--ghost {
  background: transparent;
  border-color: var(--ink);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--ink);
  color: var(--bg);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sticky selection bar */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.bar__info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.bar__count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.bar__total {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.bar .btn {
  min-width: 140px;
}

.bar .btn:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

/* Done */

.done {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.done__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.done h2 {
  font-size: 24px;
}

.done__lead {
  margin: 8px 0 0;
  color: var(--muted);
}

.done__code {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-size: 14px;
  color: var(--muted);
}

.done__code strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.done .lines,
.done .total {
  text-align: left;
}

.done__facts {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  text-align: left;
  font-size: 15px;
}

.done__facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.done__facts dt {
  color: var(--muted);
}

.done__facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.done__status {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--pending-bg);
  color: var(--pending-ink);
  font-size: 15px;
  text-align: left;
}

.done__tip {
  margin: 18px 0;
  font-size: 14px;
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: #ffffff;
  border: 1px solid rgba(192, 234, 108, 0.25);
  font-size: 15px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
}

.has-bar .toast {
  bottom: calc(100px + env(safe-area-inset-bottom));
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 0.2s ease-out;
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translate(-50%, 8px);
    }
  }
}

/* Admin */

.admin-top {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-top__logo {
  display: block;
  width: 84px;
  height: auto;
  margin-bottom: 10px;
}

.admin-top__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px;
}

.admin-top h1 {
  font-size: 20px;
}

.admin-top p {
  margin: 2px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.admin-top__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-top .btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.admin-top .btn--ghost {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.admin-top .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.admin-main a {
  color: var(--link);
}

.admin-main h2 {
  margin: 32px 0 12px;
  font-size: 19px;
}

.login {
  max-width: 400px;
  margin: 40px auto;
}

.login h2 {
  margin: 0 0 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat__label {
  font-size: 13px;
  color: var(--muted);
}

.stat__value {
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.schedule {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.schedule .day {
  padding: 16px;
}

.srow {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.srow:first-of-type {
  border-top: 0;
}

.srow__time {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.srow__body {
  min-width: 0;
}

.srow__who strong {
  display: block;
}

.srow__label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cands {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.cand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cand__info {
  min-width: 0;
}

.cand__name {
  font-weight: 600;
}

.cand__meta {
  font-size: 12px;
  color: var(--muted);
}

.cand .btn,
.cand .tag {
  flex: none;
}

.srow__who .tag {
  margin-left: 6px;
  vertical-align: 1px;
}

.srow__free {
  color: var(--ok);
  font-weight: 600;
}

.srow.is-past {
  opacity: 0.5;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tr.is-closed td {
  color: var(--muted);
}

.table tr.is-closed td:nth-child(n + 3):not(:last-child) {
  text-decoration: line-through;
}

.table a {
  color: var(--link);
}

.nowrap {
  white-space: nowrap;
}

.small {
  font-size: 12px;
}

.btn--small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn--danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

.btn--ok {
  background: var(--accent);
  color: var(--accent-ink);
}

.actions {
  display: flex;
  gap: 6px;
}

.stat--pending {
  border-color: var(--pending-ink);
  background: var(--pending-bg);
}

.stat--pending .stat__label,
.stat--pending .stat__value {
  color: var(--pending-ink);
}

/* Admin: settings editor */
.settings h2 {
  margin: 28px 0 10px;
}

.settings > h2:first-child {
  margin-top: 4px;
}

.settings .card {
  margin-bottom: 14px;
}

.settings .field {
  margin-bottom: 14px;
}

.settings .field:last-child {
  margin-bottom: 0;
}

.settings textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.settings textarea:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(192, 234, 108, 0.45);
}

.settings .hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.erow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

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

.erow .field {
  margin: 0;
}

/* Centre the small delete button on the 54px inputs it sits next to. */
.erow > .btn--small,
.eday__head > .btn--small {
  margin-bottom: 11px;
}

.erow--prices {
  grid-template-columns: 80px minmax(0, 1fr) 120px auto;
}

.erow--blocks {
  grid-template-columns: 130px 90px minmax(0, 1fr) auto;
}

.erow__when {
  align-self: end;
  padding-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.eday {
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eday__head {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

.eday__head .field {
  margin: 0;
  flex: 0 1 190px;
}

.eday__name {
  flex: 1;
  align-self: end;
  padding-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.settings .field input[type="date"],
.settings .field input[type="time"] {
  min-width: 0;
}

.settings__bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.settings__errors {
  margin: 12px 0 0;
  padding: 12px 14px 12px 32px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  font-size: 14px;
}

.settings__errors[hidden] {
  display: none;
}

@media (max-width: 559px) {
  .erow--prices {
    grid-template-columns: 70px minmax(0, 1fr) auto;
  }

  .erow--prices .field:nth-child(3) {
    grid-column: 1 / 3;
  }

  .erow--blocks {
    grid-template-columns: minmax(0, 1fr) 80px auto;
  }

  .erow--blocks .erow__when {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Admin: confirmation dialog */

.btn--danger-solid {
  background: #b91c1c;
  color: #ffffff;
}

.btn--danger-solid:hover {
  opacity: 0.9;
}

.modal {
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--modal-line);
  border-top: 4px solid var(--lime);
  border-radius: 20px;
  background: var(--modal-bg);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.modal--danger {
  border-top-color: #b91c1c;
}

.modal::backdrop {
  background: rgba(2, 7, 13, 0.78);
}

.modal__title {
  margin: 0 0 16px;
  font-size: 20px;
}

.modal__who {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.modal__who strong {
  font-size: 17px;
}

.modal__code {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.modal__meta {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.modal__lines {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--modal-line);
}

.modal__lines li {
  padding: 10px 0;
  border-bottom: 1px solid var(--modal-line);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.modal__note {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--modal-inset);
  font-size: 14px;
  color: var(--muted);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal__actions .btn {
  min-height: 46px;
}

@media (prefers-reduced-motion: no-preference) {
  .modal[open] {
    animation: modal-in 0.16s ease-out;
  }

  @keyframes modal-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }
}
