/* =========================================================================
   Gym-Verwaltung – Designsystem
   Idee: die Welt des Studios. Kräftige, schmale Schrift wie auf Gym-Schildern,
   Hantelscheiben-Farben (Rot, Blau, Gelb, Grün) als fröhliches Farbsystem,
   Akzentfarbe pro Studio (--brand). Fonts selbst gehostet (OFL), Icons: Lucide (ISC).
   ========================================================================= */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-ext-400-normal.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: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-ext-600-normal.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: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-ext-700-normal.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: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---- Tokens ------------------------------------------------------------- */
:root {
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bg: #f2f3f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #161a21;
  --muted: #5f6676;
  --border: #e1e4ea;
  --sidebar: #161a22;
  --sidebar-2: #1f242e;
  --sidebar-text: #a9b0bd;

  --brand: #1f5bb8;
  --on-brand: #ffffff;

  --plate-red: #d23c32;
  --plate-blue: #1f5bb8;
  --plate-yellow: #e9a800;
  --plate-green: #24955a;
  --plate-graphite: #3b4252;

  --ok: #1d9a55;
  --warn: #c27803;
  --no: #d23c32;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 20px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 10px 30px rgba(16, 24, 40, 0.12);
  --focus: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116; --surface: #181b22; --surface-2: #1d2129; --text: #e8ebf1; --muted: #9aa2b1;
    --border: #2a2f3a; --sidebar: #0b0d11; --sidebar-2: #151820; --sidebar-text: #9aa2b1;
    --plate-yellow: #f2b705; --ok: #33b872; --warn: #e3a12b; --no: #ef5a4f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1116; --surface: #181b22; --surface-2: #1d2129; --text: #e8ebf1; --muted: #9aa2b1;
  --border: #2a2f3a; --sidebar: #0b0d11; --sidebar-2: #151820; --sidebar-text: #9aa2b1;
  --plate-yellow: #f2b705; --ok: #33b872; --warn: #e3a12b; --no: #ef5a4f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font-body); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
h2 { font: 700 1.5rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; margin: 0; }
h3 { font: 700 1.15rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; margin: 0; }
p { margin: 0 0 0.75rem; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon.flip { transform: scaleX(-1); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- App shell ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--sidebar); color: var(--sidebar-text); overflow-y: auto; }
.brand-mark { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: #fff; text-decoration: none; }
.brand-mark:hover { text-decoration: none; }
.brand-logo { display: flex; align-items: center; gap: 2px; height: 38px; flex: none; }
.brand-logo i { display: block; width: 7px; border-radius: 3px; }
.brand-logo i:nth-child(1) { height: 36px; background: var(--plate-red); }
.brand-logo i:nth-child(2) { height: 28px; background: var(--plate-blue); }
.brand-logo i:nth-child(3) { height: 20px; background: var(--plate-yellow); }
.brand-logo i:nth-child(4) { width: 14px; height: 5px; border-radius: 0 3px 3px 0; background: #c9ced8; }
.brand-word { font: 700 1.35rem/0.95 var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; }
.brand-word small { display: block; font: 600 0.7rem/1.2 var(--font-body); letter-spacing: 0.14em; color: var(--sidebar-text); }
.studio-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sidebar-2); color: #fff; text-decoration: none; }
.studio-chip:hover { text-decoration: none; background: color-mix(in srgb, var(--sidebar-2) 80%, #fff); }
.studio-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent); flex: none; }
.studio-chip strong { display: block; font-weight: 700; line-height: 1.2; }
.studio-chip small { color: var(--sidebar-text); font-size: 0.8rem; }
.nav { display: grid; gap: 4px; }
.nav-label { margin: 10px 12px 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--sidebar-text) 70%, transparent); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-weight: 600; text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 40%, transparent); }
.nav a .icon { width: 1.25em; height: 1.25em; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--sidebar-2); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; color: #fff; }
.me small { display: block; color: var(--sidebar-text); font-size: 0.8rem; }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-actions button, .sidebar-actions a { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 8px; border: 0; border-radius: 8px; background: var(--sidebar-2); color: var(--sidebar-text); font: 600 0.85rem var(--font-body); cursor: pointer; text-decoration: none; }
.sidebar-actions button:hover, .sidebar-actions a:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 32px; }
.menu-toggle { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px; background: var(--surface); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 0.75rem var(--font-mono); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); overflow: hidden; }
.search-results:empty { display: none; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { width: 100%; max-width: 1280px; padding: 4px 32px 56px; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 280px; transform: translateX(-105%); transition: transform 0.25s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lift); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.45); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 4px 16px 40px; }
  .search kbd { display: none; }
}

