/*
 * Tom Select disamakan dengan komponen select Filament (kontrol bergaris tipis + chevron, panel dropdown dengan kotak cari
 * di dalamnya, opsi 13 px), terang & gelap. Warna dari token --rdl-* (config/theme.php) dan --primary-* Filament.
 */
.ts-wrapper,
.ts-dropdown {
    --ts-border: rgba(128, 128, 128, 0.32);
    --ts-menu-bg: #fff;
    --ts-menu-text: #18181b;
    --ts-muted: rgb(113 113 122);
    --ts-hover: rgba(128, 128, 128, 0.1);
    --ts-selected: rgb(var(--rdl-ocean-rgb, 37 131 197) / 0.12);
    font-size: 0.8125rem;
}
.dark .ts-wrapper,
.dark .ts-dropdown {
    --ts-border: rgba(255, 255, 255, 0.16);
    --ts-menu-bg: #18181b;
    --ts-menu-text: #f4f4f5;
    --ts-muted: rgb(161 161 170);
    --ts-hover: rgba(255, 255, 255, 0.07);
    --ts-selected: rgb(var(--rdl-ocean-rgb, 37 131 197) / 0.28);
}

/* kontrol */
.ts-wrapper.single .ts-control,
.ts-wrapper.single.input-active .ts-control {
    min-height: 1.875rem;
    padding: 0.2rem 1.8rem 0.2rem 0.5rem !important;
    border: 1px solid var(--ts-border);
    border-radius: 0.4rem;
    background: transparent;
    color: inherit;
    box-shadow: 0 1px 2px rgb(11 23 48 / 0.05);
    cursor: pointer;
    line-height: 1.25rem;
}
.ts-wrapper.single .ts-control { position: relative; align-items: center; }
.ts-wrapper.single .ts-control > .item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: inherit;
}
.ts-wrapper.single.focus .ts-control,
.ts-wrapper.single.dropdown-active .ts-control {
    border-color: var(--primary-600, var(--rdl-ocean));
    box-shadow: 0 0 0 1px var(--primary-600, var(--rdl-ocean));
}
/* chevron, bukan segitiga bawaan */
.ts-wrapper.single .ts-control::after {
    content: '';
    position: absolute;
    top: 50%;
    border: 0;
    width: 1rem;
    height: 1rem;
    right: 0.45rem;
    margin-top: -0.5rem;
    background: currentColor;
    opacity: 0.45;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='black'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='black'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ts-wrapper.single.dropdown-active .ts-control::after { border: 0; margin-top: -0.5rem; }

/* panel dropdown */
.ts-dropdown,
.ts-dropdown.single {
    z-index: 9999;
    min-width: 12rem;
    margin-top: 0.25rem;
    border: 1px solid var(--ts-border);
    border-radius: 0.5rem;
    background: var(--ts-menu-bg);
    color: var(--ts-menu-text);
    box-shadow: 0 10px 28px rgb(11 23 48 / 0.16);
    overflow: hidden;
}
.dark .ts-dropdown { box-shadow: 0 10px 28px rgb(0 0 0 / 0.55); }
.ts-dropdown .dropdown-input-wrap { border-bottom: 1px solid var(--ts-border); }
.ts-dropdown .dropdown-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 0.8125rem;
    box-shadow: none;
    outline: none;
}
.ts-dropdown .dropdown-input::placeholder { color: var(--ts-muted); }
.ts-dropdown .ts-dropdown-content { max-height: 15rem; padding: 0.25rem 0; }
.ts-dropdown .option,
.ts-dropdown .no-results { padding: 0.4rem 0.75rem; }
.ts-dropdown .no-results { color: var(--ts-muted); }
.ts-dropdown .active { background: var(--ts-hover); color: inherit; }
.ts-dropdown .selected,
.ts-dropdown .selected.active { background: var(--ts-selected); color: inherit; font-weight: 500; }
.ts-dropdown .optgroup-header { color: inherit; background: transparent; }
