.input-group .form-control {
    z-index: 1;
}

.input-group .btn {
    z-index: 2;
}

/* Search form and results positioning */
.search-form-container {
    position: relative;
    z-index: 1060; /* Higher than Bootstrap's modal (1050) */
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 15px; /* Align with input considering the column margin */
    right: 15px;
    z-index: 1050;
    background: white;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

.search-results-dropdown .list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.search-results-dropdown .list-group-item {
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    cursor: pointer;
    background: white;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.search-results-dropdown .list-group-item:last-child {
    border-bottom: none;
}

.search-results-dropdown .list-group-item:hover {
    background-color: #f8f9fa;
}

/* =========================================
   HEADER USER GREETING - MOBILE VISIBILITY FIX
   ========================================= */

/* FORCE user greeting to be visible on ALL screen sizes */
.header-profile,
.header-profile .nav-item,
.header-profile .nav-link,
.header-profile .dropdown-toggle-custom,
.header-profile .header-info,
.header-profile .header-info span {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.header-profile .nav-link,
.header-profile .dropdown-toggle-custom {
    display: flex !important;
    align-items: center !important;
}

.header-profile .header-info {
    display: inline-block !important;
}

.header-profile .header-info span {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 14px !important;
    color: #000 !important;
    font-weight: normal !important;
}

.header-profile .header-info strong {
    font-weight: 600 !important;
}

/* Ensure the entire header-right area is visible */
.navbar-nav.header-right {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
}

.navbar-nav.header-right .nav-item {
    display: block !important;
}

/* Ensure extra-nav container is visible */
.extra-nav,
.extra-cell {
    display: flex !important;
    visibility: visible !important;
    align-items: center !important;
}

/* Mobile specific adjustments */
@media (max-width: 991px) {
    .header-profile .nav-link,
    .header-profile .dropdown-toggle-custom {
        padding: 8px 12px !important;
        display: flex !important;
    }
    
    .header-profile .header-info span {
        font-size: 13px !important;
        max-width: 200px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* Make sure extra-nav is visible on tablet */
    .extra-nav {
        display: flex !important;
        order: 3 !important;
    }
    
    .extra-cell {
        display: flex !important;
        gap: 10px !important;
    }
}

@media (max-width: 767px) {
    .header-profile .header-info span {
        font-size: 12px !important;
        max-width: 150px !important;
    }
}

@media (max-width: 575px) {
    .header-profile .nav-link,
    .header-profile .dropdown-toggle-custom {
        padding: 6px 10px !important;
    }
    
    .header-profile .header-info span {
        font-size: 11px !important;
        max-width: 110px !important;
    }
}

@media (max-width: 420px) {
    .header-profile .header-info span {
        font-size: 10px !important;
        max-width: 90px !important;
    }
}

/* Ensure dropdown menu is properly sized */
.header-profile .dropdown-menu {
    min-width: 220px !important;
}



.search-results-dropdown:empty {
    display: none;
}

/* Ensure proper stacking context */
.card {
    position: relative;
    overflow: visible !important;
}

.card-body {
    position: relative;
    z-index: 1;
}

/* Ensure dropdown is above other elements */
.table-responsive {
    overflow: visible;
}

.position-relative {
    position: relative !important;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}


/* DROPDOWN MENU TEXT FIX */
.header-profile .dropdown-menu { background: #fff !important; border: 1px solid rgba(0,0,0,.15) !important; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.header-profile .dropdown-menu .dropdown-item { display: flex !important; align-items: center !important; padding: 10px 20px !important; color: #333 !important; visibility: visible !important; opacity: 1 !important; }
.header-profile .dropdown-menu .dropdown-item span { display: inline-block !important; visibility: visible !important; opacity: 1 !important; color: #333 !important; font-size: 14px !important; font-weight: normal !important; }
.header-profile .dropdown-menu .dropdown-item:hover { background-color: #f8f9fa !important; }
.header-profile .dropdown-menu .dropdown-item svg, .header-profile .dropdown-menu .dropdown-item i { display: inline-block !important; visibility: visible !important; opacity: 1 !important; }
.header-profile .dropdown-menu .dropdown-item .ms-2 { margin-left: 0.5rem !important; display: inline-block !important; visibility: visible !important; }


/* FIX SPACING BETWEEN USER GREETING AND MENU BUTTON */
.extra-cell { gap: 10px !important; justify-content: flex-end !important; }
.extra-cell .navbar-nav.header-right { margin-right: 10px !important; }
.extra-cell .menu-btn { margin-left: 10px !important; }
@media (max-width: 991px) { .extra-cell { gap: 8px !important; } }
@media (max-width: 575px) { .extra-cell { gap: 5px !important; } .extra-cell .navbar-nav.header-right { margin-right: 5px !important; } .extra-cell .menu-btn { margin-left: 5px !important; } }
