/**
 * Bootstrap 3 float-grid compatibility (UpgradeBs3ToBs5_plan.md Phase 4/5).
 *
 * BS3 columns were floats, so legacy markup freely nests col-* inside plain
 * divs (no .row). BS5 columns only get placed by their flex .row parent, so
 * those orphaned columns stack vertically. Restore the BS3 behavior for
 * columns NOT inside a .row: float them left (BS5 still sets their width).
 * Columns inside a real .row are untouched. :where() keeps specificity at
 * zero so page CSS always wins.
 *
 * Parent height collapse matches BS3 too (legacy pages carry their own
 * .clearfix divs). DELETE once every page nests columns in .row properly.
 */
:where(:not(.row)) > [class^="col-"],
:where(:not(.row)) > [class*=" col-"] {
    float: left;
}

/*
 * The bundled select2 build has no !important on its .select2-hidden-accessible
 * rule, so later width rules (e.g. AdminLTE's .fs_input { width: 100%; })
 * re-expand the visually-hidden native select to full viewport width, adding
 * horizontal page scroll on every page with a select2 filter. Re-assert the
 * modern select2 hiding contract.
 */
select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    border: 0 !important;
}

/*
 * AdminLTE declares .input-group { margin-bottom: 15px !important; } which
 * defeats Bootstrap's own .mb-0 utility purely by cascade order. Give the
 * utility a higher-specificity escape hatch so BS5 grid gutters can own the
 * spacing.
 */
.input-group.mb-0 {
    margin-bottom: 0 !important;
}

/*
 * .margintop10 is used on hundreds of legacy form blocks as the vertical
 * rhythm between fields, but no stylesheet ever defines it (the BS3-era
 * .form-group margin used to mask that). Without it, on-border floating
 * labels rise straight into the element above. Restore the helper.
 */
.margintop10 {
    margin-top: 10px;
}

/*
 * BS3 gave every .form-group a 15px bottom margin; BS5 dropped the class.
 * Legacy blocks still wrapped in the old float-label-control plugin markup
 * (toggles, radio groups, un-converted inputs) were designed around it.
 * Restore it there only — converted floating fields don't carry the class.
 */
.form-group.float-label-control {
    margin-bottom: 15px;
}
