/* ========================================
   Sidebar (Navigation) Styles
   ======================================== */

/* 메뉴 영역 */
#nav {
    position: relative;
    width: 72px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 20px 16px;
    border-right: 1px solid #ddd;
    transition: width 0.3s ease, all 0.5s ease;
}

#nav:not(.active) {
    transition: width 0.3s ease, all 0.5s ease;
}

#nav.active {
    width: 200px;
}

/* 컨텐츠 영역 width 조정 */
#contents {
    width: calc(100% - 72px) !important;
    transition: width 0.3s ease !important;
}

#nav.active~#contents {
    width: calc(100% - 200px) !important;
}

/* ========================================
   Navigation List
   ======================================== */

#nav .navList {
    width: 100%;
}

#nav .navList li {
    margin-bottom: 10px;
}

/* 메뉴 아이템 링크 */
#nav .navList li a {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    padding: 8px 8px;
}

#nav .navList li a>div {
    display: none;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    height: 24px;
}

#nav .navList li a:hover {
    border-radius: 6px;
    background: var(--bgcolor-primary-hover);
}

#nav .navList li a:hover>div {
    color: #fff;
}

#nav .navList li a:hover .ico {
    -webkit-filter: invert(1) brightness(10);
    filter: invert(1) brightness(10);
}

#nav .navList li a.active {
    border-radius: 6px;
    background: var(--bgcolor-primary);
}

#nav .navList li a.active>div {
    color: #fff;
}

/* 확장 상태 */
#nav.active .navList li a {
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

#nav.active .navList li a>div {
    display: block;
    margin-left: 8px;
}

/* ========================================
   Category Title (메뉴 그룹 제목)
   ======================================== */

#nav .navList li>div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 20px;
    height: auto;
    border-top: 1px solid #e0e0e0;
}

#nav .navList:not(.common-menu) li:first-child>div {
    margin-top: 0;
    border-top: none;
}

/* 축소 시: 텍스트 숨김 (구분선만 표시) */
#nav .navList li>div>span {
    display: none;
}

/* 확장 시: 텍스트 표시 */
#nav.active .navList li>div {
    justify-content: flex-start;
    padding: 8px;
    margin-top: 24px;
    border-top: none;
}

#nav.active .navList:not(.common-menu) li:first-child>div {
    margin-top: 0;
}

#nav.active .navList li>div>span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Tooltip (축소 시 메뉴명 표시)
   ======================================== */

#nav .navList li a {
    position: relative;
}

#nav:not(.active) .navList li a:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 6px 12px;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
}

#nav:not(.active) .navList li a:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 2px;
    border: 6px solid transparent;
    border-right-color: #333;
    z-index: 1000;
    pointer-events: none;
}

/* ========================================
   Panel Button (토글 버튼)
   ======================================== */

#nav .panelBtn {
    position: absolute;
    right: 16px;
    bottom: 20px;
    background: var(--bgcolor-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

#nav.active .panelBtn .ico.icoArrRight {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
    -webkit-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
    transition: all 0.5s ease;
}

/* ========================================
   Theme Variants
   ======================================== */

#nav.chatCounsel li a.active {
    background: var(--bgcolor-primary);
}

#nav.chatCounsel .panelBtn {
    background: var(--bgcolor-primary);
}

#nav.chatBot li a.active {
    background: var(--bgcolor-primary);
}

#nav.chatBot .panelBtn {
    background: var(--bgcolor-primary);
}

#nav.callBot li a.active {
    background: var(--bgcolor-primary);
}

#nav.callBot .panelBtn {
    background: var(--bgcolor-primary);
}