/* =========================================================
   Pasek boczny nawigacji (includes/unified_sidebar.php)
   Zawsze ciemny (świadomy wybór — czytelny punkt odniesienia
   niezależnie od jasnego/ciemnego motywu treści), z ikonami
   grup i wyraźnym stanem aktywnym.
========================================================= */

.unified-layout,
.page-wrapper .row {
    align-items: stretch;
}

.unified-sidebar {
    width: 280px;
    min-width: 280px;
    min-height: 100vh;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    color: #e5e7eb;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.unified-brand,
.unified-user-box,
.unified-sidebar-footer {
    flex: 0 0 auto;
}

/* ===== Marka / logo ===== */

.unified-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    margin-bottom: 16px;
    padding: 4px;
}

.unified-brand span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(150deg, #2563eb, #1d4ed8);
    font-weight: 900;
    letter-spacing: .04em;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
}

.unified-brand strong {
    font-size: 19px;
    line-height: 1;
    font-weight: 800;
}

/* ===== Karta użytkownika ===== */

.unified-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 15px;
    background: #1a2436;
    border: 1px solid #263349;
    margin-bottom: 16px;
}

.unified-user-box::before {
    content: "";
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: linear-gradient(150deg, #334155, #1e293b);
    border: 1px solid #334155;
}

.unified-user-box-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.unified-user-box-text div {
    color: #ffffff;
    font-weight: 800;
    line-height: 1.25;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unified-user-box-text small {
    color: #7dabf5;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: 10.5px;
}

/* ===== Menu ===== */

.unified-menu {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.unified-menu::-webkit-scrollbar { width: 7px; }
.unified-menu::-webkit-scrollbar-track { background: transparent; }
.unified-menu::-webkit-scrollbar-thumb { background: #334155; border-radius: 999px; }

.unified-menu-group {
    padding-bottom: 10px;
    border-bottom: 1px solid #1a2436;
}

.unified-menu-group:last-child { border-bottom: 0; padding-bottom: 0; }

.unified-menu-title {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 0 0 6px 8px;
}

.unified-menu-title .umt-icon { font-size: 12px; opacity: .9; }

.unified-menu a {
    position: relative;
    display: block;
    padding: 9px 12px 9px 16px;
    border-radius: 11px;
    color: #b6c2d9;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.8px;
    margin-bottom: 2px;
    transition: background .15s ease, color .15s ease;
}

.unified-menu a:hover {
    background: #17213a;
    color: #ffffff;
}

.unified-menu a.active {
    background: rgba(37, 99, 235, .16);
    color: #ffffff;
    font-weight: 800;
}

.unified-menu a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: #3b82f6;
}

/* ===== Stopka (wyloguj) ===== */

.unified-sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #1a2436;
}

.unified-sidebar-footer a {
    display: block;
    padding: 10px 14px;
    border-radius: 11px;
    color: #fca5a5;
    text-decoration: none;
    font-weight: 800;
    font-size: 13.8px;
    transition: background .15s ease, color .15s ease;
}

.unified-sidebar-footer a:hover {
    background: #3b0a0a;
    color: #ffffff;
}

/* ===== Responsywność ===== */

@media (max-width: 992px) {
    .unified-sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid #1e293b;
    }

    .unified-menu {
        max-height: 55vh;
        overflow-y: auto;
    }
}
