

.page-inner {
    /* padding: .5rem 0; */
}


.navbar-brand {
    display: inline-block;
    padding-top: .3125rem;
    padding-bottom: .3125rem;
    margin-right: .5rem;
    /* font-size: 2rem; */
    line-height: inherit;
    white-space: nowrap;
}

/* @media (min-width: 992px) {
    .modal-lg {
        max-width: 70%;
    }
} */


.form-control {
    box-shadow: 0px 0px 20px 0px #ddd;
    font-size: 14px;
    border-color: #ebedf2;
    padding: 0.6rem 1rem;
    height: inherit !important;
}

.card .card-header, .card-light .card-header {
    padding: .75rem 1rem;
    background-color: transparent;
    border-bottom: 1px solid #ebecec !important;
}

.card .card-body, .card-light .card-body {
    padding: 1rem 1.5rem;
}

.empty-state{
    padding:1.5rem;
}

/* ===================================
   SELECT2 CUSTOM STYLING
   =================================== */

/* Main Select2 Container - Match form-control */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection {
    border: 1px solid #ebedf2;
    border-radius: 0.25rem;
    box-shadow: 0px 0px 20px 0px #ddd;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff;
}

/* Single Select Styling */
.select2-container--default .select2-selection--single {
    height: inherit !important;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ebedf2;
    border-radius: 0.25rem;
    box-shadow: 0px 0px 20px 0px #ddd;
    min-height: calc(1.5em + 1rem + 4px);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057;
    line-height: 1.5;
    padding-left: 0;
    padding-right: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.75rem);
    right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    left: 50%;
    margin-left: -4px;
    margin-top: -2px;
    position: absolute;
    top: 50%;
    width: 0;
}

/* Multiple Select Styling */
.select2-container--default .select2-selection--multiple {
    border: 1px solid #ebedf2;
    border-radius: 0.25rem;
    box-shadow: 0px 0px 20px 0px #ddd;
    background-color: #fff;
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 14px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #177dff;
    border: 1px solid #177dff;
    border-radius: 0.25rem;
    color: #fff;
    font-size: 0.75rem;
    margin: 0.125rem;
    padding: 0.125rem 0.375rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: inline-block;
    font-weight: bold;
    margin-right: 0.25rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
}

/* Focus State */
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default .select2-selection:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0px 0px 20px 0px #ddd, 0 0 0 0.2rem rgba(23, 125, 255, 0.25);
}

/* Open State */
.select2-container--default.select2-container--open .select2-selection {
    border-color: #80bdff;
    box-shadow: 0px 0px 20px 0px #ddd, 0 0 0 0.2rem rgba(23, 125, 255, 0.25);
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent;
    border-width: 0 4px 5px 4px;
}

/* Dropdown Styling */
.select2-dropdown {
    border: 1px solid #ebedf2;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    background-color: #fff;
    z-index: 9999;
}

.select2-dropdown .select2-search {
    padding: 0.5rem;
}

.select2-dropdown .select2-search .select2-search__field {
    border: 1px solid #ebedf2 !important;
    border-radius: 0.25rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 14px !important;
    width: 100% !important;
    box-shadow: 0px 0px 10px 0px rgba(221, 221, 221, 0.5) !important;
    height: auto !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    background-image: none !important;
    background-clip: padding-box !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-dropdown .select2-search .select2-search__field:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(23, 125, 255, 0.25) !important;
}

/* Results Styling */
.select2-results {
    font-size: 0.875rem;
}

.select2-results__option {
    padding: 0.5rem 0.75rem;
    color: #495057;
    cursor: pointer;
}

.select2-results__option:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.select2-results__option--highlighted {
    background-color: #177dff;
    color: #fff;
}

.select2-results__option--selected {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 500;
}

.select2-results__option--disabled {
    color: #6c757d;
    cursor: not-allowed;
}

/* No Results */
.select2-results__message {
    padding: 0.75rem;
    color: #6c757d;
    font-style: italic;
}

/* Loading */
.select2-results__option--loading {
    padding: 0.75rem;
    color: #6c757d;
}

/* Clear Button */
.select2-container--default .select2-selection__clear {
    color: #6c757d;
    cursor: pointer;
    float: right;
    font-weight: bold;
    margin-right: 10px;
    position: relative;
}

.select2-container--default .select2-selection__clear:hover {
    color: #495057;
}

/* Disabled State */
.select2-container--default .select2-selection--single.select2-selection--disabled,
.select2-container--default .select2-selection--multiple.select2-selection--disabled {
    background-color: #e9ecef;
    border-color: #ebedf2;
    cursor: not-allowed;
    opacity: 0.65;
}

.select2-container--default .select2-selection--disabled .select2-selection__rendered {
    color: #6c757d;
}

