/* Unterrichtsplanung – Farben angelehnt an das XUND-Moodle (Blau, Türkis, Rot) */
:root {
  --blau: #0056b3; --blau-hell: #e8f0fa; --tuerkis: #00b8b9; --tuerkis-hell: #e6fbfb;
  --rot: #e60028; --rot-hell: #fff0f2; --gruen: #2d7a4f; --gruen-hell: #e5f2ea;
  --orange: #9a6200; --orange-hell: #fbf0dc; --tinte: #1d232b; --grau: #5a6573;
  --linie: #dde3ea; --flaeche: #f6f8fb; --weiss: #fff; --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--tinte); background: var(--flaeche); line-height: 1.45; }
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.klein { font-size: .85rem; } .grau { color: var(--grau); } .rechts { text-align: right; }
.zeile { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.zwischen { justify-content: space-between; }

/* Kopf */
.kopf { background: var(--weiss); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 20; }
.kopf-innen { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 1.2rem; padding: .55rem 1.2rem; }
.marke { font-weight: 700; color: var(--tinte); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.marke span.punkt { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, var(--blau), var(--tuerkis)); display: inline-block; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.nav a { color: var(--grau); padding: .4rem .7rem; border-radius: 6px; font-weight: 500; }
.nav a:hover, .nav a.aktiv { background: var(--blau-hell); color: var(--blau); text-decoration: none; }
.kopf form.suche input { width: 200px; }
.kopf .rechts-ende { margin-left: auto; display: flex; gap: .6rem; align-items: center; }

main { max-width: 1400px; margin: 0 auto; padding: 1.2rem; }
.unterzeile { color: var(--grau); margin-bottom: 1rem; }

/* Karten und Raster */
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.1rem; }
.karte + .karte { margin-top: 1rem; }
.raster { display: grid; gap: 1rem; }
.raster-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.raster-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kennzahl { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem; }
.kennzahl b { font-size: 1.6rem; display: block; }
.kennzahl.warnung b { color: var(--orange); } .kennzahl.fehler b { color: var(--rot); }

/* Knöpfe und Formulare */
.knopf, button { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--linie); background: var(--weiss); color: var(--tinte); padding: .42rem .8rem; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.knopf:hover, button:hover { border-color: var(--blau); color: var(--blau); text-decoration: none; }
.knopf.haupt, button.haupt { background: var(--blau); border-color: var(--blau); color: #fff; }
.knopf.haupt:hover, button.haupt:hover { background: #00448f; color: #fff; }
.knopf.gefahr, button.gefahr { color: var(--rot); }
.knopf.klein, button.klein { padding: .2rem .5rem; font-size: .85rem; }
input, select, textarea { font: inherit; border: 1px solid var(--linie); border-radius: 6px; padding: .38rem .5rem; background: #fff; color: var(--tinte); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau-hell); border-color: var(--blau); }
textarea { width: 100%; resize: vertical; }
form.formular p { margin: 0 0 .9rem; }
form.formular label { display: block; font-weight: 600; margin-bottom: .2rem; }
form.formular .helptext { display: block; color: var(--grau); font-size: .85rem; }
form.formular input[type=text], form.formular input[type=number], form.formular select, form.formular textarea, form.formular input[type=date], form.formular input[type=time] { width: 100%; max-width: 560px; }
form.formular ul { list-style: none; padding: 0; margin: .2rem 0; }
form.inline { display: inline; }
.errorlist { color: var(--rot); margin: .2rem 0; padding-left: 1rem; }

/* Tabellen */
table.liste { width: 100%; border-collapse: collapse; background: var(--weiss); }
table.liste th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--grau); padding: .5rem .55rem; border-bottom: 2px solid var(--linie); background: var(--flaeche); position: sticky; top: 52px; z-index: 5; }
table.liste td { padding: .5rem .55rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:hover td { background: #fafcff; }
table.liste tr.vergangen td { color: var(--grau); }
table.liste tr.pruefung td { background: var(--rot-hell); }
table.liste tr.sperre td { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fdf2f2 6px, #fdf2f2 12px); }
.datum { font-weight: 600; white-space: nowrap; }
.nr { font-weight: 700; color: var(--blau); white-space: nowrap; }

/* Etiketten */
.etikett { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--flaeche); color: var(--grau); border: 1px solid var(--linie); white-space: nowrap; }
.etikett.theorie { background: var(--blau-hell); color: var(--blau); border-color: #c9dbf2; }
.etikett.praxis { background: var(--tuerkis-hell); color: #007f80; border-color: #b8eeee; }
.etikett.pruefung { background: var(--rot-hell); color: var(--rot); border-color: #f6c6cf; }
.etikett.exkursion { background: var(--orange-hell); color: var(--orange); border-color: #ecd3a3; }
.etikett.offen { background: #fff; } .etikett.in_bearbeitung { background: var(--orange-hell); color: var(--orange); }
.etikett.geplant { background: var(--blau-hell); color: var(--blau); } .etikett.durchgefuehrt { background: var(--gruen-hell); color: var(--gruen); }
.etikett.ausgefallen { text-decoration: line-through; }
.etikett.gruppe { background: #f1ecff; color: #5b3fb3; border-color: #ddd2fb; }
.meldung { font-size: .82rem; margin-top: .2rem; }
.meldung.fehler { color: var(--rot); } .meldung.hinweis { color: var(--orange); }

.block-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--blau-hell); border-radius: 6px; padding: .1rem .45rem; margin: 0 .25rem .25rem 0; font-size: .88rem; }
.block-chip button { border: 0; background: transparent; padding: 0 .1rem; color: var(--grau); }
.block-chip button:hover { color: var(--rot); }
select.block-wahl { max-width: 230px; font-size: .85rem; padding: .2rem; }

/* Nachrichten */
.nachrichten { list-style: none; padding: 0; margin: 0 0 1rem; }
.nachrichten li { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .4rem; background: var(--blau-hell); border-left: 4px solid var(--blau); }
.nachrichten li.success { background: var(--gruen-hell); border-color: var(--gruen); }
.nachrichten li.warning { background: var(--orange-hell); border-color: var(--orange); }
.nachrichten li.error { background: var(--rot-hell); border-color: var(--rot); }

/* Feinplanung */
.fp-kopf { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.fp-kopf label { font-weight: 600; font-size: .85rem; display: block; margin-bottom: .15rem; }
.fp-summen { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .92rem; padding: .5rem .8rem; background: var(--blau-hell); border-radius: 6px; margin: .8rem 0; }
table.fp { width: 100%; border-collapse: collapse; }
table.fp th { background: var(--blau); color: #fff; text-align: left; padding: .4rem; font-size: .85rem; }
table.fp td { border-bottom: 1px solid var(--linie); padding: .3rem; vertical-align: top; }
table.fp td textarea, table.fp td input[type=text] { width: 100%; font-size: .9rem; }
table.fp td textarea { min-height: 3.2rem; }
table.fp tr.pause td { background: #f1f2f4; }
table.fp .zeit { font-weight: 700; white-space: nowrap; font-size: .9rem; }
table.fp .werkzeuge { white-space: nowrap; }
table.fp .werkzeuge button { padding: .1rem .35rem; font-size: .8rem; }
.speicherstatus { font-size: .85rem; color: var(--grau); }
.speicherstatus.ok { color: var(--gruen); } .speicherstatus.fehler { color: var(--rot); }

details.aufklapp { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .6rem .9rem; margin-top: .8rem; }
details.aufklapp summary { cursor: pointer; font-weight: 600; }
pre.code { background: #0f1720; color: #e6edf3; padding: .8rem; border-radius: 6px; overflow: auto; max-height: 280px; font-size: .8rem; }
.vorschau-moodle { border: 1px dashed var(--linie); padding: 1rem; background: #fff; border-radius: 6px; }

.anmelde-seite { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #eef4f9, #e6fbfb); }
.anmelde-karte { width: min(420px, 92vw); background: #fff; border-radius: 12px; padding: 1.8rem; box-shadow: 0 10px 40px rgba(0,40,90,.12); }
.anmelde-karte input { width: 100%; }
.anmelde-karte p { margin: 0 0 .8rem; }
.codes { font-family: monospace; font-size: 1.1rem; columns: 2; }

@media (max-width: 800px) {
  .kopf-innen { flex-wrap: wrap; }
  .raster-2 { grid-template-columns: 1fr; }
  table.liste th { position: static; }
}

/* Kalender */
.kalender { margin-bottom: 1rem; }
.kal-nav { display: inline-flex; gap: 2px; }
.kal-nav .knopf { min-width: 2rem; justify-content: center; }
.kal-raster { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--linie); border: 1px solid var(--linie); margin-top: .8rem; border-radius: 6px; overflow: hidden; }
.kal-kopf { background: var(--flaeche); text-align: center; font-size: .8rem; font-weight: 600; color: var(--grau); padding: .25rem; }
.kal-tag { background: #fff; min-height: 5.2rem; padding: .25rem .3rem; min-width: 0; }
.kal-raster.woche .kal-tag { min-height: 9rem; }
.kal-tag.we { background: #fafbfc; } .kal-tag.fremd { background: #f4f5f7; } .kal-tag.fremd .kal-datum { color: #a9b1bb; }
.kal-tag.heute { box-shadow: inset 0 0 0 2px var(--blau); }
.kal-tag.sperre { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fdf2f2 6px, #fdf2f2 12px); }
.kal-datum { font-size: .8rem; font-weight: 600; color: var(--grau); display: block; }
.kal-sperre { font-size: .72rem; color: var(--rot); }
.kal-termin { display: block; font-size: .78rem; line-height: 1.25; margin-top: 2px; padding: 1px 4px; border-left: 4px solid var(--blau); background: var(--blau-hell); border-radius: 3px; color: var(--tinte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-raster.woche .kal-termin { white-space: normal; padding: 3px 5px; }
.kal-termin:hover { background: #d9e7f8; text-decoration: none; }
.kal-termin.gross { font-size: .95rem; white-space: normal; padding: .5rem .7rem; margin-top: .5rem; }
.kal-zeit { color: var(--grau); }
table.vorschau input, table.vorschau select { font-size: .82rem; padding: .15rem .25rem; }
.fuss { max-width: 1400px; margin: 1.5rem auto .8rem; padding: 0 1.2rem; color: var(--grau); font-size: .78rem; }
@media (max-width: 800px) { .kal-raster.woche { grid-template-columns: 1fr; } .kal-raster.woche .kal-kopf { display: none; } .kal-raster.woche .kal-tag { min-height: 0; } }
