/* =========================
   Global & Container
   ========================= */
.select2-container {
    width: 100% !important;
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
}

/* Dropdown */
.select2-container .select2-dropdown {
    width: 100% !important;
    left: 0 !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.select2-results__options {
    max-height: 280px;
}
.select2-results__option {
    padding: 10px 12px;
    font-size: 0.875rem;
}
.select2-results__option--highlighted.select2-results__option--selectable {
    background: #eff6ff;
    color: #1f2937;
}
.select2-results__option--selected {
    background: #e5e7eb;
    color: #111827;
}
.select2-container--open {
    z-index: 9999;
}

/* =========================
   SINGLE
   ========================= */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    padding-left: 8px;
    padding-right: 30px;
    color: #111827;
}
.select2-container--default
    .select2-selection--single
    .select2-selection__placeholder {
    color: #9ca3af;
}
.select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    position: absolute;
    right: 10px;
    top: 0;
    height: 100%;
    width: 24px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: none;
}
.select2-container--default.select2-container--disabled
    .select2-selection--single {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}
.select2-container--default
    .select2-selection--single
    .select2-selection__clear {
    display: none !important;
}

/* =========================
   MULTIPLE (tags)
   ========================= */
.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    cursor: text;
}

/* -- KUNCI: paksa full flex layout & matikan float bawaan -- */
.select2-container--default
    .select2-selection--multiple
    .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    /* width: 100%; */
    align-items: center;
    justify-content: flex-start;
    white-space: normal;
    list-style: none;
}
.select2-container--default
    .select2-selection--multiple
    .select2-selection__rendered
    li,
.select2-container--default
    .select2-selection--multiple
    .select2-selection__choice {
    float: none !important; /* <— matikan float bawaannya */
}

/* Chip */
.select2-container--default
    .select2-selection--multiple
    .select2-selection__choice {
    margin: 0;
    padding: 6px 10px 6px 8px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25rem;
}
/* Tombol × di chip */
.select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove {
    position: static;
    order: 0;
    font-size: 16px;
    line-height: 1;
    height: 16px;
    width: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    margin: 0 2px 0 0;
    padding: 0;
    cursor: pointer;
}
.select2-container--default
    .select2-selection--multiple
    .select2-selection__choice__remove:hover {
    color: #111827;
}

/* -- KUNCI: kontainer search mengambil sisa ruang -- */
.select2-container--default
    .select2-selection--multiple
    .select2-selection__rendered
    .select2-search--inline {
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    min-width: 160px; /* ambil sisa ruang */
}

/* -- KUNCI: input search isi penuh & rata kiri -- */
.select2-container--default
    .select2-selection--multiple
    .select2-search--inline
    .select2-search__field {
    width: 100% !important;
    min-width: 0;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    line-height: 28px;
    color: #111827;
    text-align: left; /* pastikan placeholder di kiri */
}
.select2-container--default
    .select2-selection--multiple
    .select2-search--inline
    .select2-search__field::placeholder {
    color: #9ca3af;
    text-align: left;
}

/* Focus ring multiple */
.select2-container--default.select2-container--focus
    .select2-selection--multiple,
.select2-container--default .select2-selection--multiple:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: none;
}

/* Disabled */
.select2-container--default.select2-container--disabled
    .select2-selection--multiple {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Search di dropdown */
.select2-container .select2-search--dropdown .select2-search__field {
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
}