/* ---- Page header ----------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 6px 0 24px; }
.page-head > div:first-child { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); }
.page-title { margin: 4px 0 0; font: 700 clamp(2rem, 3.4vw, 2.75rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; }
.page-sub { margin: 8px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section { margin-top: 32px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

/* ---- Cards, tiles ---------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 .icon { color: var(--brand); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.grid > .card + .card, .grid-main > .card + .card { margin-top: 0; }
.grid-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile { --tile: var(--plate-blue); position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; color: var(--text); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile::after { content: ""; position: absolute; right: -34px; top: -34px; width: 124px; height: 124px; border-radius: 50%; border: 16px solid color-mix(in srgb, var(--tile) 13%, transparent); }
.tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tile); color: #fff; box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.22); }
.tile-icon .icon { width: 1.3em; height: 1.3em; }
.tile-value { margin-top: 14px; font: 700 2.9rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.tile-label { margin-top: 2px; font-weight: 700; }
.tile-meta { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile-icon { width: 36px; height: 36px; }
  .tile-value { margin-top: 10px; font-size: 2.2rem; }
  .tile-meta { font-size: 0.8rem; }
}
.tile.red { --tile: var(--plate-red); } .tile.blue { --tile: var(--plate-blue); }
.tile.yellow { --tile: var(--plate-yellow); } .tile.green { --tile: var(--plate-green); } .tile.graphite { --tile: var(--plate-graphite); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 0.85rem; }
.trend.up { color: var(--ok); } .trend.down { color: var(--no); }

/* ---- Buttons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font: 700 0.95rem/1.1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, box-shadow 0.15s, transform 0.08s; }
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--brand) 86%, #000); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 32%, transparent); }
.btn:active { transform: translateY(1px); }
.btn-soft { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); }
.btn-danger { background: var(--no); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--no) 86%, #000); box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; }
.btn-lg { padding: 15px 24px; font-size: 1.05rem; }
.btn-link { padding: 0; background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-icon { padding: 9px; }
form.inline { display: inline; margin: 0; }

/* ---- Forms ----------------------------------------------------------------- */
label { display: block; margin-bottom: 6px; font-size: 0.92rem; font-weight: 700; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"])), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--brand); vertical-align: -3px; }
input[type="file"] { width: 100%; padding: 14px; border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font: inherit; }
label.check { display: flex; align-items: center; font-weight: 600; }
.field { margin-bottom: 16px; }
.help { display: block; margin-top: 5px; color: var(--muted); font-size: 0.85rem; }
.error { display: block; margin-top: 5px; color: var(--no); font-size: 0.88rem; font-weight: 700; }
.form-errors { margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--no) 10%, var(--surface)); color: var(--no); font-weight: 700; }
.form-card { max-width: 660px; }
.form-card.wide { max-width: 920px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
fieldset { margin: 0 0 28px; padding: 0; border: 0; }
legend { margin-bottom: 14px; font: 700 1.2rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Tables, lists --------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; }
.table tfoot th { color: var(--text); font-size: 0.9rem; border-top: 1px solid var(--border); border-bottom: 0; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person strong { display: block; color: var(--text); }
.person small { color: var(--muted); }
a.person:hover { text-decoration: none; }
a.person:hover strong { color: var(--brand); }
.list { display: grid; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; min-width: 0; }

/* ---- Pills, avatars, toasts ----------------------------------------------- */
.pill { --pill: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--pill) 14%, transparent); color: var(--pill); font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok, .pill.active { --pill: var(--ok); }
.pill.warn, .pill.paused, .pill.cancelled { --pill: var(--warn); }
.pill.no { --pill: var(--no); }
.pill.prospect, .pill.pending, .pill.brand { --pill: var(--brand); }
.pill.former, .pill.ended, .pill.muted { --pill: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; }
.chip .icon { color: var(--brand); }

.avatar { --size: 40px; --avatar: var(--plate-blue); display: inline-grid; place-items: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%; background: var(--avatar); color: #fff; font: 700 calc(var(--size) * 0.4)/1 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; object-fit: cover; }
.avatar.sm { --size: 32px; } .avatar.lg { --size: 64px; } .avatar.xl { --size: 120px; }
.avatar.a0 { --avatar: var(--plate-blue); } .avatar.a1 { --avatar: var(--plate-red); }
.avatar.a2 { --avatar: var(--plate-green); } .avatar.a3 { --avatar: var(--plate-yellow); color: #1a1a1a; }

.toasts { position: fixed; z-index: 60; top: 16px; right: 16px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-left: 5px solid var(--ok); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lift); font-weight: 600; animation: toast-in 0.3s ease-out, toast-out 0.4s ease-in 6s forwards; }
.toast.error { border-left-color: var(--no); }
.toast .icon { color: var(--ok); margin-top: 2px; }
.toast.error .icon { color: var(--no); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); visibility: hidden; } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice .icon { color: var(--warn); margin-top: 3px; }
.notice.info { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.notice.info .icon { color: var(--brand); }
.notice p:last-child { margin: 0; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; color: var(--muted); text-align: center; }
.empty .icon { width: 2.2em; height: 2.2em; color: color-mix(in srgb, var(--brand) 55%, var(--muted)); }
.empty strong { color: var(--text); font-size: 1.05rem; }

.money-owed { color: var(--no); font-weight: 700; }
.money-credit { color: var(--ok); font-weight: 700; }

/* ---- Filters --------------------------------------------------------------- */
.filters { display: grid; gap: 12px; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; margin-bottom: 16px; }
@media (max-width: 900px) { .filters { grid-template-columns: minmax(0, 1fr); } }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.segmented label { position: relative; margin: 0; padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--brand); color: var(--on-brand); }
.segmented label:has(input:focus-visible) { box-shadow: var(--focus); }
.segmented .count { margin-left: 4px; opacity: 0.7; font-variant-numeric: tabular-nums; }
aside > .card + .card, aside > .card { margin-bottom: 16px; }
aside > .card + .card { margin-top: 0; }

/* ---- Dashboard ------------------------------------------------------------- */
.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 6px 0 24px; }
.hello .page-title span { color: var(--brand); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: color-mix(in srgb, var(--brand) 28%, transparent); }
.chart .bar.now { fill: var(--brand); }
.chart .bar.empty { fill: var(--border); }
.chart text { fill: var(--muted); font: 600 11px var(--font-body); }
.chart .value { fill: var(--text); font: 700 12px var(--font-body); }
.feed .list-item { padding: 9px 0; }
.feed time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: 0.1em; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* ---- Member page ----------------------------------------------------------- */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-bottom: 20px; padding: 24px; }
.hero .page-title { margin-top: 2px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-wrap { position: relative; }
.photo-edit { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); justify-items: start; } }

