/* Searchable lookup selects — shared by public site and admin panels */

.tb-lookup-wrap,
.tb-clearable-select-wrap {
    position: relative;
    width: 100%;
}

.tb-lookup-wrap > select[data-tb-lookup-enhanced="1"],
.tb-lookup-wrap > select[data-tb-local-search-enhanced="1"] {
    display: none !important;
}

.tb-lookup-display {
    width: 100%;
    border-radius: var(--radius-md, 0.5rem);
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--color-text, #0f172a);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tb-lookup-display::placeholder {
    color: #94a3b8;
}

.tb-lookup-display:focus {
    outline: none;
    border-color: var(--color-cta, #0369a1);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.15);
}

.tb-lookup-panel {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.25rem);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.tb-lookup-panel.is-floating {
    position: fixed;
    z-index: 9050;
    top: auto;
    right: auto;
    left: auto;
}

.tb-lookup-panel.is-open-up {
    box-shadow: 0 -8px 25px rgba(15, 23, 42, 0.1);
}

.tb-lookup-panel.hidden {
    display: none !important;
}

.tb-lookup-list {
    max-height: 14rem;
    overflow-y: auto;
}

.tb-lookup-item,
.tb-lookup-empty,
.tb-lookup-loading {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.65rem 0.85rem;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
}

.tb-lookup-item:hover,
.tb-lookup-item.is-selected {
    background: #eff6ff;
    color: #1d4ed8;
}

.tb-lookup-empty,
.tb-lookup-loading {
    cursor: default;
    color: #64748b;
}

.tb-clearable-select-wrap .tb-clearable-select__btn,
.tb-lookup-wrap .tb-lookup-clear {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
}

.tb-clearable-select-wrap .tb-clearable-select__btn:hover,
.tb-lookup-wrap .tb-lookup-clear:hover {
    color: #64748b;
    background: #f1f5f9;
}

html[data-theme="dark"] .tb-lookup-display {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

html[data-theme="dark"] .tb-lookup-panel {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .tb-lookup-item,
html[data-theme="dark"] .tb-lookup-empty,
html[data-theme="dark"] .tb-lookup-loading {
    color: #e2e8f0;
}

html[data-theme="dark"] .tb-lookup-item:hover,
html[data-theme="dark"] .tb-lookup-item.is-selected {
    background: rgba(3, 105, 161, 0.25);
    color: #7dd3fc;
}
