/* BL-Trainings – gemeinsames Stylesheet */
:root {
    --blau: #1f3a5f;
    --blau-hell: #2e5a8f;
    --hintergrund: #f4f6f9;
    --flaeche: #ffffff;
    --rand: #d6dde6;
    --text: #1d2430;
    --text-leise: #5b6676;
    --gruen: #1e7a46;
    --gruen-hell: #e6f4ec;
    --rot: #b42318;
    --rot-hell: #fdecea;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--hintergrund);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--blau-hell); }

/* ------------------------------------------------------------ Kopfzeile */
.kopf { background: var(--blau); color: #fff; }
.kopf-innen {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 1.15rem; color: #fff; text-decoration: none; margin-right: auto; }
.menue { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.menue a, .menue button {
    color: #dfe7f1;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    background: none;
    border: none;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
}
.menue a:hover, .menue button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.menue a.aktiv { background: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 600; }
.benutzername { font-size: 0.9rem; color: #c5d2e2; }

/* ------------------------------------------------------------ Inhalt */
main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; flex: 1; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.karte h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.karte p { margin: 0.5rem 0 0; white-space: pre-line; }
.leise { color: var(--text-leise); font-size: 0.9rem; }

.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* ------------------------------------------------------------ Formulare */
.feld { margin-bottom: 0.9rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.95rem; }
label.inline { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--rand);
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau-hell); outline-offset: 1px; }
textarea { min-height: 110px; resize: vertical; }
.zeile { display: flex; gap: 1rem; flex-wrap: wrap; }
.zeile > .feld { flex: 1 1 200px; }

button, .knopf {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    border: 1px solid var(--blau);
    background: var(--blau);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .knopf:hover { background: var(--blau-hell); }
button.zweitrangig { background: #fff; color: var(--blau); }
button.zweitrangig:hover { background: #eef3f9; }
button.gefahr { background: #fff; color: var(--rot); border-color: var(--rot); }
button.gefahr:hover { background: var(--rot-hell); }
button.klein { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
button:disabled { opacity: 0.6; cursor: wait; }
.knoepfe { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------ Meldungen */
.meldung { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid transparent; }
.meldung.erfolg { background: var(--gruen-hell); color: var(--gruen); border-color: #b6dfc6; }
.meldung.fehler { background: var(--rot-hell); color: var(--rot); border-color: #f5c2bd; }

/* ------------------------------------------------------------ Tabellen */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--flaeche); border: 1px solid var(--rand); }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { background: #eef2f7; font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
td.zahl, th.zahl { text-align: right; }
td input[type="number"] { max-width: 110px; }
tfoot td { font-weight: 700; background: #f7f9fb; }
tr.waehlbar { cursor: pointer; }
tr.waehlbar:hover td { background: #f3f7fc; }

.marke { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; background: #eef2f7; color: var(--blau); }
.marke.inaktiv { background: var(--rot-hell); color: var(--rot); }
.marke.erledigt { background: var(--gruen-hell); color: var(--gruen); }

.leer { color: var(--text-leise); font-style: italic; padding: 1rem 0; }

/* ------------------------------------------------------------ Öffentliche Seite */
.held { background: linear-gradient(135deg, var(--blau), var(--blau-hell)); color: #fff; padding: 3.5rem 1.25rem; }
.held-innen { max-width: 1100px; margin: 0 auto; }
.held h1 { font-size: 2.1rem; margin-bottom: 0.5rem; }
.held p { font-size: 1.1rem; max-width: 640px; color: #dfe7f1; }
.held .knopf { background: #fff; color: var(--blau); border-color: #fff; margin-top: 1rem; }

.anmelde-karte { max-width: 420px; margin: 2rem auto; }

/* ------------------------------------------------------------ Fußzeile */
.fuss { border-top: 1px solid var(--rand); background: var(--flaeche); }
.fuss-innen {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-leise);
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .held h1 { font-size: 1.6rem; }
    main { padding: 1.25rem 0.9rem 2rem; }
}

/* ================================================================
   Öffentliche Startseite
   ================================================================ */
html { scroll-behavior: smooth; }
.oeffentlich main { max-width: 1100px; padding-top: 0; }
.oeffentlich section[id] { scroll-margin-top: 80px; }

.kopf-oeffentlich { position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08); }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; }
.logo-zeichen {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    background: #fff;
    color: var(--blau);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.menue a.menue-login { border: 1px solid rgba(255, 255, 255, 0.5); margin-left: 0.5rem; }
.menue a.menue-login:hover { background: #fff; color: var(--blau); }

.ueberzeile {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blau-hell);
    margin: 0 0 0.4rem;
}

/* Kopfbereich */
.held { padding: 4.5rem 1.25rem 4rem; }
.held .ueberzeile { color: #a9c3e3; }
.held h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.15; margin: 0 0 1rem; }
.held-text { font-size: 1.15rem; color: #dfe7f1; max-width: 560px; margin: 0 0 1.75rem; }
.held-zweispaltig {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}
.held .knopf { margin-top: 0; }
.held .knopf.knopf-hell { background: #fff; color: var(--blau); border-color: #fff; }
.held .knopf.knopf-hell:hover { background: #e8eef6; }
.held .knopf.knopf-umriss { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.held .knopf.knopf-umriss:hover { background: rgba(255, 255, 255, 0.12); }

.fakten-karte {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}
.fakten-karte h2 { font-size: 1rem; margin: 0 0 1rem; color: #fff; }
.fakten-karte dl { margin: 0; display: grid; gap: 0.75rem; }
.fakten-karte dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; }
.fakten-karte dt { color: #a9c3e3; font-size: 0.9rem; }
.fakten-karte dd { margin: 0; color: #fff; font-weight: 600; }

/* Kennzahlen */
.kennzahlen { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.kennzahlen-innen {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.kennzahlen strong { display: block; font-size: 1.9rem; color: var(--blau); line-height: 1.1; }
.kennzahlen span { color: var(--text-leise); font-size: 0.92rem; }

/* Abschnitte */
.abschnitt { padding: 3.5rem 0 0.5rem; }
.abschnitt > h2 { font-size: 1.75rem; margin: 0 0 1.5rem; }
.zweispaltig {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
.zweispaltig h2 { font-size: 1.75rem; margin: 0 0 1rem; }

/* Angebot */
.angebot-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.angebot {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.angebot h3 { margin: 0.25rem 0 0; font-size: 1.15rem; }
.angebot p { margin: 0; }
.angebot .knopf { align-self: flex-start; margin-top: auto; }
.angebot.hervorgehoben { border: 2px solid var(--blau); box-shadow: 0 8px 24px rgba(31, 58, 95, 0.1); }
.haken { list-style: none; padding: 0; margin: 0.25rem 0; display: grid; gap: 0.35rem; }
.haken li { padding-left: 1.6rem; position: relative; }
.haken li::before { content: "✓"; position: absolute; left: 0; color: var(--gruen); font-weight: 700; }
.knopf.knopf-umriss-dunkel { background: #fff; color: var(--blau); }
.knopf.knopf-umriss-dunkel:hover { background: #eef3f9; }

/* Ablauf */
.schritte {
    list-style: none;
    counter-reset: schritt;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.schritte li {
    counter-increment: schritt;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: 1.5rem 1.25rem 1.25rem;
}
.schritte li::before {
    content: counter(schritt);
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--blau);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.schritte h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.schritte p { margin: 0; color: var(--text-leise); }
.hinweis {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--blau);
    background: #eef3f9;
    border-radius: 0 8px 8px 0;
}

.standort p { margin: 0.75rem 0 0; white-space: normal; }

/* Fußzeile groß */
.fuss-gross { margin-top: 4rem; }
.fuss-spalten { justify-content: space-between; align-items: flex-start; padding: 2rem 1.25rem; }
.fuss-spalten nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

@media (max-width: 820px) {
    .held-zweispaltig, .zweispaltig { grid-template-columns: 1fr; gap: 2rem; }
    .held { padding: 3rem 1.25rem; }
    .kopf-oeffentlich { position: static; }
}

/* Feinschliff: Ausrichtung und Marken */
.held { padding-left: 0; padding-right: 0; }
.held-innen { padding: 0 1.25rem; }
.angebot .marke { align-self: flex-start; }

/* Logo: weiße Fläche, weil das Logo blau auf weiß gestaltet ist */
.logo {
    background: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    line-height: 0;
}
.logo-bild { height: 40px; width: auto; display: block; }
@media (max-width: 640px) { .logo-bild { height: 32px; } }

/* ================================================================
   Heller Seitenkopf: Das Logo (blau auf weiß) steht ohne Kasten
   ================================================================ */
.kopf { background: #fff; color: var(--text); border-bottom: 1px solid var(--rand); }
.kopf-oeffentlich { box-shadow: 0 2px 10px rgba(31, 58, 95, 0.06); }
.logo { background: none; padding: 0; border-radius: 0; }
.logo-bild { height: 46px; }
.menue a, .menue button { color: var(--text); }
.menue a:hover, .menue button:hover { background: #eef3f9; color: var(--blau); }
.menue a.aktiv { background: #e3ebf5; color: var(--blau); }
.menue a.menue-login { border: 1px solid var(--blau); color: var(--blau); font-weight: 600; }
.menue a.menue-login:hover { background: var(--blau); color: #fff; }
.benutzername { color: var(--text-leise); }
@media (max-width: 640px) { .logo-bild { height: 36px; } }

/* ================================================================
   Fotos
   ================================================================ */
/* Kopfbereich: Foto im Hintergrund, dunkelblau überlagert, damit der Text lesbar bleibt */
.oeffentlich .held {
    background:
        linear-gradient(115deg, rgba(31, 58, 95, 0.96) 0%, rgba(31, 58, 95, 0.88) 45%, rgba(46, 90, 143, 0.72) 100%),
        url("/static/img/held.jpg") center / cover no-repeat,
        var(--blau);
}

.bilderleiste {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    padding-top: 2.5rem;
}
.bilderleiste figure { margin: 0; }
.bilderleiste img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: #dfe5ee;
}
.bilderleiste figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--text-leise); }
@media (max-width: 820px) { .bilderleiste { grid-template-columns: 1fr; } }

/* ================================================================
   Geschützter Bereich (App)
   ================================================================ */
[hidden] { display: none !important; }

/* Blaues Seitenband mit Titel – greift das Design der Startseite auf */
.app-band { background: linear-gradient(115deg, var(--blau), var(--blau-hell)); color: #fff; }
.app-band-innen { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 1.6rem; }
.app-band h1 { margin: 0 0 0.25rem; font-size: 1.7rem; }
.app-band p { margin: 0; color: #d3dfee; }
.app-inhalt { padding-top: 1.75rem; }

/* Benutzer-Anzeige rechts im Kopf */
.benutzername { display: flex; align-items: center; gap: 0.65rem; }
.benutzername strong { display: block; color: var(--text); font-size: 0.92rem; line-height: 1.2; }
.benutzername small { display: block; color: var(--text-leise); font-size: 0.8rem; }
.initialen {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: none;
    border-radius: 50%;
    background: #e3ebf5;
    color: var(--blau);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
}
.initialen.klein { width: 2rem; height: 2rem; font-size: 0.78rem; }

/* Raster: Hauptinhalt links, Seitenleiste rechts */
.app-raster { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.seitenleiste { position: sticky; top: 1rem; }
.schmal { max-width: 760px; }
h2.erste { margin-top: 0; }
.karte h3 { margin-bottom: 0.9rem; }
.werkzeugleiste { gap: 1rem; padding-bottom: 0.35rem; }

h3.schritt { display: flex; align-items: center; gap: 0.6rem; }
h3.schritt span {
    display: inline-grid; place-items: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--blau); color: #fff; font-size: 0.85rem;
}

/* Tabellen etwas ruhiger */
td { vertical-align: middle; }
tbody tr:hover td { background: #f8fafc; }
.tabelle-huelle { border-radius: var(--radius); }

/* Anwesenheitsliste im Klassenbuch */
.anwesenheit { list-style: none; margin: 0 0 0.75rem; padding: 0; border: 1px solid var(--rand); border-radius: var(--radius); }
.anwesenheit li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--rand);
}
.anwesenheit li:last-child { border-bottom: none; }
.anwesenheit .name { font-weight: 600; }
.anwesenheit .schnell { display: flex; gap: 0.35rem; }
.anwesenheit .stunden { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 400; }
.anwesenheit .stunden input { width: 5rem; text-align: right; }
.anwesenheit .marke { white-space: nowrap; }

/* Verlauf der bisherigen Einträge */
.verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; max-height: 60vh; overflow-y: auto; }
.verlauf button {
    width: 100%;
    text-align: left;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--rand);
    font-weight: 400;
    padding: 0.55rem 0.75rem;
}
.verlauf button:hover { background: #f3f7fc; border-color: var(--blau-hell); }
.verlauf button.aktiv { border-color: var(--blau); background: #e9f0f8; box-shadow: inset 3px 0 0 var(--blau); }
.verlauf strong { display: block; font-size: 0.85rem; color: var(--blau); }
.verlauf span { display: block; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kennzahl-Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.25rem; }
.kachel strong { display: block; font-size: 1.6rem; color: var(--blau); line-height: 1.2; }
.kachel span { color: var(--text-leise); font-size: 0.9rem; }

/* Kurze Rückmeldungen unten rechts */
#hinweise { position: fixed; right: 1.25rem; bottom: 1.25rem; display: grid; gap: 0.5rem; z-index: 50; }
.toast {
    padding: 0.75rem 1.1rem;
    border-radius: 8px;
    background: var(--gruen);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    max-width: 360px;
    transition: opacity 0.4s, transform 0.4s;
    animation: einblenden 0.25s ease-out;
}
.toast.fehler { background: var(--rot); }
.toast.weg { opacity: 0; transform: translateY(8px); }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
    .app-raster { grid-template-columns: 1fr; }
    .seitenleiste { position: static; }
    .anwesenheit li { grid-template-columns: auto minmax(0, 1fr) auto; }
    .anwesenheit .schnell { grid-column: 2 / -1; }
    .anwesenheit .stunden { grid-column: 2 / -1; }
    .benutzername strong, .benutzername small { display: none; }
}
.verlauf li { min-width: 0; }
.verlauf button { display: block; overflow: hidden; }

/* Anwesenheit: Umschalter Anwesend/Abwesend und Bemerkung */
.anwesenheit li { grid-template-columns: auto minmax(0, 0.9fr) auto minmax(0, 1.4fr); }
.umschalter { display: inline-flex; gap: 0.3rem; }
button.auswahl-da { background: var(--gruen); border-color: var(--gruen); color: #fff; }
button.auswahl-weg { background: var(--rot); border-color: var(--rot); color: #fff; }
.anwesenheit input.bemerkung { padding: 0.4rem 0.6rem; font-size: 0.92rem; }
@media (max-width: 900px) {
    .anwesenheit li { grid-template-columns: auto minmax(0, 1fr); }
    .anwesenheit .umschalter, .anwesenheit input.bemerkung { grid-column: 2 / -1; }
}
/* Bei vielen Menüpunkten (Admin) nur Initialen statt Name zeigen, damit der Kopf einzeilig bleibt */
@media (max-width: 1400px) { .benutzername strong, .benutzername small { display: none; } }

/* ---------- Nachweise (LF-16) */
button.link {
    background: none; border: none; padding: 0; color: var(--blau);
    text-decoration: underline; cursor: pointer; font: inherit; text-align: left;
    word-break: break-all;
}
button.link:hover { background: none; color: var(--blau); text-decoration: none; }
.nachweis-liste { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
