/*
|--------------------------------------------------------------------------
| Searchable Add Dropdown
|--------------------------------------------------------------------------
*/

.sad-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.sad-widget {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.sad-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    width: 100%;
    min-height: 42px;
}

.sad-search {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 8px 12px;
    color: #172033;
    background: #ffffff;
    border: 1px solid #b9c5d6;
    border-right: 0;
    border-radius: 5px 0 0 5px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.sad-search:focus {
    border-color: #2563eb;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.sad-add-button {
    height: 42px;
    padding: 7px 12px;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}

.sad-add-button:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.sad-add-button:disabled {
    color: #8b95a5;
    background: #e5e9f0;
    border-color: #b9c5d6;
    cursor: not-allowed;
    opacity: 1;
}

.sad-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: 280px;
    margin: 0;
    padding: 5px 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #b9c5d6;
    border-radius: 5px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.sad-list[hidden] {
    display: none !important;
}

.sad-option {
    display: block;
    width: 100%;
    padding: 9px 13px;
    color: #172033;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
}

.sad-option:hover,
.sad-option:focus {
    color: #ffffff;
    background: #2563eb;
    outline: none;
}

.sad-option.is-selected {
    color: #1d4ed8;
    background: #e8efff;
    font-weight: 700;
}

.sad-option.is-selected:hover,
.sad-option.is-selected:focus {
    color: #ffffff;
    background: #2563eb;
}

.sad-option-main {
    display: block;
}

.sad-option-meta {
    display: block;
    margin-top: 2px;
    color: #6b7890;
    font-size: 12px;
}

.sad-option:hover .sad-option-meta,
.sad-option:focus .sad-option-meta {
    color: #dbe7ff;
}

.sad-empty,
.sad-loading {
    padding: 13px;
    color: #6b7890;
    text-align: center;
    font-size: 14px;
}

.sad-help {
    display: none;
    margin-top: 5px;
    color: #6b7890;
    font-size: 12px;
    line-height: 1.4;
}

.sad-help.is-visible {
    display: block;
}

.sad-widget.is-loading .sad-search,
.sad-widget.is-loading .sad-add-button {
    cursor: wait;
}

.sad-widget.is-loading .sad-search {
    background: #f5f7fa;
}

.sad-widget.is-invalid .sad-search,
.sad-widget.is-invalid .sad-add-button {
    border-color: #dc2626;
}

.sad-hidden-old-field {
    display: none !important;
}

@media (max-width: 575px) {
    .sad-control {
        grid-template-columns: minmax(0, 1fr) 70px;
    }

    .sad-search,
    .sad-add-button {
        height: 40px;
        font-size: 13px;
    }

    .sad-list {
        max-height: 230px;
    }
}
