/* ============================================================================
   Betreiber-Leiste nach WordPress-Muster. Wird in ALLEN drei Layouts
   eingebunden und ist nur mit der Rolle Admin sichtbar. Der Rollen-Claim steckt
   im Auth-Cookie, also kein DB-Zugriff pro Request.
   ============================================================================ */

.lq-adminbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: #1d2327;
    color: #c3c4c7;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    line-height: 32px;
    display: flex;
    align-items: center;
    gap: .25rem;
    padding-inline: .75rem;
    z-index: 1080;
}

/* body bekommt padding-top: 32px, damit die Leiste nichts verdeckt. Gesetzt in
   _AdminBar.cshtml, nicht global — ohne Admin-Rolle gibt es keinen Versatz. */
body.lq-mit-adminbar { padding-top: 32px; }

.lq-adminbar-marke {
    font-weight: 600;
    color: #fff;
    padding-right: .75rem;
    white-space: nowrap;
}

.lq-adminbar a {
    color: #c3c4c7;
    text-decoration: none;
    padding-inline: .7rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.lq-adminbar a:hover,
.lq-adminbar a:focus-visible { background: #2c3338; color: #72aee6; }
.lq-adminbar a.lq-aktiv { background: #2c3338; color: #fff; }

.lq-adminbar-nav { display: flex; align-items: center; height: 32px; }

/* Untermenüs am Schreibtisch: <details>, aufgeklappt unter ihrem Titel. */
.lq-adminbar-gruppe { position: relative; height: 32px; }

.lq-adminbar-gruppe > summary {
    list-style: none;
    cursor: pointer;
    color: #c3c4c7;
    padding-inline: .7rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    user-select: none;
}
.lq-adminbar-gruppe > summary::-webkit-details-marker { display: none; }
.lq-adminbar-gruppe > summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: .7;
    transition: transform .15s ease;
}
.lq-adminbar-gruppe[open] > summary::after { transform: rotate(180deg); }

.lq-adminbar-gruppe > summary:hover,
.lq-adminbar-gruppe > summary:focus-visible,
.lq-adminbar-gruppe[open] > summary { background: #2c3338; color: #72aee6; }
.lq-adminbar-gruppe > summary.lq-aktiv { background: #2c3338; color: #fff; }

.lq-adminbar-unter {
    position: absolute;
    top: 32px;
    left: 0;
    min-width: 11rem;
    background: #1d2327;
    border: 1px solid #2c3338;
    border-top: 0;
    padding: .3rem 0;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.lq-adminbar-unter a { height: auto; padding: .45rem .9rem; }

/* "Diese Rally bearbeiten" — nur sichtbar, wenn man auf einer Rally steht.
   Optisch abgesetzt, weil es die einzige kontextabhaengige Aktion ist. */
.lq-adminbar a.lq-kontext { color: #f0c33c; }

.lq-adminbar-fueller { flex: 1 1 auto; }

.lq-adminbar-nutzer {
    color: #8c8f94;
    padding-left: .75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Auf Mobil klappt die Leiste auf ein Icon zusammen: die Links verschwinden
   hinter dem Details-Element, die Hoehe von 32 px bleibt. */
.lq-adminbar-mobil { display: none; }

@media (max-width: 767.98px) {
    .lq-adminbar-nav, .lq-adminbar-nutzer { display: none; }

    .lq-adminbar-mobil { display: block; position: relative; }
    .lq-adminbar-mobil > summary {
        list-style: none;
        cursor: pointer;
        color: #c3c4c7;
        padding-inline: .5rem;
    }
    .lq-adminbar-mobil > summary::-webkit-details-marker { display: none; }

    .lq-adminbar-mobil[open] > .lq-adminbar-aufklapp {
        position: absolute;
        top: 32px;
        left: 0;
        min-width: 12rem;
        background: #1d2327;
        border: 1px solid #2c3338;
        padding: .35rem 0;
        display: flex;
        flex-direction: column;
        line-height: 1.4;
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .lq-adminbar-mobil[open] > .lq-adminbar-aufklapp a { height: auto; padding: .5rem .9rem; }

    .lq-adminbar-titel {
        padding: .6rem .9rem .15rem;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #8c8f94;
    }
    .lq-adminbar-titel:not(:first-child) { border-top: 1px solid #2c3338; margin-top: .3rem; }
    .lq-adminbar-aufklapp a:not(.lq-adminbar-einzeln) + .lq-adminbar-einzeln {
        border-top: 1px solid #2c3338;
        margin-top: .3rem;
        padding-top: .7rem;
    }
}
