/* =====================================================================
   Hausaufgabenbetreuung ASV – Design-System
   Liquid-Glass-Optik, ASV-Markenfarben, automatisches Hell/Dunkel-Theme.
   ===================================================================== */

:root {
  /* ASV-Markenfarben */
  --asv-blau:  #0C76B4;
  --asv-rot:   #9C0F06;
  --asv-teal:  #1A8573;
  --accent:    #7C5CFF;   /* Aktion/Interaktion (Buttons) */
  --accent-ink:#ffffff;

  /* Helles App-Theme (Dashboards) */
  /* Heller, kühler Grundton mit leichtem Bezug zum Schulblau. Bewusst
     stark entsättigt: Auf Beamer, iPad in der Sonne und schlecht
     kalibrierten Lehrerzimmer-Monitoren sehen helle, blasse Töne überall
     gleich aus — kräftige kippen je nach Gerät. */
  --bg:        #e9eef7;
  --bg-grad-1: #eaf0fa;
  --bg-grad-2: #dde7f4;
  --surface:   #ffffff;
  --surface-2: #f5f6fb;
  --border:    #e6e8f0;
  --text:      #1c2030;
  --muted:     #5d6478;
  --shadow:    0 10px 30px rgba(28, 32, 48, 0.08);
  --radius:    18px;
  --radius-sm: 12px;

  /* Statusfarben */
  --ok:    #1E9E5A;
  --ok-bg: #e7f6ee;
  --warn:  #E4592B;
  --warn-bg:#fdece4;
  --info:  #2F6FEC;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0c1018;
    --bg-grad-1: #0e1420;
    --bg-grad-2: #0a0f18;
    --surface:   #161b26;
    --surface-2: #1d2330;
    --border:    #2a3140;
    --text:      #eef1f7;
    --muted:     #9aa3b6;
    --shadow:    0 10px 30px rgba(0, 0, 0, 0.35);
    --ok-bg:  #12281d;
    --warn-bg:#2a1b13;
  }
}

