/* =====================================================================
   Lachs – Design-Tokens (Quelle: Lachs-UI-Uebergabepaket/04-DESIGN-TOKENS.json)
   Alle Farben, Abstände und Maße der Oberfläche kommen von hier.
   ===================================================================== */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("lib/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("lib/inter/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --lachs-primaer: #2b8278;
    --lachs-primaer-hover: #246f66;
    --lachs-sekundaer: #822b35;
    --lachs-gefahr: #b42318;
    --lachs-gefahr-hover: #912018;

    --lachs-flaeche: #ffffff;
    --lachs-flaeche-dezent: #f8f9fa;
    --lachs-flaeche-viewer: #e9ecef;
    --lachs-flaeche-auswahl: #edf5f3;
    --lachs-flaeche-hover: #f3f6f5;

    --lachs-text: #18212e;
    --lachs-text-sekundaer: #4b5563;
    --lachs-text-gedaempft: #667085;
    --lachs-text-auf-primaer: #ffffff;

    --lachs-rand: #e3e7eb;
    --lachs-rand-stark: #cbd2d9;

    --lachs-typ-pdf: #822b35;
    --lachs-typ-word: #1864c8;
    --lachs-typ-tabelle: #168053;

    --lachs-schrift: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --lachs-radius-klein: 6px;
    --lachs-radius: 8px;
    --lachs-radius-dialog: 10px;

    --lachs-sidebar-breite: 232px;
    --lachs-sidebar-eingeklappt: 72px;
    --lachs-topbar-hoehe: 62px;
    --lachs-steuerelement-hoehe: 36px;
    --lachs-button-hoehe: 38px;

    --lachs-schatten-seite: 0 2px 12px rgba(24, 33, 46, 0.08);
    --lachs-schatten-menue: 0 8px 24px rgba(24, 33, 46, 0.12);
    --lachs-fokusring: 0 0 0 3px rgba(43, 130, 120, 0.24);

    /* Bootstrap auf die Lachs-Farben umstellen, damit auch die übrigen Seiten passen. */
    --bs-primary: var(--lachs-primaer);
    --bs-primary-rgb: 43, 130, 120;
    --bs-link-color: var(--lachs-primaer-hover);
    --bs-link-color-rgb: 36, 111, 102;
    --bs-link-hover-color: #1d5952;
    --bs-link-hover-color-rgb: 29, 89, 82;
    --bs-body-font-family: var(--lachs-schrift);
    --bs-body-font-size: 0.875rem;
    --bs-body-color: var(--lachs-text);
    --bs-secondary-color: var(--lachs-text-sekundaer);
    --bs-border-color: var(--lachs-rand);
    --bs-border-radius: var(--lachs-radius-klein);
    --bs-focus-ring-color: rgba(43, 130, 120, 0.24);
}

html, body {
    font-family: var(--lachs-schrift);
    color: var(--lachs-text);
    background: var(--lachs-flaeche);
}

body {
    font-size: 14px;
    line-height: 1.4;
}

h1:focus {
    outline: none;
}

h1, .seitentitel {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-primary {
    --bs-btn-bg: var(--lachs-primaer);
    --bs-btn-border-color: var(--lachs-primaer);
    --bs-btn-hover-bg: var(--lachs-primaer-hover);
    --bs-btn-hover-border-color: var(--lachs-primaer-hover);
    --bs-btn-active-bg: var(--lachs-primaer-hover);
    --bs-btn-active-border-color: var(--lachs-primaer-hover);
    --bs-btn-disabled-bg: var(--lachs-primaer);
    --bs-btn-disabled-border-color: var(--lachs-primaer);
}

.btn-outline-primary {
    --bs-btn-color: var(--lachs-primaer-hover);
    --bs-btn-border-color: var(--lachs-primaer);
    --bs-btn-hover-bg: var(--lachs-primaer);
    --bs-btn-hover-border-color: var(--lachs-primaer);
    --bs-btn-active-bg: var(--lachs-primaer-hover);
    --bs-btn-active-border-color: var(--lachs-primaer-hover);
}

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--lachs-primaer);
    box-shadow: var(--lachs-fokusring);
}

