/* GroLo-side BS5 / gg_hlib migration patches, applied on every page.
   Extracted from navrail.prg's *_fix_css() functions. Editing these no longer
   needs a CGI rebuild - change this file + bump the ?ver= in navrail.prg.
   The btn-group wrap fix that used to be here moved upstream into
   gg_hlib/css/main_bs5.css (.btn-toolbar .btn-group { flex-wrap: wrap }). */

/* --- title-row (dashboard open-orders) -------------------------------------
   BS5's `.table > :not(caption) > * > *` gives each td/th its own opaque
   background, painting over the color dashboard.prg sets on the <tr> via
   .title-row[-red/-green/-orange]. "inherit" pulls whatever the <tr> computed
   to (class default, or an inline per-row override), so both keep working. */
.open-orders-status .title-row > td,
.open-orders-status .title-row > th,
.open-orders-status .title-row-red > td,
.open-orders-status .title-row-red > th,
.open-orders-status .title-row-green > td,
.open-orders-status .title-row-green > th,
.open-orders-status .title-row-orange > td,
.open-orders-status .title-row-orange > th {
   background-color: inherit !important;
   color: inherit !important;
}

/* --- panel/card title size -------------------------------------------------
   gg_hlib addTitle() renders a bare <h4> in .panel-heading/.card-header. BS5's
   h4 default (24px) is larger than BS3's (18px); GroLo prefers 15px. */
.panel-heading > h4,
.card-header > h4 {
   font-size: 15px !important;
}

/* --- big-display-row (dashboard Loads counts) ------------------------------
   gg_hlib main_bs5.css sets these to 40px!important; too large for a 1-2 digit
   count on narrow/portrait screens. Override to 26px (same selector, so cascade
   order + !important decide the tie). */
.open-orders-status .big-display-row td {
   font-size: 26px !important;
}

/* --- custom table cell colors ----------------------------------------------
   BS5's `.table > :not(caption) > * > *` outspecifies a plain single-class rule,
   so it paints over cell classes even when correctly applied. gg_hlib aliases
   only the stock names (warning/success/danger/info); these are GroLo's own
   custom classes (defined via oPage:insertStyle in igl.prg) plus 'secondary'
   (which gg_hlib's alias list omits). Mirrors gg_hlib's alias technique.
   imperative's color is tenant-conditional (isMrsd -> lighter purple); navrail.prg
   sets --grolo-imperative-bg, default here is the non-MRSD shade. */
.table > :not(caption) > * > td.imperative,
.table > :not(caption) > * > th.imperative,
.table > :not(caption) > tr.imperative > td,
.table > :not(caption) > tr.imperative > th,
td.imperative, th.imperative, tr.imperative > td, tr.imperative > th {
   background-color: var(--grolo-imperative-bg, #ffe1ff); color: #000;
}
.table > :not(caption) > * > td.camel,
.table > :not(caption) > * > th.camel,
.table > :not(caption) > tr.camel > td,
.table > :not(caption) > tr.camel > th,
td.camel, th.camel, tr.camel > td, tr.camel > th {
   background-color: #C19A6B; color: #000;
}
.table > :not(caption) > * > td.brightyellow,
.table > :not(caption) > * > th.brightyellow,
.table > :not(caption) > tr.brightyellow > td,
.table > :not(caption) > tr.brightyellow > th,
td.brightyellow, th.brightyellow, tr.brightyellow > td, tr.brightyellow > th {
   background-color: #FFFF00; color: #000;
}
.table > :not(caption) > * > td.orange,
.table > :not(caption) > * > th.orange,
.table > :not(caption) > tr.orange > td,
.table > :not(caption) > tr.orange > th,
td.orange, th.orange, tr.orange > td, tr.orange > th {
   background-color: #FFA500; color: #000;
}
.table > :not(caption) > * > td.bluegreen,
.table > :not(caption) > * > th.bluegreen,
.table > :not(caption) > tr.bluegreen > td,
.table > :not(caption) > tr.bluegreen > th,
td.bluegreen, th.bluegreen, tr.bluegreen > td, tr.bluegreen > th {
   background-color: #7ab9d1; color: #000;
}
.table > :not(caption) > * > td.yelloworange,
.table > :not(caption) > * > th.yelloworange,
.table > :not(caption) > tr.yelloworange > td,
.table > :not(caption) > tr.yelloworange > th,
td.yelloworange, th.yelloworange, tr.yelloworange > td, tr.yelloworange > th {
   background-color: #FCCC1A; color: #000;
}
.table > :not(caption) > * > td.secondary,
.table > :not(caption) > * > th.secondary,
.table > :not(caption) > tr.secondary > td,
.table > :not(caption) > tr.secondary > th,
td.secondary, th.secondary, tr.secondary > td, tr.secondary > th {
   background-color: #e2e3e5; color: #000;
}
