/* Berufsbildung – ruhiges Design, Karten ohne Rahmen mit weichem Schatten, keine externen Schriften. */
:root {
  --grund: #f2f4f7; --karte: #ffffff; --text: #17212f; --leise: #556170; --linie: #edf0f4;
  --kopf: #131c2b; --kopf-text: #c3cddb; --akzent: #1d5fd0; --akzent-dunkel: #174ba6; --feld: #eef1f5; --feld-rand: #c9d1dc;
  --schatten: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.06);
  --blau-bg: #e3ecfb; --blau: #1a4fae; --orange-bg: #fdebd3; --orange: #7a4200; --gruen-bg: #dcf2e4; --gruen: #17623a;
  --grau-bg: #e9edf2; --grau: #3c4756; --rot-bg: #fbe1e1; --rot: #9b1c1c; --dunkel-bg: #17212f; --dunkel: #ffffff;
  --schule-bg: #1d5fd0; --schule: #ffffff; --leerzelle: #f6f8fa; --balken2: #a9c4f0;
}
html[data-thema="dunkel"] {
  --grund: #0f1622; --karte: #1a2333; --text: #e8edf5; --leise: #a9b5c7; --linie: #263145;
  --kopf: #0a0f18; --akzent: #3b7be6; --akzent-dunkel: #5a92f0; --feld: #263145; --feld-rand: #3a4963;
  --schatten: 0 6px 24px rgba(0, 0, 0, 0.35);
  --blau-bg: #223a66; --blau: #b9d2ff; --orange-bg: #4a3413; --orange: #ffd08a; --gruen-bg: #173a29; --gruen: #9fe0b8;
  --grau-bg: #2a3447; --grau: #cfd8e6; --rot-bg: #4a1c1c; --rot: #ffb4b4; --dunkel-bg: #e8edf5; --dunkel: #0f1622;
  --schule-bg: #2f6ad8; --leerzelle: #141b28; --balken2: #34507f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body.fenster-offen { overflow: hidden; }
h1, h2, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
a { color: var(--akzent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--akzent-dunkel); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.stark { font-weight: 600; }
.laden { padding: 48px 24px; text-align: center; color: var(--leise); }
[hidden] { display: none !important; }

/* Kopf mit Reitern */
.kopf { background: var(--kopf); color: #fff; }
.kopf-innen { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.marke { display: flex; align-items: center; gap: 10px; padding: 16px 0; font-weight: 700; font-size: 17px; color: #fff; }
.marke svg { color: #8fb8ff; }
.reiter { display: flex; gap: 4px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a { color: var(--kopf-text); padding: 17px 14px 14px; border-bottom: 3px solid transparent; font-weight: 500; white-space: nowrap; }
.reiter a:hover { color: #fff; }
.reiter a[aria-current="page"] { color: #fff; border-bottom-color: #6ea4ff; font-weight: 600; }
.kopf-rechts { display: flex; align-items: center; gap: 8px; padding: 8px 0; margin-left: auto; }
.kopf-rechts .rund { color: #dbe4f2; }
.kopf-rechts .rund:hover { background: #2a3650; }
.kuerzel { width: 36px; height: 36px; border-radius: 50%; background: #2f5fb3; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.seitenkopf p { margin-top: 4px; color: var(--leise); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Knöpfe */
.btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--karte); color: var(--text); font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { filter: brightness(0.97); }
.btn.primaer { background: var(--akzent); color: #fff; box-shadow: none; }
.btn.primaer:hover { background: var(--akzent-dunkel); filter: none; }
.btn.still { background: var(--feld); box-shadow: none; }
.btn.rot { background: var(--rot-bg); color: var(--rot); box-shadow: none; }
.btn.text { background: transparent; color: var(--akzent); box-shadow: none; padding: 0 8px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.rund { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--leise); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.rund:hover { background: var(--feld); color: var(--text); }

/* Karten */
.karte { background: var(--karte); border-radius: 14px; padding: 20px; box-shadow: var(--schatten); min-width: 0; }
.kartenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.kartenkopf .knoepfe { gap: 8px; }
.raster { display: flex; flex-wrap: wrap; gap: 20px; }
.raster > * { flex: 1 1 300px; }
.spalten { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.spalten > .schmal { flex: 2 1 320px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.spalten > .breit { flex: 3 1 480px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.leerhinweis { color: var(--leise); padding: 8px 0; }

/* Chips */
.chip { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grau-bg); color: var(--grau); }
.c-blau { background: var(--blau-bg); color: var(--blau); }
.c-orange { background: var(--orange-bg); color: var(--orange); }
.c-gruen { background: var(--gruen-bg); color: var(--gruen); }
.c-rot { background: var(--rot-bg); color: var(--rot); }
.c-dunkel { background: var(--dunkel-bg); color: var(--dunkel); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Lernenden-Karte */
.person { display: flex; flex-direction: column; gap: 14px; }
.person-kopf { display: flex; align-items: center; gap: 12px; }
.person-kopf > div { flex: 1 1 auto; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--blau-bg); color: var(--blau); }
.avatar.gross { width: 60px; height: 60px; font-size: 20px; }
.av-1 { background: var(--orange-bg); color: var(--orange); }
.av-2 { background: var(--gruen-bg); color: var(--gruen); }
.paare { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.paare > div { display: flex; justify-content: space-between; gap: 12px; }
.paare > div > span:first-child { color: var(--leise); flex: none; }
.paare > div > span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.balkenzeile { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--leise); margin-bottom: 6px; }
.balken { height: 8px; border-radius: 999px; background: var(--grau-bg); display: flex; overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--akzent); }
.balken > i + i { background: var(--balken2); }
.balken.neutral > i { background: var(--text); }
.person-fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.person-fuss a { padding: 12px 0; }

/* Wochenraster und Jahresraster */
.rollen { overflow-x: auto; position: relative; }
.woche { min-width: 640px; display: grid; grid-template-columns: 160px repeat(5, minmax(0, 1fr)); gap: 8px; align-items: center; font-size: 13px; }
.woche .kopfz { color: var(--leise); font-weight: 600; }
.woche .kopfz.heute { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.zelle { border-radius: 8px; padding: 8px 10px; background: var(--feld); color: var(--grau); }
.zelle.schule { background: var(--schule-bg); color: var(--schule); }
.zelle.uek { background: var(--dunkel-bg); color: var(--dunkel); }
.zelle.praktikum { background: var(--orange-bg); color: var(--orange); }
.zelle.ferien { background: var(--gruen-bg); color: var(--gruen); }
.zelle.leer { background: transparent; color: var(--leise); }
.jahr { min-width: 940px; display: grid; grid-template-columns: 150px repeat(12, minmax(0, 1fr)); gap: 8px 4px; align-items: stretch; font-size: 12px; text-align: center; }
.jahr .kopfz { color: var(--leise); font-weight: 600; padding: 2px 0; }
.jahr .kopfz.jetzt { background: var(--dunkel-bg); color: var(--dunkel); border-radius: 6px; }
.jahr .wer { text-align: left; font-size: 13px; font-weight: 600; align-self: center; }
.jahr .feldz { background: var(--leerzelle); border-radius: 8px; padding: 6px 3px; display: flex; flex-direction: column; gap: 4px; min-height: 40px; justify-content: center; }
.jahr .feldz .chip { padding: 3px 4px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }

/* Listen */
.zeile { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linie); }
.zeile:first-child { border-top: 0; }
.zeile .mitte { flex: 1 1 auto; min-width: 0; }
.zeile .mitte > div { overflow-wrap: break-word; }
.tag { width: 46px; text-align: center; font-weight: 700; line-height: 1.2; flex: none; }
.tag small { display: block; font-size: 12px; font-weight: 600; color: var(--leise); }
.zeile.erledigt .mitte { color: var(--leise); text-decoration: line-through; }
.haken { width: 22px; height: 22px; flex: none; accent-color: var(--akzent); }
.hakenfeld { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex: none; margin: -6px 0 -6px -11px; }
.neuzeile { display: flex; gap: 8px; margin-top: 12px; }
.neuzeile input { flex: 1 1 auto; min-width: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; vertical-align: middle; }
thead th { color: var(--leise); font-weight: 600; padding-top: 4px; }
tbody tr { border-top: 1px solid var(--linie); }
tbody th { font-weight: 600; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.zahl, th.zahl { text-align: right; }
td.aktion { width: 44px; padding: 0; }

/* Auswahl der Lernenden */
.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl a, .wahl button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--karte); color: var(--grau); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); display: inline-flex; align-items: center; cursor: pointer; }
.wahl a[aria-current="true"] { background: var(--dunkel-bg); color: var(--dunkel); box-shadow: none; }
.wahl .btn.text { box-shadow: none; background: transparent; color: var(--akzent); }

/* Formularfelder */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input[type="password"], input[type="file"], select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--feld-rand); border-radius: 10px; background: var(--karte); padding: 8px 12px; }
textarea { min-height: 120px; resize: vertical; }
select { appearance: auto; }
.filter { display: flex; align-items: center; gap: 8px; color: var(--leise); font-size: 13px; }
.filter select { width: auto; background: var(--feld); border-color: transparent; }
.schalter { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--feld-rand); position: relative; cursor: pointer; flex: none; margin: 0; transition: background 0.15s; }
.schalter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.schalter:checked { background: var(--akzent); }
.schalter:checked::after { transform: translateX(18px); }
.schalterzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-top: 1px solid var(--linie); }
.schalterzeile:first-of-type { border-top: 0; }
.schalterzeile .mitte { flex: 1 1 auto; }

/* Vollbild-Fenster für Erfassen und Bearbeiten */
.fenster { position: fixed; inset: 0; z-index: 50; background: var(--grund); overflow-y: auto; display: flex; flex-direction: column; }
.fensterkopf { background: var(--kopf); color: #fff; display: flex; align-items: center; gap: 8px; padding: 8px 16px; position: sticky; top: 0; z-index: 1; }
.fensterkopf h1 { font-size: 18px; flex: 1 1 auto; letter-spacing: 0; }
.fensterkopf .rund { color: #dbe4f2; }
.fensterkopf .rund:hover { background: #2a3650; color: #fff; }
.fensterinhalt { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.felder { background: var(--karte); border-radius: 14px; padding: 20px; box-shadow: var(--schatten); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feld { grid-column: span 2; display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.feld.halb { grid-column: span 1; }
.feld > span, .feld > legend { font-weight: 600; font-size: 13px; padding: 0; }
.feld small { color: var(--leise); }
.feld.schalterfeld { flex-direction: row; align-items: center; justify-content: space-between; }
.pflicht { color: var(--rot); }
.pillen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pille input { position: absolute; opacity: 0; }
.pille span { min-width: 52px; min-height: 44px; border-radius: 10px; background: var(--feld); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; cursor: pointer; }
.pille input:checked + span { background: var(--akzent); color: #fff; }
.pille input:focus-visible + span { outline: 3px solid var(--akzent); outline-offset: 2px; }
.fehler { background: var(--rot-bg); color: var(--rot); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.gefahr { display: flex; justify-content: flex-start; }

/* Anmeldung */
.anmeldung { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.anmeldung form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.anmeldung .marke { color: var(--text); padding: 0; font-size: 20px; }
.anmeldung .marke svg { color: var(--akzent); }
.anmeldung label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.anmeldung .btn { width: 100%; }

@media (max-width: 640px) {
  main { padding: 20px 14px 56px; gap: 18px; }
  .kopf-innen { padding: 0 14px; gap: 0 12px; }
  .marke { padding: 12px 0; }
  .reiter { order: 3; flex-basis: 100%; margin: 0 -14px; padding: 0 6px; }
  .reiter a { padding: 12px 10px 10px; }
  h1 { font-size: 22px; }
  .karte { padding: 16px; }
  .felder { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .feld, .feld.halb { grid-column: span 1; }
  .fensterinhalt { padding: 16px 12px 56px; }
  .zeile { gap: 6px; }
  .zeile > .chip:not(.c-rot) { display: none; }
  .tag { width: 40px; }
  .seitenkopf .knoepfe { width: 100%; }
  .seitenkopf .knoepfe .btn { flex: 1 1 auto; }
}

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.meldung { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--dunkel-bg); color: var(--dunkel);
  padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--schatten); max-width: calc(100vw - 32px); }

/* Version 1.1.0: Einsatzplan und Kompetenzen */
.eplan { min-width: 940px; }
.eplan-zeile { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.eplan .wer { font-weight: 600; font-size: 13px; }
.eplan .wer small { display: block; font-weight: 400; color: var(--leise); font-size: 12px; }
.eplan-bahn { position: relative; background: var(--leerzelle); border-radius: 8px; overflow: hidden; }
.eplan-bahn.kopfbahn { height: 24px; background: transparent; }
.kopfbahn span { position: absolute; top: 2px; text-align: center; font-size: 12px; font-weight: 600; color: var(--leise); border-radius: 6px; line-height: 20px; }
.kopfbahn span.jetzt { background: var(--dunkel-bg); color: var(--dunkel); }
.eplan-linie { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--linie); }
.eplan-heute { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--rot); z-index: 2; }
.ebalken { position: absolute; height: 34px; border: 0; border-radius: 8px; padding: 0 10px; font-weight: 600; font-size: 13px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; z-index: 1; }
.ebalken:hover { filter: brightness(0.95); }
.e-projekt { background: var(--akzent); color: #fff; }
.e-grund { background: var(--blau-bg); color: var(--blau); }
.e-bau { background: var(--grau-bg); color: var(--grau); }
.e-qv { background: var(--dunkel-bg); color: var(--dunkel); }
.e-sonst { background: var(--gruen-bg); color: var(--gruen); }
.e-prak { background: var(--orange-bg); color: var(--orange); }
.ktab select { width: auto; min-width: 150px; max-width: 240px; background: var(--feld); border-color: transparent; font-size: 13px; }
.ktab select.warn { background: var(--orange-bg); color: var(--orange); }
.ktab select.st-selbstaendig { background: var(--gruen-bg); color: var(--gruen); }
.ktab select.st-geuebt { background: var(--orange-bg); color: var(--orange); }
.ktab select.st-eingefuehrt { background: var(--blau-bg); color: var(--blau); }
.semknopf { min-height: 44px; padding: 0 2px; font-size: 13px; }
a.rund, a.btn { text-decoration: none; }
a.btn, a.btn:hover { color: var(--text); }

/* Version 1.2.0: Bereiche und Leistungsziele */
.ktab tr.bereich { border-top: 0; }
.ktab tr.bereich th { padding: 22px 0 6px; color: var(--leise); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.ktab tbody tr.bereich:first-child th { padding-top: 6px; }
.ktab tr.lz td { background: var(--leerzelle); }
.ktab tr.lz td:first-child { padding-left: 52px; }
.ktab tr.lz td:last-child { padding-right: 0; }
.kzeile { display: flex; align-items: center; gap: 4px; }
.kzeile .rund { margin-left: -8px; }
.klapp svg { transition: transform 0.15s; }
.klapp.auf svg { transform: rotate(90deg); }
.quelle { font-size: 12px; font-weight: 500; white-space: nowrap; margin-left: 4px; }
.ktab td:nth-child(2) { white-space: nowrap; }
.feld.zwischen { padding-top: 14px; border-top: 1px solid var(--linie); }
.feld.zwischen:first-child { padding-top: 0; border-top: 0; }
.feld.zwischen h2 { font-size: 16px; }
