:root {
  --marke: #02497f;
  --marke-hell: #e6f1fb;
  --kopf-bg: #06355c;
  --kopf-text: #dbe7f2;
  --leiste-bg: #0a3f6b;
  --leiste-text: #cfe0ef;
  --leiste-aktiv: #ffffff;
  --flaeche: #f2f4f6;
  --karte: #ffffff;
  --rand: #e2e5e9;
  --text: #1c1f23;
  --text-leise: #6b7280;
  --gefahr: #a32d2d;
}
[data-thema="dunkel"] {
  --marke: #4a9bd8;
  --marke-hell: #123449;
  --kopf-bg: #0d1b26;
  --kopf-text: #c8d4de;
  --leiste-bg: #11212e;
  --leiste-text: #a9bac8;
  --leiste-aktiv: #ffffff;
  --flaeche: #171e25;
  --karte: #1e262e;
  --rand: #2c3742;
  --text: #e6ebf0;
  --text-leise: #93a1ae;
  --gefahr: #e88;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--flaeche);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--marke); }

/* ---------- Kopfzeile ---------- */
.kopfzeile {
  height: 52px; background: var(--kopf-bg); color: var(--kopf-text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; flex: none;
}
.kopf-marke { display: flex; align-items: center; gap: 10px; }
.kopf-marke img { height: 30px; border-radius: 4px; display: block; }
.kopf-marke span { font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; }
.thema-schalter {
  display: flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px;
}
.thema-schalter button {
  width: 32px; height: 28px; border: none; background: none; cursor: pointer;
  color: var(--kopf-text); border-radius: 999px; font-size: 15px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.thema-schalter button.aktiv { background: rgba(255,255,255,.9); color: #06355c; }
.abmelden-knopf {
  background: var(--karte); color: var(--text); border: none; border-radius: 8px;
  padding: 8px 18px; font-size: 13px; cursor: pointer;
}

/* ---------- Grundraster ---------- */
.huelle { display: flex; height: calc(100vh - 52px); }

/* ---------- Seitenleiste ---------- */
.seitenleiste {
  width: 230px; flex: none; background: var(--leiste-bg); color: var(--leiste-text);
  display: flex; flex-direction: column;
}
.seitenleiste.schmal { width: 56px; }
.seitenleiste.schmal .beschriftung,
.seitenleiste.schmal .gruppe-liste,
.seitenleiste.schmal .nutzer-text { display: none; }

.alle-schliessen {
  height: 54px; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  color: #e39b9b; font-size: 13px; cursor: pointer; flex: none;
}
.alle-schliessen:hover { color: #f3bcbc; }

.leiste-mitte { flex: 1; overflow-y: auto; padding: 6px 8px; }

.gruppe-kopf {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer;
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--leiste-text); border-radius: 8px; user-select: none;
}
.gruppe-kopf:hover { background: rgba(255,255,255,.06); }
.gruppe-kopf .pfeil { font-size: 13px; transition: transform .15s; flex: none; }
.gruppe-kopf.offen .pfeil { transform: rotate(90deg); }
.gruppe-liste { padding: 0 0 6px 0; }
.gruppe-liste .eintrag {
  display: block; padding: 8px 10px 8px 34px; font-size: 13px; border-radius: 8px;
  color: var(--leiste-text); text-decoration: none; cursor: pointer;
}
.gruppe-liste .eintrag:hover { background: rgba(255,255,255,.08); color: var(--leiste-aktiv); }
.gruppe-liste .leer { padding: 8px 10px 8px 34px; font-size: 12px; color: rgba(255,255,255,.38); }

.leiste-fuss { flex: none; border-top: 1px solid rgba(255,255,255,.1); }
.einklappen {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  font-size: 13px; color: var(--leiste-text); cursor: pointer;
}
.einklappen:hover { color: var(--leiste-aktiv); }
.nutzer-block {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.nutzer-punkt {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,.14); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.nutzer-text { flex: 1; min-width: 0; line-height: 1.3; }
.nutzer-text .name { font-size: 13px; color: #fff; }
.nutzer-text .rolle {
  font-size: 11px; color: rgba(255,255,255,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zahnrad {
  background: rgba(255,255,255,.1); border: none; color: var(--leiste-text);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Reiter ---------- */
.hauptbereich { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--kopf-bg); }
.reiterleiste {
  height: 54px; flex: none; display: flex; align-items: flex-end; gap: 4px;
  padding: 0 10px; overflow-x: auto;
}
.reiter {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 16px;
  background: rgba(255,255,255,.07); color: var(--kopf-text);
  border-radius: 8px 8px 0 0; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none;
}
.reiter.aktiv { background: var(--flaeche); color: var(--text); }
.reiter .zu {
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 13px; opacity: .6;
}
.reiter .zu:hover { background: rgba(128,128,128,.25); opacity: 1; }
.reiter-neu {
  width: 34px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: var(--kopf-text); font-size: 18px; cursor: pointer; flex: none; opacity: .8;
}

.buehne { flex: 1; background: var(--flaeche); padding: 10px; overflow: hidden; }
.platte {
  height: 100%; background: var(--karte); border: 1px solid var(--rand);
  border-radius: 10px; display: flex; flex-direction: column; overflow: hidden;
}
.platte-kopf {
  height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--rand); font-size: 14px;
}
.platte-kopf .werkzeuge { display: flex; gap: 18px; font-size: 13px; color: var(--text-leise); }
.platte-kopf .werkzeuge a { color: var(--text-leise); text-decoration: none; cursor: pointer; }
.platte-kopf .werkzeuge a:hover { color: var(--marke); }
.platte iframe { flex: 1; width: 100%; border: none; background: var(--karte); }
.leerbuehne {
  height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--text-leise); gap: 10px; text-align: center;
}
.leerbuehne i { font-size: 34px; opacity: .35; }

/* ---------- Inhaltsseiten (in den Reitern) ---------- */
.seite { padding: 22px; }
.seite h1 { font-size: 24px; margin: 0 0 2px; font-weight: 600; }
.seite .brotkrume { font-size: 13px; color: var(--text-leise); margin: 0 0 20px; }
.karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 18px; margin-bottom: 14px;
}
.karte h2 { font-size: 15px; margin: 0 0 3px; font-weight: 600; }
.karte p.hinweis { font-size: 13px; color: var(--text-leise); margin: 0 0 14px; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kachel {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 18px; cursor: pointer; text-decoration: none; color: var(--text); display: block;
}
.kachel:hover { border-color: var(--marke); }
.kachel .symbol {
  width: 42px; height: 42px; border-radius: 9px; background: var(--marke-hell);
  color: var(--marke); display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.kachel .titel { font-size: 15px; margin-bottom: 3px; }
.kachel .unter { font-size: 12px; color: var(--text-leise); }

form.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
label { font-size: 12px; color: var(--text-leise); display: block; margin-bottom: 4px; }
input, select {
  padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; font-size: 13px;
  min-width: 160px; background: var(--karte); color: var(--text);
}
button, .knopf {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--rand); background: var(--karte);
  font-size: 13px; cursor: pointer; text-decoration: none; color: var(--text); display: inline-block;
}
button.primaer { background: var(--marke); color: #fff; border-color: var(--marke); }
button.gefahr { color: var(--gefahr); border-color: var(--gefahr); background: none; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rand); }
th { color: var(--text-leise); font-weight: 500; }
.chip {
  display: inline-block; background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; margin: 2px 4px 2px 0;
}
.fehler { color: var(--gefahr); font-size: 13px; margin-bottom: 12px; }

/* ---------- Anmeldung ---------- */
.anmelde-huelle {
  display: flex; justify-content: center; align-items: center; min-height: 100vh;
  background: var(--kopf-bg);
}
.anmelde-karte {
  background: var(--karte); border-radius: 12px; padding: 34px; width: 100%; max-width: 330px;
}
