/* Staff navigation rail, mobile drawer, and the Staff Virtual Vic launcher/panel.
   Global (not scoped) because the nav is rendered by child components. */

.sidebar {
    background-color: var(--bs-light);
    width: 60px;
    transition: width 0.3s ease;
    z-index: 999;
    position: relative;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    transition: width 0.3s ease;
}

.sidebar:has(.sidebar-content:hover),
.sidebar.sidebar-open {
    width: 240px;
}

.sidebar-header {
    height: 60px;
    overflow: hidden;
    flex-shrink: 0;
    padding-right: 6px;
}

.sidebar-header .full-logo { display: none; }
.sidebar-header .mobile-logo { display: block; padding-left: 10px; }

.sidebar:has(.sidebar-content:hover) .sidebar-header .full-logo,
.sidebar.sidebar-open .sidebar-header .full-logo { display: block; }

.sidebar:has(.sidebar-content:hover) .sidebar-header .mobile-logo,
.sidebar.sidebar-open .sidebar-header .mobile-logo { display: none; }

.logo {
    width: 40px;
    min-width: 40px;
    opacity: 0.7;
    margin: 0.5rem auto;
    padding: 5px;
    transition: all 0.3s ease;
}

.sidebar:has(.sidebar-content:hover) .logo,
.sidebar.sidebar-open .logo {
    width: 150px;
    min-width: 150px;
    opacity: 1;
    margin: 0 auto 1rem auto;
    padding: 10px;
}

.sidebar-pin {
    background: transparent;
    border: 0;
    color: rgb(107 114 128);
    border-radius: 0.4rem;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.sidebar-pin:hover,
.sidebar-pin:focus-visible { background: rgb(0 0 0 / 0.06); color: var(--bs-primary); }
.sidebar-pin[aria-pressed="true"] { color: var(--bs-primary); }

.sidebar .desktop-menu { flex: 1 1 auto; }

.sidebar .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    padding: 0.45rem;
    text-align: left;
    background-color: var(--bs-light);
    color: rgb(55 65 81);
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.sidebar:has(.sidebar-content:hover) .nav-link,
.sidebar.sidebar-open .nav-link {
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.45rem 1rem 0.45rem calc(1rem - 3px);
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus-visible {
    background-color: var(--bs-primary);
    color: white;
}

.sidebar .nav-link.active {
    background-color: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-light));
    border-left-color: var(--bs-primary);
    color: var(--bs-primary);
}

.sidebar .nav-link.active .circle-icon {
    background-color: var(--bs-primary);
    color: #fff;
}

.circle-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--bs-gray-300);
    color: #fff;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nav-link:hover .circle-icon,
.nav-link:focus-visible .circle-icon {
    background-color: #fff;
    color: var(--bs-primary);
}

.sidebar:has(.sidebar-content:hover) .circle-icon,
.sidebar.sidebar-open .circle-icon {
    background-color: var(--bs-primary);
    color: #fff;
}

.sidebar:has(.sidebar-content:hover) .nav-link:hover .circle-icon,
.sidebar.sidebar-open .nav-link:hover .circle-icon {
    background-color: #fff;
    color: var(--bs-primary);
}

/* Unread count pinned to the icon so it shows in the collapsed rail. */
.nav-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--bs-light);
}

.sidebar:has(.sidebar-content:hover) .nav-badge,
.sidebar.sidebar-open .nav-badge { display: none; }

.sidebar:not(:has(.sidebar-content:hover)):not(.sidebar-open) .link-text,
.sidebar:not(:has(.sidebar-content:hover)):not(.sidebar-open) .search-item,
.sidebar:not(:has(.sidebar-content:hover)):not(.sidebar-open) .zone-title,
.sidebar:not(:has(.sidebar-content:hover)):not(.sidebar-open) .zone-hr {
    display: none !important;
}

.sidebar:has(.sidebar-content:hover) .link-text,
.sidebar.sidebar-open .link-text,
.sidebar:has(.sidebar-content:hover) .search-item,
.sidebar.sidebar-open .search-item { display: inline-flex; }

.sidebar:not(:has(.sidebar-content:hover)):not(.sidebar-open) .zone-divider {
    margin: 0.35rem 0.6rem 0.15rem !important;
    border-top: 1px solid rgb(0 0 0 / 0.08);
}

.zone-header-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.zone-toggle { cursor: pointer; }
.zone-toggle:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }

.zone-title,
.zone-mobile-title {
    font-size: 0.70em;
    letter-spacing: 1.5px;
    font-weight: bold;
    text-transform: uppercase;
}

.zone-hr { opacity: 0.3; }
.zone-chevron { font-size: 0.8em; transition: transform 0.2s ease; }
.zone-chevron.open { transform: rotate(180deg); }

.work-zone-header .zone-title { color: var(--bs-primary); }
.work-zone-header .zone-hr { border-color: var(--bs-primary); }
.staff-zone-header .zone-title { color: var(--bs-secondary-color); }
.staff-zone-header .zone-hr { border-color: var(--bs-secondary-color); }
.admin-zone-header .zone-title { color: #198754; }
.admin-zone-header .zone-hr { border-color: #198754; }

.sidebar-footer {
    border-top: 1px solid rgb(0 0 0 / 0.08);
    padding: 0.35rem 0 0.75rem;
    margin-top: auto;
}

.vic-launcher .circle-icon { background-color: var(--bs-primary); color: #fff; }
.vic-launcher[aria-expanded="true"] { background-color: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-light)); }

/* Mobile drawer */
.mobile-menu-bar { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.mobile-vic-launcher { white-space: nowrap; }

.mobile-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    color: rgb(55 65 81);
    border-radius: 0.4rem;
}

.mobile-nav .nav-link.active { background: color-mix(in srgb, var(--bs-primary) 12%, #fff); color: var(--bs-primary); }
.mobile-nav .nav-link .circle-icon { width: 24px; height: 24px; font-size: 11px; background-color: var(--bs-primary); }
.mobile-nav .nav-link .nav-badge { display: none; }
.mobile-nav .zone-mobile-title { padding: 0.5rem 0.75rem 0.25rem; }
.mobile-nav .zone-mobile-title .zone-hr { display: none; }

/* Staff Virtual Vic off-canvas panel */
.vic-offcanvas-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.25);
    z-index: 1045;
}

.vic-offcanvas {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(500px, 100vw);
    background: #fff;
    box-shadow: -0.5rem 0 1.5rem rgb(0 0 0 / 0.18);
    z-index: 1046;
    display: flex;
    flex-direction: column;
    outline: none;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        border-bottom: 1px solid #ddd;
    }

    .sidebar-footer,
    .sidebar-pin { display: none; }

    .vic-offcanvas { width: 100vw; }
}

/* Live-connection status for Staff Virtual Vic, surfaced from the layout on every page. */
.vic-live-host:not(:has(*)) { display: none; }

.vic-live-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1044;
    background: #fff;
    border: 1px solid #f1dfb3;
    border-radius: .6rem;
    box-shadow: 0 .4rem 1rem rgb(0 0 0 / 0.12);
}