.form-check-input:checked {
    background-color: var(--lachs-primaer);
    border-color: var(--lachs-primaer);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--lachs-primaer);
    --bs-nav-pills-link-active-color: var(--lachs-text-auf-primaer);
    --bs-nav-link-color: var(--lachs-primaer-hover);
    --bs-nav-link-hover-color: var(--lachs-primaer-hover);
    --bs-nav-pills-border-radius: var(--lachs-radius-klein);
}

.nav-pills .nav-link:not(.active):hover {
    background-color: var(--lachs-flaeche-hover);
}

.nav-pills .nav-link:focus-visible {
    box-shadow: var(--lachs-fokusring);
}

.nav-tabs .nav-link.active {
    color: var(--lachs-primaer-hover);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =====================================================================
   Grundgerüst: Sidebar links, Topbar oben, Inhalt scrollt darunter.
   Die Gesamtseite scrollt nie horizontal – breite Bereiche scrollen in sich.
   ===================================================================== */

.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-haupt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-inhalt {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 32px 32px;
}

/* Arbeitsflächen mit eigenen Scrollbereichen (z. B. Akte → Dokumente) füllen die Höhe. */
.app-inhalt:has(> .arbeitsflaeche) {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

/* --- Sidebar --- */
.app-sidebar {
    width: var(--lachs-sidebar-breite);
    flex-shrink: 0;
    background: var(--lachs-flaeche);
    border-right: 1px solid var(--lachs-rand);
    display: flex;
    flex-direction: column;
    transition: width 0.15s ease;
    z-index: 30;
}

.marke {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 76px;
    padding: 0 20px;
    color: var(--lachs-text);
    text-decoration: none;
    flex-shrink: 0;
}

.marke:hover {
    color: var(--lachs-text);
}

.marke-zeichen {
    flex-shrink: 0;
}

.marke-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}

.marke-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.marke-zusatz {
    font-size: 14px;
    color: var(--lachs-text-gedaempft);
}

.hauptnavigation {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 12px;
}

.nav-gruppe {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-ueberschrift {
    margin: 20px 0 6px;
    padding: 16px 14px 0;
    border-top: 1px solid var(--lachs-rand);
    font-size: 13px;
    font-weight: 500;
    color: var(--lachs-text-gedaempft);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nav-eintrag {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--lachs-radius);
    background: none;
    width: 100%;
    color: var(--lachs-text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    text-align: left;
}

.nav-eintrag .icon {
    flex-shrink: 0;
    color: var(--lachs-text-sekundaer);
}

.nav-eintrag:hover {
    background: var(--lachs-flaeche-hover);
    color: var(--lachs-text);
}

.nav-eintrag.active {
    background: var(--lachs-primaer);
    color: var(--lachs-text-auf-primaer);
}

.nav-eintrag.active .icon {
    color: var(--lachs-text-auf-primaer);
}

.nav-eintrag:focus-visible {
    outline: 2px solid var(--lachs-primaer);
    outline-offset: 2px;
}

.nav-hinweis {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--lachs-text-gedaempft);
}

.sidebar-fuss {
    padding: 12px;
    border-top: 1px solid var(--lachs-rand);
    flex-shrink: 0;
}

.sidebar-fuss .nav-eintrag {
    color: var(--lachs-text-sekundaer);
    font-weight: 400;
}

.sidebar-version {
    padding: 6px 12px 0;
    font-size: 12px;
    color: var(--lachs-text-gedaempft);
    white-space: nowrap;
}

.nur-eingeklappt {
    display: none !important;
}

/* Eingeklappt: nur Icons; Beschriftungen bleiben für Screenreader erhalten. */
@media (min-width: 1024px) {
    .menue-eingeklappt .app-sidebar {
        width: var(--lachs-sidebar-eingeklappt);
    }

    .menue-eingeklappt .marke {
        padding: 0;
        justify-content: center;
    }

    .menue-eingeklappt .hauptnavigation,
    .menue-eingeklappt .sidebar-fuss {
        padding-left: 10px;
        padding-right: 10px;
    }

    .menue-eingeklappt .nav-eintrag {
        justify-content: center;
        padding: 0;
    }

    .menue-eingeklappt .sidebar-version {
        padding: 6px 0 0;
        font-size: 11px;
        text-align: center;
    }

    .menue-eingeklappt .nav-ueberschrift {
        font-size: 0;
        padding: 0;
        margin: 12px 4px;
    }

    .menue-eingeklappt .marke-text,
    .menue-eingeklappt .nav-text,
    .menue-eingeklappt .nav-hinweis {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .menue-eingeklappt .nur-ausgeklappt {
        display: none !important;
    }

    .menue-eingeklappt .nur-eingeklappt {
        display: inline-block !important;
    }
}

/* --- Topbar --- */
.app-topbar {
    height: var(--lachs-topbar-hoehe);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px 0 32px;
    border-bottom: 1px solid var(--lachs-rand);
    background: var(--lachs-flaeche);
}

.brotkrumen {
    min-width: 0;
    flex: 1;
}

.brotkrumen ol {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    white-space: nowrap;
}

.brotkrumen li {
    overflow: hidden;
    text-overflow: ellipsis;
}

.brotkrumen li + li::before {
    content: "/";
    margin-right: 8px;
    color: var(--lachs-text-gedaempft);
}

.brotkrumen a {
    color: var(--lachs-text-sekundaer);
    text-decoration: none;
}

.brotkrumen a:hover {
    color: var(--lachs-text);
    text-decoration: underline;
}

.brotkrumen [aria-current] {
    color: var(--lachs-text);
}

/* Brotkrumen und Hilfen teilen sich den Platz gleich, damit die Suche dazwischen mittig steht. */
.topbar-hilfen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--lachs-radius);
    color: var(--lachs-text-sekundaer);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-link:hover {
    background: var(--lachs-flaeche-hover);
    color: var(--lachs-text);
}

.profil-knopf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 2px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--lachs-text-sekundaer);
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3d4652;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.profil-menue {
    position: fixed;
    inset: auto;
    top: calc(var(--lachs-topbar-hoehe) - 4px);
    right: 16px;
    margin: 0;
    min-width: 240px;
}

.profil-menue-kopf {
    padding: 8px 12px 10px;
    border-bottom: 1px solid var(--lachs-rand);
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--lachs-text-gedaempft);
    overflow-wrap: anywhere;
}

