
:root {
  --breite-seite: 232px;
  --breite-seite-schmal: 60px;

  --bg: #f8fafc;
  --flaeche: #ffffff;
  --flaeche-hell: #f1f5f9;
  --seite-bg: #0f172a;
  --seite-text: #cbd5e1;
  --seite-text-leise: #64748b;
  --seite-aktiv: #1e293b;
  --rand: #e2e8f0;
  --rand-stark: #cbd5e1;
  --text: #0f172a;
  --text-leise: #475569;
  --text-still: #94a3b8;
  --rot: #dc2626;
  --gruen: #059669;
  --gelb: #b45309;
  --blau: #0284c7;
  --schatten: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --bg: #020617;
    --flaeche: #0f172a;
    --flaeche-hell: #1e293b;
    --seite-bg: #0b1220;
    --seite-text: #cbd5e1;
    --seite-text-leise: #64748b;
    --seite-aktiv: #1e293b;
    --rand: #1e293b;
    --rand-stark: #334155;
    --text: #e2e8f0;
    --text-leise: #94a3b8;
    --text-still: #64748b;
    --gelb: #d97706;
    --schatten: none;
    color-scheme: dark;
  }
}

:root[data-thema="dunkel"] {
  --bg: #020617;
  --flaeche: #0f172a;
  --flaeche-hell: #1e293b;
  --seite-bg: #0b1220;
  --seite-text: #cbd5e1;
  --seite-text-leise: #64748b;
  --seite-aktiv: #1e293b;
  --rand: #1e293b;
  --rand-stark: #334155;
  --text: #e2e8f0;
  --text-leise: #94a3b8;
  --text-still: #64748b;
  --gelb: #d97706;
  --schatten: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- Gerüst -------------------------------------------------------------- */

.schale { display: flex; min-height: 100vh; }

.seite {
  width: var(--breite-seite);
  flex: 0 0 var(--breite-seite);
  display: flex; flex-direction: column;
  background: var(--seite-bg);
  color: var(--seite-text);
  border-right: 1px solid rgba(148, 163, 184, .14);
  position: sticky; top: 0; height: 100vh;
  transition: width .16s ease, flex-basis .16s ease;
}
.schale.schmal .seite {
  width: var(--breite-seite-schmal);
  flex-basis: var(--breite-seite-schmal);
}

.seite-marke {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  min-height: 65px;
}
.seite-marke > svg { flex: 0 0 32px; border-radius: 9px; }
.marke-text { display: flex; flex-direction: column; overflow: hidden; }
.marke-text b { font-size: 14px; color: #f8fafc; white-space: nowrap; }
.marke-text span { font-size: 12px; color: var(--seite-text-leise); white-space: nowrap; }

.seite-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-gruppe {
  margin: 14px 0 4px; padding: 0 8px;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--seite-text-leise);
}
.nav-eintrag {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 10px; margin-bottom: 2px;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--seite-text); font: inherit; font-size: 14px; text-align: left;
  cursor: pointer; position: relative; white-space: nowrap;
}
.nav-eintrag svg { flex: 0 0 20px; opacity: .85; }
.nav-eintrag:hover { background: rgba(148, 163, 184, .1); }
.nav-eintrag.aktiv { background: var(--seite-aktiv); color: #fff; font-weight: 600; }
.nav-eintrag.aktiv::before {
  content: ''; position: absolute; left: -8px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--rot);
}
.nav-eintrag.aktiv svg { opacity: 1; }

.seite-fuss { padding: 10px 8px 8px; border-top: 1px solid rgba(148, 163, 184, .14); }

.thema {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(148, 163, 184, .1); border-radius: 8px; margin-bottom: 8px;
}
.thema button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 4px; border: 0; border-radius: 6px;
  background: transparent; color: var(--seite-text-leise);
  font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.thema button.aktiv { background: var(--seite-aktiv); color: #f8fafc; }
.thema button svg { flex: 0 0 14px; }

.einklappen {
  width: 100%; padding: 4px; margin-bottom: 8px;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--seite-text-leise); cursor: pointer; font-size: 18px; line-height: 1;
}
.einklappen:hover { background: rgba(148, 163, 184, .1); }
.schale.schmal .einklappen .pfeil { display: inline-block; transform: rotate(180deg); }

