/* Back-office (AA-native, Bootstrap 5) overrides. */

/* Neutral outline button that stays readable on BOTH light (Flatly) and dark
   (Darkly) AA themes. btn-outline-secondary is dark-on-dark on dark themes and
   btn-outline-light is light-on-light on light themes; this keys off the theme's
   own body/border variables instead of a fixed palette. */
.btn-outline-theme {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
.btn-outline-theme:hover,
.btn-outline-theme:focus {
    color: var(--bs-body-bg);
    background-color: var(--bs-body-color);
    border-color: var(--bs-body-color);
}
/* Selected/active state (e.g. btn-check radio toggles) — fill so the choice reads. */
.btn-check:checked + .btn-outline-theme,
.btn-outline-theme.active,
.btn-outline-theme:active {
    color: var(--bs-body-bg);
    background-color: var(--bs-body-color);
    border-color: var(--bs-body-color);
}

/* select2-bootstrap-5-theme is compiled against Bootstrap's light palette, so it
   emits literal light colors. Repoint its surfaces at the active theme's CSS
   variables (with dark fallbacks) so the widget matches AA's dark theme.
   Selectors include `.select2-dropdown` where the theme does, so ours win on
   specificity + source order. */

/* Closed control */
.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bs-body-bg, #212529);
    border-color: var(--bs-border-color, #495057);
    color: var(--bs-body-color, #dee2e6);
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color, #dee2e6);
}

/* Open dropdown panel + search field.
   No border-color here: the panel only shows while focused, so let the theme's
   blue focus border stand. */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bs-body-bg, #212529);
    color: var(--bs-body-color, #dee2e6);
}
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: var(--bs-body-bg, #212529);
    border-color: var(--bs-border-color, #495057);
    color: var(--bs-body-color, #dee2e6);
}

/* Result rows */
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option {
    color: var(--bs-body-color, #dee2e6);
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--highlighted {
    background-color: var(--bs-primary, #0d6efd);
    color: #fff;
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option[aria-selected="true"] {
    background-color: var(--bs-secondary-bg, #343a40);
    color: var(--bs-body-color, #dee2e6);
}