/* ---- Check-in kiosk -------------------------------------------------------- */
.kiosk { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .kiosk { grid-template-columns: minmax(0, 1fr); } }
.scan { padding: 28px; }
.scan-visual { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 16px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); animation: breathe 2.4s ease-in-out infinite; }
.scan-visual .icon { width: 2.2em; height: 2.2em; }
@keyframes breathe { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--brand) 8%, transparent); } }
.scan input.scan-input { padding: 16px 18px; font: 600 1.6rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.result { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; padding: 26px; border-width: 2px; animation: pop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
.result.granted { border-color: var(--ok); background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 13%, var(--surface)), var(--surface) 65%); }
.result.denied { border-color: var(--no); background: linear-gradient(135deg, color-mix(in srgb, var(--no) 12%, var(--surface)), var(--surface) 65%); animation: pop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1), shake 0.45s 0.35s; }
.result .avatar { box-shadow: 0 0 0 6px var(--surface), 0 0 0 10px color-mix(in srgb, var(--ok) 45%, transparent); }
.result.denied .avatar { box-shadow: 0 0 0 6px var(--surface), 0 0 0 10px color-mix(in srgb, var(--no) 45%, transparent); }
.verdict { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 2.4rem/1 var(--font-display); text-transform: uppercase; }
.result.granted .verdict { color: var(--ok); }
.result.denied .verdict { color: var(--no); }
.welcome { margin: 8px 0 0; font-size: 1.35rem; font-weight: 700; }
.result .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip.celebrate { background: color-mix(in srgb, var(--plate-yellow) 22%, var(--surface)); border-color: color-mix(in srgb, var(--plate-yellow) 50%, transparent); }
.chip.celebrate .icon { color: var(--plate-yellow); }
.chip.attention .icon { color: var(--warn); }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.confetti { pointer-events: none; position: absolute; inset: 0; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.9; animation: fall 2.6s ease-in forwards; }
.confetti i:nth-child(4n) { background: var(--plate-red); } .confetti i:nth-child(4n+1) { background: var(--plate-blue); }
.confetti i:nth-child(4n+2) { background: var(--plate-yellow); } .confetti i:nth-child(4n+3) { background: var(--plate-green); }
@keyframes fall { to { transform: translateY(260px) rotate(540deg); opacity: 0; } }