.konto { display: flex; align-items: center; gap: 4px; }
.konto-knopf {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; background: transparent; border: 0; border-radius: 8px;
  color: var(--seite-text); font: inherit; text-align: left; cursor: pointer;
}
.konto-knopf:hover { background: rgba(148, 163, 184, .1); }
.kuerzel {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--rot); color: #fff; font-size: 12px; font-weight: 700;
}
.konto-text { display: flex; flex-direction: column; min-width: 0; }
.konto-text b { font-size: 13px; color: #f8fafc; }
.konto-text b, .konto-text span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.konto-text span { font-size: 11px; color: var(--seite-text-leise); }
.konto-aus {
  flex: 0 0 auto; padding: 7px;
  background: transparent; border: 0; border-radius: 7px;
  color: var(--seite-text-leise); cursor: pointer;
}
.konto-aus:hover { background: rgba(148, 163, 184, .1); color: var(--rot); }

/* Eingeklappt: nur Symbole. */
.schale.schmal .marke-text,
.schale.schmal .nav-eintrag span,
.schale.schmal .nav-gruppe span,
.schale.schmal .thema button span,
.schale.schmal .konto-text { display: none; }
.schale.schmal .seite-marke,
.schale.schmal .nav-eintrag { justify-content: center; padding-left: 0; padding-right: 0; }
.schale.schmal .nav-gruppe { border-top: 1px solid rgba(148,163,184,.14); margin: 10px 4px 6px; padding: 0; height: 1px; }
.schale.schmal .thema { flex-direction: column; }
.schale.schmal .konto-aus { display: none; }

/* --- Inhalt -------------------------------------------------------------- */

.inhalt { flex: 1; min-width: 0; padding: 22px 26px 60px; }
@media (max-width: 700px) { .inhalt { padding: 16px 14px 40px; } }

.bereich-kopf {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.bereich-kopf h1 { font-size: 21px; margin: 0 0 2px; letter-spacing: -.02em; }
.bereich-kopf .hinweis { margin: 0; max-width: 62ch; }

/* --- Bausteine ----------------------------------------------------------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--schatten);
}
.karte.warn { border-color: var(--gelb); }
.karte > h2:first-child, .karte > .karte-kopf:first-child { margin-top: 0; }

.karte-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}

h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); margin: 0 0 10px; font-weight: 700;
}
h3 { font-size: 14px; margin: 16px 0 8px; }
p.hinweis { color: var(--text-leise); font-size: 13px; margin: 0 0 12px; }
.hilfstext { color: var(--text-still); font-size: 12px; }
.leer { color: var(--text-still); font-size: 13px; margin: 6px 0; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 0; font-size: 14px; }
dt { color: var(--text-still); }
dd { margin: 0; }

code {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  background: var(--flaeche-hell); border: 1px solid var(--rand);
  border-radius: 5px; padding: 2px 6px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-still); padding: 7px 8px; border-bottom: 1px solid var(--rand);
  font-weight: 600;
}
td { padding: 9px 8px; border-bottom: 1px solid var(--rand); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.still td { opacity: .55; }
.tabelle-rollbar { overflow-x: auto; }

.marker {
  display: inline-block; font-size: 11px; font-weight: 600;
  border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.gruen { background: color-mix(in srgb, var(--gruen) 16%, transparent); color: var(--gruen); }
.rot { background: color-mix(in srgb, var(--rot) 16%, transparent); color: var(--rot); }
.gelb { background: color-mix(in srgb, var(--gelb) 18%, transparent); color: var(--gelb); }
.grau { background: var(--flaeche-hell); color: var(--text-leise); }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-leise); }
input, select, textarea {
  background: var(--flaeche); border: 1px solid var(--rand-stark); color: var(--text);
  border-radius: 7px; padding: 8px 10px; font: inherit; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--blau) 45%, transparent); outline-offset: 1px;
  border-color: var(--blau);
}
input.schluessel {
  font-family: ui-monospace, Consolas, monospace; letter-spacing: .07em; text-transform: uppercase;
}
input[type="checkbox"] { width: auto; }

button {
  background: var(--flaeche); border: 1px solid var(--rand-stark); color: var(--text);
  border-radius: 7px; padding: 8px 13px; font: inherit; font-size: 14px; cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--text-still); }
button.haupt { background: var(--rot); border-color: var(--rot); color: #fff; font-weight: 600; }
button.haupt:hover:not(:disabled) { filter: brightness(1.08); }
button.leise { background: transparent; border-color: transparent; color: var(--text-leise); }
button.leise:hover:not(:disabled) { background: var(--flaeche-hell); border-color: transparent; }
button.gefahr { color: var(--rot); }
button:disabled { opacity: .45; cursor: not-allowed; }

.knopfreihe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gitter { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.gitter.drei { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .gitter, .gitter.drei { grid-template-columns: 1fr; } }
.spanne { grid-column: 1 / -1; }

.verborgen { display: none !important; }

/* Codes zum Abschreiben oder Ausdrucken: Festbreitenschrift, damit sich
   Buchstaben und Ziffern nicht ähneln, und weiter Zeilenabstand, damit beim
   Abtippen niemand verrutscht. */
.codeliste {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 2;
  margin: 10px 0;
  padding: 12px 16px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--flaeche-hell);
  user-select: all;
}

.meldung { border-radius: 8px; padding: 10px 13px; font-size: 13px; margin: 0 0 16px; }
.meldung.fehler {
  background: color-mix(in srgb, var(--rot) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rot) 40%, transparent); color: var(--rot);
}
.meldung.gut {
  background: color-mix(in srgb, var(--gruen) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gruen) 40%, transparent); color: var(--gruen);
}
.meldung.warnung {
  background: color-mix(in srgb, var(--gelb) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--gelb) 40%, transparent); color: var(--gelb);
}

