/* ═══════════════════════════════════════════════════════
   Select2 — SmartAdmin-aligned styling
   Applies to ALL Select2 dropdowns (single + multi-column)
   ═══════════════════════════════════════════════════════ */

/* Dropdown container */
.select2-container--default .select2-dropdown {
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Search field inside the dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--theme-primary, #886ab5);
    box-shadow: 0 0 0 3px rgba(136, 106, 181, 0.15);
}

/* Default option (single column) */
.select2-container--default .select2-results__option {
    padding: 7px 12px;
    font-size: 13px;
    color: #333;
    transition: background-color .12s ease, color .12s ease;
}

/* Highlighted (keyboard / hover) — single column */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--theme-primary, #886ab5) !important;
    color: #fff !important;
}

/* Already selected — single column */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f0ebf8;
    color: #333;
    font-weight: 500;
}

/* Empty / no-results / "type X chars" messages */
.select2-results__message {
    padding: 10px 12px !important;
    font-size: 13px;
    color: #888;
}

/* Scrollbar */
.select2-results__options {
    max-height: 320px;
}

.select2-results__options::-webkit-scrollbar {
    width: 6px;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ═══════════════════════════════════════════════════════
   EntitySelect2 — Multi-Column variant
   When .es2-row is present, the row paints the background
   so the option itself stays transparent.
   ═══════════════════════════════════════════════════════ */

/* Multi-column needs more width */
.select2-container--default .select2-dropdown:has(.es2-row),
.select2-container--default .select2-dropdown:has(.es2-header) {
    min-width: 600px;
}

/* Header */
.es2-header {
    display: flex;
    padding: 0;
    background: #f5f5f5;
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid var(--theme-primary, #886ab5);
}

    .es2-header .es2-col {
        padding: 6px 10px;
        font-size: 10px;
    }

/* Data rows */
.es2-row {
    display: flex;
    padding: 0;
    font-size: 12px;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background-color .12s ease;
}

/* Cells */
.es2-col {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 10px;
    line-height: 1.4;
}

/* Reset option padding when a multi-column row is inside */
.select2-container--default .select2-results__option:has(.es2-row) {
    padding: 0 !important;
}

/* Highlighted multi-column: keep option transparent, paint the row */
.select2-container--default .select2-results__option--highlighted[aria-selected]:has(.es2-row) {
    background-color: transparent !important;
}

    .select2-container--default .select2-results__option--highlighted[aria-selected] .es2-row {
        background-color: var(--theme-primary, #886ab5) !important;
    }

    .select2-container--default .select2-results__option--highlighted[aria-selected] .es2-col {
        color: #fff !important;
    }

/* Selected multi-column row */
.select2-container--default .select2-results__option[aria-selected=true]:has(.es2-row) {
    background-color: transparent;
}

    .select2-results__option[aria-selected=true] .es2-row {
        background-color: #f0ebf8;
        font-weight: 500;
    }

/* Zebra striping (skipped for highlighted/selected via specificity) */
.select2-results__option:nth-child(odd) .es2-row {
    background-color: #fafafa;
}

/* ═══ PageHeader Select2 — match custom-select height ═══ */
.search .select2-container .select2-selection--single {
    height: 33px;
    min-height: 33px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

    .search .select2-container .select2-selection--single .select2-selection__rendered {
        line-height: 33px;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 13px;
    }

    .search .select2-container .select2-selection--single .select2-selection__arrow {
        height: 33px;
    }

    .search .select2-container .select2-selection--single .select2-selection__placeholder {
        line-height: 33px;
    }