/* Bootstrap 5 overrides for Indigo — loaded on migrated views, AFTER the BS5 CSS so it wins.
   Pins BS5 defaults back to the app's look during the BS3->5 transition and bridges the
   still-shared validator.js (BS3 output classes) to a BS5-correct appearance.
   See docs/bootstrap5-migration-spec-and-discoveries.md (D7, D11, D12). Each newly-migrated
   view must link this file after /bs5 bootstrap.min.css. */

/* D7 — BS5 defaults font-family to the native system stack; pin it back to the app's stack
   so migrated and un-migrated pages match during the transition. */
:root {
    --bs-body-font-family: Arial, Helvetica, sans-serif;
}
body {
    font-family: Arial, Helvetica, sans-serif;
}

/* D12 — BS5 also changes the type SCALE, not just the family. Verified against the actual
   packages: bootstrap@3.4.1 shipped `body { font-size: 14px }` and `.form-control
   { font-size: 14px; padding: 6px 12px }`; BS5 sizes everything in `rem` against an untouched
   16px root (`.form-control { font-size: 1rem; padding: 0.375rem 0.75rem }`), so all type and
   control padding came out ~14% larger.

   Rescale the ROOT, not body: `rem` resolves against <html>, so a `body { font-size: 14px }`
   pin fixes body text but never reaches BS5's rem-sized component internals. 14/16 = 0.875.
   This also proportionally restores BS3's tighter control padding.

   Indigo's own stylesheets size much of their text in percentages (80%/90%/100%/150%...),
   authored against the 14px baseline, so they compound correctly off this too.

   Absolute-px rules elsewhere (e.g. style-login's #login-panel 450x400, input height 25px)
   are unaffected by a root rescale — only the text/padding inside those fixed boxes rescales,
   which is the intent. */
html {
    font-size: 87.5%;
}

/* D16 — bootstrap-tagsinput hardcodes BS3 chip classes: its default is
   `tagClass: function(){ return "label label-info" }`. BS3's `.label` supplied
   `color:#fff; padding:.2em .6em .3em; font-size:75%; font-weight:700; border-radius:.25em`,
   and BS5 has no `.label` at all (it became `.badge`). The app's own style-forms.css sets the
   chip background to black, so with `.label` gone the text fell back to the inherited near-black
   body colour: chips rendered BLACK ON BLACK — the tag was correctly added and selected, it was
   simply invisible, which read as "selecting a tag blanks it out".

   Restore only what BS3's `.label` provided, scoped to the tagsinput container so no global
   `.label` rule is introduced (nothing else in the app uses these classes — the sole source is
   tagsinput's own default). display/vertical-align/background stay with the app's own rules. */
.bootstrap-tagsinput .tag {
    color: #fff;
    padding: .2em .6em .3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: .25em;
}

/* D17 — BS3's form-check and button/well classes, which BS5 dropped entirely.
   Reported from a prod-vs-BS5 comparison: the "Override Auto Visibility by Role" radios
   (None/All/Selected) render INLINE on prod and STACKED on BS5. Cause: the markup uses BS3's
   `.radio-inline`, which BS5 replaced with `.form-check-inline` — so the wrappers became plain
   block divs. Verified neither Bootstrap 5 nor any Indigo stylesheet defines these, i.e. they
   currently have no styling at all from either source:
       .radio-inline    18 uses across  8 views
       .checkbox-inline 12 uses across 12 views
       .btn-default      6 uses across  3 views
       .well             2 uses
   plus bare `.radio` / `.checkbox` block wrappers (operation-console, admin).

   Bridged rather than migrated to `.form-check*`, matching D11/D16: 30+ occurrences across a dozen
   views, several of them customer report forms, so rewriting the markup is far more churn and risk
   than restoring the four rules. A real `.form-check` migration belongs with the Phase 3 owned-
   replacement work.

   Values taken from bootstrap@3.4.1's compiled CSS, not guessed (D13). Deliberately NOT copying
   BS3's `padding-left:20px` + absolutely-positioned input scheme: Indigo's markup has the input as
   a SIBLING of the label rather than inside it, and BS5 gives inputs their own margins, so
   replicating that would risk overlapping text. Only layout and spacing are restored, which is what
   the reported difference actually is. Indigo's own narrower rules (e.g.
   `.form-group .checkbox {margin:0}`, `.panellogsearch .radio label`) keep winning on specificity. */
