/* Farben aus dem Atomos-Logo: Violett #726fa2, Koralle #ed6c5a, Sand #d9b6a0 */
:root {
  --hintergrund: #f4f4f8;
  --karte: #ffffff;
  --rand: #e0dfea;
  --text: #22212f;
  --text-leise: #625f75;
  --primaer: #5f5c93;
  --primaer-dunkel: #4b4878;
  --primaer-hell: #ecebf5;
  --koralle: #ed6c5a;
  --sand: #d9b6a0;
  --nav-bg: #2d2b45;
  --nav-hover: #3a3858;
  --nav-fg: #d9d8e8;
  --rot: #d9533f;
  --gelb: #ffe48a;
  --gelb-rand: #e7b800;
  --gruen: #dff3e2;
  --gruen-text: #1d7a35;
  --blau: #0b4fa8;
  --schatten: 0 1px 2px rgba(16, 32, 48, .06), 0 4px 16px rgba(16, 32, 48, .06);
  --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--hintergrund); }
button, input { font: inherit; }
kbd {
  font: 600 .78em ui-monospace, Consolas, monospace; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--rand); border-bottom-width: 2px; background: #f8fafc; color: var(--text);
}

/* Rahmen: Menü links, Inhalt rechts */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; }
.seitenleiste { background: var(--nav-bg); color: var(--nav-fg); display: flex; flex-direction: column; min-height: 0; }
.seitenleiste .marke {
  display: block; margin: 14px 14px 6px; padding: 10px 14px; background: #fff; border-radius: 10px;
}
.seitenleiste .marke img { display: block; width: 100%; height: auto; }
.seitenleiste .produkt { padding: 4px 18px 10px; font-size: .78rem; letter-spacing: .04em; color: #a9a7c4; }
.seitenleiste nav { flex: 1; padding: 6px 0; overflow: auto; }
.seitenleiste nav .gruppe {
  padding: 16px 20px 6px; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #8f8cab;
}
.seitenleiste nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 20px; color: var(--nav-fg); text-decoration: none;
  border-left: 3px solid transparent; font-size: .95rem; font-weight: 500;
}
.seitenleiste nav a svg { flex: none; opacity: .85; }
.seitenleiste nav a:hover { background: var(--nav-hover); color: #fff; }
.seitenleiste nav a.aktiv { background: var(--nav-hover); color: #fff; border-left-color: var(--koralle); }
.seitenleiste .fuss { border-top: 1px solid #403e5e; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.seitenleiste .person { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.seitenleiste .person strong { color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seitenleiste .person small { color: #a9a7c4; font-size: .75rem; }
.seitenleiste .abmelden {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border-color: #4a4868; color: var(--nav-fg);
  padding: 6px 10px; font-size: .82rem;
}
.seitenleiste .abmelden:hover:not(:disabled) { background: var(--nav-hover); border-color: #5c5a80; color: #fff; }
.hauptbereich { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.menue-knopf { display: none; padding: 6px; border: none; background: transparent; }

/* Kopfzeile */
.kopf {
  display: flex; align-items: center; gap: 24px; padding: 12px 22px; background: var(--karte);
  border-bottom: 1px solid var(--rand);
}
.kopf h1 { margin: 0; font-size: 1.25rem; }
.schritte { display: flex; gap: 6px; list-style: none; margin: 0 auto; padding: 0; }
.schritte li {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  color: var(--text-leise); font-weight: 600; font-size: .92rem;
}
.schritte li span {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #e7ecf1; font-size: .8rem;
}
.schritte li.aktiv { background: var(--primaer-hell); color: var(--primaer-dunkel); }
.schritte li.aktiv span { background: var(--primaer); color: #fff; }
.schritte li.fertig span { background: var(--gruen-text); color: #fff; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; }
.nutzer { color: var(--text-leise); font-size: .92rem; }
.etikett { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.etikett.warnung { background: #fff1c7; color: #7a5600; }

/* Knöpfe */
button {
  cursor: pointer; border: 1px solid var(--rand); background: var(--karte); color: var(--text);
  padding: 7px 14px; border-radius: 8px; font-weight: 600;
}
button:hover:not(:disabled) { border-color: #b9c4d0; background: #f7f9fb; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #8cc4e6; outline-offset: 1px; }
button.primaer, button.gross { background: var(--primaer); border-color: var(--primaer); color: #fff; }
button.primaer:hover:not(:disabled), button.gross:hover:not(:disabled) { background: var(--primaer-dunkel); }
button.gross { width: 100%; padding: 12px; font-size: 1.02rem; }
button.breit { width: 100%; }
button.leise { border-color: transparent; background: transparent; color: var(--text-leise); }
button.leise:hover:not(:disabled) { background: #eef2f6; }
button.rund {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 1.05rem;
  background: var(--primaer-hell); border-color: #d7d5ea; color: var(--primaer-dunkel); font-weight: 700;
}
button.primaer kbd { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.35); }

/* Meldungen */
.meldung { margin: 12px 20px 0; padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.meldung.fehler { background: #fde7e7; color: #8f1d1d; border: 1px solid #f5c2c2; }
.meldung.hinweis { background: #fff6d6; color: #6b4e00; border: 1px solid #f1df9c; }
.meldung.erfolg { background: var(--gruen); color: var(--gruen-text); border: 1px solid #bfe4c6; }

/* Raster */
.raster {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px;
  padding: 16px 20px 20px; min-height: 0;
}
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); }
.seite { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; }
.seite .karte { padding: 16px; }
.seite h2 { margin: 0 0 6px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.klein { font-size: .85rem; color: var(--text-leise); margin: 0 0 12px; }
.zaehler {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--gelb); color: #6b4e00; font-size: .8rem;
}
.zaehler.null { background: var(--gruen); color: var(--gruen-text); }
label { display: block; font-size: .85rem; color: var(--text-leise); font-weight: 600; margin-bottom: 10px; }
label input {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--rand);
  border-radius: 8px; color: var(--text); font-weight: 400; background: #fff;
}
label input[readonly] { background: #f4f6f8; color: var(--text-leise); }

/* Editor-Karte */
.editor-karte { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.werkzeug { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--rand); flex-wrap: wrap; }
.aufnahme {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 999px;
  background: var(--rot); border-color: var(--rot); color: #fff; font-size: 1.02rem; min-width: 190px; justify-content: center;
}
.aufnahme:hover:not(:disabled) { background: #b83131 !important; }
.aufnahme .punkt { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.aufnahme.laeuft { background: #fff !important; color: var(--rot); border-color: var(--rot); }
.aufnahme.laeuft .punkt { background: var(--rot); border-radius: 2px; animation: pulsieren 1.2s infinite; }
@keyframes pulsieren { 50% { opacity: .3; } }
.pegel { width: 110px; height: 8px; border-radius: 4px; background: #e7ecf1; overflow: hidden; }
#pegel-balken { height: 100%; width: 0; background: linear-gradient(90deg, #3bb36a, #f0b429); transition: width .08s; }
.zeit { font-variant-numeric: tabular-nums; color: var(--text-leise); font-size: .9rem; }
.status { color: var(--text-leise); font-size: .9rem; }
.test { font-size: .8rem; color: var(--text-leise); margin-left: auto; }

.editor {
  flex: 1; overflow: auto; padding: 22px 26px; font-size: 1.08rem; line-height: 1.75; outline: none;
  white-space: pre-wrap; word-wrap: break-word; min-height: 200px;
}
.editor.leer::before { content: attr(data-leer); color: #9aa5b1; pointer-events: none; }
.editor.aufnahme-laeuft { background: #fffdfa; }
.editor.gesperrt { background: #f7f9fb; color: #2b3542; cursor: default; }
.editor .vorlaeufig { color: #8b95a3; font-style: italic; }
.editor .w.kritisch { color: var(--blau); text-decoration: underline; text-decoration-color: #7fb0e8; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.editor .w.unsicher { background: var(--gelb); border-radius: 3px; box-shadow: 0 0 0 1px var(--gelb-rand) inset; cursor: pointer; }
.editor .w.unsicher.geprueft { background: var(--gruen); box-shadow: none; cursor: auto; }
.editor .w.aktuell { background: #bfe3ff !important; border-radius: 3px; }
.editor .w.blinken { animation: blinken .9s; }
@keyframes blinken { 0%, 100% { box-shadow: 0 0 0 0 rgba(15,106,158,0); } 30% { box-shadow: 0 0 0 4px rgba(15,106,158,.35); } }

.abspieler { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--rand); background: #fafbfc; }
.abspieler input[type=range] { flex: 1; accent-color: var(--primaer); }

/* Prüfliste */
.pruefliste { list-style: none; margin: 12px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.pruefliste li {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer;
  border-left: 3px solid var(--gelb-rand); margin-bottom: 4px; background: #fffbea;
}
.pruefliste li:hover { background: #fff3c4; }
.pruefliste li.erledigt { border-left-color: #8ccf9a; background: transparent; color: var(--text-leise); }
.pruefliste li.erledigt::after { content: "✓"; margin-left: auto; color: var(--gruen-text); }
.pruefliste small { color: var(--blau); font-size: .75rem; }

.freigabe .erfolg { margin: 0 0 10px; color: var(--gruen-text); font-weight: 700; }
.zeile { display: flex; gap: 8px; margin-top: 10px; justify-content: space-between; }
.zeile.rechts { justify-content: flex-end; }

/* Dialoge */
.dialog { border: none; border-radius: 14px; padding: 22px 24px; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(20, 30, 40, .45); }
.dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.breit-dialog { max-width: 980px; width: calc(100% - 40px); max-height: calc(100% - 40px); }
.dialog-kopf { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; }
.hilfe-inhalt h3 { margin: 20px 0 8px; font-size: 1rem; }
.hilfe-schritte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hilfe-schritte section { background: #f6f9fb; border: 1px solid var(--rand); border-radius: 10px; padding: 4px 14px 10px; }
.hilfe-schritte h3 { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.hilfe-schritte h3 span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primaer); color: #fff; font-size: .9rem; }
.hilfe-schritte ul { padding-left: 18px; margin: 0; }
.hilfe-schritte li { margin-bottom: 8px; line-height: 1.45; font-size: .93rem; }
.beispiel { padding: 0 4px; border-radius: 3px; }
.beispiel.grau { color: #8b95a3; font-style: italic; }
.beispiel.gelb { background: var(--gelb); }
.beispiel.gruen { background: var(--gruen); }
.beispiel.blau { color: var(--blau); text-decoration: underline 2px #7fb0e8; text-underline-offset: 3px; }
.tasten { border-collapse: collapse; width: 100%; font-size: .92rem; }
.tasten td { padding: 6px 8px; border-bottom: 1px solid #eef1f4; }
.tasten td:nth-child(odd) { white-space: nowrap; width: 1%; }
details { border-bottom: 1px solid #eef1f4; padding: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 4px; color: #3b4654; line-height: 1.5; }

/* Verwaltungsseiten (Einstellungen, Konto) */
.inhalt { flex: 1; overflow: auto; padding: 20px 22px 32px; }
.inhalt .karte { padding: 20px 22px; margin-bottom: 18px; max-width: 980px; }
.inhalt h2 { margin: 0 0 4px; font-size: 1.1rem; }
.inhalt .klein { margin-bottom: 16px; }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.schalter { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: .95rem; }
.schalter input { width: 18px; height: 18px; margin: 0; accent-color: var(--primaer); }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.ergebnis { font-weight: 600; font-size: .92rem; }
.ergebnis.ok { color: var(--gruen-text); }
.ergebnis.nein { color: #a42a1d; }
.info-zeile { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .88rem; color: var(--text-leise); margin: 14px 0 0; }
.info-zeile b { color: var(--text); font-weight: 600; }
.status-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #b8b6c9; }
.status-punkt.an { background: #2fa25a; }
table.liste { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.liste th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); padding: 8px 10px; border-bottom: 1px solid var(--rand); }
table.liste td { padding: 9px 10px; border-bottom: 1px solid #efeef5; vertical-align: middle; }
table.liste td.knoepfe { text-align: right; white-space: nowrap; }
table.liste td.knoepfe button { padding: 5px 10px; font-size: .82rem; }
table.liste td select { margin: 0; width: auto; min-width: 150px; padding: 5px 8px; font-size: .88rem; }
.rolle { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #eceaf4; color: var(--primaer-dunkel); }
.rolle.admin { background: #fde5e1; color: #9c3324; }
.neu-zeile { display: grid; grid-template-columns: 1fr 1.4fr 150px auto; gap: 10px; align-items: end; margin-top: 16px; }
.neu-zeile label { margin: 0; }
select { font: inherit; display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; }
.geheim { font: 600 1.15rem ui-monospace, Consolas, monospace; letter-spacing: .06em; background: #f5f4fa; border: 1px dashed #c9c6e0; border-radius: 8px; padding: 12px 14px; margin: 10px 0; user-select: all; word-break: break-all; }
button.gefahr { color: #a42a1d; }
.abstand-oben { margin-top: 16px; }
.inhalt .karte.breit { max-width: none; }
.filter { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; margin-bottom: 14px; }
.filter label { margin: 0; min-width: 220px; }
.filter label.schalter { min-width: 0; padding-bottom: 8px; }
.filter .klein { margin: 0 0 8px auto; }
tr.zurueckgezogen td { color: var(--text-leise); }
tr.zurueckgezogen td:nth-child(2) { text-decoration: line-through; }
.leer-hinweis { text-align: center; color: var(--text-leise); padding: 28px 0 10px; margin: 0; }
.bericht-text {
  white-space: pre-wrap; line-height: 1.7; font-size: 1.02rem; background: #fafafd; border: 1px solid var(--rand);
  border-radius: 10px; padding: 18px 20px; margin: 14px 0; max-height: 60vh; overflow: auto;
}
label.inline { display: inline; margin: 0; color: inherit; font-weight: 500; font-size: inherit; }

/* Anmeldung */
.anmelde-seite { display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #f4f4f8 0%, #ecebf5 55%, #f8ece8 100%); }
.anmelde-karte { width: 380px; max-width: calc(100% - 32px); padding: 30px; }
.anmelde-karte .logo { display: block; width: 210px; height: auto; margin: 0 auto 18px; }
.anmelde-karte h1 { margin: 0 0 4px; font-size: 1.25rem; text-align: center; }
.anmelde-karte .klein { text-align: center; }
.anmelde-karte .fehlertext { color: #8f1d1d; font-weight: 600; min-height: 1.4em; margin: 0 0 8px; font-size: .9rem; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .seitenleiste { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  body.menue-offen .seitenleiste { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menue-knopf { display: inline-flex; }
  .raster { grid-template-columns: 1fr; overflow: auto; }
  .schritte { display: none; }
  .hilfe-schritte { grid-template-columns: 1fr; }
  .editor { min-height: 50vh; }
  .neu-zeile { grid-template-columns: 1fr; }
}
