/* ── Schaltzentrale-Button (global verfügbar, auch ohne arbeitsplatz.css) ── */
.btn-zentrale {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(74,143,255,.15), rgba(120,180,255,.10));
    border: 1px solid rgba(120,180,255,.35);
    color: #cfe1ff;
    border-radius: 8px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}
.btn-zentrale:hover {
    background: linear-gradient(135deg, rgba(74,143,255,.3), rgba(120,180,255,.2));
    border-color: rgba(150,200,255,.55);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(74,143,255,.25);
}
.btn-zentrale .bz-icon { font-size: 14px; }
.btn-zentrale.active {
    background: linear-gradient(135deg, #4a8fff, #2563eb);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(74,143,255,.45);
}
.bz-missed-badge {
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(0,0,0,.4), 0 0 12px rgba(255,79,106,.6);
}

/* ── Notification Bell ─────────────────────────────────────────────────── */
.ntf-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto; /* schiebt Glocke + Profil-Button als Gruppe an den rechten Rand */
}
.ntf-bell {
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    width: 36px; height: 36px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}
.ntf-bell:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--border);
    color: var(--text);
}
.ntf-badge {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: #ef4444; color: #fff;
    font-size: 9px; font-weight: 800; line-height: 16px;
    border-radius: 99px; text-align: center;
    box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(239,68,68,.5);
    pointer-events: none;
    animation: ntfPop .2s ease-out;
}
@keyframes ntfPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}
.ntf-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--s1);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    z-index: 99999;
    overflow: hidden;
    animation: ntfDropIn .18s ease-out;
}
@keyframes ntfDropIn {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ntf-dd-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.ntf-dd-title {
    font-size: 13px; font-weight: 700; color: var(--text);
}
.ntf-mark-all {
    background: transparent; border: none; color: var(--muted);
    font-size: 11px; cursor: pointer; font-family: var(--font);
    padding: 3px 8px; border-radius: 6px; transition: all .15s;
}
.ntf-mark-all:hover { background: rgba(255,255,255,.06); color: var(--text); }
.ntf-list {
    max-height: 340px; overflow-y: auto;
}
.ntf-empty {
    padding: 28px 20px; text-align: center;
    font-size: 12px; color: var(--muted2);
}
.ntf-item {
    padding: 12px 16px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.ntf-item:last-child { border-bottom: none; }
.ntf-item:hover { background: rgba(255,255,255,.04); }
.ntf-item.ntf-unread { background: rgba(74,143,255,.06); border-left: 3px solid var(--blue); }
.ntf-item.ntf-unread:hover { background: rgba(74,143,255,.10); }
.ntf-item-msg { font-size: 12px; color: var(--text); line-height: 1.5; }
.ntf-item-time { font-size: 10px; color: var(--muted2); margin-top: 4px; font-family: var(--mono); }

/* ── Globale Sub-Nav (Schaltzentrale auf Seiten ohne eigene Sub-Nav) ── */
#global-subnav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--s1);
    border-bottom: 1px solid var(--border);
    z-index: 699;
}
/* Nur wenn Profil-Menü offen: Topbar über alles heben */
.topbar.profile-open {
    z-index: 99999;
}
/* Auf Seiten mit eigenem Sub-Nav ausblenden */
body:has(.stats-bar) #global-subnav,
body:has(.admin-tabs) #global-subnav,
body:has(.crm-subnav) #global-subnav { display: none; }

/* Spacer reserviert Platz für Topbar (60px) + globale Sub-Nav (44px) */
#nav-placeholder {
    height: 104px;
    flex-shrink: 0;
}
/* Seiten mit eigenem Sub-Nav: nur Topbar-Höhe reservieren */
body:has(.stats-bar) #nav-placeholder { height: 60px; }
body:has(.admin-tabs) #nav-placeholder,
body:has(.crm-subnav) #nav-placeholder { height: 104px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 0 28px;
    height: 60px;
    background: var(--s1);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
}

.nav {
    display: flex;
    gap: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-item {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text);
    background: var(--s2);
}

.nav-item .badge {
    background: var(--amber);
    color: var(--bg);
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 6px;
}

.profile-wrap {
    position: relative;
}
.profile-badge {
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color .15s, background .15s;
}
.profile-badge:hover { border-color: var(--muted2); background: rgba(255,255,255,.03); }
.profile-badge.open  { border-color: var(--blue); background: rgba(74,143,255,.08); }
.profile-chevron {
    font-size: 9px;
    opacity: .7;
    transition: transform .2s;
    margin-left: 2px;
}
.profile-badge.open .profile-chevron { transform: rotate(180deg); }

/* Dropdown */
.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: linear-gradient(160deg, rgba(28,32,60,.92) 0%, rgba(15,18,38,.95) 100%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.12) inset;
    z-index: 99999;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    pointer-events: none;
    transition: opacity .18s, transform .18s;
    overflow: hidden;
}
.profile-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.pm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.pm-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pm-info { min-width: 0; flex: 1; }
.pm-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-email {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-divider {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: 0 12px;
}
.pm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, color .12s;
    text-decoration: none;
}
.pm-item:hover {
    background: rgba(74,143,255,.1);
    color: #fff;
}
.pm-item.pm-item-danger:hover {
    background: rgba(232,90,120,.12);
    color: #ff8da0;
}
.pm-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   MOBILE NAVBAR — Burger + Slide-Down Panel  (≤768px)
   ════════════════════════════════════════════════════════════════ */

.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: border-color .15s, background .15s;
}
.mobile-toggle:hover {
    border-color: var(--muted2);
    background: rgba(255,255,255,.03);
}
.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s, opacity .2s;
}
.topbar.mobile-open .mobile-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.topbar.mobile-open .mobile-toggle span:nth-child(2) { opacity: 0; }
.topbar.mobile-open .mobile-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        padding: 0 16px;
        min-height: 60px;
        height: auto;
    }
    .logo { order: 1; }
    .mobile-toggle {
        display: flex;
        order: 2;
    }

    /* Nav + Profile-Bereich: ausgeklappt full-width unter Topbar */
    .nav {
        position: static;
        transform: none;
    }
    .nav,
    .profile-wrap {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height .3s ease, opacity .25s, padding .3s;
        padding: 0;
    }
    .topbar.mobile-open .nav {
        max-height: 600px;
        opacity: 1;
        padding: 8px 0 4px;
        flex-direction: column;
        gap: 2px;
        overflow: visible;
    }
    .topbar.mobile-open .profile-wrap {
        max-height: 600px;
        opacity: 1;
        padding: 4px 0 14px;
        border-top: 1px solid rgba(255,255,255,.06);
        margin-top: 4px;
        overflow: visible;
    }

    .nav .nav-item {
        width: 100%;
        padding: 12px 14px;
        font-size: 14px;
    }

    .profile-wrap { position: static; }
    .profile-badge {
        width: 100%;
        justify-content: space-between;
        padding: 12px 14px;
    }
    /* Dropdown auf Mobile: full-width direkt unter dem Trigger */
    .profile-menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        transform: none;
    }
    .profile-menu.show { transform: none; }
}

@media (max-width: 480px) {
    .topbar { padding: 0 12px; }
    .logo-name { font-size: 14px; }
}