/* ---- Courses ---------------------------------------------------------------- */
.course-red { --course: var(--plate-red); } .course-blue { --course: var(--plate-blue); }
.course-yellow { --course: var(--plate-yellow); } .course-green { --course: var(--plate-green); }
.course-orange { --course: #d9480f; } .course-violet { --course: #6741c8; }
.course-teal { --course: #0b7f7c; } .course-graphite { --course: var(--plate-graphite); }
.course-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--course); }
.course-badge { display: inline-grid; place-items: center; flex: none; min-width: 54px; height: 38px; padding: 0 8px; border-radius: 10px; background: color-mix(in srgb, var(--course) 16%, var(--surface)); color: color-mix(in srgb, var(--course) 72%, var(--text)); font: 700 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.course-badge .icon { width: 1.25em; height: 1.25em; }

.calendar { padding: 0; overflow: hidden; }
.cal-head, .cal-body { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--border); }
.cal-day-head { display: grid; gap: 4px; justify-items: center; padding: 12px 6px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cal-day-head strong { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); font: 700 1.6rem/1 var(--font-display); letter-spacing: 0; }
.cal-day-head.today { color: var(--brand); }
.cal-day-head.today strong { background: var(--brand); color: var(--on-brand); }
.cal-body { position: relative; }
.cal-hour { position: relative; height: var(--px-hour); }
.cal-hour span { position: absolute; top: 4px; right: 8px; color: var(--muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--px-hour) - 1px), var(--border) calc(var(--px-hour) - 1px) var(--px-hour)); }
.cal-col.today { background-color: color-mix(in srgb, var(--brand) 5%, transparent); }
.cal-event { position: absolute; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 6px 8px; border-left: 4px solid var(--course); border-radius: 10px; background: color-mix(in srgb, var(--course) 15%, var(--surface)); color: var(--text); font-size: 0.8rem; line-height: 1.2; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.cal-event:hover { z-index: 2; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.ev-title { display: flex; flex: none; gap: 5px; align-items: baseline; overflow: hidden; white-space: nowrap; }
.cal-event.compact { padding-top: 4px; padding-bottom: 4px; }
.cal-event.compact .ev-meta { display: none; }
.ev-title strong { overflow: hidden; font-size: 0.9rem; text-overflow: ellipsis; }
.ev-time { color: color-mix(in srgb, var(--course) 75%, var(--text)); font-weight: 700; font-variant-numeric: tabular-nums; }
.ev-meta { color: var(--muted); white-space: nowrap; }
.ev-fill { flex: none; height: 4px; margin-top: auto; overflow: hidden; border-radius: 4px; background: color-mix(in srgb, var(--course) 20%, transparent); }
.ev-fill i { display: block; max-width: 100%; height: 100%; border-radius: 4px; background: var(--course); }
.cal-event.cancelled, .agenda-item.cancelled { opacity: 0.55; text-decoration: line-through; }
.agenda { display: none; }
@media (max-width: 900px) {
  .calendar { display: none; }
  .agenda { display: grid; gap: 20px; }
}
.agenda-day h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agenda-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--border); border-left: 5px solid var(--course); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; }
.agenda-item:hover { text-decoration: none; box-shadow: var(--shadow); }
.agenda-item small { display: block; color: var(--muted); }

