/* Searchable selects: the native field remains in the form, while the visible
   control provides instant filtering for long lists. */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.searchable-select__input {
    width: 100%;
    min-width: 0;
}

.searchable-select__results {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    display: none;
    max-height: min(20rem, 42vh);
    padding: 0.3rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    box-shadow: 0 0.7rem 1.5rem rgba(15, 23, 42, 0.18);
}

.searchable-select.is-open .searchable-select__results {
    display: block;
}

.searchable-select__option,
.searchable-select__empty {
    width: 100%;
    padding: 0.55rem 0.65rem;
    color: #172033;
    font: inherit;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
}

.searchable-select__option {
    cursor: pointer;
}

.searchable-select__option:hover,
.searchable-select__option:focus,
.searchable-select__option.is-active {
    color: #fff;
    outline: none;
    background: #2563eb;
}

.searchable-select__option[aria-selected="true"] {
    font-weight: 700;
}

.searchable-select__option:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: transparent;
}

.searchable-select__empty {
    color: #64748b;
    font-style: italic;
}

.searchable-select__input[aria-invalid="true"] {
    border-color: #dc3545;
}