/* Small Form Controls */
.form-control-sm + .select2-container .select2-selection {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Large Form Controls */
.form-control-lg + .select2-container .select2-selection {
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

/* Invalid State */
.is-invalid + .select2-container .select2-selection,
.was-validated .select2-container .select2-selection:invalid {
    border-color: #fd7e14;
    box-shadow: 0px 0px 20px 0px #ddd, 0 0 0 0.2rem rgba(253, 126, 20, 0.25);
}

/* Valid State */
.is-valid + .select2-container .select2-selection,
.was-validated .select2-container .select2-selection:valid {
    border-color: #31ce36;
    box-shadow: 0px 0px 20px 0px #ddd, 0 0 0 0.2rem rgba(49, 206, 54, 0.25);
}

/* Modal specific adjustments */
.modal .select2-dropdown {
    z-index: 10060; /* Higher than Bootstrap modal (1055) and backdrop (1050) */
}

.modal .select2-container {
    z-index: 56; /* Just above modal */
}

.modal .select2-container--open .select2-dropdown {
    z-index: 10060;
}

/* Ensure Select2 search input works properly in modals */
.modal .select2-search__field {
    border: 1px solid #ebedf2 !important;
    border-radius: 0.25rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 14px !important;
    width: 100% !important;
    box-shadow: 0px 0px 10px 0px rgba(221, 221, 221, 0.5) !important;
    height: auto !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    pointer-events: auto !important;
    user-select: text !important;
}

.modal .select2-search__field:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(23, 125, 255, 0.25) !important;
}

/* Override Bootstrap modal focus restrictions for Select2 */
.modal .select2-container,
.modal .select2-dropdown,
.modal .select2-search,
.modal .select2-search__field {
    pointer-events: auto !important;
}

/* Fix for Select2 dropdown positioning in modals */
.modal .select2-dropdown--below {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.modal .select2-dropdown--above {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Form group integration */
.form-group .select2-container {
    display: block;
}

.form-group .select2-container .select2-selection {
    display: block;
    width: 100%;
}

/* Label integration */
.form-group label + .select2-container {
    margin-top: 0;
}

/* Input group integration */
.input-group .select2-container {
    flex: 1 1 auto;
    width: 1% !important;
}

.input-group .select2-container .select2-selection {
    border-radius: 0;
}

.input-group .select2-container:first-child .select2-selection {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.input-group .select2-container:last-child .select2-selection {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Bootstrap validation feedback */
.select2-container + .invalid-feedback {
    display: block;
}

.select2-container + .valid-feedback {
    display: block;
}

/* Placeholder styling */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
    font-style: italic;
}

.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Custom scrollbar for dropdown */
.select2-results::-webkit-scrollbar {
    width: 6px;
}

.select2-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.select2-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.select2-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Enhanced focus ring for accessibility */
.select2-container--default .select2-selection:focus-visible {
    outline: 2px solid #177dff;
    outline-offset: 2px;
}

/* Ensure search field is always visible and functional */
.select2-dropdown .select2-search--dropdown {
    display: block !important;
    padding: 0.5rem !important;
}

.select2-dropdown .select2-search--dropdown .select2-search__field {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: textfield !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Fix for potential input conflicts */
.select2-search__field::-webkit-search-cancel-button {
    -webkit-appearance: none !important;
}

.select2-search__field::-webkit-search-decoration {
    -webkit-appearance: none !important;
}

/* Ensure search is enabled */
.select2-container .select2-search--dropdown {
    display: block !important;
}

/* Override any global input styles that might interfere */
.select2-dropdown input.select2-search__field {
    margin: 0 !important;
    outline: none !important;
    border-radius: 0.25rem !important;
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure search container is visible */
.select2-search {
    display: block !important;
    position: relative !important;
}

/* Make sure search input is clickable and focusable */
.select2-search input {
    pointer-events: auto !important;
    cursor: text !important;
}

/* Additional search field fixes */
.select2-dropdown .select2-search {
    display: block !important;
    background: #fff !important;
}

.select2-dropdown .select2-search input {
    background: #fff !important;
    border: 1px solid #ebedf2 !important;
}

/* Loading state styling */
.select2-container--default .select2-selection--single .select2-selection__rendered .select2-selection__placeholder {
    color: #6c757d;
}

.select2-spinner {
    position: absolute !important;
    top: 50% !important;
    right: 30px !important;
    transform: translateY(-50%) !important;
    width: 16px !important;
    height: 16px !important;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .select2-dropdown {
        /* background-color: #2c3e50; */
        border-color: #80bdff;
    }

    .select2-results__option {
        color: #495057;
    }

    .select2-results__option:hover {
        background-color: #80bdff;
    }

    .select2-results__option--highlighted {
        background-color: #3498db;
    }

    
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .select2-container .select2-selection {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .select2-dropdown {
        font-size: 14px;
    }

    .select2-results__option {
        padding: 0.75rem;
    }
}