.profil-menue-kopf strong {
    display: block;
    color: var(--lachs-text);
    font-weight: 600;
}

.app-topbar .drawer-knopf,
.app-overlay {
    display: none;
}

/* Unter 1280 px brauchen die Hilfslinks ihren Platz nicht – nur Icons. */
@media (max-width: 1279.98px) {
    .topbar-link .topbar-link-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}

/* Unter 1024 px wird die Sidebar zur Schublade (Drawer). */
@media (max-width: 1023.98px) {
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: none;
    }

    .menue-offen .app-sidebar {
        transform: none;
        box-shadow: var(--lachs-schatten-menue);
    }

    .menue-offen .app-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(24, 33, 46, 0.32);
        z-index: 25;
    }

    .app-topbar .drawer-knopf {
        display: inline-grid;
    }

    .sidebar-fuss {
        display: none;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-inhalt {
        padding: 16px;
    }
}

/* =====================================================================
   Wiederverwendbare Bedienelemente
   ===================================================================== */

.l-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--lachs-button-hoehe);
    padding: 0 16px;
    border: 1px solid var(--lachs-rand-stark);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche);
    color: var(--lachs-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.l-knopf:hover {
    background: var(--lachs-flaeche-hover);
    color: var(--lachs-text);
}

.l-knopf-primaer {
    border-color: var(--lachs-primaer);
    background: var(--lachs-primaer);
    color: var(--lachs-text-auf-primaer);
}

.l-knopf-primaer:hover {
    border-color: var(--lachs-primaer-hover);
    background: var(--lachs-primaer-hover);
    color: var(--lachs-text-auf-primaer);
}

/* Für unwiderrufliche Aktionen wie „Endgültig löschen“. */
.l-knopf-gefahr {
    border-color: var(--lachs-gefahr);
    background: var(--lachs-gefahr);
    color: #ffffff;
}

.l-knopf-gefahr:hover {
    border-color: var(--lachs-gefahr-hover);
    background: var(--lachs-gefahr-hover);
    color: #ffffff;
}

.l-menue-eintrag.gefahr,
.l-menue-eintrag.gefahr .icon {
    color: var(--lachs-gefahr);
}

.l-knopf-geteilt {
    display: inline-flex;
}

.l-knopf-geteilt > .l-knopf:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.l-knopf-geteilt > .l-knopf:last-child {
    padding: 0 10px;
    border-left-color: rgba(255, 255, 255, 0.35);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.l-knopf-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--lachs-radius-klein);
    background: none;
    color: var(--lachs-text-sekundaer);
    cursor: pointer;
    flex-shrink: 0;
}

