/* ============================================================================
   Kraft-voll-Leben Training — Design-System "Bold & Sportlich" (Dark)
   Akzent: Orange #d35400. Display: Anton, Headlines: Oswald, Text: Inter.
   ========================================================================== */

@font-face { font-family: 'Anton';  src: url('./vendor/fonts/anton.woff2') format('woff2');      font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Oswald'; src: url('./vendor/fonts/oswald-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter';  src: url('./vendor/fonts/inter-400.woff2') format('woff2');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter';  src: url('./vendor/fonts/inter-600.woff2') format('woff2');  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter';  src: url('./vendor/fonts/inter-700.woff2') format('woff2');  font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg:        #0c0d10;
  --bg-2:      #101116;
  --surface:   #16181e;
  --surface-2: #1e2027;
  --surface-3: #262932;
  --border:    #2a2d37;
  --border-2:  #363a46;
  --text:      #f4f5f7;
  --muted:     #9298a6;
  --faint:     #656b78;

  --accent:      #d35400;
  --accent-2:    #ff6b1a;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(211, 84, 0, .14);
  --accent-glow: rgba(255, 107, 26, .35);

  --danger: #e5484d;
  --ok:     #3fb950;
  --warn:   #f0a52a;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow:      0 2px 8px rgba(0,0,0,.35), 0 12px 40px rgba(0,0,0,.35);
  --shadow-glow: 0 8px 30px rgba(211,84,0,.28);

  --font-body:    'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head:    'Oswald', 'Inter', system-ui, sans-serif;
  --font-display: 'Anton', 'Oswald', 'Inter', system-ui, sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #ff8442; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { min-height: 60vh; display: grid; place-items: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Typografie ---------- */
h1.page {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}
h1.page .accent { color: var(--accent-2); }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  color: var(--accent-2);
  font-weight: 600;
}

/* ---------- Brand-Lockup + Marke ---------- */
.brand-lockup { display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff; box-shadow: var(--shadow-glow);
  flex: none;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name {
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; line-height: 1; font-size: 1.05rem;
}
.brand-name small { display: block; font-size: .62rem; letter-spacing: .32em; color: var(--muted); margin-top: 3px; }

/* ---------- App-Shell ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem 1.25rem;
  background: rgba(12,13,16,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.nav a {
  white-space: nowrap;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em;
  font-size: .82rem; color: var(--muted);
  padding: .5rem .8rem; border-radius: var(--radius-sm); position: relative;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent-ink); background: linear-gradient(140deg, var(--accent-2), var(--accent)); box-shadow: var(--shadow-glow); }

/* Aufklappmenue "Admin": alles, was nur dem Einrichten dient. Ein flaches Menue
   waere fuer einen Superadmin dreizehn Punkte breit — mehr, als in eine Zeile
   passt. */
.nav-group { position: relative; }
.nav-caret { display: inline-block; margin-left: .35rem; font-size: .7rem; opacity: .7; transition: transform .15s; }
.nav-toggle.open .nav-caret { transform: rotate(180deg); }
.nav-toggle { cursor: pointer; }
.nav-menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 30;
  min-width: 11.5rem; display: flex; flex-direction: column; padding: .3rem;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
/* Der Farbverlauf von .nav a.active wirkt in der schmalen Liste unruhig —
   hier genuegt ein ruhiger Hintergrund. */
.nav-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  text-transform: none; letter-spacing: .02em; text-align: left; color: var(--text);
}
.nav-menu a.active { color: var(--accent); background: var(--surface-2); box-shadow: none; }
.nav-menu .nav-badge { margin-left: 0; }
.topbar .user { margin-left: auto; display: flex; gap: .7rem; align-items: center; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--surface-3); border: 1px solid var(--border-2);
  font-family: var(--font-head); font-weight: 600; font-size: .85rem; color: var(--text);
}
.content { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 1.75rem 1.25rem 5rem; }