/* Explizite Theme-Umschaltung (setzt System-Default außer Kraft) */
:root[data-theme="dark"] {
  --bg:#0c1018; --bg-grad-1:#0e1420; --bg-grad-2:#0a0f18; --surface:#161b26;
  --surface-2:#1d2330; --border:#2a3140; --text:#eef1f7; --muted:#9aa3b6;
  --shadow:0 10px 30px rgba(0,0,0,0.35); --ok-bg:#12281d; --warn-bg:#2a1b13;
}
:root[data-theme="light"] {
  --bg:#e9eef7; --bg-grad-1:#eaf0fa; --bg-grad-2:#dde7f4; --surface:#fff;
  --surface-2:#f5f6fb; --border:#e6e8f0; --text:#1c2030; --muted:#5d6478;
  --shadow:0 10px 30px rgba(28,32,48,0.08); --ok-bg:#e7f6ee; --warn-bg:#fdece4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 620px at 12% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(780px 620px at 108% 4%, color-mix(in srgb, var(--asv-blau) 15%, transparent), transparent 58%),
    radial-gradient(820px 720px at 82% 108%, color-mix(in srgb, var(--asv-teal) 13%, transparent), transparent 60%),
    radial-gradient(700px 600px at -6% 96%, color-mix(in srgb, var(--asv-rot) 5%, transparent), transparent 62%),
    linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
/* Navigation und Aktionen sind Flächen, keine Fließtext-Links — die
   Unterstreichung ließ die Kopfzeile wie eine Linkliste aussehen. */
.chip, .btn, .kiosk-foot a { text-decoration: none; }
h1, h2, h3 { margin: 0 0 .3em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.02em; }

/* ---------- Layout-Helfer ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 28px) 60px; }
.grid { display: grid; gap: 18px; align-items: stretch; }
.grid > .card { display: flex; flex-direction: column; }
.row  { display: flex; gap: 14px; flex-wrap: wrap; }
.between { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
/* In Karten soll der Status rechts BLEIBEN statt unter den Titel zu rutschen. */
.card > .between { flex-wrap: nowrap; align-items: flex-start; }
.card > .between > :first-child { min-width: 0; }
.card > .between > .badge { flex: none; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* Zweispaltiges Layout (Inhalt + Seitenleiste), das auf Tablet/Handy
   sauber untereinander klappt – statt die Tabelle zu quetschen. */
.cols-main { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
@media (max-width: 1000px) { .cols-main { grid-template-columns: 1fr; } }

/* ---------- Karten / Glas ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.glass {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; transition: transform .06s ease, box-shadow .2s ease, background .2s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 15px 24px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Formulare ---------- */
label { font-weight: 600; font-size: .92rem; display: block; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=time],
input[type=date], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }

/* ---------- Badges / Chips ---------- */
.badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:.82rem; font-weight:600; }
.badge-ok   { background: var(--ok-bg);  color: var(--ok); }
.badge-warn { background: var(--warn-bg);color: var(--warn); }
.badge-info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.badge-accent{ background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.chip {
  display:inline-flex; align-items:center; gap:8px; padding:9px 15px; border-radius:999px;
  border:1px solid var(--border); background: var(--surface); cursor:pointer; font-weight:600; font-size:.92rem;
}
.chip.active { background: var(--accent); color:#fff; border-color: var(--accent); }

/* ---------- Avatare ---------- */
.avatar { display:block; border-radius: 26%; }

/* ---------- Flash-Meldungen ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.flash-ok   { background: var(--ok-bg);   color: var(--ok); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }

/* =====================================================================
   KIOSK (iPad) – immersive, kindgerechte, dunkle Glas-Oberfläche
   ===================================================================== */
body.kiosk {
  background:
    radial-gradient(1100px 780px at 6% -10%, rgba(156,15,6,0.34), transparent 56%),
    radial-gradient(1050px 820px at 106% -4%, rgba(12,118,180,0.36), transparent 56%),
    radial-gradient(1150px 950px at 50% 122%, rgba(26,133,115,0.32), transparent 56%),
    radial-gradient(760px 640px at 88% 60%, rgba(124,92,255,0.20), transparent 60%),
    linear-gradient(160deg, #0b0f16, #090c12);
  background-size: 160% 160%;
  color: #f4f7fb;
  min-height: 100vh;
  animation: kioskDrift 34s ease-in-out infinite alternate;
}
@keyframes kioskDrift {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 90% 60%, 0 0; }
  100% { background-position: 8% 6%, 92% 8%, 46% 92%, 82% 52%, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.kiosk { animation: none; }
}
.kiosk .k-wrap { max-width: 1500px; margin: 0 auto; padding: clamp(20px, 4vw, 48px); padding-bottom: 90px; }
.kiosk h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; }
.kiosk .sub { color: #aeb8c9; font-size: clamp(1rem, 1.6vw, 1.25rem); margin-top: 4px; }

.k-search {
  display:flex; align-items:center; gap:14px; justify-content:center;
  background:#fff; color:#1c2030; border:none; border-radius:999px;
  padding: 20px 30px; font-size: 1.35rem; font-weight: 700; width: min(680px, 92%);
  margin: 6px auto 8px; box-shadow: 0 18px 50px rgba(0,0,0,0.35); cursor: pointer;
}
.k-search svg { opacity:.7; }

.streak-badge {
  display:inline-flex; align-items:center; gap:12px;
  background: color-mix(in srgb, #ffffff 10%, transparent);
  border:1px solid rgba(255,255,255,0.16); border-radius:18px; padding:14px 20px;
  backdrop-filter: blur(14px);
}
.streak-badge .flame { font-size: 1.7rem; }
.streak-badge b { font-size: 1.5rem; display:block; line-height:1; }
.streak-badge small { color:#aeb8c9; }

.k-section-title { display:flex; align-items:center; gap:10px; color:#c7d0de; font-weight:700; font-size:1.15rem; margin: 26px 0 14px; }

.tiles { display:grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.tile {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px; padding: 18px 14px; text-align:center;
  cursor: pointer; transition: transform .12s ease, background .2s, border-color .2s;
  display:flex; flex-direction:column; align-items:center; gap:10px; position:relative;
}
.tile:hover { transform: translateY(-3px); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.16); }
.tile:active { transform: scale(0.97); }
.tile .avatar { width: 74px; height: 74px; box-shadow: 0 8px 22px rgba(0,0,0,0.35); }
.tile .name { font-weight: 700; font-size: 1.08rem; }
.tile .klasse { color:#9aa6b8; font-size:.9rem; }
.tile .check { position:absolute; top:10px; right:10px; width:26px; height:26px; border-radius:50%; background: var(--ok); color:#fff; display:grid; place-items:center; font-size:.85rem; box-shadow:0 4px 10px rgba(0,0,0,.3); }
.tile.spontan-badge::after { content:"spontan"; position:absolute; top:10px; left:10px; font-size:.68rem; background:rgba(124,92,255,.25); color:#c9beff; padding:2px 8px; border-radius:999px; }

.k-here {
  margin-top: 30px; border: 1px dashed rgba(26,133,115,0.5); border-radius: 22px; padding: 18px;
  background: rgba(26,133,115,0.06);
}
.k-here .k-here-title { color:#57d9bd; font-weight:800; margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.tiles.here .tile { background: rgba(124,92,255,0.10); border-color: rgba(124,92,255,0.28); }
.tiles.here .avatar { width: 58px; height: 58px; }
.tile .time { color:#9aa6b8; font-size:.82rem; }

/* Kiosk-Fußzeile mit dezenten Rollen-Logins */
.kiosk-foot { position: fixed; bottom: 14px; right: 16px; display:flex; gap:10px; z-index:20; }
.kiosk-foot a { font-size:.8rem; color:#8b95a7; text-decoration:none; background: rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08); padding:7px 12px; border-radius:10px; }
.kiosk-foot a:hover { color:#dfe5ef; background: rgba(255,255,255,0.1); }

.brand-mini { display:flex; align-items:center; gap:12px; }
.brand-mini img { width:48px; height:48px; border-radius:12px; }

/* Logo der Ahnatal-Schule Vellmar: klein und dezent, nie dominant.
   Die PNG-Fassung ist freigestellt (transparent) – deshalb braucht es
   keinen weißen Kasten mehr. Auf dunklem Grund würde der schwarze
   Schriftzug untergehen, dort erscheint es als helle Silhouette. */
/* Kürzel-Felder: Eingabe groß schreiben, Platzhalter aber normal lassen
   (sonst steht dort „Z. B. MUSJ" statt „z. B. MUSJ"). */
.kuerzel-eingabe { text-transform:uppercase; }
.kuerzel-eingabe::placeholder { text-transform:none; }

.schul-logo { height:24px; width:auto; flex:none; opacity:.75; }
.schul-logo--auf-dunkel { filter:brightness(0) invert(1); opacity:.5; }
@media (prefers-color-scheme: dark) {
  .schul-logo { filter:brightness(0) invert(1); opacity:.5; }
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .tile .avatar { width: 60px; height: 60px; }
  .kiosk-foot { position: static; justify-content:center; margin-top: 30px; }
}

/* =====================================================================
   Gemeinsame Komponenten (zentral statt je Seite dupliziert)
   ===================================================================== */
/* Listen-Tabellen */
.tbl { width:100%; border-collapse:collapse; }
.tbl th { text-align:left; font-size:.78rem; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:10px 10px; border-bottom:1px solid var(--border); }
.tbl td { padding:12px 10px; border-bottom:1px solid var(--border); vertical-align:middle; }
.tbl tr:last-child td { border-bottom:none; }
.zeile-fehlt { background: var(--warn-bg); }
/* Abschnitts-Überschriften (in Karten) */
.seiten-titel, .seiten-titel-a, .seiten-titel-k {
  font-size:.82rem; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); margin:0 0 14px; font-weight:700;
}
/* Ampel (Klassenlehrkraft) */
.ampel { font-weight:700; }
.ampel-gruen { color:var(--ok); }
.ampel-gelb { color:#c98b0e; }
.ampel-rot { color:var(--warn); }
/* auf schmalen Handys weniger wichtige Tabellenspalten ausblenden */
@media (max-width: 560px) { .hide-phone { display:none; } }

/* ---------- Kopfzeile: Navigation vs. eigene Anmeldung ----------
   Vorher standen Seitenlinks, der eigene Name und „Abmelden" als gleich
   aussehende Pillen nebeneinander — man sah nicht, was wohin führt.
   Jetzt trennt ein feiner Strich die Navigation von der Person. */
.kopf-trenner {
  width: 1px; height: 24px; background: var(--border);
  margin: 0 2px; flex: none;
}
.kopf-person {
  font-weight: 700; font-size: .92rem; color: var(--muted);
  white-space: nowrap;
}
.chip-still { background: transparent; border-color: transparent; color: var(--muted); }
.chip-still:hover { background: var(--surface-2); color: var(--text); }

/* Karten-Titel einheitlich. Vorher war jede To-do-Karte anders eingefärbt
   (lila/orange/grün) — das las sich wie eine Bedeutung, war aber Zufall.
   Die Farbe trägt jetzt allein das Status-Abzeichen rechts. */
.karte-titel {
  font-size: .96rem; font-weight: 700; color: var(--text);
  line-height: 1.25; hyphens: auto; overflow-wrap: anywhere;
}

/* ---------- Tages-Navigation (Lernbegleitung) ---------- */
.tag-navi {
  display:inline-flex; align-items:center; gap:2px;
  border:1px solid var(--border); background:var(--surface);
  border-radius:999px; padding:3px;
}
.tag-pfeil {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:999px;
  font-size:1.25rem; line-height:1; font-weight:700; color:var(--muted);
  text-decoration:none;
}
.tag-pfeil:hover { background:var(--surface-2); color:var(--text); }
.tag-pfeil.aus { opacity:.28; pointer-events:none; }
.tag-datum { padding:0 10px; font-weight:700; font-size:.94rem; white-space:nowrap; }

/* Sortierbare Tabellenköpfe */
.sortier-kopf { text-decoration:none; color:inherit; display:inline-flex; align-items:center; gap:4px; }
.sortier-kopf:hover { color:var(--accent); }

/* ---------- „Als App speichern"-Anleitung (Eltern) ----------
   Bewusst gezeichnet statt Screenshots: Bildschirmfotos veralten mit jeder
   iOS-Version und müssten für jede Gerätesprache neu gemacht werden. */
.app-anleitung h2 { font-size: 1.15rem; margin-top: 0; }
.app-anleitung > .muted { font-size: .93rem; margin-top: 0; }
.anleitung-schritte {
  display: grid; gap: 14px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.anleitung-schritt {
  text-align: center; padding: 18px 14px 16px;
  background: var(--surface-2); border-radius: var(--radius);
}
.anleitung-schritt strong { display: block; margin-top: 8px; }
.anleitung-schritt .muted { font-size: .86rem; margin: 6px 0 0; line-height: 1.45; }
.a-telefon { width: 108px; height: 162px; display: block; margin: 0 auto; }
.anleitung-nr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-top: 12px;
  border-radius: 999px; background: var(--asv-teal); color: #fff;
  font-weight: 800; font-size: .86rem;
}
/* Bauteile der gezeichneten Telefone */
.a-geraet      { fill: none; stroke: var(--border); stroke-width: 3; }
.a-fuell       { fill: color-mix(in srgb, var(--asv-teal) 22%, transparent); }
.a-fuell-hell  { fill: color-mix(in srgb, var(--muted) 22%, transparent); }
.a-linie-fuell { fill: var(--asv-teal); }
.a-linie       { fill: none; stroke: var(--asv-teal); stroke-width: 2.4;
                 stroke-linecap: round; stroke-linejoin: round; }
.a-kreis       { fill: none; stroke: var(--asv-teal); stroke-width: 2.4; }
.a-rahmen-aktiv{ fill: none; stroke: var(--asv-teal); stroke-width: 2.4; rx: 8; }
.a-app         { fill: var(--asv-teal); }
.anleitung-android {
  margin: 16px 0 0; padding: 12px 14px; font-size: .9rem;
  background: color-mix(in srgb, var(--asv-teal) 9%, transparent);
  border-radius: var(--radius-sm);
}
@media (max-width: 520px) {
  .anleitung-schritte { grid-template-columns: 1fr; }
  .anleitung-schritt { display: grid; grid-template-columns: 78px 1fr;
                       gap: 4px 14px; text-align: left; align-items: center; }
  .a-telefon { width: 78px; height: 117px; grid-row: span 3; }
  .anleitung-nr { margin-top: 0; }
}

/* ---------- Wochentags-Auswahl (Eltern-Anmeldung, Tage ändern, Verwaltung) ----------
   Lag vorher nur im Anmeldeformular; wird jetzt an drei Stellen gebraucht. */
.tag-zeile { border:1px solid var(--border); border-radius:14px; padding:12px 14px; margin-bottom:10px; transition:border-color .2s, background .2s; }
.tag-zeile.aktiv { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 5%, transparent); }
.tag-kopf { display:flex; align-items:center; gap:10px; font-weight:700; cursor:pointer; }
.tag-kopf input { width:22px; height:22px; }
/* Drei Angaben je Tag: Art, Fach, abweichende Gehzeit. auto-fit statt
   fester Spaltenzahl — am Telefon untereinander, am Rechner nebeneinander. */
.tag-optionen { margin-top:12px; display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.tag-optionen.hidden { display:none; }
@media (max-width:520px){ .tag-optionen { grid-template-columns:1fr; } }
/* Kompakte Fassung für Tabellen in der Verwaltung */
.tage-klein .tag-zeile { padding:8px 10px; margin-bottom:6px; border-radius:10px; }
.tage-klein .tag-kopf { font-size:.92rem; }
.tage-klein .tag-kopf input { width:18px; height:18px; }
.tage-klein .tag-optionen { margin-top:8px; gap:6px; }

/* =====================================================================
   Verwaltung: Seitenleiste
   Zehn Seiten in einer Kopfzeilen-Reihe waren nicht wiederzufinden — alle
   Knöpfe sahen gleich aus und die Reihe brach je nach Fensterbreite
   anders um. Die Leiste bleibt stehen, gliedert nach Anlass und zeigt
   durchgehend, wo man gerade ist.
   ===================================================================== */
.hat-leiste { --leiste-breite: 250px; }
.leiste-huelle { display: flex; min-height: 100vh; min-height: 100dvh; }

.leiste {
  width: var(--leiste-breite);
  flex: none;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px 16px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.leiste-marke {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 18px; text-decoration: none; color: var(--text);
}
.leiste-marke img { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.leiste-marke span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.leiste-marke small { font-size: .8rem; }

.leiste-nav { display: flex; flex-direction: column; gap: 2px; }
.leiste-gruppe {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding: 18px 12px 6px;
}
.leiste-punkt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--text); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.leiste-punkt:hover { background: var(--surface-2); }
/* Die aktive Seite bewusst kräftig: Auf einem Beamer oder einem blassen
   Monitor verschwindet eine zarte Tönung, ein dunkles Feld nie. */
.leiste-punkt.aktiv { background: var(--text); color: var(--surface); }
.leiste-punkt.aktiv:hover { background: var(--text); }
.leiste-symbol { width: 20px; text-align: center; flex: none; font-size: .95rem; }
.leiste-logo { margin: auto 12px 4px; align-self: flex-start; }

.leiste-inhalt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inhalt-kopf {
  display: flex; align-items: center; gap: 14px;
  padding: 20px clamp(16px, 3vw, 34px) 12px;
}
.inhalt-kopf h1 {
  margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15;
  overflow-wrap: anywhere;
}
.inhalt-kopf small { display: block; margin-top: 2px; }
.inhalt-flaeche { padding: 8px clamp(16px, 3vw, 34px) 40px; }
.inhalt-fuss { padding: 0 clamp(16px, 3vw, 34px) 26px; font-size: .85rem; }

/* Menü-Knopf nur am Telefon; am Rechner steht die Leiste ohnehin da. */
.leiste-knopf, .leiste-schliessen { display: none; }

@media (max-width: 860px) {
  .leiste-huelle { display: block; }
  .leiste {
    position: fixed; z-index: 60; top: 0; left: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow);
    background: var(--surface);
  }
  .leiste-schalter:checked ~ .leiste-huelle .leiste { transform: none; }
  .leiste-schalter:checked ~ .leiste-huelle .leiste-schliessen {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(10, 14, 22, .45);
  }
  .leiste-knopf {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none; border-radius: 11px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 1.15rem; cursor: pointer;
  }
  .inhalt-kopf { flex-wrap: wrap; }
}

/* ---------------------------------------------------------------------
   Kennzahlen-Reihe (Übersicht)
   --------------------------------------------------------------------- */
.kennzahlen {
  display: grid; gap: 12px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.kennzahl {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
  text-decoration: none; color: var(--text);
}
a.kennzahl:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.kennzahl-wert { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.kennzahl-titel { font-size: .85rem; color: var(--muted); font-weight: 600; }
.kennzahl.ist-offen .kennzahl-wert { color: var(--warn); }

/* Aufgabenliste auf der Übersicht */
.aufgabe {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.aufgabe:last-child { border-bottom: 0; }
.aufgabe-text { flex: 1; min-width: 200px; }
/* Das Auswahlfeld soll nicht die ganze Restbreite fressen — sonst rutscht
   der Knopf in eine eigene Zeile und die Zeile sieht kaputt aus. */
.aufgabe select { flex: 0 1 250px; max-width: 250px; }

/* Zwei ungleiche Spalten (breites Diagramm + schmale Liste). Als Inline-Stil
   ließ sich das am Telefon nicht aufheben — Inline schlägt jede Klasse. */
.grid-breit-schmal {
  grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
  align-items: start;
}
@media (max-width: 760px) {
  .grid-breit-schmal { grid-template-columns: 1fr; }
}

/* Vorschlag des Systems in der Aufgabenliste — abgesetzt, damit auf einen
   Blick klar ist, was das System vermutet und was die Eltern getippt haben. */
.vorschlag {
  display: inline-block; margin-top: 4px; font-size: .9rem;
  color: var(--accent);
}

/* Adresse zum Weitergeben (persönlicher Eltern-Link, App-Link) */
.kopier-block { margin-top: 10px; }
.kopier-zeile { display: flex; gap: 8px; align-items: stretch; }
.kopier-zeile input {
  flex: 1; min-width: 0; margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem;
}
.kopier-zeile .btn { flex: none; white-space: nowrap; }
.kopier-zeile .btn.kopiert { border-color: var(--ok); color: var(--ok); }

/* Kleiner Knopf für Tabellenzellen */
.btn-klein { padding: 4px 10px; font-size: .8rem; border-radius: 9px; }

/* „Kind nicht dabei?" — aufklappbare Eingabe unter dem Auswahlfeld */
.kind-neu { margin-top: 10px; border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; }
.kind-neu > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent); }
.kind-neu[open] { border-style: solid; background: var(--surface-2); }
.kind-neu-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }

/* Anzeige „Stand …" + Aktualisieren-Knopf (siehe app.js) */
.auto-akt {
  position: fixed; right: 12px; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 8px 6px 14px;
  box-shadow: var(--shadow); font-size: .82rem; color: var(--muted);
}
@media print { .auto-akt { display: none; } }