.l-knopf-icon:hover:not(:disabled) {
    background: var(--lachs-flaeche-hover);
    color: var(--lachs-text);
}

.l-knopf:disabled,
.l-knopf-icon:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.l-knopf:focus-visible,
.l-knopf-icon:focus-visible,
.topbar-link:focus-visible,
.profil-knopf:focus-visible,
.marke:focus-visible {
    outline: 2px solid var(--lachs-primaer);
    outline-offset: 2px;
    box-shadow: var(--lachs-fokusring);
}

.l-eingabe,
.l-auswahl {
    height: var(--lachs-steuerelement-hoehe);
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid var(--lachs-rand-stark);
    border-radius: var(--lachs-radius-klein);
    background: var(--lachs-flaeche);
    color: var(--lachs-text);
    font: inherit;
    font-size: 14px;
}

.l-auswahl {
    appearance: none;
    padding-right: 32px;
    background: var(--lachs-flaeche) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%234b5563'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
    cursor: pointer;
}

textarea.l-eingabe {
    height: auto;
    padding: 8px 12px;
    line-height: 1.5;
}

.l-eingabe::placeholder {
    color: var(--lachs-text-gedaempft);
}

.l-eingabe:focus,
.l-auswahl:focus {
    outline: none;
    border-color: var(--lachs-primaer);
    box-shadow: var(--lachs-fokusring);
}

.l-eingabe[aria-invalid="true"] {
    border-color: #b42318;
}

.l-feld {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.l-feld label {
    font-size: 13px;
    font-weight: 500;
}

.l-feld-hinweis {
    font-size: 12px;
    color: var(--lachs-text-gedaempft);
}

.l-feld-fehler {
    font-size: 13px;
    color: #b42318;
}

/* Menüs (Popover, z. B. Drei-Punkte-Menü) */
.l-menue {
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--lachs-rand);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche);
    color: var(--lachs-text);
    box-shadow: var(--lachs-schatten-menue);
}

.l-menue-eintrag {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--lachs-radius-klein);
    background: none;
    color: var(--lachs-text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.l-menue-eintrag .icon {
    color: var(--lachs-text-sekundaer);
}

.l-menue-eintrag:hover,
.l-menue-eintrag:focus-visible {
    background: var(--lachs-flaeche-hover);
    color: var(--lachs-text);
    outline: none;
}

.l-menue-eintrag:focus-visible {
    box-shadow: inset 0 0 0 2px var(--lachs-primaer);
}

.l-menue-eintrag[aria-disabled="true"] {
    color: var(--lachs-text-gedaempft);
    cursor: default;
}

.l-menue-eintrag[aria-disabled="true"]:hover {
    background: none;
}

.l-menue-eintrag[aria-disabled="true"] .icon {
    color: var(--lachs-rand-stark);
}

.l-menue-trenner {
    height: 1px;
    margin: 6px 4px;
    background: var(--lachs-rand);
}

.l-menue-gruppe {
    padding: 6px 10px 4px;
    font-size: 12px;
    color: var(--lachs-text-gedaempft);
}

/* Dialoge (natives <dialog>) */
.l-dialog {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--lachs-rand);
    border-radius: var(--lachs-radius-dialog);
    color: var(--lachs-text);
    box-shadow: var(--lachs-schatten-menue);
}

.l-dialog::backdrop {
    background: rgba(24, 33, 46, 0.4);
}

.l-dialog-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--lachs-rand);
}

.l-dialog-kopf h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.l-dialog-inhalt {
    padding: 20px;
}

.l-dialog-fuss {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--lachs-rand);
    background: var(--lachs-flaeche-dezent);
    border-radius: 0 0 var(--lachs-radius-dialog) var(--lachs-radius-dialog);
}

/* Lade-Indikator */
.l-lader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--lachs-rand-stark);
    border-top-color: var(--lachs-primaer);
    border-radius: 50%;
    animation: l-drehen 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes l-drehen {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .l-lader { animation-duration: 2.4s; }
    .app-sidebar { transition: none; }
}

