/* Pflege-Lerntrainer – Darkmode */
:root {
  --bg: #0f1115;
  --karte: #1a1d24;
  --feld: #12151b;
  --linie: #2a2f3a;
  --text: #e5e7eb;
  --grau: #9ca3af;
  --rot: #f87171;
  --gruen: #4ade80;
  --orange: #fb923c;
  --ok-bg: #14361f;
  --fehler-bg: #3d1616;
  --merke-bg: #3a1a1a;
  --option: #252a33;
  --option-aktiv: #2f3542;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.45; }
a { color: #93c5fd; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
.grau { color: var(--grau); }
.klein { font-size: .85rem; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 0; border-radius: 10px; color: #fff; background: #374151;
  font: inherit; font-weight: 700; padding: .65em 1.1em; cursor: pointer; text-decoration: none;
  transition: filter .15s, transform .05s; user-select: none;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.klein { padding: .45em .8em; font-size: .9rem; }
.btn.gross { padding: .85em 1.4em; font-size: 1.05rem; }
.btn.link { background: transparent; color: var(--grau); padding: .3em .5em; font-weight: 600; }
.btn.link:hover { color: var(--text); }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }

/* Formulare */
input, textarea, select {
  font: inherit; color: var(--text); background: var(--feld); border: 1px solid var(--linie);
  border-radius: 8px; padding: .6em .75em; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--grau); }
label { display: block; margin: .6rem 0; font-weight: 600; }
label input, label textarea, label select { margin-top: .3rem; font-weight: 400; }
input[type=checkbox] { width: auto; accent-color: #15803d; transform: scale(1.25); margin: 0 .5rem 0 .2rem; }

/* Kopfzeile */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: .7rem 1.2rem; background: #13161c; border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10;
}
.marke { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.topbar-rechts { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.inhalt { max-width: 1040px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

/* Login */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-box { width: 100%; max-width: 380px; background: var(--karte); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--linie); }
.login-box .btn { width: 100%; margin-top: .6rem; }

/* Meldungen */
.meldung { padding: .7rem 1rem; border-radius: 8px; margin: .6rem 0; }
.meldung.fehler { background: var(--fehler-bg); color: #fecaca; }
.meldung.ok { background: var(--ok-bg); color: #bbf7d0; }
.meldung.info { background: #172036; color: #bfdbfe; }
.ankuendigung { background: #2a2210; border: 1px solid #5c4813; color: #fde68a; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; white-space: pre-line; }

/* Boxen */
.box { background: var(--karte); border-radius: var(--radius); padding: 1rem 1.2rem; border: 1px solid var(--linie); }
.box + .box { margin-top: 1rem; }
.raster > .box { margin-top: 0; }
body.admin .inhalt { max-width: 1320px; }

/* Menü */
.themen-kopf-zeile { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.thema-zeile { display: grid; grid-template-columns: minmax(170px, 1.4fr) minmax(90px, .8fr) minmax(120px, 1.2fr) 9.5rem;
  grid-template-areas: "name lehrer balken anzahl"; gap: .7rem; align-items: center; padding: .35rem 0; }
.thema-zeile .tz-name { grid-area: name; } .thema-zeile .lehrer { grid-area: lehrer; }
.thema-zeile .balken { grid-area: balken; } .thema-zeile .anzahl { grid-area: anzahl; }
.thema-zeile label { margin: 0; display: flex; align-items: center; cursor: pointer; }
.balken { height: 10px; background: var(--linie); border-radius: 99px; overflow: hidden; }
.balken > span { display: block; height: 100%; background: #15803d; border-radius: 99px; transition: width .3s; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: .8rem; margin-top: 1rem; }
.kachel { background: var(--karte); border-radius: var(--radius); border: 1px solid var(--linie); border-top: 5px solid; padding: .9rem 1rem 1.1rem; cursor: pointer; text-align: left; color: var(--text); font: inherit; transition: transform .1s, filter .15s; }
.kachel:hover { transform: translateY(-2px); filter: brightness(1.1); }
.kachel h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.kachel p { margin: 0; color: var(--grau); font-size: .92rem; }

/* Lernansicht */
.lernkopf { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.lernkopf h2 { margin: 0; font-size: 1.35rem; }
.lernkopf .info { margin-left: auto; color: var(--grau); }
.lernkarte { background: var(--karte); border-radius: var(--radius); border: 3px solid; overflow: hidden; }
.lernkarte .streifen { color: #fff; font-weight: 700; padding: .45rem 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
.lernkarte .innen { padding: 1.3rem 1.5rem 1.5rem; }
.frage { font-size: 1.45rem; font-weight: 700; margin: .4rem 0 .6rem; }
.frage.mitte { text-align: center; margin: 1.6rem 0 1rem; }
.hinweis { color: var(--grau); font-style: italic; text-align: center; }
.trenner { height: 2px; background: var(--linie); margin: 1rem 0; border: 0; }
.antwortliste { margin: 0; padding-left: 1.2rem; }
.antwortliste li { margin: .25rem 0; font-size: 1.05rem; }
.antwortliste li.ohne { list-style: none; margin-left: -1.2rem; }
.merke { background: var(--merke-bg); color: var(--rot); font-weight: 700; padding: .7rem .9rem; border-radius: 8px; margin-top: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .9rem; }
.chip { padding: .25rem .6rem; border-radius: 6px; font-weight: 700; font-size: .9rem; }
.chip.ok { background: var(--ok-bg); color: var(--gruen); }
.chip.nein { background: var(--fehler-bg); color: var(--rot); }
textarea.eingabe { min-height: 9rem; resize: vertical; }

.optionen { display: grid; gap: .55rem; }
.option { text-align: left; background: var(--option); color: var(--text); border: 0; border-radius: 10px; padding: .85rem 1rem; font: inherit; font-size: 1.05rem; cursor: pointer; display: flex; gap: .8rem; }
.option:hover { background: var(--option-aktiv); }
.option .nr { color: var(--grau); font-weight: 700; }
.option.richtig { background: var(--ok-bg); color: var(--gruen); font-weight: 700; }
.option.falsch { background: var(--fehler-bg); color: var(--rot); font-weight: 700; }
.option:disabled { cursor: default; }
.feedback { margin-top: 1rem; }
.feedback p, .blitz-feedback, .fehlerliste .loesung { white-space: pre-line; }
.eselsbruecke { margin: 1.1rem 0 .2rem !important; color: #fde68a; font-weight: 600; }
.feedback h3 { margin: 0 0 .3rem; }

.blitz-aussage { font-size: 1.6rem; font-weight: 700; text-align: center; min-height: 6.5rem; display: grid; place-items: center; padding: 1rem 0; }
.blitz-feedback { text-align: center; font-weight: 700; min-height: 3rem; }
.blitz-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.blitz-knoepfe .btn { font-size: 1.3rem; padding: 1em; }

.ergebnis-zahl { font-size: 3rem; font-weight: 800; text-align: center; margin: .3rem 0 0; }
.ergebnis-text { text-align: center; margin-bottom: 1rem; }
.fehlerliste { background: var(--feld); border-radius: 8px; padding: .6rem 1rem; max-height: 340px; overflow: auto; }
.fehlerliste .eintrag { margin: .6rem 0; }
.fehlerliste .loesung { color: var(--gruen); margin-left: 1.2rem; }
.fehlerliste .anzahl { color: var(--rot); font-weight: 700; }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle th { color: var(--grau); font-weight: 600; font-size: .9rem; }
.tabelle-scroll { overflow-x: auto; }

.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: #1f2937; color: var(--text); padding: .7rem 1.1rem; border-radius: 10px; box-shadow: 0 6px 24px #0008; z-index: 50; max-width: 92vw; }
.toast.fehler { background: #7f1d1d; }

/* Admin */
.admin-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-nav a { padding: .5rem .9rem; border-radius: 8px; background: var(--karte); color: var(--text); text-decoration: none; font-weight: 600; border: 1px solid var(--linie); }
.admin-nav a.aktiv { background: #7e22ce; border-color: #7e22ce; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.zahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: .9rem 1rem; }
.zahl b { display: block; font-size: 1.8rem; }
.zugang { background: var(--feld); border: 1px dashed var(--linie); border-radius: 8px; padding: .7rem .9rem; margin: .5rem 0; font-family: Consolas, "Courier New", monospace; white-space: pre-wrap; }
.status-aktiv { color: var(--gruen); font-weight: 700; }
.status-gesperrt { color: var(--rot); font-weight: 700; }
.aktionen { display: flex; gap: .3rem; flex-wrap: wrap; min-width: 300px; max-width: 420px; }
.aktionen form { margin: 0; }
.punkt { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: middle; margin-right: .4rem; }
.heat { text-align: center !important; font-weight: 700; border-radius: 6px; }
details summary { cursor: pointer; font-weight: 600; }
code { background: var(--feld); padding: .1em .35em; border-radius: 4px; }

@media (max-width: 700px) {
  body { font-size: 15px; }
  .nur-gross { display: none; }
  .thema-zeile { grid-template-columns: 1fr auto; grid-template-areas: "name anzahl" "balken balken"; row-gap: .3rem; }
  .thema-zeile .lehrer { display: none; }
  .frage { font-size: 1.2rem; }
  .lernkarte .innen { padding: 1rem; }
  .blitz-aussage { font-size: 1.25rem; }
  .lernkopf .info { margin-left: 0; width: 100%; }
}

/* Bilder */
.bild { margin: 1rem 0 0; text-align: center; }
.bild img { max-width: 100%; max-height: 340px; border-radius: 10px; background: #fff; padding: 6px; }
.bild figcaption { font-size: .78rem; color: var(--grau); margin-top: .35rem; }
.bild figcaption a { color: var(--grau); }

/* Box-Erklärung */
.box-leiste { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; margin: .4rem 0 .8rem; }
.box-stufe { border-radius: 8px; padding: .45rem .3rem; text-align: center; color: #fff; font-size: .82rem; line-height: 1.25; }
.box-stufe b { display: block; font-size: .95rem; }
.box-regeln { margin: 0 0 1rem; padding-left: 1.1rem; }
.box-regeln li { margin: .2rem 0; }
@media (max-width: 700px) { .box-stufe { font-size: .7rem; } .box-stufe b { font-size: .8rem; } }

/* Dateien & Update */
.datei-liste code { word-break: break-all; }
.bild-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.bild-kachel { background: var(--feld); border-radius: 8px; padding: .5rem; text-align: center; font-size: .8rem; }
.bild-kachel img { max-width: 100%; max-height: 100px; background: #fff; border-radius: 6px; }
