/* ==========================================================================
   Dance Registration — design tokens & components
   --------------------------------------------------------------------------
   One token system, consumed by every page (public + admin).

   Two rules when editing this file:

   1. Colours, radii, spacing and shadows come from the tokens in :root.
      Do not introduce a raw hex value in a component rule.

   2. The class names in the "JS CONTRACT" and "PRINT" notes below are
      load-bearing. static/app.js queries them by name, and the print block
      targets them. Renaming one silently breaks behaviour with no error.

   JS CONTRACT (queried by static/app.js — do not rename):
     .slot  .active  .open  #admin-trigger  #admin-panel
     [data-registration-form] [data-start-phase] [data-phase]
     [data-step-indicator] [data-next-phase] [data-prev-phase]
     [data-dob-input] [data-age-input] [data-entry-track] [data-dance-style]
     [data-no-slots] [data-other-radio] [data-other-input]
     [data-min-age] [data-max-age] [data-category-type] [data-genre]
     status-chip + status-* classes are generated server-side.

   JS CONTRACT (queried by static/schedule_sort.js — do not rename):
     #sort-list  .sort-row  .sort-handle  .sort-ghost
     .sort-custom  .sort-custom-row  .sort-mode
     [data-sort-key] [data-sort-mode] [data-sort-custom]

   PRINT (styles.css @media print block — do not rename):
     .app-header .filter-bar .auto-number-bar .button-row
     .contestant-group .page .section-head .sort-panel
   ========================================================================== */

/* ── Web fonts ─────────────────────────────────────────────────────────────
   Self-hosted. Provenance and the re-subsetting recipe live in
   static/fonts/README.md. Both faces are variable fonts, so one file per
   family covers every weight.

   "Noto Sans SC Subset" carries only the 33 CJK glyphs used by the templates
   (9.5 KB). Any CJK glyph outside that set — a contestant's name, say —
   falls through to the next family in --font-sans, which every target OS
   ships. That is intended, not a gap.

   The weight range below is 400 800 because that is what the files actually
   carry (fvar wght 200-800; the Noto subset goes to 900). It must cover every
   weight the stylesheet asks for — the headings use 800. Declare a narrower
   range and the browser silently synthesises the missing weights as faux
   bold, which renders differently in every engine. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Noto Sans SC Subset";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/noto-sans-sc-subset.woff2") format("woff2");
  unicode-range: U+4E2A, U+4EBA, U+4F53, U+516C, U+522B, U+53C2, U+540D,
    U+56E2, U+59D3, U+5B66, U+5BFC, U+5E08, U+5E74, U+5F00, U+62A5, U+6307,
    U+65E5, U+671F, U+6BD4, U+751F, U+7535, U+7C7B, U+7CFB, U+7EC4, U+8001,
    U+8005, U+8054, U+821E, U+8BDD, U+8D5B, U+8E48, U+9662, U+9F84;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-sunken: #f1f4fa;

  /* Primary — every call to action */
  --primary: #1769e0;
  --primary-hover: #0f57c7;
  --primary-light: #e8f1ff;
  --primary-border: #b9d3f7;

  /* Accent — dates, status, highlights. Used sparingly. */
  --gold: #d49a24;
  --gold-light: #fff7e5;
  --gold-border: #f0d9a4;

  /* Text */
  --text: #102a4c;
  --text-2: #5e718a;
  --text-muted: #8190a5;

  /* Lines */
  --border: #d9e2ee;
  --border-strong: #c3cfe0;

  /* Feedback */
  --success: #0f8a68;
  --success-bg: #eaf8f3;
  --success-border: #b6e3d3;
  --warning: #c98508;
  --warning-bg: #fff5dd;
  --warning-border: #f0d9a4;
  --danger: #d64545;
  --danger-bg: #fcecec;
  --danger-border: #f2c4c4;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Elevation — barely-there, per the brief */
  --shadow-card: 0 1px 2px rgba(16, 42, 76, 0.04), 0 8px 24px rgba(16, 42, 76, 0.05);
  --shadow-raised: 0 2px 6px rgba(16, 42, 76, 0.06), 0 18px 42px rgba(16, 42, 76, 0.09);
  --shadow-focus: 0 0 0 3px rgba(23, 105, 224, 0.22);

  /* Type — CJK falls through per-glyph to the subset, then to the OS */
  --font-sans: "Plus Jakarta Sans", "Noto Sans SC Subset", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;

  /* ------------------------------------------------------------------
     Legacy aliases. These names are used throughout the components below
     and by nothing else. They exist so the older rules keep resolving
     while the palette is migrated; new rules should use the real tokens
     above directly.
     ------------------------------------------------------------------ */
  --ink: var(--text);
  --muted: var(--text-2);
  --line: var(--border);
  --panel: var(--surface);
  --blue: var(--primary);
  --blue-dark: var(--primary-hover);
  --green: var(--success);
  --amber: var(--warning);
  --red: var(--danger);
}