/* Hinweis auf noch nicht ausgebaute Bereiche */
.nicht-ausgebaut {
    max-width: 560px;
    margin: 32px 0;
    padding: 24px;
    border: 1px dashed var(--lachs-rand-stark);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche-dezent);
}

.nicht-ausgebaut h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.nicht-ausgebaut p {
    margin: 0;
    color: var(--lachs-text-sekundaer);
}

/* Kacheln der Kanzleiverwaltung */
.verwaltung-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    max-width: 880px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.verwaltung-kachel {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--lachs-rand);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche);
    color: var(--lachs-text);
    text-decoration: none;
}

.verwaltung-kachel:hover {
    border-color: var(--lachs-rand-stark);
    background: var(--lachs-flaeche-hover);
}

.verwaltung-kachel:focus-visible {
    outline: none;
    box-shadow: var(--lachs-fokusring);
}

.verwaltung-kachel .icon {
    flex: none;
    color: var(--lachs-primaer);
}

.verwaltung-kachel strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.verwaltung-kachel span span {
    color: var(--lachs-text-sekundaer);
}

/* Popover-Menüs werden per Skript am Auslöser ausgerichtet (siehe js/dokumente.js). */
.l-menue[popover]:not(.profil-menue) {
    position: fixed;
    inset: auto;
    margin: 0;
}

/* =====================================================================
   Drucken: nur das Dokument (js/dokumente.js legt es in #druckbereich).
   ===================================================================== */
#druckbereich {
    display: none;
}

@media print {
    body:has(#druckbereich) > :not(#druckbereich) {
        display: none !important;
    }

    body:has(#druckbereich) #druckbereich {
        display: block;
    }

    .druck-seite {
        display: block;
        width: 100%;
        break-after: page;
    }

    .druck-text {
        white-space: pre-wrap;
        font: 11pt/1.5 var(--lachs-schrift);
    }
}

/* =====================================================================
   Adresse bearbeiten: Reiter, Kontakte, Auswahlliste mit Suche
   ===================================================================== */

.adress-reiter {
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.adress-reiter .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--lachs-text-sekundaer);
}

.adress-reiter-anzahl,
.adress-reiter-fehler {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.adress-reiter-anzahl {
    background: var(--lachs-flaeche-auswahl);
    color: var(--lachs-primaer-hover);
}

.adress-reiter-fehler {
    background: #b42318;
    color: #fff;
}

.adress-reiter-inhalt {
    padding: 20px;
    border: 1px solid var(--bs-border-color);
    border-top: 0;
    border-radius: 0 0 var(--lachs-radius-klein) var(--lachs-radius-klein);
    background: var(--lachs-flaeche);
}

/* Ansichtsmodus: gesperrte Felder wie lesbarer Text darstellen, nicht ausgegraut. */
.adresse-ansicht fieldset:disabled .form-control,
.adresse-ansicht fieldset:disabled .form-select {
    background-color: var(--lachs-flaeche-dezent);
    background-image: none;
    color: var(--lachs-text);
    opacity: 1;
    cursor: default;
}

.adresse-ansicht fieldset:disabled .form-control::placeholder,
.adresse-ansicht fieldset:disabled .form-select::placeholder {
    color: transparent;
}

.adresse-ansicht fieldset:disabled .form-check-input:checked ~ .form-check-label {
    opacity: 1;
}

.kontakt-karte {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--lachs-rand);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche-dezent);
}

.kontakt-karte-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.kontakt-karte-kopf h2 {
    margin: 0;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.such-auswahl {
    position: relative;
}

.such-auswahl-liste {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--lachs-rand);
    border-radius: var(--lachs-radius);
    background: var(--lachs-flaeche);
    box-shadow: var(--lachs-schatten-menue);
}

.such-auswahl-liste li {
    padding: 6px 10px;
    border-radius: var(--lachs-radius-klein);
    cursor: pointer;
}

.such-auswahl-liste li[aria-selected="true"] {
    background: var(--lachs-flaeche-hover);
}

.such-auswahl-liste li.gewaehlt {
    font-weight: 600;
    color: var(--lachs-primaer-hover);
}

.such-auswahl-liste li.such-auswahl-leer {
    color: var(--lachs-text-gedaempft);
    cursor: default;
}
