:root {
    --sidebar-width: 260px;
    --top-header-height: 70px;
}

body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #1a1d23;
    color: #fff;
}

.wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* --- 왼쪽 사이드바 --- */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #21252d;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #343a40;
    z-index: 1050;
}

/* 데스크톱 접힘 상태 (lg 이상에서 수동 토글용) */
#sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

/* --- 반응형 설정 (lg 미만: 992px) --- */
@media (max-width: 991.98px) {
    #sidebar {
        position: absolute;
        height: 100%;
        margin-left: calc(var(--sidebar-width) * -1);
    }

    /* lg 미만에서 열렸을 때 */
    #sidebar.mobile-show {
        margin-left: 0 !important;
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.5);
    }

    /* lg 미만용 닫기 버튼 표시 */
    .mobile-close-btn {
        display: block !important;
    }
}

.sidebar-header {
    height: var(--top-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- 오른쪽 메인 영역 --- */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-header {
    height: var(--top-header-height);
    background: rgba(26, 29, 35, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #343a40;
    flex-shrink: 0;
}

.toggle-btn {
    background: none;
    border: none;
    color: #fff;
    padding: 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1d23;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    display: block;
    border-radius: 8px;
    transition: 0.2s;
}

.nav-link:hover {
    color: red;    
}

/* 배경 어둡게 처리 (lg 미만용) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.sidebar-overlay.active {
    display: block;
}

/* --- 사이드바 전용 얇고 어두운 스크롤바 --- */

/* 1. 사이드바 스크롤 영역에만 적용 (Webkit: Chrome, Safari, Edge) */
.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
    /* 얇게 조정 */
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    /* 사이드바 배경색과 동일하게 */
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #3d4451;
    /* 막대 색상을 어둡게 */
    border-radius: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #4b5263;
    /* 호버 시 약간 밝게 */
}

/* 2. Firefox 전용 (사이드바 영역만) */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: #3d4451 transparent;
}