/* ── Base ────────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Keyboard escape hatch out of the sticky header. Visually hidden until
   focused — see .skip-link below. */
.skip-link {
  background: var(--primary);
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  left: var(--space-4);
  padding: 10px 16px;
  position: absolute;
  top: -100px;
  transition: top 0.15s ease;
  z-index: 20;
}

.skip-link:focus {
  color: #fff;
  top: var(--space-4);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

h3 {
  font-size: 16px;
  font-weight: 700;
}

.eyebrow {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.eyebrow-primary {
  color: var(--primary);
}

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

.helper-text {
  color: var(--text-2);
  font-size: 13px;
  margin: 0 0 var(--space-3);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.app-header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  min-height: 68px;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--text);
}

nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

nav a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

nav a:hover {
  color: var(--primary);
}

/* ── Admin disclosure panel ──────────────────────────────────────────────── */

.admin-trigger {
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  padding: 7px 16px;
  transition: background 0.15s, border-color 0.15s;
}

.admin-trigger:hover,
.admin-trigger[aria-expanded="true"] {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-hover);
}

.admin-trigger .chevron {
  transition: transform 0.25s ease;
}

.admin-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.admin-panel {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);
  transition: max-height 0.25s ease, padding 0.25s ease;
}

.admin-panel.open {
  max-height: 500px;
  padding: var(--space-4) var(--space-6);
}

.admin-grid {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  max-width: 900px;
}

.admin-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: var(--space-3);
  padding: 11px 15px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.admin-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--text);
}

.admin-icon {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 1;
}

.admin-label {
  flex: 1 1 auto;
}

.admin-logout {
  color: var(--text-2);
}

.admin-logout:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* ── Page shell ──────────────────────────────────────────────────────────── */

.page {
  margin: 0 auto;
  max-width: 1140px;
  padding: var(--space-6) var(--space-5) 64px;
}

.section-head {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.button-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
  overflow: hidden;
  position: relative;
}

/* The ribbon art. Decorative only: aria-hidden in the markup, and
   pointer-events:none so it never eats a click on the CTA beneath it. */
