/* ==========================================================================
   3. 레이아웃: 사이드바 및 메뉴 (Sidebar Layout)
   ========================================================================== */
.wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: var(--nav-height);
        bottom: 0;
        z-index: 1050;
        box-shadow: 10px 0 15px rgba(0, 0, 0, 0.1);
    }

    #sidebar.show {
        left: 0;
    }
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-main);
}

#content-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
}

.sidebar-search-area .input-group-text,
.sidebar-search-area .form-control,
.sidebar-search-area .form-select {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-color: var(--sidebar-bg-darker);
}

.text-inherit {
    color: inherit !important;
}

/* Search Highlight */
.search-highlight {
    background-color: #ffd54f !important;
    color: #212121 !important;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.dark-mode .search-highlight {
    background-color: #ffca28 !important;
    color: #000000 !important;
}

#menuList {
    flex: 1;
    overflow-y: auto;
}

/* Custom Scrollbar for Menu */
#menuList::-webkit-scrollbar {
    width: 5px;
}

#menuList::-webkit-scrollbar-thumb {
    background: var(--secondary-gray);
    border-radius: 10px;
}

.parent-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--parent-text);
    background: var(--parent-bg);
    cursor: pointer;
    border-bottom: 1px solid var(--sidebar-bg-darker);
}

.child-menu {
    font-size: 0.8rem;
    padding: 8px 15px 8px 35px;
    display: block;
    text-decoration: none;
    color: var(--sidebar-text) !important;
    transition: all 0.2s;
    border-bottom: 1px solid var(--child-border);
}

.child-menu:hover {
    background: var(--primary-blue);
    color: #fff !important;
}

.child-menu.active {
    background: var(--child-active-bg);
    color: var(--child-active-text) !important;
    font-weight: bold;
    border-left: 4px solid var(--child-active-text);
}

.menu-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    word-break: break-all;
}

.menu-id {
    font-size: 0.7rem;
    color: var(--primary-blue);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.child-menu:hover .menu-id {
    color: #fff;
}