/* select2 renders its widget as a sibling of the original <select>, so toggling [hidden] on the
   select alone (e.g. a per-row field only relevant for some products) leaves the widget visible. */
select[hidden] + .select2-container { display: none !important; }

.input-group:has(select) { padding: 0 !important; }
.input-group:has(select) > i { position: absolute; left: 13px; z-index: 2; margin: 0; pointer-events: none; }
.input-group .select2-container { flex: 1; min-width: 0; width: 100% !important; margin: 0; font-size: 14px; }
.input-group .select2-container--default .select2-selection--single { height: 36px; display: flex; align-items: center; border: 0; background: transparent; outline: 0; }
.input-group .select2-selection--single .select2-selection__rendered { display: block; width: 100%; padding: 0 40px 0 47px; color: #0f172a; font-weight: 500; line-height: 36px; text-align: left !important; }
.input-group .select2-selection__placeholder { color: #64748b !important; }
.input-group .select2-selection--single .select2-selection__arrow { height: 36px; right: 0; }
.company-card .input-group .select2-container--default .select2-selection--single,
.company-card .input-group .select2-container--default .select2-selection--single .select2-selection__rendered,
.company-card .input-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    text-align: left !important;
    justify-content: flex-start !important;
}
.company-card .input-group .select2-container--default .select2-selection--single .select2-selection__rendered,
.company-card .input-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    display: block;
    width: 100%;
    margin: 0 !important;
}
.select2-dropdown { box-sizing: border-box; overflow: hidden; border: 2px solid #1e3a8a; border-radius: 12px; background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .18); }
.select2-container--open .select2-dropdown,
.select2-container--open .select2-dropdown--below,
.select2-container--open .select2-dropdown--above {
    border: 2px solid #1e3a8a !important;
    border-radius: 12px !important;
}
.select2-container--open .select2-dropdown--below { margin-top: 4px; }
.select2-container--open .select2-dropdown--above { margin-top: -4px; }
.select2-search--dropdown { padding: 10px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.select2-search--dropdown .select2-search__field { height: 38px; padding: 0 12px; border: 2px solid #cbd5e1 !important; border-radius: 10px; color: #0f172a; font-size: 14px; outline: none; transition: .2s ease; }
.select2-search--dropdown .select2-search__field:focus { border-color: #79d4ff !important; box-shadow: 0 0 0 3px rgba(121, 212, 255, .25), 0 0 14px rgba(121, 212, 255, .35); }
.select2-results__options { max-height: 260px !important; padding: 4px; }
.select2-results__option { display: block; margin: 1px 2px; padding: 9px 14px; border-radius: 8px; color: #334155; font-size: 14px; font-weight: 500; text-align: left !important; direction: ltr; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: #eaf8ff; color: #1e3a8a; font-weight: 600; }
.select2-container--default .select2-results__option--selected { background: #e8eeff; color: #1e3a8a; font-weight: 600; }

/* Select2 formatting throughout the authenticated application. */
.crm-workspace .select2-container { min-width: 0; width: 100% !important; font-size: 14px; }
.crm-workspace .select2-container--default .select2-selection--single { display: flex; height: 40px; align-items: center; border: 2px solid #1e3a8a; border-radius: 14px; background: #fff; outline: 0; transition: border-color .25s ease, box-shadow .25s ease; }
.crm-workspace .select2-container--default .select2-selection--single .select2-selection__rendered { width: 100%; padding: 0 38px 0 13px; color: #0f172a; font-weight: 500; line-height: 36px; }
.crm-workspace .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #64748b; font-weight: 400; }
.crm-workspace .select2-container--default .select2-selection--single .select2-selection__arrow { top: 1px; right: 7px; height: 36px; }
.crm-workspace .select2-container--default.select2-container--focus .select2-selection--single,
.crm-workspace .select2-container--default.select2-container--open .select2-selection--single { border-color: #8adfff; background: #e3e8ed; box-shadow: 0 0 0 3px rgba(121,212,255,.22), 0 0 12px rgba(121,212,255,.38); }

.crm-workspace .select2-container--default.select2-container--focus .select2-selection--single,
.crm-workspace .select2-container--default.select2-container--open .select2-selection--single {
    border-radius: 14px !important;
    background-clip: padding-box;
}

.crm-workspace .inventory-toolbar .select2-container--default.select2-container--focus .select2-selection--single,
.crm-workspace .inventory-toolbar .select2-container--default.select2-container--open .select2-selection--single {
    border-radius: 12px !important;
}
.select2-container--default.select2-container--open .select2-selection--single { border-radius: 14px !important; }
.crm-workspace .inventory-toolbar .select2-container { width: 125px !important; min-width: 125px; }
.crm-workspace .inventory-toolbar .select2-selection--single { height: 34px; border-radius: 12px; }
.crm-workspace .inventory-toolbar .select2-container--open .select2-selection--single { border-radius: 12px !important; }
.crm-workspace .inventory-toolbar .select2-selection--single .select2-selection__rendered { padding-left: 10px; font-size: 12px; line-height: 30px; }
.crm-workspace .inventory-toolbar .select2-selection--single .select2-selection__arrow { height: 30px; }
.crm-workspace .bill-line .select2-container { width: 100% !important; min-width: 0; }
.select2-results__option[role="group"] { clear: both; margin: 0; padding: 0; }
.select2-container--default .select2-results__group { display: block; min-height: 27px; margin-top: 5px; padding: 7px 12px 4px; color: #1e3a8a; font-size: 11px; font-weight: 700; line-height: 16px; text-transform: uppercase; }

.select2-results__option[role="group"]:first-child > .select2-results__group { margin-top: 0; }
.select2-results__options--nested { display: block; padding: 0 4px 3px; }
.select2-results__options--nested > .select2-results__option { min-height: 32px; margin: 1px 0; padding: 7px 14px 7px 18px; line-height: 18px; }

/* Soft light-gray dropdown surfaces used throughout the workspace. */
.crm-workspace .select2-container--default .select2-selection--single,
.select2-dropdown,
.select2-search--dropdown,
.select2-search--dropdown .select2-search__field,
.select2-results {
    background: #e9edf1;
}

.select2-dropdown {
    border-color: #294985;
    box-shadow: 0 8px 20px rgba(15, 31, 58, .14);
}

.select2-results__option {
    color: #26364c;
}

/* Native modal dialogs live in the browser's top layer. Keep Select2 menus in
   that same dialog so they remain visible and pointer-selectable. */
.quick-entity-dialog[open] {
    overflow: visible;
    border-color: #0d255b;
    background: #0d255b;
    background-clip: border-box;
}

/* Keep the dialog available as Select2's unclipped positioning context while
   clipping the popup surface itself to the same rounded inner edge. */
.quick-entity-dialog[open] > form {
    overflow: hidden;
    border-radius: 14px;
    background: #dfe5ea;
    background-clip: border-box;
}

.quick-entity-dialog[open] > form > header {
    border-radius: 14px 14px 0 0;
}

.quick-entity-dialog[open] > form > footer {
    border-radius: 0 0 14px 14px;
}

.quick-entity-dialog > .select2-container--open {
    z-index: 10;
}

.quick-entity-dialog > .select2-container--open .select2-dropdown {
    max-height: min(280px, 45dvh);
}

@media (max-width: 900px) {
    .select2-dropdown,
    .select2-container--open {
        box-sizing: border-box !important;
    }

    .select2-search--dropdown .select2-search__field {
        font-size: 16px;
    }
}
