.form-control, .form-select {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    padding: 0px 8px;
    min-height: 28px !important;
    color: #000000;
    font-size: 15px !important;
    height: 28px;
}

.quotation-readonly .quote-datepicker[readonly] {
    background-color: #eee !important;
}

[data-bs-theme="dark"] .quotation-readonly .quote-datepicker[readonly] {
    background-color: #181c27 !important;
    color: #ffffff !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #000000;
}
::placeholder {
    color: #000 !important;
}
.form-check-input {
    border: 1px solid #2d2d2d;
}
.input-group .btn {
    left: 4px;
    top: -1px;
}
div.dataTables_wrapper div.dataTables_processing {
    position: absolute;
    top: 100%;
    left: 0%;
    width: 200px;
    margin-left: -220px;
    margin-top: 60px;
    text-align: center;
    padding: 1em 0;
}
ul.sub-menu.mm-collapse a span {
    white-space: normal;
}
.input-group-prepend select.form-control.form-select-sm {
    border-radius: 4px 0px 0px 4px;
}
input#client_phone_no {
    border-radius: 0px 4px 4px 0px;
}

/* Select2 dropdown border fixes for mobile */
.select2-dropdown {
    border: 1px solid #aaa !important;
    border-radius: 4px !important;
}

.select2-container--open .select2-dropdown--above {
    border-bottom: 1px solid #aaa !important;
}

.select2-container--open .select2-dropdown--below {
    border-top: 1px solid #aaa !important;
}

/* Ensure dropdown maintains borders on all screen sizes */
@media (max-width: 768px) {
    .select2-dropdown {
        border: 1px solid #aaa !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }

    .select2-container--open .select2-dropdown {
        border: 1px solid #aaa !important;
    }
}

/* Additional mobile fixes for Select2 */
.select2-mobile-fix {
    border: 1px solid #aaa !important;
    border-radius: 4px !important;
}

.select2-mobile-fix.select2-dropdown--above {
    border-bottom: 1px solid #aaa !important;
}

.select2-mobile-fix.select2-dropdown--below {
    border-top: 1px solid #aaa !important;
}

/* Dark mode support for Select2 and form elements */
[data-bs-theme="dark"] {
    .form-control, .form-select {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
        color: #ffffff !important;
    }
    
    .form-control::placeholder,
    .form-select::placeholder {
        color: #B0B3B8 !important;
    }
    
    .select2-container--default .select2-selection--single {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
        color: #ffffff !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: #ffffff !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__placeholder {
        color: #B0B3B8 !important;
    }
    
    .select2-container--default .select2-selection--multiple {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
    }
    
    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
        color: #ffffff !important;
    }

    .select2-dropdown {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
    }
    
    .select2-container--default .select2-results__option {
        color: #ffffff !important;
        background-color: #181c27 !important;
    }
    
    .select2-container--default .select2-results__option--highlighted[aria-selected] {
        background-color: #5b73e8 !important;
        color: #ffffff !important;
    }
    
    .select2-container--default .select2-search--dropdown .select2-search__field {
        background-color: #181c27 !important;
        border: 1px solid #404040 !important;
        color: #ffffff !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        border-color: #B0B3B8 transparent transparent transparent !important;
    }
    
    .select2-container--open .select2-selection--single .select2-selection__arrow b {
        border-color: transparent transparent #B0B3B8 transparent !important;
    }

    img[src*="transfer_user"] {
        filter: brightness(0) invert(1) !important;
    }

    .flatpickr-calendar {
        background-color: #181c27 !important;
        border-color: #404040 !important;
        color-scheme: dark;
    }

    .flatpickr-months .flatpickr-monthDropdown-months,
    .flatpickr-months .flatpickr-monthDropdown-months:hover,
    .flatpickr-current-month input.cur-year,
    .flatpickr-current-month .numInputWrapper,
    .flatpickr-current-month .numInputWrapper input,
    .flatpickr-current-month .numInputWrapper span {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #ffffff !important;
    }

    .flatpickr-monthDropdown-months option,
    .flatpickr-monthDropdown-month {
        background-color: #181c27 !important;
        color: #ffffff !important;
    }

    span.flatpickr-weekday {
        color: #ffffff !important;
    }

    .flatpickr-day {
        color: #ffffff !important;
    }

    .swal2-popup {
        background-color: #181c27 !important;
        color: #ffffff !important;
        border: 1px solid #404040 !important;
    }

    .swal2-title,
    .swal2-html-container,
    .swal2-content {
        color: #ffffff !important;
    }

    .swal2-textarea {
        background-color: #181c27 !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }

    .swal2-textarea::placeholder {
        color: #B0B3B8 !important;
    }

    .swal2-validation-message {
        background-color: #181c27 !important;
        color: #ffffff !important;
    }

    .swal2-footer {
        border-top-color: #404040 !important;
        color: #ffffff !important;
    }

    .offcanvas-header {
        background-color: #181c27 !important;
        border-bottom-color: #404040 !important;
    }

    .offcanvas-body {
        background-color: #181c27 !important;
    }

    .quotation-snapshot-premium-card-header {
        background-color: #252b3b;
    }

    .document-headers,
    .document-footnotes {
        background-color: #181c27 !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }

    .document-headers *,
    .document-footnotes * {
        color: #ffffff !important;
    }

    .statement-header .company-name {
        color: #ffffff !important;
    }

    .statement-details {
        background-color: #181c27 !important;
        color: #ffffff !important;
    }

    .print-footer p {
        color: #ffffff !important;
    }

    ::placeholder {
        color: #B0B3B8 !important;
    }

    .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
        color: #ffffff !important;
        background-color: transparent !important;
    }

    .invoice-container .select2-selection--multiple .select2-selection__choice__remove {
        color: #ffffff !important;
    }

    .journal-container,
    .voucher-container,
    .invoice-container {
        background-color: #181c27 !important;
    }

    .journal-container .file-upload-container a,
    .voucher-container .file-upload-container a,
    .invoice-container .file-upload-container a {
        color: #B0B3B8 !important;
    }

    .summary-section,
    #tax-breakdown {
        background-color: #252b3b !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }

    #line-items-tbody tr:nth-child(odd) td {
        background-color: #181c27 !important;
    }

    #line-items-tbody tr:nth-child(even) td {
        background-color: #1f2433 !important;
    }

    #line-items-table thead.table-light th {
        background-color: #252b3b !important;
        color: #ffffff !important;
        border-color: #404040 !important;
    }

    #line-items-table.table-bordered > :not(caption) > * > * {
        border-color: #404040 !important;
    }

    #line-items-table .form-control:focus,
    #line-items-table .form-select:focus {
        border-color: #5b73e8 !important;
        background-color: #252b3b !important;
    }

    #dateDropdownButton,
    #dateDropdownButton:hover,
    #dateDropdownButton:focus,
    #dateDropdownButton:active {
        background-color: #181c27 !important;
        border-color: #404040 !important;
        color: #ffffff !important;
    }
}