/* ---------- Karten ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}
.card h2 {
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; font-size: 1.05rem; margin: 0 0 .5rem;
}
.card.accent-top { border-top: 3px solid var(--accent); }

/* ---------- Formulare ---------- */
label.field {
  display: block; font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin-bottom: .4rem;
}
input, select, textarea {
  width: 100%; padding: .68rem .8rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select option { background: var(--surface); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  font-size: .82rem; cursor: pointer;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  border: 1px solid transparent;
  transition: transform .08s ease, box-shadow .15s, filter .15s;
}
.btn:hover { box-shadow: var(--shadow-glow); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; filter: none; }
.btn.ghost {
  background: var(--surface-2); color: var(--text); border-color: var(--border-2);
}
.btn.ghost:hover { background: var(--surface-3); box-shadow: none; }
/* Reihen von Geisterknoepfen als Reiter (E-Mail-Einstellungen, Rechtstexte):
   ohne diese Regel trug die Klasse "active" dort bisher gar keine Wirkung. */
.btn.ghost.active { color: var(--accent-ink); background: linear-gradient(140deg, var(--accent-2), var(--accent)); border-color: transparent; }
.btn.danger { background: linear-gradient(140deg, #f0575c, var(--danger)); }
.btn.sm { padding: .4rem .7rem; font-size: .72rem; }
.btn.block { width: 100%; }

/* ---------- Meldungen ---------- */
.alert { padding: .75rem .9rem; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid; }
.alert.err { background: rgba(229,72,77,.12);  color: #ff9a9d; border-color: rgba(229,72,77,.4); }
.alert.ok  { background: rgba(63,185,80,.12);  color: #86e29a; border-color: rgba(63,185,80,.4); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em;
  font-size: .68rem; font-weight: 600; border: 1px solid var(--border-2); color: var(--muted);
}
.badge.role { color: var(--accent-2); border-color: rgba(211,84,0,.45); background: var(--accent-soft); }
.badge.st-active   { color: var(--ok);   border-color: rgba(63,185,80,.45); }
.badge.st-invited  { color: var(--warn); border-color: rgba(240,165,42,.45); }
.badge.st-disabled { color: var(--faint); }
/* Kennzeichen, das zugleich Schalter ist (Sichtbarkeit in der Workout-Liste).
   Es soll aussehen wie die anderen Kennzeichen — nur anfassbar. */
.badge-btn { cursor: pointer; background: transparent; transition: background .15s, border-color .15s; }
.badge-btn:hover { background: var(--surface-2); border-color: var(--border-2); }

/* ---------- Tabelle ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th {
  text-align: left; padding: .7rem .65rem; border-bottom: 1px solid var(--border);
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em;
  font-size: .7rem; color: var(--muted); font-weight: 600;
}
table.data td { padding: .6rem .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface); }
table.data tr:last-child td { border-bottom: none; }

/* ---------- Auth-Seite ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1.25rem;
  background:
    radial-gradient(60vw 40vh at 50% -10%, rgba(211,84,0,.22), transparent 70%),
    radial-gradient(40vw 30vh at 90% 110%, rgba(255,107,26,.10), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 1.4rem; }
.auth-head .brand-mark { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto .9rem; }
.auth-head .brand-mark svg { width: 36px; height: 36px; }
.auth-title {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .01em;
  font-size: 1.9rem; line-height: 1; margin: 0;
}
.auth-title .accent { color: var(--accent-2); }
.auth-sub { color: var(--muted); margin-top: .5rem; font-size: .95rem; }

/* ---------- Hero (Startseite) ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(211,84,0,.28), transparent 55%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: 1.9rem 1.6rem;
}
.hero .eyebrow { margin-bottom: .5rem; }
.hero h1 {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(1.9rem, 1.3rem + 3vw, 3.1rem); line-height: .98; letter-spacing: .01em; margin: 0;
}
.hero h1 .accent { color: var(--accent-2); }

/* ---------- Diverses ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem;
  border: 1px solid var(--border-2); border-radius: 999px; font-size: .8rem; cursor: pointer; user-select: none;
  color: var(--muted); transition: border-color .12s, color .12s;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip input { width: auto; accent-color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; word-break: break-all; color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid.cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- Katalog ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.4rem; }
.toolbar .search { flex: 1 1 220px; min-width: 180px; }
.toolbar select { width: auto; }
.wgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.wcard { cursor: pointer; display: flex; flex-direction: column; gap: .55rem; transition: transform .1s, box-shadow .15s, border-color .15s; }
.wcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: var(--border-2); }
.wcard .top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wcode { font-family: var(--font-head); font-weight: 600; color: var(--accent-2); letter-spacing: .06em; font-size: .82rem; }
.wtitle { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .02em; font-size: 1.08rem; line-height: 1.1; }
.wmeta { display: flex; flex-wrap: wrap; gap: .35rem; }
.pill { font-size: .72rem; padding: .16rem .55rem; border-radius: 999px; border: 1px solid var(--border-2); color: var(--muted); }
.star { background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; color: var(--faint); padding: 0 .1rem; transition: color .12s, transform .12s; }
.star:hover { transform: scale(1.15); }
.star.on { color: var(--accent-2); }
.done-tag { color: var(--ok); font-size: .74rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Workout-Detail: Bloecke ---------- */
.block { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.block .bhead { background: var(--surface-2); padding: .65rem .95rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .03em; font-size: .92rem; }
.block .brow { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .95rem; border-top: 1px solid var(--border); }
.block .brow .amt { color: var(--accent-2); font-family: var(--font-head); font-weight: 600; margin-right: .5rem; }

/* ---------- Timer (Vollbild) ---------- */
/* margin: 0 ist kein Zierrat: steht ein Overlay als spaeteres Kind in einem
   .stack (workout.js, videos.js, …), erbt es dessen margin-top von 1rem — und
   ein fixed positioniertes Element mit top:0/bottom:0 rutscht dadurch um genau
   diesen Betrag nach unten, statt den Rand zu ignorieren. Oben klaffte so ein
   16px hoher Schlitz, durch den die Kopfzeile der Seite durchschien. */
.timer-overlay { position: fixed; inset: 0; margin: 0; z-index: 100; background-color: var(--bg); display: flex; flex-direction: column; transition: background .3s; }
.timer-overlay.k-work { background-image: radial-gradient(circle at 50% 38%, rgba(211,84,0,.32), transparent 62%); }
.timer-overlay.k-rest { background-image: radial-gradient(circle at 50% 38%, rgba(60,120,220,.24), transparent 62%); }
.timer-overlay.k-prep { background-image: radial-gradient(circle at 50% 38%, rgba(240,165,42,.22), transparent 62%); }
.timer-overlay.k-done { background-image: radial-gradient(circle at 50% 38%, rgba(63,185,80,.22), transparent 62%); }
/* Durchgaengiges Band ueber die volle Breite: es fasst den Timer oben ein und
   macht auf einen Blick klar, dass man im Vollbild-Modus ist. */
.timer-overlay .tbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.25rem;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: var(--shadow-glow);
}
.timer-overlay .tbar .eyebrow { color: #fff; opacity: .95; }
/* Der Geisterknopf ist auf dem Band sonst kaum zu sehen. */
.timer-overlay .tbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(0,0,0,.12); }
.timer-overlay .tbar .btn.ghost:hover { background: rgba(0,0,0,.28); }
.seg { display: flex; width: fit-content; gap: .3rem; padding: .3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin: 0 auto; }
.seg button { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; padding: .5rem 1.15rem; border: none; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: var(--shadow-glow); }
/* Die Ziffern waren so gross, dass Blocktitel, Phase und Vorschau daneben
   verschwanden — dabei sagen genau die, was gerade zu tun ist. Der Countdown
   ist deshalb kleiner, alles ringsum groesser, und rund um die Ziffern steht
   spuerbar Luft. */
/* Uebung ueber den Ziffern, Runde und Vorschau darunter sind gleich gross und
   teilen sich deshalb eine Groesse — sonst laufen sie beim naechsten
   Nachjustieren auseinander. Der Blocktitel bleibt darunter: er nennt, wo man
   ist, nicht was zu tun ist. */
.timer-stage { --timer-line: clamp(1.5rem, 4.6vw, 2.6rem); flex: 1; display: grid; place-items: center; text-align: center; padding: 1.5rem 1.25rem; }
.timer-blocklabel { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .18em; font-size: clamp(1.15rem, 3vw, 1.6rem); color: var(--accent-2); margin-bottom: .6rem; }
.timer-phase { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: var(--timer-line); color: var(--text); }
.timer-time { font-family: var(--font-display); font-size: clamp(3.6rem, 17vw, 10.5rem); line-height: 1; letter-spacing: .02em; margin: clamp(1.5rem, 5vw, 3.2rem) 0; }
.timer-time.k-work { color: var(--accent-2); }
.timer-time.k-rest { color: #6aa3ff; }
.timer-round { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: var(--timer-line); color: var(--muted); }
.timer-next { margin-top: 1rem; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: var(--timer-line); color: var(--faint); }
.timer-next strong { color: var(--text); font-weight: 600; }
.timer-controls { display: flex; gap: .8rem; justify-content: center; padding: 1.5rem 1rem 2.2rem; flex-wrap: wrap; }

/* ---------- Kamera-Zählung (Bewegungserkennung) ---------- */
.pose-view { position: relative; width: 100%; max-width: 720px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
/* Gespiegelt wie ein Spiegel — sonst fühlt sich jede Bewegung verkehrt an. */
.pose-view video, .pose-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }
.pose-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; background: rgba(0,0,0,.5); }
.pose-count { position: absolute; right: 1rem; bottom: .6rem; font-family: var(--font-display); font-size: clamp(3rem, 12vw, 6.5rem); line-height: 1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.pose-count small { font-size: .45em; opacity: .8; }
.pose-msg { min-height: 1.6em; margin-top: .7rem; text-align: center; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: clamp(1rem, 2.6vw, 1.5rem); color: var(--muted); }
.pose-msg.good { color: var(--ok); }
.pose-msg.bad { color: var(--danger); }
.pose-tip { margin-top: .4rem; text-align: center; font-size: .95rem; color: var(--warn); }
.pose-debug { margin-top: .4rem; text-align: center; font-size: .9rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.timer-pose { width: min(92vw, 720px); margin: 1rem auto; }
.timer-pose .pose-view { max-height: 52vh; }

/* ---------- Rechtsseiten (Impressum, Datenschutz) ---------- */
/* Eigene, ruhige Spalte statt .auth-card: Fliesstext liest sich in einer
   schmalen Spalte besser, und die Seiten muessen auch ohne Anmeldung stehen. */
.legal { min-height: 100vh; display: flex; flex-direction: column; }
.legal-head { padding: 1.25rem; border-bottom: 1px solid var(--border); }
.legal-body { width: 100%; max-width: 780px; margin: 0 auto; padding: 2rem 1.25rem 3rem; flex: 1; }
.legal-body p { line-height: 1.65; }
.legal-body code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; color: var(--accent-2); }

/* Fusszeile mit den Pflichtlinks. Sie steht auf jeder Seite, auch auf denen
   fuer Gaeste — "staendig verfuegbar" meint genau das. */
.legal-footer {
  display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; justify-content: center;
  padding: 1.25rem; border-top: 1px solid var(--border);
  font-size: .84rem; color: var(--muted);
}
.legal-footer a { color: var(--muted); }
.legal-footer a:hover { color: var(--accent-2); }

/* Gerenderter Rechtstext — auf der oeffentlichen Seite und in der Vorschau. */
.legal-text h2, .legal-preview h2 {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .04em;
  font-size: 1.05rem; margin: 1.6rem 0 .5rem;
}
.legal-text h2:first-child, .legal-preview h2:first-child { margin-top: 0; }
.legal-text p, .legal-preview p { line-height: 1.65; margin: .6rem 0; }
.legal-preview { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.15rem; max-height: 32rem; overflow-y: auto; }

/* ---------- Modal ---------- */
/* margin: 0 aus demselben Grund wie beim Timer weiter oben — auch Dialoge
   haengen als spaetere .stack-Kinder und rutschten sonst um 1rem nach unten. */
.modal-overlay { position: fixed; inset: 0; margin: 0; z-index: 90; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 1rem; }
.modal { width: 100%; max-width: 580px; max-height: 88vh; overflow-y: auto; }

/* ---------- Statistik-Kacheln ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.stat-tile { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.stat-num { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; color: var(--accent-2); }
.stat-lbl { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; color: var(--muted); margin-top: .35rem; }

/* ---------- Kalender ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.cal-dow { text-align: center; font-family: var(--font-head); text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; color: var(--muted); padding-bottom: .3rem; }
.cal-cell { min-height: 3rem; display: grid; place-items: center; border-radius: 8px; font-size: .9rem; border: 1px solid var(--border); background: var(--bg); cursor: pointer; color: var(--muted); }
.cal-cell:not(.empty):hover { border-color: var(--border-2); color: var(--text); }
.cal-cell.empty { cursor: default; border-color: transparent; background: transparent; }
.cal-cell.has { background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 600; box-shadow: var(--shadow-glow); }

/* ---------- Video-Einbettung ---------- */
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Log-Zeile ---------- */
.log-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: none; }

/* ---------- Kalender / Termine ---------- */
.ev-card { border-left: 3px solid var(--accent); }
.ev-card.is-past { border-left-color: var(--border-2); opacity: .72; }
.ev-when { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--accent-2); }
.ev-card.is-past .ev-when { color: var(--muted); }
.ev-where { color: var(--muted); margin-top: .35rem; }
.ev-desc { margin-top: .6rem; white-space: pre-wrap; }
.ev-seats { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; font-size: .92rem; }
.seat-num { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--accent-2); }
.ev-card.is-past .seat-num { color: var(--muted); }
.ed-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.ev-card.is-series { border-left-color: var(--accent-2); }
.ser-list { margin-top: .9rem; border-top: 1px solid var(--border); }
.ser-item { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.ser-item:last-child { border-bottom: none; }
.ser-date { font-family: var(--font-head); font-size: .86rem; letter-spacing: .04em; }
.chip.is-off { opacity: .45; }
.bk-row { border-top: 1px solid var(--border); padding-top: .8rem; }
.bk-row:first-of-type { border-top: none; padding-top: 0; }
.modal.wide { max-width: 720px; }

/* ---------- Änderungsprotokoll ---------- */
.eyebrow.ok   { color: var(--ok); }
.eyebrow.info { color: var(--muted); }
.eyebrow.warn { color: var(--warn); }
.eyebrow.err  { color: var(--danger); }
.cl-list { margin: .35rem 0 0; padding-left: 1.15rem; }
.cl-list li { margin-top: .25rem; }
.cl-list li::marker { color: var(--faint); }
.cl-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: .02em .28em; color: var(--accent-2); }

/* ---------- Markierung an der Navigation ---------- */
/* Zahl am Menuepunkt, sobald etwas Neues da ist. Der Punkt allein wuerde die
   Frage "wie viel?" offen lassen — die Zahl beantwortet sie sofort. */
.nav a { position: relative; }
.nav-badge {
  display: inline-block; margin-left: .35rem; padding: 0 .38rem; min-width: 1.15rem;
  border-radius: 999px; background: var(--accent-2); color: #fff;
  font-family: var(--font-head); font-size: .68rem; font-weight: 600; line-height: 1.2rem;
  text-align: center; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.nav a.has-news { color: var(--text); }
.nav a.active .nav-badge { background: #fff; color: var(--accent); }

/* ---------- Buchungsuebersicht ---------- */
.bk-row.is-unread { border-left: 3px solid var(--accent-2); margin-left: -.9rem; padding-left: .9rem; }
.unread-dot {
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-soft); flex: 0 0 auto;
}
.unread-dot.off { background: var(--border-2); box-shadow: none; }
.bk-last { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.bk-last.strong { color: var(--accent-2); }
.bk-detail { margin-top: .9rem; border-top: 1px dashed var(--border); padding-top: .9rem; }
.act-row { display: flex; gap: .5rem; align-items: baseline; font-size: .86rem; padding: .18rem 0; }
.act-icon { width: 1.1rem; text-align: center; color: var(--faint); flex: 0 0 auto; }
.act-icon.guest { color: var(--accent-2); }
.act-text { flex: 1 1 auto; }
.act-when { font-size: .78rem; white-space: nowrap; }

/* Groessere Schrift fuer die Buchungsuebersicht: Hier wird viel gelesen, und
   die allgemeinen Kleinformate (Badges, kleine Knoepfe, Labels) waren auf
   grossen Bildschirmen kaum noch lesbar. Gilt nur innerhalb dieser Seite. */
.bookings { font-size: 1.1rem; }
.bookings .bk-meta { font-size: 1rem; }
.bookings .bk-last { font-size: .95rem; }
.bookings .act-row { font-size: 1rem; }
.bookings .act-when { font-size: .9rem; }
.bookings .pill { font-size: .85rem; padding: .2rem .65rem; }
.bookings .badge { font-size: .8rem; padding: .2rem .7rem; }
.bookings .btn.sm { font-size: .85rem; padding: .5rem .9rem; }
.bookings .stat-num { font-size: 3rem; }
.bookings .stat-lbl { font-size: .88rem; }
.bookings .seg button { font-size: .95rem; }
.bookings label.field { font-size: .85rem; }
.bookings input, .bookings textarea { font-size: 1.05rem; }
.bookings .unread-dot { width: .6rem; height: .6rem; }
.bookings .bk-row { padding-top: 1rem; margin-bottom: 1rem; }
.bookings .bk-row:last-child { margin-bottom: 0; }

/* Größere Schrift für Arbeitsseiten mit viel Text (zuerst die Kurse). Die
   allgemeinen Kleinformate — Badges, kleine Knöpfe, Labels, Chips — waren auf
   großen Bildschirmen kaum lesbar. Gilt nur innerhalb von .view-large. */
.view-large { font-size: 1.12rem; }
.view-large .muted { line-height: 1.55; }
.view-large .badge { font-size: .8rem; padding: .2rem .7rem; }
.view-large .pill { font-size: .85rem; padding: .2rem .65rem; }
.view-large .btn { font-size: .95rem; }
.view-large .btn.sm { font-size: .85rem; padding: .5rem .9rem; }
.view-large .chip { font-size: .95rem; }
.view-large label.field { font-size: .85rem; }
.view-large input, .view-large select, .view-large textarea { font-size: 1.05rem; }
.view-large .seg button { font-size: .95rem; }
.view-large .alert { font-size: 1rem; }
.view-large .card h2 { font-size: 1.25rem; }
.view-large h3 { font-size: 1.2rem; }
.view-large .ev-when { font-size: .9rem; }
.view-large .ser-date { font-size: 1rem; }
.view-large .ser-item { padding: .7rem 0; }
.view-large .ev-seats { font-size: 1.02rem; }
.view-large .seat-num { font-size: 1.8rem; }

/* ---------- Benutzerverwaltung ---------- */
/* Acht Spalten passen auf kein schmales Fenster. Statt sie zu quetschen,
   bekommt die Tabelle eine Mindestbreite und .table-wrap scrollt seitlich. */
table.data.users { min-width: 980px; }
table.data.users select { min-width: 8rem; }
table.data.users td { vertical-align: top; }
/* In der Zeile stehen die Rechte nur als kurze Aufzaehlung — geaendert werden
   sie in der aufgeklappten Detailansicht, wo Platz dafuer ist. */
table.data.users td.u-perms { max-width: 11rem; }
/* Die Knoepfe bleiben stehen, wenn die Tabelle seitlich scrollt — sonst muesste
   man fuer jedes "Speichern" erst nach rechts wandern. */
table.data.users th:last-child,
table.data.users td:last-child { position: sticky; right: 0; background: var(--surface); border-left: 1px solid var(--border); }
table.data.users tbody tr:hover td:last-child { background: var(--surface-2); }
table.data.users tr.u-detail td { position: static; background: var(--bg-2); }
.u-detail { background: var(--bg-2); }
.u-detail > td { padding: 1rem .65rem 1.3rem; }
.u-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; font-size: .84rem; color: var(--muted); }
.u-mini { font-size: .8rem; color: var(--muted); }
.u-list { margin: .4rem 0 0; padding: 0; list-style: none; font-size: .86rem; }
.u-list li { padding: .25rem 0; border-bottom: 1px solid var(--border); }
.u-list li:last-child { border-bottom: none; }

/* ---------- Kopfzeile auf schmalen Fenstern ---------- */
/* Reicht die Breite nicht mehr, bricht die Kopfzeile um: Marke und Benutzer
   bleiben oben, die Navigation nimmt die volle Breite darunter und legt sich
   noetigenfalls selbst auf mehrere Zeilen. Vorher lief sie schlicht aus dem
   Fenster — bei einem Superadmin schon ab etwa 1130 Pixeln. */
@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: .5rem; }
  .nav { order: 3; flex-basis: 100%; }
  /* Das Aufklappmenue haengt hier an der Kopfzeile statt am Knopf: steht der
     Knopf nach dem Umbruch weit links, schoebe es sich sonst aus dem Fenster. */
  .nav-group { position: static; }
  .nav-menu {
    left: 0; right: 0; top: 100%; min-width: 0;
    border-left: none; border-right: none; border-radius: 0 0 var(--radius) var(--radius);
  }
}

@media (max-width: 640px) {
  .topbar { gap: .75rem; padding: .6rem .8rem; }
  .brand-name small { display: none; }
  .content { padding: 1.25rem .85rem 4rem; }
}
