/* =====================================================
   LISTBAR.CSS - 라온인포텍 공통 사이드바 전용
   - 사이드바 디자인, 너비, 메뉴, 모바일 슬라이드
   - dashboard.css와 역할 분리
   ===================================================== */

/* 사이드바 내부 크기 계산을 모든 페이지에서 동일하게 유지 */
.dashboard-sidebar,
.dashboard-sidebar *,
.dashboard-sidebar *::before,
.dashboard-sidebar *::after {
    box-sizing: border-box;
}

/* 관리자 메뉴와 모바일 배경 숨김 */
#adminMenu[hidden],
#adminMenu a[hidden],
#sidebarBackdrop[hidden] {
    display: none !important;
}

/* 비동기 사이드바 삽입 전에도 본문 여백 유지 */
body.has-listbar,
body:has(.dashboard-sidebar) {
    padding-left: 250px;
}

/* =====================================================
   1. 좌측 사이드바
   ===================================================== */

body:has(.dashboard-sidebar) .dashboard-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 1100;
    background: #111d35;
    color: #d6dfef;
    display: flex;
    flex-direction: column;
    padding: 29px 17px 20px;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white !important;
    text-decoration: none;
    margin: 0 7px 37px;
}

.brand-symbol {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #497cf7;
    display: grid;
    place-items: center;
    font-size: 25px;
    font-weight: 800;
}

.sidebar-brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.sidebar-brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 1.6px;
    opacity: 0.65;
    margin-top: 4px;
}

.sidebar-section-label {
    color: #8192b2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin: 24px 13px 9px;
}

.sidebar-navigation {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #d5ddef !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}

.sidebar-link i {
    font-size: 18px;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #2a426f;
    color: white !important;
}

.sidebar-footer {
    margin-top: auto;
    padding: 25px 13px 0;
    color: #7185a8;
    font-size: 11px;
}


/* =====================================================
   2. 모바일 사이드바 제어
   ===================================================== */

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 0;
    font-size: 26px;
    color: #263a58;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-backdrop[hidden] {
    display: none !important;
}


/* 태블릿 및 모바일 사이드바 동작 */
@media (max-width: 1050px) {
    body.has-listbar,
    body:has(.dashboard-sidebar) {
        padding-left: 0;
    }


    body:has(.dashboard-sidebar) .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .sidebar-toggle {
        display: block;
    }

    body.sidebar-open:has(.dashboard-sidebar) .dashboard-sidebar {
        transform: translateX(0) !important;
    }

    .sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 25, 44, 0.5);
        z-index: 1090;
    }
}

/* 모바일 메뉴 버튼 */
@media (max-width: 650px) {
    body:has(.dashboard-sidebar) .sidebar-toggle {
        grid-area: menu;
        display: block;
        justify-self: start;
        min-width: 40px;
        padding: 4px;
    }
    body:has(.dashboard-sidebar) .sidebar-toggle {
        padding: 2px;
    }
}

/* =====================================================
   3. 좌측 사이드바 로고 이미지
   - 기존 L 로고를 이미지로 교체
   - PC / 모바일 공통
   ===================================================== */

.sidebar-brand .brand-symbol {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
}

.sidebar-brand .brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

