/* Reset, Seitengerüst (Sidebar/Inhalt) und Grundtypografie. */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-font-smoothing: antialiased;
}

/* Gerüst: feste Sidebar links, scrollender Inhalt rechts. */
.huelle {
    display: grid;
    grid-template-columns: var(--nav-breite) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Dunkle Seitennavigation ---------- */

.seitennav {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
    padding: 1.4rem 0.9rem 1.1rem;
    background: var(--nav-bg);
    border-right: 1px solid var(--nav-rand);
    color: var(--nav-text);
    overflow-y: auto;
}

.marke {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.5rem;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--nav-text);
    text-decoration: none;
}

.marke-zeichen {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--verlauf-primaer);
    border-radius: var(--radius-klein);
    box-shadow: var(--schatten-akzent);
}

.marke-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Suche in der Navigation */
.nav-suche { position: relative; margin: 0; display: block; }

.nav-suche svg {
    position: absolute;
    top: 50%;
    left: 0.7rem;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: var(--nav-gedimmt);
    pointer-events: none;
}

.nav-suche input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.1rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--nav-text);
    background: var(--nav-bg-tief);
    border: 1px solid var(--nav-rand);
    border-radius: var(--radius-klein);
}

.nav-suche input::placeholder { color: var(--nav-gedimmt); }
.nav-suche input:focus-visible {
    outline: none;
    border-color: var(--akzent);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 25%);
}

/* Verweisgruppen */
.nav-gruppe { display: grid; gap: 0.15rem; }

.nav-titel {
    margin: 0 0 0.35rem;
    padding: 0 0.6rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nav-gedimmt);
}

.nav-verweis {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    font-size: 0.88rem;
    color: var(--nav-gedimmt);
    text-decoration: none;
    border-radius: var(--radius-klein);
    border: 0;
    background: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.nav-verweis svg { flex: none; width: 1.1rem; height: 1.1rem; }
.nav-verweis:hover { background: var(--nav-aktiv); color: var(--nav-text); }
.nav-verweis:focus-visible { outline: 2px solid var(--akzent-hell); outline-offset: -2px; }

.nav-verweis.ist-aktiv {
    background: var(--nav-aktiv);
    color: #fff;
    font-weight: 550;
    box-shadow: inset 2px 0 0 var(--akzent-hell);
}

.nav-unterliste {
    display: grid;
    gap: 0.1rem;
    margin: 0.1rem 0 0;
    padding: 0 0 0 1.75rem;
    list-style: none;
    border-left: 1px solid var(--nav-aktiv);
    margin-left: 1.15rem;
}

.nav-unterpunkt {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
}

/* Geöffneter Zweig: der Sammelpunkt hebt sich ab, die Markierung trägt der Lehrgang. */
.nav-verweis.ist-zweig { color: var(--nav-text); }

.nav-unterpunkt.ist-aktiv { box-shadow: inset 2px 0 0 var(--akzent-hell); }

.nav-zahl {
    margin-left: auto;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35rem;
    text-align: center;
    color: #fff;
    background: var(--akzent-tief);
    border-radius: var(--radius-pille);
    font-variant-numeric: tabular-nums;
}

/* Fuss der Navigation */
.nav-fuss { margin-top: auto; display: grid; gap: 0.15rem; padding-top: 0.9rem; border-top: 1px solid var(--nav-rand); }

.nav-konto {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-klein);
}

.nav-punkt {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    color: #fff;
    background: var(--verlauf-kuehl);
    border-radius: var(--radius-pille);
}

.nav-konto-text { min-width: 0; line-height: 1.3; }
.nav-konto-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 550;
    color: var(--nav-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-konto-rolle { display: block; font-size: 0.72rem; color: var(--nav-gedimmt); }

.abmelden { margin: 0; display: block; }

/* ---------- Inhaltsspalte ---------- */

.inhalt { display: flex; flex-direction: column; min-width: 0; }

main { width: 100%; max-width: 74rem; margin: 0 auto; padding: 2.25rem 2rem 4rem; flex: 1; }

.fuss {
    max-width: 74rem;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem 2.5rem;
    color: var(--gedimmt);
    font-size: 0.78rem;
}

/* Kopfzeile nur auf schmalen Geräten – öffnet die Navigation */
.mobilkopf {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-rand);
    position: sticky;
    top: 0;
    z-index: 25;
}

.nav-schalter {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: var(--nav-text);
    background: none;
    border: 1px solid var(--nav-rand);
    border-radius: var(--radius-klein);
    cursor: pointer;
}
.nav-schalter svg { width: 1.15rem; height: 1.15rem; }
.nav-schalter:focus-visible { outline: 2px solid var(--akzent-hell); outline-offset: 2px; }

.nav-schleier { position: fixed; inset: 0; z-index: 38; background: rgb(0 0 0 / 45%); }

/* ---------- Typografie ---------- */

a { color: var(--akzent); }

h1 {
    font-size: 1.9rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 650;
    margin: 0 0 0.4rem;
}

h2 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.02rem; letter-spacing: -0.01em; font-weight: 600; margin: 1.5rem 0 0.4rem; }
p { margin: 0 0 0.9rem; }

.lead { color: var(--gedimmt); font-size: 0.98rem; margin-bottom: 1.85rem; max-width: 46rem; }

.zurueck {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gedimmt);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.15rem;
    transition: color .15s;
}
.zurueck:hover { color: var(--akzent); }

.seitenkopf { margin-bottom: 1.75rem; }

/* ---------- Schmale Geräte ---------- */

@media (max-width: 64rem) {
    main { padding: 1.75rem 1.5rem 3.5rem; }
    .fuss { padding: 0 1.5rem 2.5rem; }
}

@media (max-width: 52rem) {
    .huelle { grid-template-columns: minmax(0, 1fr); }
    .mobilkopf { display: flex; }

    .seitennav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(17rem, 84vw);
        height: 100dvh;
        box-shadow: 8px 0 32px rgb(0 0 0 / 30%);
    }

    .seitennav[hidden] { display: none; }

    main { padding: 1.5rem 1.1rem 3rem; }
    .fuss { padding: 0 1.1rem 2rem; }
    h1 { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Farbschema-Schalter sitzt im Navigationsfuss und nutzt die Verweis-Optik. */
.thema-schalter { font-size: 0.88rem; }
.thema-zeichen { display: grid; place-items: center; width: 1.1rem; flex: none; font-size: 0.95rem; line-height: 1; }
.thema-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Offene Notiztafel sperrt das Scrollen dahinter. */
body.notiz-offen { overflow: hidden; }
