/* Farben aus dem Corporate Design (KSZ Redesign22): Anthrazit, Schwarz und die vier Akzentfarben
   Gelb, Grün, Cyan, Magenta (wie im Stundenplan: 15:30 / 16:30 / 17:30 / 18:30, 19:30 Schwarz).
   Hauptakzent ist das CD-Grün – als Fläche mit dunkler Schrift. Als Schrift auf Weiß nur die
   dunklere Stufe (--link, Kontrast 5:1), nie das reine CD-Grün (2,5:1). */
:root {
  --cd-anthracite: #3c413d;
  --cd-black: #231f20;
  --cd-yellow: #ebc900;
  --cd-green: #4fb848;
  --cd-cyan: #00accd;
  --cd-magenta: #ed0677;
  --cd-light: #f2f3f2;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: var(--cd-light);
  --border: #e3e5e3;
  --text: var(--cd-anthracite);
  --heading: var(--cd-black);
  --muted: #747a76;
  --accent: var(--cd-green);
  --accent-hover: #45a63f;
  --accent-ink: var(--cd-black);
  --accent-soft: #e9f6e7;
  --link: #2e7d28;
  --ok: #2e7d28;
  --ok-soft: #e9f6e7;
  /* Hinweise (Probeschüler, offen, entschuldigt): CD-Gelb als Fläche, Anthrazit als Schrift */
  --warn: var(--cd-anthracite);
  --warn-soft: #faf0b4;
  /* Warnungen/Fehler im CD-Magenta (wie die vierte Linie unter dem Logo):
     Flächen exakt #ed0677, Schrift eine Spur dunkler (#d1006a), damit sie gut lesbar ist (5:1) */
  --bad-fill: var(--cd-magenta);
  --bad: #d1006a;
  --bad-soft: #fff6fa;
  --info-soft: #f0f0f0;
  --side: #121212;
  --side-text: #bdbdbd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --font: "Ainslie Sans", "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d; --surface: #171717; --surface-2: #1f1f1f; --border: #2c2c2c;
    --text: #d6d8d6; --heading: #ffffff; --muted: #8f948f; --accent-soft: #1c3a1a; --link: #6fcf67;
    --ok: #6fcf67; --ok-soft: #173016; --warn: #f2d84d; --warn-soft: #3a3417;
    --bad: #ff5cab; --bad-soft: #2a1420; --info-soft: #1f1f1f; --side: #000000;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font);
}
a { color: inherit; }
a.link, .link a, td a { color: var(--link); text-decoration: none; font-weight: 500; }
a.link:hover, td a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1 { font-size: 1.9rem; font-weight: 300; margin: 0; letter-spacing: -.01em; color: var(--heading); line-height: 1.2; }
h1 strong { font-weight: 700; }
h2 { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 .75rem; color: var(--heading); }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-text); padding: 1.5rem .85rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  /* angedeutete Beton-Struktur wie im Header der Homepage */
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .06), transparent 45%),
                    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, .04), transparent 50%);
}
.brand { color: #fff; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; padding: 0 .6rem 1.5rem; display: flex; gap: .65rem; align-items: center; line-height: 1.3; }
/* Logo (schwarz, transparent) – auf dunklem Grund als Negativ */
.logo-full { display: block; width: 100%; height: auto; }
.logo-negative { filter: invert(1); }
.brand .logo-full { max-width: 200px; margin: 0 auto; }
.nav a { display: flex; gap: .6rem; align-items: center; padding: .55rem .8rem; border-radius: 99px; text-decoration: none; color: var(--side-text); margin-bottom: 3px; font-size: .92rem; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: .75rem .5rem; }
.nav .count { margin-left: auto; background: var(--bad-fill); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 .45rem; font-weight: 600; }
.sidebar .user { margin-top: auto; padding: .75rem .65rem 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.sidebar .user form { display: inline; }
.sidebar .user button { background: none; border: 0; color: var(--side-text); padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
main { padding: 1.5rem 2rem 3rem; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: .15rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 1rem; }
.grid > .card + .card, .grid > * > .card:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; gap: .5rem; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi .value { font-size: 2.3rem; font-weight: 300; letter-spacing: -.02em; line-height: 1.1; color: var(--heading); }
.kpi .label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; margin-top: .3rem; }
/* mehrere Kennzahlen in einer Karte (z. B. Anwesenheit auf der Schülerseite) */
.kpi-row { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }
.kpi-row .kpi .value { font-size: 1.9rem; }
.kpi-row .kpi .label { letter-spacing: .04em; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--border); align-items: center; }
.list li:first-child { border-top: 0; }
/* Prüfung im Kurs: Kinder je Kurs aufklappbar (einzeln an-/abmelden) */
.list li:has(> details.kids) { flex-wrap: wrap; }
.list li > details.kids { flex-basis: 100%; margin: -.1rem 0 .1rem; }
.list li > details.kids summary { cursor: pointer; width: fit-content; }
.list li > details.kids .list { margin: .35rem 0 .2rem 1rem; padding-left: .9rem; border-left: 2px solid var(--border); }
.list li > details.kids .list li { padding: .35rem 0; }
/* Datum rechts in Listen: feste Breite, rechtsbündig – so stehen Plaketten davor sauber untereinander.
   (Keine „tabular-nums“ für ganze Zeilen: die Schrift macht damit auch Leerzeichen und Punkte breit.) */
.list .date { display: inline-block; min-width: 5.4em; text-align: right; }
.empty { color: var(--muted); font-size: .9rem; padding: .25rem 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tr.clickable { cursor: pointer; }

/* Forms */
.btn { display: inline-flex; align-items: center; gap: .45rem; border: 1px solid #c9c9c9; background: transparent; color: var(--heading); padding: .55rem 1.2rem; border-radius: 99px; font: inherit; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--heading); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Pfeil als gezeichnete Form statt Schriftzeichen – sitzt so exakt mittig */
.btn-primary::after { content: ""; flex: none; width: 18px; height: 10px; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn-sm.btn-primary::after { content: none; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: .3rem .8rem; font-size: .66rem; }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], input[type=password], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit;
}
/* Fokus: ein Rahmen statt Rand + Außenlinie übereinander */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(79, 184, 72, .3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
/* Auswahlfelder mit eigenem, ruhigem Pfeil statt Systempfeil – derselbe Pfeil steht in admin.css */
select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23858a86' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; background-size: 12px 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.field .errorlist { color: var(--bad); list-style: none; padding: 0; margin: .25rem 0 0; font-size: .85rem; }
.field.check { display: flex; align-items: center; gap: .5rem; }
.field.check label { margin: 0; }
.checks ul, .checks > div { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem .75rem; }
.checks label { font-weight: 400; display: flex; gap: .45rem; align-items: center; font-size: .9rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; margin: 0 0 1rem; background: var(--surface); }
/* Abschnittsüberschrift innerhalb der Karte statt auf der Rahmenkante */
legend { float: left; width: 100%; padding: 0 0 .7rem; margin: 0 0 .9rem; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--heading); }
legend + * { clear: both; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { max-width: 280px; }
.filters select { width: auto; }
.tariff-fit { margin-top: .15rem; font-size: .74rem; color: var(--muted); }
.tariff-fit::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cd-yellow); margin-right: .35rem; vertical-align: middle; }
.inline-form { display: inline; }

/* Badges, belts, chips */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 99px; background: color-mix(in srgb, var(--c, #888) 18%, transparent); color: color-mix(in srgb, var(--c, #888) 55%, #000); border: 1px solid color-mix(in srgb, var(--c, #888) 45%, transparent); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .badge { color: color-mix(in srgb, var(--c, #888) 60%, #fff); } }
/* Programm: nur der Name in normaler Schrift */
.prog { white-space: nowrap; }
td .prog + .prog::before { content: "· "; color: var(--muted); }
.status { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; white-space: nowrap; }
.status-aktiv, .status-bestanden, .status-anwesend, .status-bezahlt, .status-eingezogen { background: var(--ok-soft); color: var(--ok); }
.status-probe, .status-offen, .status-entschuldigt { background: var(--warn-soft); color: var(--warn); }
.status-ehemalig, .status-storniert { background: var(--surface-2); color: var(--muted); }
.status-unentschuldigt, .status-nicht_bestanden, .status-ruecklastschrift, .status-gekuendigt { background: var(--bad-soft); color: var(--bad); }
.belt { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; vertical-align: middle; }
.belt-band { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); display: inline-block; overflow: hidden; flex: none; }
/* Streifen horizontal in der Mitte: Stufe bei TaeKi, nächsthöherer Gürtel bei Zwischen-Kups */
.belt-stripe { position: absolute; left: 0; right: 0; top: 50%; height: 6px; transform: translateY(-50%); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15); }
.belt-lg .belt-stripe { height: 9px; }
.belt-lg .belt-band { width: 28px; height: 28px; }
.belt-name { font-size: .88rem; }
/* geknoteter Gürtel (aus der TaeKi-Gürtelgrafik) */
.belt-knot { flex: none; width: 26px; height: 24px; display: block; overflow: visible; }
.belt-lg .belt-knot { width: 38px; height: 35px; }
.tag { display: inline-block; font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 .4rem; margin-right: .2rem; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: var(--info-soft); }
.messages .success { background: var(--ok-soft); color: var(--ok); }
.messages .error { background: var(--bad-soft); color: var(--bad); }
.messages .warning { background: var(--warn-soft); color: var(--warn); }
.note-box { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .75rem; }
.alert-box { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .75rem; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .85rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.tabs a.active { color: var(--heading); border-bottom: 3px solid var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Student header */
.profile-head { display: flex; gap: 1rem; align-items: center; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--side); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 1.1rem; letter-spacing: .05em; flex: none; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; }
.dl-compact { grid-template-columns: auto 1fr; }

/* Progress */
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--heading); }
.progress.done span { background: var(--accent); }

