.select2-container { max-width: 100%; min-width: 0; }
.select2-container--default .select2-selection--single { min-height: 34px; border: 1px solid #ced4da; border-radius: 4px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 32px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 32px; }
.select2-container--default .select2-selection--multiple { min-height: 34px; border-color: #ced4da; }
.select2-container--default.select2-container--focus .select2-selection { border-color: #087f78; }
.select2-container--default.select2-container--disabled .select2-selection { background-color: #e9ecef; }
.erp-header-right .select2-container { width: 150px !important; }

/* Select2 must share the same flexible field column as native inputs. */
.erp-form-row > .select2-container { flex: 1 1 0; width: 0 !important; }
.erp-form-row > input,
.erp-form-row > textarea { min-width: 0; }
@media (min-width: 769px) {
    .erp-form-row > label { flex: 0 0 180px; }
}
@media (max-width: 768px) {
    .erp-form-row > .select2-container { flex: none; width: 100% !important; }
}

/* Keep replacement controls at the native field's height and toolbar width. */
.select2-container--default .select2-selection--single { height: var(--erp-select-height, 38px); min-height: var(--erp-select-height, 38px); }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: calc(var(--erp-select-height, 38px) - 2px); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: calc(var(--erp-select-height, 38px) - 2px); }
.erp-select-pagesize { width: 100px !important; }
.index-search > .erp-select-search { width: 180px !important; flex: 0 1 180px; }
.index-search { flex-wrap: wrap; min-width: 0; }
.erp-row-group > .select2-container { flex: 1 1 0; width: 0 !important; }
@media (max-width: 768px) {
    .erp-row-group > .select2-container { flex: none; width: 100% !important; }
}

/* Match Select2 to the ERP form controls and teal theme. */
.select2-container { font-family: inherit; font-size: inherit; }
.select2-container--default .select2-selection { border: 1px solid #ced4da; border-radius: .375rem; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: #212529; padding-left: 12px; padding-right: 36px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { right: 10px; width: 16px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { width: 7px; height: 7px; border: solid #495057; border-width: 0 1.5px 1.5px 0; margin: -5px 0 0 -4px; transform: rotate(45deg); }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-color: #495057; border-width: 0 1.5px 1.5px 0; margin-top: -2px; transform: rotate(225deg); }
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection { border-color: var(--primary, #1E4F4A); box-shadow: 0 0 0 .2rem rgba(30,79,74,.15); outline: none; }
.select2-container--default .select2-selection__placeholder { color: #6c757d; }
.select2-container--default.select2-container--disabled .select2-selection { cursor: not-allowed; }
.select2-container--default.select2-container--disabled .select2-selection__rendered { color: #6c757d; }
.select2-container--default .select2-selection--multiple { min-height: var(--erp-select-height, 38px); padding: 2px 8px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--primary-light, #CDEBE8); border-color: #b7d9d5; color: var(--primary, #1E4F4A); border-radius: 4px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--primary, #1E4F4A); }
.select2-dropdown { border-color: #b7d9d5; border-radius: .375rem; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.12); font-family: inherit; }
.select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid #ced4da; border-radius: 4px; padding: 6px 10px; font: inherit; color: #212529; outline: none; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--primary, #1E4F4A); box-shadow: 0 0 0 2px rgba(30,79,74,.12); }
.select2-results__option { padding: 8px 12px; }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--primary-light, #CDEBE8); color: var(--primary, #1E4F4A); }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--primary, #1E4F4A); color: #fff; }