/* Zoning Gym – Designsystem. Basis: Zoning-Markentokens (Rot/Anthrazit/warmes Grau, Hanken Grotesk, DM Mono). */
@font-face { font-family: "Hanken Grotesk"; src: url("assets/fonts/hanken-grotesk-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("assets/fonts/dm-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #f3f1ee; --panel: #ffffff; --recessed: #ebe8e4; --sunken: #e3dfda; --hover: #f6f4f1;
  --text: #0c0c0e; --body: #232327; --muted: #5d5f65; --faint: #6e7076;
  --border: #dcd8d3; --border-strong: #c3bfba;
  --accent: #ff2430; --accent-text: #c90d18; --accent-soft: #ffe6e7; --on-accent: #0c0c0e;
  --primary: #17171a; --on-primary: #ffffff; --primary-hover: #2c2c31;
  --focus: #c90d18;
  --ok: #19623d; --ok-soft: #e2f3e8; --warn: #765100; --warn-soft: #fbefd2; --err: #a30d18; --err-soft: #fde3e4;
  --info: #175b92; --info-soft: #e1eefa; --violet: #5b3ea8; --violet-soft: #ece6fb; --slate: #44505c; --slate-soft: #e6eaee;
  --amber: #8a5a00; --amber-soft: #fcefd0; --blue: #175b92; --blue-soft: #e1eefa; --green: #19623d; --green-soft: #e2f3e8;
  --red: #b3121c; --red-soft: #ffe6e7;
  --side-bg: #121214; --side-text: #d9d8d5; --side-muted: #96979c; --side-active: rgba(255,255,255,.09);
  --shadow-sm: 0 1px 2px rgba(20,16,12,.06), 0 1px 1px rgba(20,16,12,.04);
  --shadow: 0 2px 6px rgba(20,16,12,.06), 0 8px 24px rgba(20,16,12,.07);
  --shadow-lg: 0 12px 48px rgba(12,12,14,.22);
  --r-sm: 6px; --r: 8px; --r-md: 11px; --r-lg: 15px; --r-xl: 20px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side-w: 244px; --top-h: 64px; --bottom-h: 68px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0e; --panel: #19191c; --recessed: #222226; --sunken: #2a2a2f; --hover: #202024;
  --text: #f4f4f2; --body: #e9e8e5; --muted: #b9bbc0; --faint: #a3a5ab;
  --border: #34343a; --border-strong: #4f4f55;
  --accent: #ff2430; --accent-text: #ff7179; --accent-soft: #3a1416; --on-accent: #0c0c0e;
  --primary: #f4f4f2; --on-primary: #0c0c0e; --primary-hover: #ffffff;
  --focus: #ff7179;
  --ok: #85d6a6; --ok-soft: #15301f; --warn: #f4cb70; --warn-soft: #362a0c; --err: #ff9298; --err-soft: #3d1518;
  --info: #8ecaff; --info-soft: #132a3e; --violet: #c4b2ff; --violet-soft: #2a2340; --slate: #c2ccd6; --slate-soft: #262c33;
  --amber: #f4cb70; --amber-soft: #362a0c; --blue: #8ecaff; --blue-soft: #132a3e; --green: #85d6a6; --green-soft: #15301f;
  --red: #ff8f96; --red-soft: #3d1518;
  --side-bg: #08080a; --side-active: rgba(255,255,255,.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 10px rgba(0,0,0,.35); --shadow-lg: 0 16px 56px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--body); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
h1, h2, h3, h4 { color: var(--text); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 760; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--r); }
.skip-link:focus { top: 12px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 26px; height: 26px; }

/* ---------- Rahmen ---------- */
.shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; z-index: 30; border-right: 1px solid rgba(255,255,255,.04); }
.brand { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 20px; color: #fff; text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 17px; width: auto; display: block; }
.brand .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; padding: 3px 7px 2px; border-radius: 5px; background: var(--accent); color: #0c0c0e; font-weight: 600; }
.gym-switch { margin: 4px 12px 8px; padding: 10px 12px; border-radius: var(--r); background: rgba(255,255,255,.05); display: flex; gap: 10px; align-items: center; }
.gym-switch .dot { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #ff2430, #ff6a3d); display: grid; place-items: center; color: #0c0c0e; font-weight: 800; font-size: 14px; flex: none; }
.gym-switch b { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.gym-switch span { color: var(--side-muted); font-size: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; scrollbar-width: thin; }
.nav-group { margin-top: 14px; }
.nav-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 0 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r); color: var(--side-text); text-decoration: none;
  font-weight: 560; font-size: 14.5px; position: relative; min-height: 40px; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--accent); color: #0c0c0e; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.nav a:focus-visible { outline-color: #ff7179; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex: none;
  background: var(--recessed); color: var(--text); letter-spacing: .02em; }