.radio-inline,
.checkbox-inline {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 10px;
    font-weight: 400;
    vertical-align: middle;
    cursor: pointer;
}
.radio,
.checkbox {
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
}
/* D18b — the "+" add button sits low against its field. `.btn-add` has NO styling anywhere in the
   app: it is a bare <button> carrying native UA chrome, and BS5's reboot does not neutralise that.
   Inside the flex `.input-group-addon` its own box metrics and baseline win over the addon's
   centring — measured: button centre 4px BELOW the field centre, and the 27px button overflowing
   the 27px addon by 4px at the bottom.

   Stretch it to the addon's height and centre the glyph inside it, so alignment no longer depends on
   the button's intrinsic metrics. Scoped to `.input-group-addon > .btn-add`: all 11 occurrences
   (indigo-admin 9, indigo-operation-console 2) are inside one, so this covers every use without
   touching anything else. */
/* The addon must BE the centring context. The combobox plugin's own BS5 patch (D10) gives
   `display:flex; align-items:center` only to `.combobox-container .input-group-addon` — the INNER
   addon holding the caret. The "+" addon is a SIBLING of the container, a direct child of the
   input-group, so that rule never matched it and it computes `display: block` on the real page.
   Confirmed by driving the actual admin console with a login rather than a hand-built fixture:
   addonClass="input-group-addon", addonDisplay="block". My earlier fixture wrongly nested the addon
   inside the container, so it inherited flex there and the mismatch hid this for three rounds.
   Set it explicitly so the button's alignment does not depend on which rule happened to match. */
.input-group > .input-group-addon {
    display: flex;
    align-items: center;
}
/* D18e — `.btn-remove` was left out of this list when D18b was written, so the two buttons in a
   custom-field option column were laid out by entirely different rules. The "+" got everything
   below; the "-" fell through to `.panelitem .input-group-addon button { margin-left: 5px }` plus
   the browser's default `padding: 1px 6px`, which pushed it right by a measured 4px (the shared
   `margin-left` applies to both, so only the padding and the missing flex centring differ).
   Reported as "the + sign is in the right spot, the - sign is rammed hard right" (Ian, 2026-08-01).
   It is the same button in the same addon — the class only changes to mark which row is last, so
   it must be styled the same. One class name covers all 16 uses; there is no
   .btn-remove-allocation / -restriction, unlike the add side. */
.input-group-addon > .btn-add,
.input-group-addon > .btn-remove,
.input-group-addon > .btn-add-allocation,
.input-group-addon > .btn-add-restriction {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    height: 100%;
    margin: 0;
    padding: 0 2px;
    border: 0;
    background: none;
    line-height: 1;
}
/* BS3's `.glyphicon` carries `position:relative; top:1px` — a baseline nudge for glyphs sitting
   inline next to text. Inside `.btn-add` the glyph is the button's only content and is centred by
   flex, so the nudge has nothing to correct and just drops it 1px below the field's centre line
   (measured). Neutralise it here only; inline glyphicons elsewhere still want it. */
/* the operation console's two variants carry different class names for the same button, so they
   need naming explicitly -- .btn-add-allocation sat 1.5px high until they were added here */
.input-group-addon > .btn-add > .glyphicon,
.input-group-addon > .btn-remove > .glyphicon,
.input-group-addon > .btn-add-allocation > .glyphicon,
.input-group-addon > .btn-add-restriction > .glyphicon {
    top: 0;
}

/* D17b — vertical alignment of the control against its label. D17 restored the LAYOUT (inline vs
   stacked) but deliberately skipped BS3's `padding-left:20px` + absolutely-positioned input scheme,
   because Indigo's markup has the input as a SIBLING of the label. The residue was that the control
   still rode 2px high and sat flush against the text (measured: input centre 2px above label centre,
   0px gap) — "they still don't line up with the text properly". Both default to
   `vertical-align: baseline`, and an input's baseline is its bottom edge, hence the lift. */
.radio > input[type="radio"],
.checkbox > input[type="checkbox"],
.radio-inline > input[type="radio"],
.checkbox-inline > input[type="checkbox"] {
    vertical-align: middle;
    margin-top: 0;
    margin-right: 5px;
}
.radio label,
.checkbox label,
.radio-inline label,
.checkbox-inline label {
    vertical-align: middle;
}
.radio label,
.checkbox label,
.radio-inline label,
.checkbox-inline label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}
.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}
.well {
    min-height: 20px;
    padding: 19px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
}

/* D11 — bridge validator.js's BS3 output (has-error / help-block.with-errors / glyphicon feedback)
   to a BS5-correct look, so forms styled by the still-shared validator.js render right under BS5.
   validator.js itself is unchanged, so un-migrated BS3 views keep their own (BS3) styling. */
.has-error .form-control,
.has-error .combobox-container input {
    border-color: var(--bs-danger, #dc3545);
}
.help-block.with-errors {
    color: var(--bs-danger, #dc3545);
    font-size: .875em;
    margin-top: .25rem;
}
/* the glyphicon feedback icon has no font under BS5 — hide it rather than show a blank box */
.glyphicon.form-control-feedback,
.form-control-feedback.glyphicon {
    display: none;
}
