/* Main Styles */
.btn-custom {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid hsl(29, 86.70%, 52.90%);
}

input.half-height {
    height: 38px;
    padding: 5px 10px;
    font-size: 1rem;
    line-height: 1.2;
}


.no-border th,
.no-border td {
    border-top: none;
    border-left: none;
    border-right: none;
}

.no-border {
    border-top: none;
}

.select-search {
    height: 35px;
    width: 100%;
    font-size: 1rem;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.btn-search {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 1rem;
    align-items: center;
    gap: 2rem;
    color: #495057;
}

.btn-width {
    width: 100%;
}

#btn-card {
    width: 100%;
}

#btn-cash {
    width: 100%;
}

/* Table Styles */
.table td,
.table th {
    text-align: center;
}

.table th.text-left,
.table td.text-left {
    text-align: left !important;
}

/* Quantity Input Styles */
.quantity-input {
    max-width: 100%;
    text-align: center;
}

.input-group {
    width: 100%;
    display: flex;
    align-items: center;
}

.input-group button {
    width: 30px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group .form-control {
    height: 35px;
    text-align: center;
    flex-grow: 1;
}

.input-group .btn-outline-secondary {
    border-color: #ced4da;
    line-height: 1;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    color: #000;
}

/* Width Utilities */
.w-30 {
    width: 30% !important;
}

.w-40 {
    width: 40% !important;
}

/* Validation Styles */
.is-invalid {
    border-color: #f46a6a !important;
}

.invalid-feedback {
    color: #f46a6a;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.required-field::after {
    content: " *";
    color: #f46a6a;
}

.form-label.required {
    position: relative;
}

.form-label.required::after {
    content: " *";
    color: #f46a6a;
    position: absolute;
    margin-left: 3px;
}

/* Spinner Styles */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* Table Responsive Styles */
.table-responsive {
    position: relative;
}

.table-responsive thead {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 1;
}

.table-responsive tbody {
    display: block;
    max-height: 500px;
    overflow-y: auto;
}

.table-responsive thead,
.table-responsive tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Checkbox Styles */
.form-check-input[type="checkbox"] {
    display: inline-block !important;
    opacity: 1 !important;
    position: relative !important;
    visibility: visible !important;
}

/* Modal Styles */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal.fade.show {
    display: block !important;
    opacity: 1 !important;
}

/* Select2 Custom Styles */
.select2-container .select2-selection--single {
    height: 38px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #212529;
    line-height: 1.5;
    padding-left: 0;
    padding-right: 0;
}

.select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-results__option {
    padding: 0.5rem 1rem;
}

.select2-results__option--selected {
    background-color: #f8f9fa;
    color: #212529;
}

.select2-results__option--highlighted {
    background-color: #6c757d !important; /* Bootstrap's secondary color */
    color: white !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.5rem;
}

.select2-container--focus .select2-selection--single {
    border-color: #6c757d;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25); /* Updated to use secondary color */
}

.select2-container--open .select2-dropdown {
    border-color: #6c757d;
}

.select2-container.is-invalid .select2-selection--single {
    border-color: #f46a6a !important;
}

.select2-container {
    width: 100% !important;
    outline: 0;
}

/* Select2 Bootstrap 5 Theme Overrides */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.5;
    color: #495057 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #212529 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.5rem 1rem;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #f8f9fa;
    color: #212529;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #6c757d !important; /* Bootstrap's secondary color */
    color: white !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
}

/* Add these new styles at the end of your existing CSS */

/* Select2 Highlighted Option Styling */
.select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #6c757d !important; /* Bootstrap secondary color */
}

/* Force white text for all content in highlighted options */
.select2-results__option--highlighted,
.select2-results__option--highlighted *,
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted * {
    color: white !important;
}

/* Specifically target the email text in user results */
.select2-results__option--highlighted .text-muted,
.select2-container--bootstrap-5 .select2-results__option--highlighted .text-muted {
    color: rgba(255, 255, 255, 0.8) !important; /* Slightly transparent white */
}

/* Keep default styling for non-highlighted options */
.select2-results__option .text-muted,
.select2-container--bootstrap-5 .select2-results__option .text-muted {
    color: #6c757d !important; /* Bootstrap's default muted color */
}