.hero-art {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.hero-inner {
  max-width: 640px;
  padding: 44px var(--space-6) 40px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.hero .eyebrow {
  color: var(--primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.btn-lg {
  font-size: 15px;
  padding: 15px 26px;
}

/* Date / venue / deadline strip. Used in the hero and in the event card. */
.hero-meta,
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-meta li,
.event-meta li {
  align-items: center;
  display: flex;
  gap: var(--space-2);
}

.hero-meta svg,
.event-meta svg {
  color: var(--text-muted);
  flex: 0 0 auto;
}

.meta-label {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-value {
  color: var(--text);
  font-weight: 700;
}

/* ── Event summary card ──────────────────────────────────────────────────── */

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.event-card-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.event-card h2 {
  font-size: 22px;
  margin-bottom: var(--space-1);
}

.event-meta {
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

/* The bank-instructions line sits under the meta strip; give it room so it
   does not collide with the date/venue row. Spacing only — a second hairline
   this close to the meta divider reads as clutter. */
.event-card > .muted {
  margin: var(--space-4) 0 0;
}

/* ── Cards, panels, grid ─────────────────────────────────────────────────── */

.panel,
.card,
.empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.panel {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
}

.card {
  padding: var(--space-5);
}

.card h2 {
  font-size: 19px;
  margin-bottom: var(--space-2);
}

.empty {
  color: var(--text-2);
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.layout.two-col {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}

.two-col {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1fr;
}

.two-col h3 {
  font-size: 15px;
  margin: 0 0 var(--space-2);
}

/* A sub-heading inside a full-width panel. The rules above reach a heading by
   its POSITION (inside a .two-col); the registration review page's payment and
   slip panels are full-width now, so their headings opt in by name instead and
   keep the same 15px/8px they had while they were still inside a two-column
   wrapper. Only that page uses it -- see templates/admin/registration_detail.html. */
.panel-subhead {
  font-size: 15px;
  margin: 0 0 var(--space-2);
}

/* ── Coupon box (public payment page) ────────────────────────────────────── */

.coupon-form {
  border-top: 1px solid var(--border);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

/* Field and button on one line; the field takes the space, so the button keeps
   its natural width instead of stretching. */
.coupon-row {
  align-items: stretch;
  display: flex;
  gap: var(--space-2);
}

.coupon-row input {
  flex: 1 1 auto;
  /* Codes are read off a poster and typed by hand -- spaced so a 0 cannot be read
     as an O. */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.coupon-row .button {
  flex: 0 0 auto;
}

/* ── Payment terms (public, shared partial) ──────────────────────────────── */

/* Deliberately quieter than the panels around it. These are terms the customer
   should be able to read, not a headline competing with the amount they are
   about to pay -- so: small, grey, and last on the page. */
.terms-panel h2 {
  color: var(--text-2);
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}

.terms-panel p {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 var(--space-2);
}

.terms-panel p:last-child {
  margin-bottom: 0;
}

/* ── Definition lists ────────────────────────────────────────────────────── */

.details {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.details div {
  display: flex;
  justify-content: space-between;
}

dt {
  color: var(--text-2);
  font-weight: 700;
}

dd {
  margin: 0;
  text-align: right;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.button {
  align-items: center;
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: var(--space-2);
  justify-content: center;
  line-height: 1.2;
  padding: 13px 22px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-hover);
}

.small-button {
  padding: 8px 14px;
}

/* A form that sits inline among other content, not as its own block.
   Previously undefined — the class was in use but had no rule. */
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.inline-form label {
  margin-bottom: 0;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

label {
  color: var(--text-2);
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

input,
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  min-height: 44px;
  padding: 10px 13px;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

textarea {
  resize: vertical;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.track-fieldset,
.ticket-fieldset {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-4) var(--space-3);
  text-align: left;
}

.track-fieldset legend,
.ticket-fieldset legend {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0 var(--space-2);
}

/* Radio rows: override the global label{display:grid} so the control and
   its text stay on one line, left-aligned. */
.radio-row {
  align-items: center;
  color: var(--text);
  display: flex !important;
  flex-direction: row !important;
  font-size: 15px;
  font-weight: 600;
  gap: var(--space-3);
  grid-template-columns: none !important;
  justify-content: flex-start;
  margin: var(--space-2) 0;
  max-width: 100%;
  width: auto;
}

.radio-row input[type="radio"] {
  accent-color: var(--primary);
  flex: 0 0 auto;
  height: 1.1rem;
  margin: 0;
  max-height: 1.1rem;
  max-width: 1.1rem;
  min-height: 1.1rem !important;
  min-width: 1.1rem;
  width: 1.1rem !important;
}

.ticket-other input[type="number"] {
  max-width: 110px;
  min-height: 38px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.check-label {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: row;
  gap: var(--space-2);
  padding: 10px 13px;
}

.check-label input {
  min-height: auto;
  width: auto;
}

/* ── Stepper ─────────────────────────────────────────────────────────────── */

.stepper {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.step {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex: 1 1 0;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-2) 0;
  position: relative;
}

/* Connector between steps, drawn from the circle to the next step. */
.step:not(:last-child)::after {
  background: var(--border);
  content: "";
  height: 1px;
  left: calc(100% - var(--space-2));
  position: absolute;
  right: var(--space-2);
  top: 50%;
  width: auto;
}

.step span {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  position: relative;
  width: 30px;
  z-index: 1;
}

.step strong {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step.active {
  color: var(--text);
}

.step.active span {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.registration-phase[hidden] {
  display: none;
}

.registration-form {
  display: grid;
  gap: 0;
  max-width: 100%;
}

.registration-form .panel {
  width: 100%;
}

/* ── Slot list (competition selection) ───────────────────────────────────── */

.slot-list {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  max-height: 560px;
  overflow: auto;
  padding-right: var(--space-1);
}

.slot {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  display: flex !important;
  flex-direction: row !important;
  gap: var(--space-3);
  grid-template-columns: none !important;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

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

.slot:has(input:checked) {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.slot input {
  min-height: auto;
  width: auto;
}

.slot input[type="checkbox"] {
  accent-color: var(--primary);
  flex: 0 0 auto;
  height: 1.15rem;
  margin-top: 3px;
  max-height: 1.15rem;
  max-width: 1.15rem;
  min-height: 1.15rem !important;
  min-width: 1.15rem;
  width: 1.15rem !important;
}

.slot > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.slot small {
  color: var(--text-2);
  display: block;
  font-weight: 400;
  margin-top: var(--space-1);
}

.slot[hidden] {
  display: none !important;
}

/* A slot with no seats left: still listed, so a registrant sees it exists, but
   not selectable. The seat count itself is never rendered. */
.slot-full {
  cursor: not-allowed;
  opacity: 0.55;
}

.slot-full-label {
  color: var(--text-2);
}

/* The camera panel on the ticket collection desk. */
.scan-panel {
  margin-top: var(--space-3, 1rem);
  max-width: 28rem;
}

.scan-panel video {
  display: block;
  width: 100%;
  max-height: 55vh;
  background: #000;
  border-radius: 10px;
  object-fit: cover;
}

.scan-status {
  margin: 0.5rem 0;
  color: var(--text-2);
}

.scan-status.scan-error {
  color: #b91c1c;
  font-weight: 600;
}

.scan-panel[hidden] {
  display: none !important;
}

.registration-form .slot-list {
  max-height: none;
  overflow: visible;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

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

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 11px var(--space-2);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--surface-2);
}

.table-scroll {
  margin: 0 -4px;
  overflow-x: auto;
  padding: 0 4px var(--space-1);
  width: 100%;
}

.table-scroll table {
  min-width: 100%;
  width: max-content;
}

/* Config editor column widths (Name, Type, Level, Song titles, etc.) */
.editable-table th,
.editable-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.editable-table .col-name input,
.editable-table input.col-name {
  min-width: 12rem;
  width: 14rem;
}

.editable-table .col-type select,
.editable-table .col-type input,
.editable-table select.col-type,
.editable-table input.col-type {
  min-width: 8rem;
  width: 9rem;
}

.editable-table .col-level input,
.editable-table input.col-level {
  min-width: 9rem;
  width: 11rem;
}

.editable-table .col-song input,
.editable-table input.col-song {
  min-width: 12rem;
  width: 14rem;
}

.editable-table .col-artist input,
.editable-table input.col-artist {
  min-width: 10rem;
  width: 12rem;
}

.editable-table .col-category select,
.editable-table select.col-category {
  min-width: 12rem;
  width: 14rem;
}

.editable-table .col-narrow input,
.editable-table input.col-narrow {
  min-width: 4.5rem;
  width: 5rem;
}

.editable-table .col-check {
  text-align: center;
  width: 4rem;
}

.editable-table th {
  font-size: 12px;
  letter-spacing: 0.02em;
  max-width: 10rem;
  text-transform: none;
  white-space: normal;
}

.editable-row input {
  font-size: 14px;
  min-height: 38px;
  padding: 6px 10px;
}

.editable-row input[type="text"],
.editable-row input:not([type]) {
  min-width: 8rem;
}

.editable-row input[type="number"] {
  min-width: 4.5rem;
  width: 5.5rem;
}

.editable-row input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

/* ── Amounts, status chips and pills ─────────────────────────────────────── */

.amount {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: var(--space-3) var(--space-5);
}

.status-pill {
  background: var(--gold-light);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  white-space: nowrap;
}

.status-chip {
  border-radius: var(--radius-pill);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
}

.status-pending_payment,
.status-slip_uploaded {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-payment_checked,
.status-paid {
  background: var(--success-bg);
  color: var(--success);
}

.status-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-unknown {
  background: var(--surface-sunken);
  color: var(--text-2);
}

/* ── Messages ────────────────────────────────────────────────────────────── */

.messages {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.message {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.message.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.message.error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

/* routes/public.py:360 emits a "warning" category. It had no rule, so the
   flash rendered as unstyled body text. */
.message.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

/* ── Detail pages ────────────────────────────────────────────────────────── */

.detail-panel {
  margin-bottom: var(--space-5);
}

.detail-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.detail-grid div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.detail-grid dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.detail-grid dd {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  text-align: left;
}

/* ── Callouts ────────────────────────────────────────────────────────────── */

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
}

.callout p {
  color: var(--text-2);
  line-height: 1.5;
  margin: var(--space-2) 0 0;
}

.callout-blue {
  background: var(--primary-light);
  border-left-color: var(--primary);
}

.compact-callout {
  margin-bottom: var(--space-5);
  margin-top: 0;
}

.compact-callout a {
  font-weight: 700;
  margin-left: 4px;
}

/* ── Public: payment page ────────────────────────────────────────────────── */

/* The summary card reuses .event-card's frame; only the left rule changes, so
   it reads as "your registration" rather than "the event". */
.summary-card {
  border-left-color: var(--primary);
}

/* The serial is an identifier, not prose — spaced so it can be read aloud or
   transcribed character by character without ambiguity. */
.summary-ref {
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 0.04em;
  margin: 0;
}

/* What to pay, and by when: the two figures this page exists to convey. */
.figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.figure-value {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* An amount that is OWED. .amount is green because it was built for a settled
   total; on a page where nothing has been paid that colour would read as a
   receipt. Gold is the attention treatment the rest of the design uses. */
.amount-due {
  background: var(--gold-light);
  border-color: var(--gold-border);
  color: var(--gold);
}

.callout-warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}

.callout-danger {
  background: var(--danger-bg);
  border-left-color: var(--danger);
}

.callout-success {
  background: var(--success-bg);
  border-left-color: var(--success);
}

/* .callout p sets the secondary text colour; this line is the consequence of
   missing the deadline, so it stays at full contrast. */
.callout p.callout-emphasis {
  color: var(--text);
  font-weight: 700;
}

.slip-warning {
  font-weight: 700;
}

.slip-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.slip-form label {
  font-weight: 700;
}

.slip-form input[type="file"] {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  width: 100%;
}

/* The form is a column, so a child stretches by default. On desktop the CTA
   should size to its label; the mobile full-width override is in the
   responsive block below. */
.button-block {
  align-self: flex-start;
}

.slip-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.slip-list li {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  padding: var(--space-3) 0;
}

/* ── Admin: filter bars, config forms, report furniture ──────────────────── */

.filter-bar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  min-width: 200px;
}

.filter-bar select {
  font-weight: 400;
  min-width: 220px;
  padding: 8px 10px;
}

.filter-actions {
  padding-bottom: 2px;
}

.report-summary {
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.auto-number-bar {
  align-items: end;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.auto-number-bar label {
  margin-bottom: 0;
}

.contestant-group {
  margin-top: var(--space-5);
}

.contestant-group-head {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.contestant-group-head h2 {
  margin-bottom: var(--space-1);
}

.contestant-num-input {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.contestant-table .col-number {
  width: 5.5rem;
}

.config-form {
  border-top: 1px solid var(--border);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
}

.config-form h3 {
  font-size: 16px;
  margin-bottom: var(--space-3);
}

.config-fields {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--space-4);
}

.age-config-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.pricing-config-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.config-fields label {
  font-size: 12px;
  margin-bottom: 0;
}

.config-fields input {
  min-height: 40px;
}

.config-fields select,
.editable-row select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  min-height: 40px;
  padding: 6px 8px;
  width: 100%;
}

.config-fields select[multiple],
.editable-row select[multiple] {
  min-height: 92px;
}

.generator-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  margin-top: var(--space-5);
}

.generator-stack > .panel {
  min-width: 0;
  width: 100%;
}

.generator-stack .panel {
  overflow-x: visible;
}

/* Wide canvas for the template / project config editors */
.page:has(.generator-stack) {
  max-width: 1480px;
}

/* A full-width tinted band separating contestant-list sections. Was an
   inline style="background:#eef2f7" in the template; moved here so the
   colour comes from a token. */
.contestant-band {
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  margin: var(--space-5) 0 var(--space-3);
  padding: 10px 14px;
}

.contestant-band-title {
  font-size: 17px;
  letter-spacing: 0.02em;
}

/* ── Schedule sort panel ─────────────────────────────────────────────────────
   The drag-to-reorder control above the contestant list. The class names the
   page script hooks — #sort-list, .sort-row, .sort-handle, .sort-custom,
   .sort-custom-row, .sort-mode — are load-bearing; see the JS CONTRACT note at
   the top of this file before renaming any of them. */
.sort-list,
.sort-custom {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sort-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.sort-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  user-select: none;
  touch-action: none;
}

.sort-handle:active {
  cursor: grabbing;
}

.sort-row-name {
  min-width: 160px;
  font-weight: 600;
}

.sort-mode {
  margin-left: auto;
}

/* A key's custom order, shown under it as a full-width sub-list. */
.sort-custom {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--border);
}

/* The flex above would otherwise beat the `hidden` attribute's display:none,
   leaving the sub-list on screen in every mode. */
.sort-custom[hidden] {
  display: none;
}

.sort-custom-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sort-ghost {
  opacity: 0.4;
}

.sort-custom-empty {
  padding: 4px 8px;
}

.sort-stale-warning {
  margin: var(--space-3) 0;
}

/* Marks where one genre's block ends and the next begins, in the project
   generator's slot table. Was an inline style="border-top:2px solid #cbd5e1". */
.genre-rule {
  border-top: 2px solid var(--border-strong);
}

.narrow {
  margin: 0 auto;
  max-width: 520px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .two-col,
  .config-fields,
  .age-config-fields,
  .music-config-fields,
  .pricing-config-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .app-header,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-header {
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .page {
    padding: var(--space-5) var(--space-4) 48px;
  }

  .layout.two-col,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }

  .hero h1 {
    font-size: 30px;
  }

  /* Steps stack, and the horizontal connectors would point the wrong way. */
  .stepper {
    flex-direction: column;
    gap: var(--space-1);
  }

  .step:not(:last-child)::after {
    display: none;
  }

  /* Forms are the mobile-first case: the primary CTA spans the screen. */
  .button-block {
    align-self: stretch;
  }

  .figure-row {
    gap: var(--space-4);
  }
}

/* ── Print ───────────────────────────────────────────────────────────────────
   admin/contestant_list.html is the print target: it must come out clean,
   with no nav chrome and no group split across a page break.

   The selector names here are load-bearing — see the header note. */

@media print {
  .app-header,
  .filter-bar,
  .auto-number-bar,
  .button-row,
  .section-head .button-row,
  .sort-panel {
    display: none !important;
  }

  .contestant-group {
    break-inside: avoid;
  }

  .page {
    max-width: none;
    padding: 0;
  }
}

/* ── Tabs (Judges | Results) ─────────────────────────────────────────────── */

.tabs {
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-1);
  margin: var(--space-3) 0 var(--space-5);
}

.tab {
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: -1px;
  padding: 8px 14px;
  text-decoration: none;
}

.tab:hover {
  color: var(--text);
}

.tab.on {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

/* Two pickers side by side on the Results tab. */
.picker-row {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
  .picker-row {
    grid-template-columns: 1fr;
  }
}

/* A folded reference block: the summary carries the heading and a one-line fact. */
.info-fold > summary {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
}

.info-fold > summary::-webkit-details-marker {
  display: none;
}

.info-fold > summary h2 {
  margin: 0;
}

.info-fold > summary::before {
  color: var(--text-2);
  content: "▸";
}

.info-fold[open] > summary::before {
  content: "▾";
}

.info-fold[open] > summary {
  margin-bottom: var(--space-4);
}
