.sidebar.modern-sidebar .modern-sidebar-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
}

.sidebar.modern-sidebar .modern-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 61px;
    padding: 15px 12px !important;
}

.sidebar.modern-sidebar .modern-logo-container .modern-logo-text {
    min-width: 0;
    padding: 0;
    gap: 10px;
    white-space: nowrap;
}

.sidebar.modern-sidebar .modern-logo-container .logo-title {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapse-btn.hamburger-btn {
    font-size: 16px;
    padding: 6px 8px;
    line-height: 1;
    flex-shrink: 0;
}

@media (min-width: 992px) {
    body:not(.sidebar-mini) .sidebar-collapse-btn.hamburger-btn {
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    body:not(.sidebar-mini) .sidebar-collapse-btn.hamburger-btn:active {
        transform: translateY(-50%) scale(0.92);
    }
}

.sidebar-collapse-btn.hamburger-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

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

.sidebar .search-item {
    flex-shrink: 0;
}

.sidebar .modern-search-box i {
    float: none;
    width: auto;
    margin: 0;
    font-size: 15px;
    line-height: 1;
}

.sidebar-scroll .custom-modern-sidebar-nav {
    padding-bottom: 10px !important;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-profile-footer {
    flex-shrink: 0;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-profile-card {
    position: relative;
}

.sp-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px 8px 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sp-trigger:hover,
.sidebar-profile-card.open .sp-trigger {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.sp-trigger:focus {
    outline: none;
}

.sp-trigger:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.sp-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #ffffff;
    color: #003044;
    font-size: 14px;
    font-weight: bold;
}

.sp-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.sp-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.25;
    min-width: 0;
    white-space: nowrap;
}

.sp-meta i {
    width: 11px;
    flex-shrink: 0;
    font-size: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}

.sp-enterprise {
    flex: 0 1 auto;
    min-width: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-sep {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
}

.sp-role {
    flex-shrink: 0;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes sp-menu-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@keyframes sp-menu-side {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: none; }
}

.sidebar-profile-card.open .sp-menu {
    animation: sp-menu-up 0.16s ease-out;
}

.sidebar-profile-card .sp-menu.dropdown-menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    margin: 0 0 8px;
}

.sp-menu > li > a.sp-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: default;
}

.sp-menu .sp-menu-label {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 6px;
}

.sp-menu > li.divider {
    margin: 4px 0;
}

#app-content {
    overflow: auto;
    height: 100vh;
}

@media (min-width: 992px) {
    .sidebar,
    .sidebar .sidebar-wrapper {
        width: 280px;
    }

    .main-panel {
        width: calc(100% - 280px);
    }

    .sidebar {
        transition-property: width, margin-left, transform;
    }
}

@media (min-width: 992px) {
    .sidebar .sidebar-wrapper {
        transition: width 0.36s cubic-bezier(0.685, 0.0473, 0.346, 1);
    }

    body.sidebar-mini .sidebar,
    body.sidebar-mini .sidebar .sidebar-wrapper {
        width: 64px;
    }

    body.sidebar-mini .main-panel {
        width: calc(100% - 64px);
    }

    body.sidebar-mini .sidebar.modern-sidebar .modern-sidebar-wrapper {
        overflow: visible;
    }

    body.sidebar-mini .sidebar:has(.sidebar-profile-card.open) {
        z-index: 3;
    }

    body.sidebar-mini .sidebar.modern-sidebar .modern-logo-container {
        justify-content: center;
        padding: 15px 0 !important;
    }

    body.sidebar-mini .modern-logo-container .modern-logo-text {
        display: none !important;
    }

    body.sidebar-mini .sidebar-scroll {
        scrollbar-width: none;
    }

    body.sidebar-mini .sidebar-scroll::-webkit-scrollbar {
        width: 0;
    }

    body.sidebar-mini .sidebar .search-item {
        display: flex;
        justify-content: center;
        padding: 8px 0;
    }

    body.sidebar-mini .modern-search-box {
        width: 40px;
        height: 36px;
        padding: 0;
        justify-content: center;
        background-color: transparent;
        border-color: transparent;
        cursor: pointer;
    }

    body.sidebar-mini .modern-search-box:hover,
    body.sidebar-mini .modern-search-box:active {
        background-color: rgba(255, 255, 255, 0.12);
        border-color: transparent;
        transform: none;
        box-shadow: none;
    }

    body.sidebar-mini .modern-search-box input {
        display: none;
    }

    body.sidebar-mini .custom-modern-sidebar-nav .modern-nav-link {
        width: 40px;
        height: 40px;
        margin: 4px auto;
        padding: 0 !important;
        justify-content: center;
    }

    body.sidebar-mini .custom-modern-sidebar-nav .modern-nav-link:hover,
    body.sidebar-mini .custom-modern-sidebar-nav li.active .modern-nav-link {
        transform: none;
    }

    body.sidebar-mini .custom-modern-sidebar-nav li.active .modern-nav-link {
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    }

    body.sidebar-mini .custom-modern-sidebar-nav .modern-nav-link i {
        width: auto !important;
        margin-right: 0 !important;
    }

    body.sidebar-mini .custom-modern-sidebar-nav .modern-nav-link p {
        display: none;
    }

    body.sidebar-mini .sidebar-profile-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 10px 0 8px;
    }

    body.sidebar-mini .sp-trigger,
    body.sidebar-mini .sp-trigger:hover,
    body.sidebar-mini .sidebar-profile-card.open .sp-trigger {
        width: auto;
        padding: 0;
        background-color: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    body.sidebar-mini .sp-details {
        display: none;
    }

    body.sidebar-mini .sidebar-profile-card .sp-menu.dropdown-menu {
        top: auto;
        bottom: 0;
        left: calc(100% + 14px);
        right: auto;
        width: max-content;
        min-width: 220px;
        max-width: calc(100vw - 100px);
        margin: 0;
    }

    body.sidebar-mini .sidebar-profile-card.open .sp-menu {
        animation-name: sp-menu-side;
    }
}

@media (max-width: 991px) {
    .sidebar-collapse-btn {
        display: none !important;
    }

    .cq-mobile-topbar.custom-modern-navbar {
        min-height: 56px;
        height: 56px;
        padding: 0;
        margin-bottom: 0;
    }

    .cq-mobile-topbar .navbar-header {
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        justify-content: space-between;
        height: 56px;
    }

    .cq-mobile-topbar .navbar-toggle {
        margin: 0;
    }

    .cq-mobile-topbar .cq-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        height: auto;
        padding: 0;
        color: #ffffff;
        font-size: 15px;
    }

    .cq-mobile-topbar .cq-mobile-brand img {
        border-radius: 6px;
    }

    #app-content {
        height: calc(100vh - 56px);
    }
}

.cq-rail-tip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10600;
    max-width: 240px;
    padding: 6px 10px;
    background-color: #003044;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    font-family: var(--cq-font-family);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-4px, -50%);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}

.cq-rail-tip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
    .cq-rail-tip {
        transition: none;
    }
}
