/* ------------------------------------------------------------------
 * sprcb.css
 * ------------------------------------------------------------------
 * Corrections to the bought-in theme. Loaded AFTER the vendor sheets
 * in page_top.php, so ordinary rules win on source order; only the
 * rules the theme itself marks !important are repeated as !important.
 *
 * Never edit assets/vendor/** - it is replaced wholesale when the
 * template is updated. Anything we change goes in here.
 * ------------------------------------------------------------------ */

/* GREEN.
 *
 * The theme's success colour is #72e128. White text on it measures
 * about 1.9:1, and the outline variant puts the same colour as text on
 * white, so every green button in the app is hard to read - Rhid
 * reported it on the "Everyone booked has arrived" button on the desk
 * officer sheet, 7 Sep, and it is the same everywhere.
 *
 * #2e7d32 with white text is about 5.1:1, which clears AA for normal
 * text. Hover and active are one and two steps darker so the button
 * still reacts.
 *
 * A `badge bg-success` - the "Open" tag on the desk officer sheet - is
 * the same white on #72e128 and gets the same treatment. What IS left
 * alone is `bg-label-success` and `alert-success`: those are dark text
 * on a pale ground and already read fine. Nothing moves; only colour
 * changes.
 */

.btn-success {
  color: #fff;
  background-color: #2e7d32;
  border-color: #2e7d32;
}

.btn-success:hover {
  color: #fff !important;
  background-color: #276b2b !important;
  border-color: #276b2b !important;
}

.btn-check:focus + .btn-success,
.btn-success:focus,
.btn-success.focus {
  color: #fff;
  background-color: #276b2b;
  border-color: #276b2b;
  box-shadow: none;
}

.btn-check:checked + .btn-success,
.btn-check:active + .btn-success,
.btn-success:active,
.btn-success.active,
.btn-success.show.dropdown-toggle,
.show > .btn-success.dropdown-toggle {
  color: #fff !important;
  background-color: #1f5c24 !important;
  border-color: #1f5c24 !important;
}

.btn-group .btn-success,
.input-group .btn-success {
  border-right: 1px solid #1f5c24;
  border-left: 1px solid #1f5c24;
}

.btn-outline-success {
  color: #2e7d32;
  border-color: #7fb583;
  background: transparent;
}

.btn-outline-success:hover {
  color: #23611f !important;
  background-color: #eaf5ea !important;
  border-color: #7fb583 !important;
}

.btn-check:focus + .btn-outline-success,
.btn-outline-success:focus {
  color: #23611f;
  background-color: #e2f1e3;
  border-color: #7fb583;
}

.btn-check:checked + .btn-outline-success,
.btn-check:active + .btn-outline-success,
.btn-outline-success:active,
.btn-outline-success.active,
.btn-outline-success.dropdown-toggle.show {
  color: #fff !important;
  background-color: #2e7d32 !important;
  border-color: #2e7d32 !important;
}

.btn-outline-success .badge,
.btn-outline-success:hover .badge,
.btn-outline-success:focus:hover .badge,
.btn-outline-success:active .badge,
.btn-outline-success.active .badge,
.show > .btn-outline-success.dropdown-toggle .badge {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

/* The state tag on the desk officer sheet, and any other bg-success
   badge. !important because the theme's own .bg-success carries it. */
.badge.bg-success {
  background-color: #2e7d32 !important;
  color: #fff !important;
}

/* ------------------------------------------------------------------
 * READABILITY (Rhid, 9 Oct 2026).
 *
 * Most of the theme's colours are corrected by sprcb-contrast.css,
 * which tools/build_contrast_css.php generates from the vendor sheets
 * and which loads just before this file. What follows is what a
 * generator cannot work out. Every pair below measures at least 4.5:1.
 * ------------------------------------------------------------------ */

/* Amber, where the theme reaches it through var(--bs-warning-rgb)
   rather than a literal colour, so the generator does not see it.
   Amber text on white was 1.8:1; white text on amber was 1.8:1. */
.text-warning {
  color: #805300 !important;
}

.bg-warning,
.badge.bg-warning {
  color: #3b2a00 !important;
}

.alert-solid-warning .alert-link {
  color: #3b2a00;
}

/* SUCCESS LABELS AND ALERTS. Somebody edited core.css by hand and gave
   .bg-label-success, .alert-success and .list-group-item-success a
   bright lime ground (#67d11f) with near-black text. That text reads,
   but a link or a text-muted inside the alert does not (3.1:1), and
   lime sits oddly beside every other label, which is pale. These put
   success back in line with the rest: pale green, dark green text.
   Delete this block to go back to the lime. */
.bg-label-success {
  background-color: #e8f5e9 !important;
  color: #24672a !important;
}

.alert-success {
  background-color: #e8f5e9;
  border-color: #b9dcbc;
  color: #24672a;
}

.alert-success .alert-link,
.alert-success .alert-heading,
.alert-success hr {
  color: #1c5220;
}

.list-group-item-success {
  background-color: #e8f5e9;
  color: #24672a;
}
