/* Custom CSS to support Tailwind-like utility classes used by Heroicons */
.w-3, svg.w-3 { width: 0.75rem !important; }
.h-3, svg.h-3 { height: 0.75rem !important; }

.w-3\.5, svg.w-3\.5 { width: 0.875rem !important; }
.h-3\.5, svg.h-3\.5 { height: 0.875rem !important; }

.w-4, svg.w-4 { width: 1rem !important; }
.h-4, svg.h-4 { height: 1rem !important; }

.w-5, svg.w-5 { width: 1.25rem !important; }
.h-5, svg.h-5 { height: 1.25rem !important; }

.w-6, svg.w-6 { width: 1.5rem !important; }
.h-6, svg.h-6 { height: 1.5rem !important; }

.w-7, svg.w-7 { width: 1.75rem !important; }
.h-7, svg.h-7 { height: 1.75rem !important; }

.w-8, svg.w-8 { width: 2rem !important; }
.h-8, svg.h-8 { height: 2rem !important; }

.w-10, svg.w-10 { width: 2.5rem !important; }
.h-10, svg.h-10 { height: 2.5rem !important; }

.w-12, svg.w-12 { width: 3rem !important; }
.h-12, svg.h-12 { height: 3rem !important; }

.w-16, svg.w-16 { width: 4rem !important; }
.h-16, svg.h-16 { height: 4rem !important; }

svg {
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

/* Sidebar & Navbar Brand Logo Sizing */
.iq-sidebar-logo img.light-logo,
.iq-navbar-logo img {
    height: auto !important;
    max-height: 72px !important;
    width: auto !important;
    margin: 5%;
    max-width: 225px !important;
    object-fit: contain !important;
}

/* Sidebar Logo Header Container Sizing */
.iq-sidebar-logo {
    height: 58px !important;
    min-height: 88px !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.iq-sidebar-logo .header-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 100% !important;
}

.iq-sidebar-logo .header-logo img {
    height: auto !important;
    max-height: 90px !important;
    width: auto !important;
    max-width: 310px !important;
    object-fit: contain !important;
    transition: all 0.3s ease-in-out !important;
}

/* Collapsed Sidebar Mode Responsive Logo (Desktop Only) */
@media (min-width: 1300px) {
    body.sidebar-main .iq-sidebar-logo {
        height: 70px !important;
        min-height: 70px !important;
        padding: 8px 4px !important;
        justify-content: center !important;
    }

    body.sidebar-main .iq-sidebar-logo .header-logo img {
        max-height: 48px !important;
        max-width: 52px !important;
        object-fit: contain !important;
    }
}

/* Mobile View Sidebar Logo Sizing */
@media (max-width: 1299.98px) {
    body.sidebar-main .iq-sidebar-logo .header-logo img,
    .iq-sidebar-logo .header-logo img {
        max-height: 55px !important;
        max-width: 200px !important;
        object-fit: contain !important;
    }
}

/* Mobile Navbar Dropdown Alignment & Styling */
@media (max-width: 991.98px) {
    .iq-top-navbar .navbar-collapse {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        right: 15px !important;
        left: auto !important;
        width: 310px !important;
        max-width: calc(100vw - 30px) !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18) !important;
        padding: 18px 16px !important;
        z-index: 1050 !important;
        border: 1px solid #e2e8f0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .iq-top-navbar .navbar-collapse:not(.show) {
        display: none !important;
    }

    .iq-top-navbar .mobile-search-wrapper {
        width: 100% !important;
    }

    .iq-top-navbar .navbar-nav.navbar-list {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 0 12px 0 !important;
        margin: 0 0 12px 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .iq-top-navbar .navbar-nav.navbar-list>li {
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Force hide redundant caption avatar inside list on mobile */
    .iq-top-navbar .navbar-list .caption-content,
    .iq-top-navbar .caption-content,
    .iq-top-navbar li.caption-content {
        display: none !important;
    }

    .iq-top-navbar .iq-sub-dropdown.dropdown-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: -10px !important;
        left: auto !important;
        z-index: 1100 !important;
    }
}

/* Global Navbar & Dropdown Stacking Order */
.iq-top-navbar {
    z-index: 1030 !important;
}

.iq-top-navbar .iq-sub-dropdown,
.iq-top-navbar .iq-sub-dropdown.dropdown-menu {
    z-index: 1035 !important;
}

/* Live Search Autocomplete Overlay */
.global-search-results {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 380px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 99999 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 6px 0 !important;
}

.global-search-results.d-none {
    display: none !important;
}

/* Desktop Sidebar Header Alignment */
@media (min-width: 992px) {
    .iq-menu-bt-sidebar {
        height: 38px !important;
        width: 38px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        transition: background-color 0.2s ease !important;
    }

    .iq-menu-bt-sidebar:hover {
        background-color: #f1f5f9 !important;
    }
}

/* Bottom Sidebar Collapse Toggle */
.iq-sidebar-bottom {
    position: relative;
    z-index: 15;
    background: #ffffff;
}

.sidebar-toggle-btn:hover {
    background-color: #e2e8f0 !important;
}

/* Collapsed Sidebar Mode (body.sidebar-main) */
body.sidebar-main .sidebar-toggle-text {
    display: none !important;
}

body.sidebar-main .iq-sidebar-bottom {
    padding: 8px 4px !important;
}

body.sidebar-main .sidebar-toggle-btn {
    justify-content: center !important;
    padding: 8px !important;
}