.side-foot .avatar { background: #2a2a2f; color: #fff; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { color: var(--side-muted); font-size: 12px; }
.side-foot .icon-btn { color: var(--side-text); }
.side-foot .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { margin-left: var(--side-w); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, transform .24s ease; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .crumb { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.topbar .mobile-brand { display: none; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; min-width: 280px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; text-align: left; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--recessed); color: var(--muted); }
.content { flex: 1; padding: 8px 28px 48px; width: 100%; max-width: 1480px; }
.admin-banner { background: var(--primary); color: var(--on-primary); display: flex; align-items: center; gap: 12px; padding: 8px 28px; font-size: 13.5px; }
.admin-banner button { margin-left: auto; }
.bottom-nav { display: none; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.page-head p { color: var(--muted); margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 620; font-size: 14.5px; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--hover); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.accent:hover { background: #ff3e48; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--recessed); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; gap: 6px; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 16px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r); border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--recessed); color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Karten & Raster ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 560; }
.kpi .label svg { color: var(--faint); }
.kpi .value { font-size: 30px; font-weight: 760; color: var(--text); letter-spacing: -.02em; margin-top: 8px; line-height: 1.1; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.hero { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.kpi.hero .label, .kpi.hero .sub, .kpi.hero .label svg { color: color-mix(in srgb, var(--on-primary) 72%, transparent); }
.kpi.hero .value { color: var(--on-primary); }
.kpi.hero::after { content: ""; position: absolute; right: -26px; top: -26px; width: 78px; height: 78px; border-radius: 50%; border: 13px solid var(--accent); }
.kpi.hero .label { padding-right: 48px; }
.trend-up { color: var(--ok); font-weight: 650; }
.trend-down { color: var(--err); font-weight: 650; }
.kpi.hero .trend-up { color: #85d6a6; }
:root[data-theme="dark"] .kpi.hero .trend-up { color: #19623d; }
.meter { height: 8px; border-radius: 8px; background: var(--recessed); overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }
.meter.ok > span { background: var(--ok); } .meter.warn > span { background: #d99a00; }

/* ---------- Badges & Chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 20px; font-size: 12.5px; font-weight: 650; white-space: nowrap; line-height: 1.6; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.b-active, .b-paid, .b-ok, .b-attended, .b-booked { background: var(--ok-soft); color: var(--ok); }
.b-paused, .b-upcoming, .b-info, .b-waitlist { background: var(--info-soft); color: var(--info); }
.b-cancelled, .b-warn, .b-open, .b-no_show { background: var(--warn-soft); color: var(--warn); }
.b-returned, .b-err, .b-overdue { background: var(--err-soft); color: var(--err); }
.b-ended, .b-lead, .b-neutral, .b-cancelled-inv { background: var(--recessed); color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--panel); color: var(--body); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip:hover { border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip .n { font-family: var(--mono); font-size: 11.5px; opacity: .75; }
.tone { --c: var(--slate); --cs: var(--slate-soft); }
.tone-red { --c: var(--red); --cs: var(--red-soft); } .tone-blue { --c: var(--blue); --cs: var(--blue-soft); }
.tone-green { --c: var(--green); --cs: var(--green-soft); } .tone-amber { --c: var(--amber); --cs: var(--amber-soft); }
.tone-violet { --c: var(--violet); --cs: var(--violet-soft); } .tone-slate { --c: var(--slate); --cs: var(--slate-soft); }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; flex: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 620; border-bottom: 2.5px solid transparent;
  margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .n { font-family: var(--mono); font-size: 11.5px; background: var(--recessed); padding: 1px 7px; border-radius: 10px; color: var(--muted); }

/* ---------- Tabellen / Listen ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input, .search input[type=search] { padding-left: 40px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; font-weight: 620; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: var(--hover); }
.t .person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t .person b { color: var(--text); font-weight: 650; display: block; }
.t .person a { color: inherit; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.list .meta { color: var(--muted); font-size: 13px; }
.list a.li-link { color: inherit; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; }
.list a.li-link:hover .title { text-decoration: underline; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.pager { display: flex; justify-content: center; padding: 14px; gap: 10px; align-items: center; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 620; font-size: 13.5px; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--err); font-weight: 600; }
.input, input[type=text], input[type=search], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--panel);
  color: var(--text); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--err); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent-text); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; color: var(--text); margin-bottom: 10px; padding: 0; }
.money { position: relative; }
.money input { padding-right: 34px; text-align: right; }
.money::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.form-error { background: var(--err-soft); color: var(--err); border-radius: var(--r); padding: 10px 14px; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.notice { border-radius: var(--r); padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.info { background: var(--info-soft); color: var(--info); } .notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--ok-soft); color: var(--ok); } .notice.err { background: var(--err-soft); color: var(--err); }
.notice b { color: inherit; }
.option-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.option-card { position: relative; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 14px; cursor: pointer; background: var(--panel); display: block; }
.option-card:hover { border-color: var(--border-strong); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) { border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.option-card:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.option-card .price { font-size: 22px; font-weight: 760; color: var(--text); margin: 4px 0; }
.option-card .price small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Dialog / Sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12,12,14,.48); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .16s ease; backdrop-filter: blur(2px); }
.dialog { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: min(88dvh, 900px);
  display: flex; flex-direction: column; animation: pop .18s ease; border: 1px solid var(--border); }
.dialog.wide { width: min(820px, 100%); }
.dialog.side { position: fixed; right: 0; top: 0; bottom: 0; height: 100dvh; max-height: none; width: min(520px, 100%); border-radius: var(--r-lg) 0 0 var(--r-lg); animation: slide .2s ease; }
.overlay.has-side { justify-content: flex-end; padding: 0; }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { flex: 1; font-size: 19px; }
.dialog-body { padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; align-content: start; flex: 1; }
.dialog-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
body.locked { overflow: hidden; }

/* Befehlspalette */
.palette { width: min(640px, 100%); align-self: flex-start; margin-top: 10vh; }
.palette .p-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette .p-input input { border: 0; box-shadow: none; padding: 0; min-height: 32px; font-size: 18px; background: transparent; }
.palette .p-input input:focus { box-shadow: none; }
.palette .results { max-height: 56dvh; overflow-y: auto; padding: 8px; }
.palette .group-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 4px; }
.palette .res { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--body); text-decoration: none; cursor: pointer; }
.palette .res:hover, .palette .res[aria-selected="true"] { background: var(--recessed); text-decoration: none; }
.palette .res b { color: var(--text); }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--primary); color: var(--on-primary); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-lg);
  display: flex; gap: 10px; align-items: flex-start; animation: pop .2s ease; font-size: 14.5px; }
.toast.err { background: var(--err); color: #fff; }
:root[data-theme="dark"] .toast.err { color: #0c0c0e; }
.toast .t-ico { flex: none; margin-top: 1px; }
.toast button { margin-left: auto; color: inherit; background: none; border: 0; cursor: pointer; padding: 0 2px; opacity: .8; font-size: 18px; line-height: 1; }

/* ---------- Diagramme ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 2 4; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Dashboard ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li a { display: flex; gap: 12px; align-items: flex-start; padding: 13px 20px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.alert-list li:last-child a { border-bottom: 0; }
.alert-list li a:hover { background: var(--hover); }
.alert-list .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert-list .ico.error { background: var(--err-soft); color: var(--err); } .alert-list .ico.warning { background: var(--warn-soft); color: var(--warn); }
.alert-list .ico.info { background: var(--info-soft); color: var(--info); }
.alert-list b { color: var(--text); display: block; }
.alert-list .go { margin-left: auto; color: var(--faint); align-self: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .time { font-family: var(--mono); font-size: 13px; color: var(--text); }
.timeline .time small { display: block; color: var(--muted); font-size: 11px; }
.cap { min-width: 88px; text-align: right; }
.cap .meter { margin-top: 4px; height: 6px; }
.greeting { font-size: 28px; }

/* ---------- Kurse ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day-col { min-width: 0; }
.day-col h3 { font-size: 13px; color: var(--muted); font-weight: 650; padding: 8px 4px; display: flex; gap: 6px; align-items: baseline; }
.day-col h3 b { font-size: 20px; color: var(--text); font-weight: 760; }
.day-col.today h3 b { color: var(--accent-text); }
.day-col.today h3::after { content: "Heute"; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #0c0c0e; background: var(--accent); padding: 1px 6px; border-radius: 4px; margin-left: auto; }
.slot { display: block; width: 100%; text-align: left; border: 1px solid var(--border); border-left: 4px solid var(--c); background: var(--panel); border-radius: var(--r);
  padding: 9px 10px; margin-bottom: 8px; cursor: pointer; color: inherit; box-shadow: var(--shadow-sm); }
.slot:hover { border-color: var(--border-strong); border-left-color: var(--c); background: var(--hover); }
.slot .s-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.slot .s-name { font-weight: 700; color: var(--text); font-size: 14px; line-height: 1.25; margin: 2px 0 4px; }
.slot .s-meta { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.slot.cancelled { border-left-style: dashed; background: var(--recessed); } .slot.cancelled .s-name { text-decoration: line-through; }
.slot.past { background: var(--recessed); box-shadow: none; }
.slot .meter { height: 5px; margin-top: 6px; }
.slot.full .meter > span { background: var(--err); }
.day-tabs { display: none; }

/* Schichtplan */
.roster { overflow-x: auto; }
.roster table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; }
.roster th, .roster td { border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; font-size: 13px; }
.roster th { text-align: left; color: var(--muted); font-weight: 620; background: var(--panel); }
.roster td.name { position: sticky; left: 0; background: var(--panel); min-width: 170px; z-index: 1; }
.roster th.today, .roster td.today { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.shift { display: block; width: 100%; text-align: left; border-radius: 6px; padding: 5px 8px; margin-bottom: 4px; background: var(--cs); color: var(--c); font-weight: 650;
  border: 0; cursor: pointer; font-size: 12.5px; }
.shift small { display: block; font-weight: 500; }
.add-shift { width: 100%; border: 1px dashed var(--border-strong); background: none; border-radius: 6px; color: var(--muted); cursor: pointer; min-height: 28px; font-size: 12px; }
.add-shift:hover { color: var(--text); border-color: var(--muted); }

/* Personen */
.person-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.person-card .avatar { width: 46px; height: 46px; font-size: 16px; }
.avatar.tone { background: var(--cs); color: var(--c); }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 22px; border-radius: 18px; background: var(--primary); color: var(--on-primary); }
.profile-head h1 { font-size: 24px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); font-weight: 560; min-width: 0; overflow-wrap: anywhere; }
.contract-box { border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; display: grid; gap: 14px; }
.progress-line { position: relative; height: 10px; background: var(--recessed); border-radius: 10px; overflow: hidden; }
.progress-line span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 10px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; gap: 8px; }

/* Check-in */
.checkin-hero { background: var(--side-bg); color: #fff; border-radius: var(--r-xl); padding: 28px; position: relative; overflow: hidden; }
.checkin-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 34px solid var(--accent); opacity: .95; }
.checkin-hero h1 { color: #fff; font-size: 30px; }
.checkin-hero p { color: #b9bbc0; margin-top: 6px; }
.checkin-search { position: relative; margin-top: 20px; max-width: 640px; z-index: 1; }
.checkin-search input { min-height: 58px; font-size: 19px; border-radius: var(--r-md); padding-left: 54px; border: 0; background: #fff; color: #0c0c0e; }
.checkin-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #5d5f65; width: 22px; height: 22px; }
.checkin-results { margin-top: 10px; max-width: 640px; position: relative; z-index: 1; display: grid; gap: 6px; }
.checkin-results button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 0; background: #232327;
  color: #fff; cursor: pointer; text-align: left; }
.checkin-results button:hover, .checkin-results button:focus-visible { background: #34343a; }
.checkin-results .avatar { background: #2a2a2f; color: #fff; }
.checkin-results .meta { color: #b9bbc0; font-size: 13px; }
.checkin-hero .badge { background: rgba(255,255,255,.12); color: #fff; }
.checkin-hero .b-active { background: #15301f; color: #85d6a6; } .checkin-hero .b-paused { background: #132a3e; color: #8ecaff; }
.checkin-hero .b-cancelled { background: #362a0c; color: #f4cb70; } .checkin-hero .b-ended, .checkin-hero .b-lead { background: #2a2a2f; color: #c9cacd; }
.presence { font-size: 54px; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1; }
.success-flash { display: flex; align-items: center; gap: 14px; background: var(--ok-soft); color: var(--ok); padding: 16px 18px; border-radius: var(--r-md); font-weight: 650; animation: pop .2s ease; }
.success-flash .big { width: 44px; height: 44px; border-radius: 50%; background: var(--ok); color: var(--panel); display: grid; place-items: center; flex: none; }

/* Admin */
.gym-card { padding: 20px; display: grid; gap: 14px; }
.gym-card .logo { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #ff2430, #ff6a3d); display: grid; place-items: center; font-weight: 800; color: #0c0c0e; font-size: 18px; }

/* Rechnung (Druck) */
.invoice-doc { background: #fff; color: #111; border-radius: var(--r); padding: 28px; border: 1px solid var(--border); font-size: 13.5px; }
.invoice-doc h2 { color: #111; font-size: 20px; }
.invoice-doc table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.invoice-doc td, .invoice-doc th { padding: 8px 0; border-bottom: 1px solid #ddd; text-align: left; }
.invoice-doc .r { text-align: right; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login-visual { background: var(--side-bg); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-visual .ring { position: absolute; border-radius: 50%; border: 56px solid var(--accent); width: 520px; height: 520px; right: -170px; bottom: -190px; }
.login-visual .ring.two { border-width: 2px; border-color: rgba(255,255,255,.12); width: 760px; height: 760px; right: -290px; bottom: -310px; }
.login-visual h1 { color: #fff; font-size: clamp(34px, 4vw, 52px); line-height: 1.04; letter-spacing: -.035em; max-width: 13ch; margin-top: auto; position: relative; }
.login-visual h1 em { font-style: normal; color: var(--accent); }
.login-visual p { color: #b9bbc0; max-width: 46ch; margin-top: 16px; font-size: 16.5px; position: relative; }
.login-feats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; position: relative; }
.login-feats span { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; border: 1px solid rgba(255,255,255,.16); color: #d9d8d5; padding: 6px 10px; border-radius: 20px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form form { width: min(400px, 100%); display: grid; gap: 18px; }
.login-form h2 { font-size: 28px; letter-spacing: -.02em; }
.login-form .muted { margin-top: -10px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }

/* ---------- Responsiv ---------- */
@media (max-width: 1240px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) and (min-width: 721px) {
  :root { --side-w: 76px; }
  .brand { justify-content: center; padding: 0; }
  .brand img, .brand .tag-text { display: none; }
  .gym-switch { justify-content: center; padding: 8px; margin: 4px 10px 8px; }
  .gym-switch > div:last-child, .nav-label, .nav a span.lbl, .nav a .count, .side-foot .who { display: none; }
  .nav a { justify-content: center; padding: 10px; }
  .side-foot { flex-direction: column; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .search-trigger { min-width: 0; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 23px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px 0 16px; height: 58px; }
  .topbar.hide { transform: translateY(-100%); }
  .topbar .crumb { display: none; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 760; font-size: 17px; text-decoration: none; min-width: 0; }
  .topbar .mobile-brand .m-dot { width: 30px; height: 30px; border-radius: 8px; background: var(--side-bg); display: grid; place-items: center; flex: none; }
  .topbar .mobile-brand .m-dot i { width: 12px; height: 12px; border-radius: 50%; border: 3.5px solid var(--accent); display: block; }
  .topbar .mobile-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-trigger { min-width: 0; width: 42px; padding: 0; justify-content: center; margin-left: auto; }
  .search-trigger .lbl, .search-trigger kbd { display: none; }
  .content { padding: 4px 14px 32px; }
  .admin-banner { padding: 8px 14px; }
  .page-head { margin: 10px 0 16px; align-items: stretch; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 24px; }
  .kpi .label { font-size: 12.5px; }
  .card-head, .card-body, .card-foot, .list > li, .alert-list li a, .timeline li { padding-left: 14px; padding-right: 14px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--panel); border-top: 1px solid var(--border); height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 24px rgba(0,0,0,.06); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none;
    font-size: 11.5px; font-weight: 650; background: none; border: 0; cursor: pointer; min-height: 56px; }
  .bottom-nav [aria-current="page"] { color: var(--text); }
  .bottom-nav [aria-current="page"] svg { color: var(--accent-text); }
  .bottom-nav .fab { margin-top: -22px; }
  .bottom-nav .fab .fab-in { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #0c0c0e; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(255,36,48,.4); border: 4px solid var(--panel); }
  .bottom-nav .fab svg { color: #0c0c0e !important; }
  /* Tabellen werden zu Karten */
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
  table.t.cards td { padding: 0; border: 0; }
  table.t.cards td[data-label]:not(.keep)::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  table.t.cards td.hide-m { display: none; }
  table.t.cards td.primary-cell { grid-column: 1 / 2; }
  table.t.cards td.side-cell { grid-column: 2; grid-row: 1; text-align: right; }
  table.t.cards td.sub-cell { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
  table.t.cards td.num { text-align: left; }
  table.t.cards td.side-cell.num { text-align: right; }
  .t th { position: static; }
  .week { display: block; }
  .day-col { display: none; }
  .day-col.shown { display: block; }
  .day-col h3 { display: none; }
  .day-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
  .day-tabs button { flex: 1 0 auto; min-width: 46px; border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-md); padding: 6px 4px; cursor: pointer; display: grid; text-align: center; color: var(--muted); font-size: 12px; font-weight: 620; }
  .day-tabs button b { font-size: 18px; color: var(--text); }
  .day-tabs button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
  .day-tabs button[aria-pressed="true"] b { color: var(--on-primary); }
  .slot { padding: 12px 14px; }
  .overlay { padding: 0; align-items: flex-end; }
  .dialog, .dialog.wide { width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet .22s ease; }
  .dialog.side { height: 92dvh; top: auto; border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; }
  .dialog-head::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); margin-top: -12px; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  .dialog-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dialog-foot .btn { flex: 1; }
  .palette { margin-top: 0; align-self: flex-end; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--bottom-h) + 12px + env(safe-area-inset-bottom)); width: auto; }
  .login { grid-template-columns: 1fr; }
  .login-visual { padding: 28px 22px 34px; min-height: 0; }
  .login-visual h1 { font-size: 32px; margin-top: 36px; }
  .login-visual .ring { width: 260px; height: 260px; border-width: 30px; right: -90px; bottom: -120px; }
  .login-visual .ring.two { display: none; }
  .login-feats { display: none; }
  .login-form { padding: 28px 20px 40px; align-items: flex-start; }
  .checkin-hero { padding: 22px 18px; border-radius: var(--r-lg); }
  .checkin-hero h1 { font-size: 24px; }
  .greeting { font-size: 23px; }
  .profile-head { padding: 18px; }
  .search { max-width: none; min-width: 100%; }
  .toolbar .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .admin-banner, .dialog-foot, .dialog-head .icon-btn, .toasts, .no-print { display: none !important; }
  body.printing .shell { display: none; }
  body.printing .overlay { position: static; background: none; padding: 0; display: block; backdrop-filter: none; }
  body.printing .dialog { box-shadow: none; border: 0; max-height: none; width: 100%; }
  body.printing .dialog-body { overflow: visible; }
  .invoice-doc { border: 0; padding: 0; }
}
.mt { margin-top: 14px; }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }
.legend i.lg-in { background: var(--primary); } .legend i.lg-out { background: var(--accent); }
.grow { flex: 1; min-width: 0; }
.list .meter { margin-top: 6px; height: 5px; max-width: 260px; }
ol.chips { list-style: none; margin: 0; padding: 0; }
ol.chips .chip { cursor: default; }
.palette .dialog-body { padding: 0; }
.option-card .row { gap: 8px; }
.timeline .tone .swatch { vertical-align: middle; }
nav[aria-label="Brotkrumen"] a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .kpi.hero::after { width: 54px; height: 54px; right: -20px; top: -20px; border-width: 10px; }
  .kpi.hero .label { padding-right: 26px; }
  .t tbody tr.link:hover td { background: none; }
  .t tbody tr.link:hover { background: var(--hover); }
  .toolbar > .field { flex: 1 1 140px; }
}