/* Kennzahlen */
.zahlen { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.zahl {
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px;
  padding: 13px 15px; box-shadow: var(--schatten);
}
.zahl b { display: block; font-size: 25px; line-height: 1.15; letter-spacing: -.02em; }
.zahl span { font-size: 12px; color: var(--text-still); }

/* Verbindungskette */
.kette { display: flex; flex-direction: column; gap: 3px; }
.glied {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px;
  border-left: 3px solid var(--rand-stark); background: var(--flaeche-hell);
  border-radius: 0 7px 7px 0;
}
.glied.gut { border-left-color: var(--gruen); }
.glied.warnung { border-left-color: var(--gelb); }
.glied.fehler { border-left-color: var(--rot); }
.glied b { font-size: 13px; display: block; }
.glied span { font-size: 13px; color: var(--text-leise); }
.glied em { font-size: 12px; color: var(--gelb); font-style: normal; display: block; margin-top: 3px; }
.punkt { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--rand-stark); }
.punkt.gut { background: var(--gruen); }
.punkt.warnung { background: var(--gelb); }
.punkt.fehler { background: var(--rot); }

/* Schrittanzeige der Einrichtung */
.schritt {
  display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%;
  background: var(--flaeche-hell); color: var(--text-still);
  font-size: 12px; font-weight: 700; margin-right: 8px;
}
.schritt.fertig { background: color-mix(in srgb, var(--gruen) 18%, transparent); color: var(--gruen); }
.schritt.dran { background: var(--rot); color: #fff; }

/* Kompaktlogo: Piktogramm plus Wortmarke */
.marke-logo { display: inline-flex; align-items: center; gap: 11px; }
.marke-logo > svg { border-radius: 9px; flex: 0 0 auto; }
.marke-wort { display: flex; flex-direction: column; line-height: 1.1; }
.marke-wort b {
  font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--text);
}
.marke-wort > span {
  font-size: 10px; font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: var(--rot);
}

/* Anmeldemaske ohne Schale */
.anmeldeseite { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.anmeldeseite .karte { width: 100%; max-width: 380px; margin: 0; }
.anmeldeseite .marke-logo { margin-bottom: 18px; }

/* Umschalter zwischen zwei gleichrangigen Wegen - kein Menue, sondern eine
   Wahl, die beide Male zum selben Ziel fuehrt. */
.reiter { display: flex; gap: 2px; margin-bottom: 14px;
          background: var(--flaeche-hell); border: 1px solid var(--rand);
          border-radius: 8px; padding: 3px; }
.reiter button { flex: 1; border: 0; background: transparent; color: var(--text-still);
                 font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 6px;
                 cursor: pointer; }
.reiter button:hover { color: var(--text); }
.reiter button.aktiv { background: var(--flaeche); color: var(--text);
                       font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.12); }

dialog {
  background: var(--flaeche); color: var(--text);
  border: 1px solid var(--rand-stark); border-radius: 12px;
  padding: 20px; max-width: 760px; width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(15, 23, 42, .25);
}
dialog::backdrop { background: rgba(2, 6, 23, .6); }