.session-hero { border-top: 6px solid var(--course); }
.session-date { display: grid; place-items: center; align-content: center; width: 96px; height: 106px; border-radius: 16px; background: var(--course); color: #fff; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.session-date strong { font: 700 2.9rem/1 var(--font-display); letter-spacing: 0; }
.capacity-ring { --fill: 0; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: conic-gradient(var(--course) calc(var(--fill) * 1%), color-mix(in srgb, var(--course) 15%, var(--surface)) 0); }
.capacity-ring > div { display: grid; place-items: center; align-content: center; width: 88px; height: 88px; border-radius: 50%; background: var(--surface); }
.capacity-ring strong { font: 700 2.1rem/1 var(--font-display); }
.capacity-ring span { color: var(--muted); font-size: 0.75rem; }

/* ---- Login ------------------------------------------------------------------ */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; background: var(--sidebar); color: #fff; }
.auth-art .claim { position: relative; z-index: 1; font: 700 clamp(2.6rem, 5vw, 4.4rem)/0.95 var(--font-display); text-transform: uppercase; }
.auth-art .claim span { color: var(--plate-yellow); }
.auth-art p { position: relative; z-index: 1; max-width: 32ch; color: var(--sidebar-text); font-size: 1.1rem; }
.auth-art .ring { position: absolute; border-radius: 50%; border-style: solid; opacity: 0.9; }
.auth-art .ring.r1 { width: 420px; height: 420px; right: -120px; bottom: -120px; border-width: 56px; border-color: var(--plate-red); }
.auth-art .ring.r2 { width: 300px; height: 300px; right: 140px; bottom: -150px; border-width: 44px; border-color: var(--plate-blue); }
.auth-art .ring.r3 { width: 190px; height: 190px; right: -40px; bottom: 230px; border-width: 30px; border-color: var(--plate-yellow); }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 32px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 220px; padding: 28px 20px; }
  .auth-art .ring.r1 { width: 260px; height: 260px; border-width: 36px; }
  .auth-art .ring.r2, .auth-art .ring.r3 { display: none; }
}

/* ---- Colour swatches (settings) ------------------------------------------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 14px 8px 8px; border: 2px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; }
.swatch::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.25); }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked) { border-color: var(--swatch); background: color-mix(in srgb, var(--swatch) 10%, var(--surface)); }
.swatch:has(input:focus-visible) { box-shadow: var(--focus); }
.swatch-blue { --swatch: #1f5bb8; } .swatch-red { --swatch: #c8332b; } .swatch-green { --swatch: #1d8a4f; }
.swatch-orange { --swatch: #d9480f; } .swatch-violet { --swatch: #6741c8; } .swatch-teal { --swatch: #0b7f7c; }
.swatch-graphite { --swatch: #343b48; } .swatch-yellow { --swatch: #e9a800; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