/* Course plan */
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.day h2 { color: var(--muted); }
.course-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.course-card .time { font-weight: 700; }
.course-card .meta { color: var(--muted); font-size: .8rem; }

/* Attendance */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: .4rem .9rem; cursor: pointer; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--muted); border-left: 1px solid var(--border); user-select: none; }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label.p { background: var(--accent); color: var(--accent-ink); }
.seg input:checked + label.e { background: var(--cd-yellow); color: var(--cd-black); }
.seg input:checked + label.a { background: var(--bad-fill); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: 100%; max-width: 380px; }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; }
  .sidebar { position: static; height: auto; padding: .75rem; }
  .nav { display: flex; gap: .25rem; overflow-x: auto; }
  .nav a { margin: 0; white-space: nowrap; }
  .nav .sep, .sidebar .user { display: none; }
  .brand { padding-bottom: .5rem; justify-content: flex-start; }
  .brand .logo-full { max-width: 120px; margin: 0; }
  main { padding: 1rem 16px 2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: .4rem; }
}

/* Login im Look des Homepage-Headers */
.login-page { background: #121212 radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .08), transparent 45%) ; color: #fff; }
.login-page .card { background: #fff; color: #414141; border: 0; }
.login-page .tagline { text-align: center; margin-bottom: 1.5rem; }
.login-page .tagline .slogan { color: #d6d6d6; font-size: .95rem; margin: -1rem 0 0; }
.login-page .tagline .sub { color: #9a9a9a; font-size: .72rem; text-transform: uppercase; letter-spacing: .2em; margin-top: .5rem; }

/* Statistik & Diagramme (Farben auf Farbenblindheit geprüft: Grün/Blau, hell und dunkel) */
/* Diagramme: CD-Anthrazit mit CD-Grün (Zugänge, Einzelreihen) und CD-Magenta (Abgänge).
   Geprüft: Kontrast zur Fläche ≥ 3:1, farbenblind getrennt (ΔE 10). Die CD-Farben liegen fest, deshalb
   stehen Werte zusätzlich als Beschriftung und Tabelle da. */
:root { --series-1: var(--cd-green); --series-2: var(--cd-magenta); --chart-bg: #262a28; --chart-grid: #343a36;
  --chart-axis: #4a514c; --chart-tick: #9aa19c; --chart-value: #ffffff; }
.section-title { margin: 2rem 0 .8rem; font-size: .8rem; }
.section-title:first-of-type { margin-top: .5rem; }
.stat-grid .kpi .value { font-size: 2.1rem; margin-top: .35rem; }
.kpi .delta { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--bad); }
.chart-wrap { width: 100%; background: var(--chart-bg); border-radius: 14px; padding: 14px 12px 6px; box-sizing: border-box;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(0, 172, 205, .10), transparent 60%); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--chart-grid); stroke-width: 1; }
.chart .baseline { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tick { fill: var(--chart-tick); font-size: 11px; }
.chart .value { fill: var(--chart-value); font-size: 12px; font-weight: 600; }
.chart .line { fill: none; stroke-width: 2.5; filter: drop-shadow(0 0 5px rgba(79, 184, 72, .5)); stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s1 { stroke: var(--series-1); }
.chart .dot.s1 { fill: var(--series-1); stroke: var(--chart-bg); stroke-width: 2; }
.chart .bar.s1 { fill: var(--series-1); }
.chart .bar.s2 { fill: var(--series-2); }
.chart .crosshair { stroke: #5a5a5a; stroke-width: 1; opacity: 0; pointer-events: none; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit.on, .chart .hit:focus-visible { fill: #ffffff; fill-opacity: .06; }
.chart-tip { position: absolute; z-index: 10; background: var(--heading); color: var(--surface); padding: .35rem .6rem; border-radius: 8px; font-size: .8rem; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.legend { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend .key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: .4rem; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.legend .key.s1 { background: var(--series-1); }
.legend .key.s2 { background: var(--series-2); }
.table-view { margin-top: .6rem; font-size: .85rem; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
.table-view table { margin-top: .5rem; }
.num { white-space: nowrap; }
.stats-table td { padding: .7rem .6rem; }
.stats-table .total-row td { background: var(--surface-2); }
.share { height: 5px; background: var(--cd-anthracite); border-radius: 99px; margin-top: .4rem; max-width: 160px; overflow: hidden; }
.share span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }
.explain summary { cursor: pointer; }

/* Programm-Auswahl beim Schüler anlegen */
.program-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-btn { border: 1px solid #c9c9c9; background: transparent; color: var(--heading); border-radius: 99px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; }
.pill-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.pill-btn:hover { border-color: var(--heading); }
.pill-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill-btn.active::before { background: var(--accent-ink); }
.pill-btn:focus-visible { outline: 2px solid var(--heading); outline-offset: 2px; }
.course-group { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.nav .count.count-ok { background: var(--accent); color: #fff; }
.nav a.active .count { background: var(--cd-black); color: #fff; }
.status-gebucht { background: var(--info-soft); color: var(--heading); }
.status-erschienen { background: var(--ok-soft); color: var(--ok); }
.status-nicht_erschienen, .status-abgesagt { background: var(--surface-2); color: var(--muted); }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; background: var(--surface-2); white-space: pre; }

/* iPad-Anwesenheit: große Kacheln zum Antippen */
.att-summary { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.pill-stat { border-radius: 99px; padding: .35rem .9rem; font-size: .85rem; background: var(--surface-2); }
.pill-stat.present { background: var(--accent); color: var(--accent-ink); }
.pill-stat.excused { background: var(--warn-soft); color: var(--warn); }
.pill-stat.absent { background: var(--bad-soft); color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.tile { position: relative; text-align: left; border: 2px solid var(--border); border-radius: 16px; background: var(--surface); padding: .9rem; min-height: 110px; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: .4rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .08s; }
.tile-photo { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; margin-bottom: .2rem; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-initials { font-weight: 600; color: var(--muted); font-size: 1.3rem; }
.tile.st-unentschuldigt .tile-photo img { filter: grayscale(1); opacity: .6; }
.tile.st-entschuldigt .tile-photo img { opacity: .7; }
.photo-mode .tile { border-style: dashed; }
.photo-mode .tile-photo { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile.uploading { opacity: .5; }
.tile:active { transform: scale(.97); }
.tile-name { font-size: 1.15rem; font-weight: 600; color: var(--heading); line-height: 1.2; }
.tile-last { font-weight: 400; }
.tile-meta { display: flex; flex-wrap: wrap; gap: .25rem; }
.tile-status { margin-top: auto; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.tile.st-anwesend { border-color: var(--accent); }
.tile.st-anwesend .tile-status { color: var(--link); }
.tile.st-entschuldigt { border-color: var(--cd-yellow); background: var(--warn-soft); }
.tile.st-entschuldigt .tile-status { color: var(--warn); }
.tile.st-unentschuldigt { border-color: #f7a1c8; background: var(--bad-soft); }
.tile.st-unentschuldigt .tile-status { color: var(--bad); }
.course-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.course-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1.3rem 1.2rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--c); text-decoration: none; box-shadow: var(--shadow); }
.course-tile .ct-time { font-size: 1.8rem; font-weight: 300; color: var(--heading); }
.course-tile .ct-name { font-weight: 600; color: var(--heading); }
.course-tile .ct-meta { color: var(--muted); font-size: .85rem; }

/* QR-Poster */
.poster { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 18px; padding: 2.5rem 2rem; text-align: center; max-width: 560px; margin: 0 auto; }
.poster-logo { width: 220px; margin: 0 auto 1rem; display: block; }
.poster-title { font-size: 1.6rem; font-weight: 300; text-transform: none; letter-spacing: 0; color: #111; margin: 0 0 1.2rem; }
.poster-qr svg { width: 100%; max-width: 360px; height: auto; }
.poster-steps { text-align: left; display: inline-block; margin: 1.2rem auto 0; font-size: 1.05rem; line-height: 1.8; }
@media print {
  .sidebar, .no-print, .messages { display: none !important; }
  .layout { display: block; }
  main { padding: 0; }
  .poster { border: 0; max-width: none; padding-top: 3cm; }
  .poster-qr svg { max-width: 12cm; }
}

.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar { overflow: hidden; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.4rem; }
.photo-actions { display: flex; gap: .4rem; margin-top: .4rem; }

/* Kursauslastung auf der Übersicht */
.load-table th.c, .load-table td.c { text-align: center; }
.load-table td { padding: .45rem .5rem; }
.load-table .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.load-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: .35rem .5rem; border-radius: 10px; text-decoration: none; color: var(--heading); }
.load-cell:hover { background: var(--surface-2); }
.load-cell .num { font-weight: 600; font-size: .95rem; }
.load-cell .cap { color: var(--muted); font-weight: 400; font-size: .8rem; }
.load-cell .meter { width: 52px; height: 6px; border-radius: 99px; background: var(--cd-anthracite); overflow: hidden; }
.load-cell .meter span { display: block; height: 100%; border-radius: 99px; }
.lv-frei .meter span, .key.lv-frei { background: var(--cd-green); }
.lv-fast .meter span, .key.lv-fast { background: var(--cd-yellow); }
.lv-voll .meter span, .key.lv-voll { background: var(--cd-magenta); }
.lv-voll { background: var(--bad-soft); }
.lv-frei .meter span { box-shadow: 0 0 5px rgba(79, 184, 72, .55); }
@media (prefers-color-scheme: dark) { .load-cell .meter, .share { background: #343a36; } }
.load-cell .trend { font-size: .6rem; margin-left: 3px; vertical-align: 1px; }
.load-cell .trend.up { color: var(--ok); }
.load-cell .trend.down { color: var(--bad); }
.event-icon { display: inline-block; width: 1.5rem; }
.event-icon .trophy-icon, .event-icon .cake-icon { vertical-align: -4px; color: var(--heading); }
.today-badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: .05rem .55rem; font-weight: 600; }
.kpi .delta .up { color: var(--ok); }
.kpi .delta .down { color: var(--bad); }

/* Probetrainings von heute hervorheben */
.list li.is-today { background: var(--accent-soft); border-left: 4px solid var(--accent); margin: 0 -1.2rem; padding-left: calc(1.2rem - 4px); padding-right: 1.2rem; border-top-color: transparent; }
.list li.is-today + li { border-top-color: transparent; }
.list li.is-today .link { font-weight: 700; }
tr.is-today td { background: var(--accent-soft); }
tr.is-today td:first-child { box-shadow: inset 4px 0 0 var(--accent); }

/* Beton-Hintergrund wie auf der Homepage (dunkle Flächen) */
.sidebar, body.login-page {
  background-color: #2b2f2c;
  background-image: url("../img/beton.jpg");
  background-size: cover;
  background-position: center top;
}
.sidebar { background-attachment: local; }
body.login-page { background-attachment: fixed; }

/* Heller Beton-Hintergrund für den Inhaltsbereich (nur im hellen Modus; Karten bleiben weiß) */
@media (prefers-color-scheme: light) {
  body:not(.login-page):not(.public) {
    background-color: #f2f2f2;
    background-image: linear-gradient(rgba(250, 250, 250, .35), rgba(250, 250, 250, .35)), url("../img/beton-hell.jpg");
    background-size: cover;
    background-attachment: fixed;
  }
}

/* Plus-Zeichen in Buttons als gezeichnete Form – sitzt exakt mittig */
.btn .plus { flex: none; width: 10px; height: 10px; background-color: currentColor;
  -webkit-mask: linear-gradient(#000 0 0) center / 100% 1.6px no-repeat, linear-gradient(#000 0 0) center / 1.6px 100% no-repeat;
  mask: linear-gradient(#000 0 0) center / 100% 1.6px no-repeat, linear-gradient(#000 0 0) center / 1.6px 100% no-repeat; }

/* Tarifauswahl (Vertrag ändern) */
.tariff-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.field label.tariff-option, .tariff-option { display: flex; align-items: center; gap: .75rem; margin: 0; border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; background: var(--surface); font-size: .95rem; font-weight: 400; }
.tariff-option:hover { border-color: var(--heading); }
.tariff-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.tariff-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--link); }
.tariff-text { display: flex; flex-direction: column; gap: .15rem; line-height: 1.3; }
.tariff-meta { color: var(--muted); font-size: .85rem; }
.tariff-more { margin-top: .8rem; }
.tariff-more summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.change-history { list-style: none; padding: 0; margin: .4rem 0 0; font-size: .9rem; }
.change-history li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem 0; border-top: 1px dashed var(--border); }

/* Vertragskarte auf der Schülerseite */
.contract-fee { margin-top: .6rem; }
.contract-fee-amount { font-size: 1.5rem; font-weight: 600; color: var(--heading); }
.contract-planned { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap;
  margin-top: .6rem; padding: .55rem .8rem; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; font-size: .9rem; }
.contract-planned-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); margin-right: .35rem; }
.contract-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem 1.5rem; margin: .9rem 0 0;
  padding-top: .9rem; border-top: 1px dashed var(--border); }
.contract-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); margin-bottom: .2rem; }
.contract-facts dd { margin: 0; }
.contract-sub { margin-top: .9rem; }
.contract-sub h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); margin: 0; }
.contract-history summary { cursor: pointer; width: fit-content; }

/* Erkennungszeichen aus dem CD: vier feine Linien in Gelb, Grün, Cyan, Magenta */
.cd-lines { height: 11px; background:
  linear-gradient(var(--cd-yellow) 0 0) 0 0 / 100% 1.5px no-repeat,
  linear-gradient(var(--cd-green) 0 0) 0 3px / 100% 1.5px no-repeat,
  linear-gradient(var(--cd-cyan) 0 0) 0 6px / 100% 1.5px no-repeat,
  linear-gradient(var(--cd-magenta) 0 0) 0 9px / 100% 1.5px no-repeat; }
.brand + .cd-lines { margin: -.6rem .6rem 1.4rem; border-radius: 2px; }
@media (max-width: 820px) { .brand + .cd-lines { display: none; } }

/* Probetraining eintragen: freie Termine als Karten */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .5rem; }
.slot-time { color: var(--heading); }
.slot-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; cursor: pointer; }
.slot-card:hover { border-color: var(--heading); }
.slot-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: var(--accent-soft); }
.slot-card strong { color: var(--heading); }
.slot-free { flex-basis: 100%; font-size: .78rem; color: var(--muted); }

/* Nachrichten-Listen (Probetraining): Text links, feste Aktionsspalte rechts, lange Zeilen mit „…“ */
.msg-list li { align-items: center; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.msg-main > a, .msg-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-sub { font-size: .82rem; color: var(--muted); }
.msg-actions { flex: none; display: flex; align-items: center; gap: .5rem; white-space: nowrap; }

/* Vorjahresvergleich unter Kennzahlen */
.kpi .delta.prev { color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.kpi .value .unit { font-size: .45em; color: var(--muted); font-weight: 400; margin-left: .15em; }
.table-view td.up { color: var(--ok); }
.table-view td.down { color: var(--bad); }

/* Auswahl-Kacheln (Radio/Checkbox als Karte), z. B. Vertragspartner, Ersatztermine im Portal */
.slot-list { display: grid; gap: .5rem; }
.slot-option { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; }
.slot-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.slot-option input { width: 20px; height: 20px; accent-color: var(--link); }

/* Kursplan: Kachel öffnet die Teilnehmerliste */
a.course-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.course-link:hover { border-color: var(--c, var(--accent)); transform: translateY(-1px); }
.week-nav { display: flex; gap: 1.2rem; margin-top: .35rem; }

/* Änderungsantrag aus der Mitglieder-App auf der Schülerseite */
.note-box.change-request { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* --- Prüfung in drei Schritten (Anmelden · Prüfungslisten · Ergebnisse und Gebühren) ----------- */
.belt-sm .belt-band { width: 16px; height: 16px; }
.belt-sm { font-size: .88rem; gap: .35rem; }
.exam-steps { display: flex; gap: .4rem; margin: 0 0 1rem; flex-wrap: wrap; }
.exam-steps a { padding: .55rem 1rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .85rem; }
.exam-steps a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.exam-days { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1rem; }
.exam-days a { padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--border); text-decoration: none;
  color: var(--text); font-size: .85rem; background: var(--surface); }
.exam-days a span { color: var(--muted); margin-left: .25rem; }
.exam-days a.active { border-color: var(--heading); color: var(--heading); font-weight: 600; }
details.exam-course { padding: .2rem 1.2rem; }
details.exam-course + details.exam-course { margin-top: .6rem; }
details.exam-course summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer;
  list-style: none; padding: .8rem 0; }
details.exam-course summary::-webkit-details-marker { display: none; }
.exam-course-title { font-weight: 600; color: var(--heading); }
.exam-course-title::before { content: "›"; display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s; }
details[open] .exam-course-title::before { transform: rotate(90deg); }
.exam-course-count { font-size: .82rem; color: var(--muted); white-space: nowrap; }
details.exam-course[open] { padding-bottom: 1rem; }
.exam-kids { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.exam-kids li { display: grid; grid-template-columns: 30px minmax(0, 1fr) 12.5rem minmax(0, 9rem); gap: .7rem; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--border); }
.exam-kids li form { margin: 0; }
.exam-kids .kid-name { color: var(--muted); }
.exam-kids li.is-on .kid-name { color: var(--heading); font-weight: 600; }
.exam-kids .kid-note { font-size: .78rem; color: var(--muted); text-align: right; }
.exam-kids .kid-note span[title] { color: var(--bad); }
.kid-toggle { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; padding: 0; display: grid; place-items: center; }
.kid-toggle:hover { border-color: var(--link); }
.kid-toggle.on { background: var(--accent); border-color: var(--accent); }
.kid-toggle.on::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); }
.kid-toggle.elsewhere { border-style: dashed; }
.exam-list-day + .exam-list-day { margin-top: 1rem; }
.exam-list-block { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 1.1rem 0 .4rem; }
.exam-list-day h2 + .exam-list-block, form > .exam-list-block:first-of-type { margin-top: .4rem; }
table.exam-list td, table.exam-list th { padding: .45rem .5rem; }
.print-only { display: none; }
.exam-results { list-style: none; margin: 0; padding: 0; }
.exam-results li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.result-seg label { padding: .45rem .8rem; }
.fee-field { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.fee-field input { width: 5.2rem; text-align: right; padding: .4rem .5rem; }
.exam-results-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.exam-results-foot ul { list-style: none; margin: 0; padding: 0; line-height: 1.5; }
.exam-results-foot strong { color: var(--text); font-weight: 600; }
.exam-results-foot .btn { margin-left: auto; }
@media (max-width: 720px) {
  .exam-results li { grid-template-columns: 1fr; gap: .5rem; }
  .exam-kids li { grid-template-columns: 30px minmax(0, 1fr) 11rem; }
  .exam-kids .kid-note { grid-column: 2 / -1; text-align: left; }
}
@media print {
  .print-only { display: table-cell; }
  .exam-list-day { break-after: page; border: 0; box-shadow: none; padding: 0; }
  .exam-list-day:last-of-type { break-after: auto; }
  table.exam-list td { height: 2rem; border-bottom: 1px solid #999; }
  /* Kästchen zum Abhaken von Hand */
  table.exam-list td:not(.print-only) { white-space: nowrap; }
  table.exam-list .check-col { width: 5.5rem; text-align: center; }
  table.exam-list .check-box { display: inline-block; width: 1rem; height: 1rem; border: 1.5px solid #231f20; border-radius: 3px; vertical-align: middle; }
}
.result-seg input:checked + label:not(.p):not(.a) { background: var(--surface-2); color: var(--heading); }
.exam-results .result-seg, .exam-results .fee-field { justify-self: start; }
.exam-kids .kid-note span.credit-note[title] { color: var(--link); }
/* Prüfungslisten: Gürtel-Zeile und Druck (eine Seite pro Kurszeit) */
.belt-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin: 2rem 0 .4rem; font-size: .92rem; }
.belt-count { display: inline-flex; align-items: center; gap: .3rem; }
.print-only-block { display: none; }
@media print {
  .print-only-block { display: flex; }
  .exam-print-head { justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 2px solid #231f20;
    padding-bottom: .4rem; margin-bottom: .6rem; font-size: 1.05rem; }
  .exam-list-day { break-after: auto !important; }
  /* oben Platz für die Klemme des Klemmbretts; die Seite selbst hat beim Listendruck keinen Rand */
  .exam-print-page { break-after: page; break-inside: avoid-page; padding: 3cm 1.5cm 1.2cm; }
  .exam-list-day:last-of-type .exam-print-page:last-child { break-after: auto; }
  .belt-band, .belt svg, .belt-knot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.exam-kids .kid-rank { justify-self: start; }
.exam-kids .kid-units { font-size: .74rem; font-weight: 400; color: var(--muted); margin-left: .35rem; font-variant-numeric: tabular-nums; }
.exam-kids .kid-units.is-short { color: var(--bad); }
.exam-kids .kid-units.is-ok { color: var(--ok); font-weight: 600; }
/* Trainingsumfang laut Tarif: Basis ●○○ · Standard ●●○ · Plus ●●● */
.level-dots { display: inline-flex; gap: 2px; margin-left: .35rem; vertical-align: middle; }
.level-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.level-dots i.on { background: var(--accent); }
h1 .level-dots { gap: 3px; margin-left: .6rem; }
h1 .level-dots i { width: 8px; height: 8px; }
/* Gast hinzufügen: Suche beim Tippen */
.guest-search { position: relative; }
.guest-list { list-style: none; margin: .4rem 0 0; padding: .3rem; max-width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.guest-list li { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; }
.guest-list li:hover, .guest-list li:focus { background: var(--accent-soft); outline: none; }
.guest-list li.empty { cursor: default; color: var(--muted); }
/* Schülerseite: Trainingstage ändern */
.day-change { margin-top: .6rem; }
.day-change summary { cursor: pointer; }
.day-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; margin-top: .6rem; }
.day-option { display: flex; gap: .45rem; align-items: flex-start; padding: .45rem .55rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.day-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.day-option input { margin-top: .2rem; }
.group-choose { list-style: none; margin: 0; padding: 0; }
.group-choose a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem .2rem;
  border-top: 1px solid var(--border); text-decoration: none; color: var(--heading); }
.group-choose li:first-child a { border-top: 0; }
.group-choose .status { margin-left: .4rem; }

/* Statistik: Tarife je Programm (Basis/Standard/Plus wie die Punkte, heller = weniger Kurse) */
.tariff-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); min-width: 160px; }
.tariff-bar span { display: block; height: 100%; background: var(--accent); }
.tariff-bar .basis { opacity: .35; }
.tariff-bar .standard { opacity: .65; }
.tariff-legend { display: inline-flex; align-items: center; gap: .3rem; margin-right: .8rem; }
.tariff-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); display: inline-block; }
.tariff-legend i.basis { opacity: .35; }
.tariff-legend i.standard { opacity: .65; }
.exam-own-time { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 .2rem; }
.kid-legend-short { color: var(--bad); font-weight: 600; }
.exam-kids .kid-units { white-space: nowrap; }

/* Verkauf: Artikel als Kacheln zum Antippen */
.sale-tile { min-height: 96px; }
.sale-tile input { position: absolute; opacity: 0; pointer-events: none; }
.sale-tile:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.sale-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.sale-price { margin-top: auto; font-weight: 700; color: var(--heading); }
.sale-opts { display: flex; gap: .4rem; margin-top: .3rem; }
.sale-opts select { flex: 1; min-width: 0; padding: .3rem .5rem; font-size: .85rem; }
.sale-tile:has(input:checked)::after { content: "✓"; position: absolute; top: .6rem; right: .8rem; font-weight: 700; color: var(--link); }

/* Chat (Verwaltung und App): Verlauf als Sprechblasen */
.chat-log { display: flex; flex-direction: column; gap: .5rem; padding: .25rem 0; }
.chat-day { align-self: center; font-size: .75rem; color: var(--muted); margin: .5rem 0 .1rem; }
.chat-bubble { max-width: min(80%, 34rem); padding: .55rem .8rem; border-radius: 14px; background: var(--surface-2); color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-bubble.mine { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-meta { display: block; font-size: .72rem; color: var(--muted); margin-top: .2rem; text-align: right; white-space: normal; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; margin-top: .75rem; }
.chat-form textarea { flex: 1; min-height: 2.6rem; max-height: 10rem; resize: vertical; }
.chat-hint { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.push-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  background: var(--surface-2); border-radius: 10px; padding: .55rem .8rem; margin-bottom: .75rem; }
.push-toggle [hidden] { display: none; }


/* Statistik: lesefreundlicher (größere Beschriftungen, ruhigere Abstände, gleich große Diagrammschrift) */
.stats-page .section-title { margin: 2.6rem 0 1rem; font-size: .85rem; letter-spacing: .14em; display: flex; align-items: center; gap: .9rem; }
.stats-page .section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.stats-page .page-head + .section-title { margin-top: 1rem; }
.stats-page .grid { gap: 1.1rem; }
.stats-page .stat-grid .kpi { padding: 1.15rem 1.3rem 1.2rem; display: flex; flex-direction: column; }
.stats-page .kpi .label { font-size: .78rem; letter-spacing: .08em; color: var(--text); font-weight: 600; margin-top: 0; }
.stats-page .stat-grid .kpi .value { font-size: 2.5rem; margin: .45rem 0 .35rem; }
.stats-page .kpi .delta { font-size: .9rem; line-height: 1.5; color: var(--muted); margin-top: auto; }
.stats-page .kpi .delta strong { color: var(--text); font-weight: 600; }
.stats-page a.card.kpi:hover { box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.stats-page .chart-card .card-head { margin-bottom: .8rem; }
.stats-page .chart-card .card-head h2 { font-size: .85rem; }
.stats-page .chart .tick { font-size: 15px; }
.stats-page .chart .value { font-size: 16px; }
.stats-page .chart-only-narrow, .stats-page .chart-mobile { display: none; }
.stats-page .legend { font-size: .85rem; color: var(--text); gap: .3rem .9rem; }
.stats-page .legend-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.stats-page .legend-item .key { margin-left: 0; }
.stats-page .chart-card .card-head { flex-wrap: wrap; }
.stats-page .table-view summary { font-size: .85rem; margin-top: .2rem; }
.stats-page .stats-table th { font-size: .72rem; letter-spacing: .08em; padding: .8rem .7rem; white-space: nowrap; }
.stats-page .stats-table td { padding: .85rem .7rem; font-size: .95rem; }
.stats-page .stats-table tbody tr:not(.total-row):hover td { background: var(--surface-2); }
.stats-page .stats-table th:first-child, .stats-page .stats-table td:first-child { padding-left: 1.3rem; }
.stats-page .stats-table th:last-child, .stats-page .stats-table td:last-child { padding-right: 1.3rem; }
.stats-page .table-note { font-size: .85rem; line-height: 1.55; color: var(--muted); padding: .9rem 1.3rem 1.1rem; margin: 0; }
.stats-page .explain .dl { grid-template-columns: 200px 1fr; gap: .55rem 1.2rem; line-height: 1.5; }
.stats-page .explain .dl dt { color: var(--text); font-weight: 600; font-size: .9rem; }
.stats-page .explain .dl dd { color: var(--muted); font-size: .92rem; }
.stats-page .share { background: var(--surface-2); height: 4px; }
.stats-page .stats-table tr.is-empty td { color: var(--muted); }
.stats-page .stats-table tr.is-empty td strong { font-weight: 400; }
@media (prefers-color-scheme: dark) { .stats-page .share { background: #2c2c2c; } }
.stats-page .cancel-card { margin-top: 1.1rem; }
.stats-page .stats-table td.up { color: var(--ok); }
.stats-page .stats-table td.down { color: var(--bad); font-weight: 600; }
.stats-page .cancel-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.stats-page .stats-table.compact td { padding: .55rem .7rem; }
.stats-page .stats-table.compact th:first-child, .stats-page .stats-table.compact td:first-child { padding-left: .7rem; }
.stats-page .cancel-card .table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stats-page .cancel-reasons h3 { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin: .2rem 0 .5rem; }
.stats-page .cancel-reasons .list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; font-size: .92rem; }
.stats-page .reason-name { flex: 1; min-width: 0; }
.stats-page .reason-list .share { max-width: none; margin-top: .35rem; }
.stats-page .cancel-card .table-note { padding: .9rem 0 0; }
.stats-page .stats-table th .th-sub, .stats-page .table-view th .th-sub { display: block; font-size: .68rem; font-weight: 400;
  letter-spacing: .02em; text-transform: none; color: var(--muted); margin-top: .15rem; }
.stats-page .th-select { display: block; width: auto !important; min-width: 0; margin: .3rem 0 0 auto; font: inherit; font-size: .72rem;
  font-weight: 400; letter-spacing: .02em; text-transform: none; color: var(--text); background-color: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: .2rem 1.4rem .2rem .45rem; cursor: pointer;
  background-position: right .45rem center; background-size: 9px 6px; }
.stats-page .th-select:hover { border-color: var(--accent); }
.stats-page .chart-compare { margin: -.3rem 0 .7rem; font-size: .92rem; color: var(--muted); }
.stats-page .chart-compare strong { color: var(--heading); font-size: 1.05rem; }
.stats-page .chart-compare .up { color: var(--ok); }
.stats-page .chart-compare .down { color: var(--bad); }
@media (max-width: 1100px) {
  .stats-page .chart-wide { display: none; }
  .stats-page .chart-only-narrow { display: block; }
}
@media (max-width: 960px) {
  .stats-page .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-page .cancel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats-page .chart-wide, .stats-page .chart-normal, .stats-page .chart-only-narrow { display: none; }
  .stats-page .chart-mobile { display: block; }
  .stats-page .chart-wrap { padding: 10px 6px 4px; }
  .stats-page .stat-grid { grid-template-columns: 1fr; }
  .stats-page .stat-grid .kpi .value { font-size: 2.2rem; }
  .stats-page .explain .dl { grid-template-columns: 1fr; }
}

/* Streifen „Testumgebung“ oben auf jeder Seite */
.environment-banner { position: sticky; top: 0; z-index: 1000; background: var(--cd-yellow); color: var(--cd-black);
  text-align: center; font-size: .85rem; font-weight: 600; padding: .35rem 1rem; }
