/* ============================================================================
   BidCITE theme -- "standard" template (Bootstrap 4.4.1: no CSS-custom-property theming,
   so explicit selector overrides only).

   Extension point: usersc/templates/header.php:34 --
     if (file_exists('usersc/templates/'.$settings->template.'.css')) {
       <link href="usersc/templates/<?=$settings->template?>.css">
     }
   All three tenants (tenant-demo, helm-test, bidcite-demo) use the "standard" template for the core
   pages (login, account, user_settings, messages, ...), verified against each tenant's rendered <head>.

   PALETTE (2026-10-14, owner): the BidSite Design System (UX/'BidSite Design System.zip' = the stock
   Bootstrap 5 logged-in theme: primary #0d6efd, success #198754, info #0dcaf0, navbar / dark #212529,
   text #212529 on #fff, rules #dee2e6, input border #ced4da, focus #86b7fe), replacing the
   "BidCITE slate" (a navy navbar, blue-600 primary and slate-grey surfaces) of #40-#43.
   This template ships Bootstrap 4, whose stock colours are NOT the design system's (#007bff, #28a745,
   #17a2b8, #343a40, focus #80bdff), so the Bootstrap 5.3.8 values (read from users/css/bootstrap.min.css)
   are restated below. Where Bootstrap 4 already equals the design system -- body text #212529, secondary
   #6c757d, danger, warning, light, rules #dee2e6, input border #ced4da, tables -- nothing is set.
   Non-colour rules of the old theme (radii, badge weight, table-head weight, the QA-F31 brand wrap)
   stay as they were. No markup, escaping, or JS touched. The template's own inline colours
   (standard/assets/functions/style.php, the two banners in standard/navigation.php) carry the same palette:
   UserSpice's navy dropdown links and magenta hover are gone.
   ========================================================================= */

/* ----------------------------------------------------------------------------
   SPECIFICITY NOTE (2026-09-25): rules below are prefixed with `html:root` or `body` ON PURPOSE.
   Bootstrap 4's own button rules reach (0,4,0) (`.btn-primary:not(:disabled):not(.disabled):active`); the
   prefix lets this file win without !important (the .bg-* / .text-* utilities are !important in
   Bootstrap 4, so theirs are too). Do not "simplify" the prefixes away.
   ------------------------------------------------------------------------- */


/* Links: Bootstrap 4 ships #007bff / #0056b3. */
body a {
  color: #0d6efd;
}
body a:hover {
  color: #0a58ca;
}
body .btn-link {
  color: #0d6efd;
}
body .btn-link:hover {
  color: #0a58ca;
}

/* Buttons: Bootstrap 5.3.8 values on Bootstrap 4 markup. One variable set per variant, then the same
   rules for all of them (rest, hover + focus, focus ring, pressed, disabled). The old blue glow shadow is
   gone: the design system has no coloured shadows. */
body .btn-primary { --ds-fg: #fff; --ds-bg: #0d6efd; --ds-hbg: #0b5ed7; --ds-hbd: #0a58ca; --ds-abg: #0a58ca; --ds-abd: #0a53be; --ds-ring: 49, 132, 253; }
body .btn-secondary { --ds-fg: #fff; --ds-bg: #6c757d; --ds-hbg: #5c636a; --ds-hbd: #565e64; --ds-abg: #565e64; --ds-abd: #51585e; --ds-ring: 130, 138, 145; }
body .btn-success { --ds-fg: #fff; --ds-bg: #198754; --ds-hbg: #157347; --ds-hbd: #146c43; --ds-abg: #146c43; --ds-abd: #13653f; --ds-ring: 60, 153, 110; }
body .btn-danger { --ds-fg: #fff; --ds-bg: #dc3545; --ds-hbg: #bb2d3b; --ds-hbd: #b02a37; --ds-abg: #b02a37; --ds-abd: #a52834; --ds-ring: 225, 83, 97; }
body .btn-warning { --ds-fg: #000; --ds-bg: #ffc107; --ds-hbg: #ffca2c; --ds-hbd: #ffc720; --ds-abg: #ffcd39; --ds-abd: #ffc720; --ds-ring: 217, 164, 6; }
body .btn-info { --ds-fg: #000; --ds-bg: #0dcaf0; --ds-hbg: #31d2f2; --ds-hbd: #25cff2; --ds-abg: #3dd5f3; --ds-abd: #25cff2; --ds-ring: 11, 172, 204; }
body .btn-light { --ds-fg: #000; --ds-bg: #f8f9fa; --ds-hbg: #d3d4d5; --ds-hbd: #c6c7c8; --ds-abg: #c6c7c8; --ds-abd: #babbbc; --ds-ring: 211, 212, 213; }
body .btn-dark { --ds-fg: #fff; --ds-bg: #212529; --ds-hbg: #424649; --ds-hbd: #373b3e; --ds-abg: #4d5154; --ds-abd: #373b3e; --ds-ring: 66, 70, 73; }
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark) {
  color: var(--ds-fg);
  background-color: var(--ds-bg);
  border-color: var(--ds-bg);
}
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark):is(:hover, :focus, .focus) {
  color: var(--ds-fg);
  background-color: var(--ds-hbg);
  border-color: var(--ds-hbd);
}
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark):is(:focus, .focus),
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark):not(:disabled):not(.disabled):is(:active, .active):focus,
body .show > :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark).dropdown-toggle:focus {
  box-shadow: 0 0 0 0.25rem rgba(var(--ds-ring), 0.5);
}
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark):not(:disabled):not(.disabled):is(:active, .active),
body .show > :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark).dropdown-toggle {
  color: var(--ds-fg);
  background-color: var(--ds-abg);
  border-color: var(--ds-abd);
}
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark).disabled,
body :is(.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-light, .btn-dark):disabled {
  color: var(--ds-fg);
  background-color: var(--ds-bg);
  border-color: var(--ds-bg);
}

body .btn-outline-primary { --ds-o: #0d6efd; --ds-ofg: #fff; --ds-oring: 13, 110, 253; }
body .btn-outline-secondary { --ds-o: #6c757d; --ds-ofg: #fff; --ds-oring: 108, 117, 125; }
body .btn-outline-success { --ds-o: #198754; --ds-ofg: #fff; --ds-oring: 25, 135, 84; }
body .btn-outline-danger { --ds-o: #dc3545; --ds-ofg: #fff; --ds-oring: 220, 53, 69; }
body .btn-outline-warning { --ds-o: #ffc107; --ds-ofg: #000; --ds-oring: 255, 193, 7; }
body .btn-outline-info { --ds-o: #0dcaf0; --ds-ofg: #000; --ds-oring: 13, 202, 240; }
body .btn-outline-light { --ds-o: #f8f9fa; --ds-ofg: #000; --ds-oring: 248, 249, 250; }
body .btn-outline-dark { --ds-o: #212529; --ds-ofg: #fff; --ds-oring: 33, 37, 41; }
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark) {
  color: var(--ds-o);
  border-color: var(--ds-o);
}
/* AA text (D15): the outline-info label is #087990 (cyan #0dcaf0 is 1.96:1 on white); border, hover and pressed fill stay
   --ds-o. Hover / pressed set their own colour below, with more specificity. Cyan again on a dark surface. */
body .btn-outline-info {
  color: #087990;
}
body .bg-dark .btn-outline-info,
body .navbar-dark .btn-outline-info {
  color: #0dcaf0;
}
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark):hover,
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark):not(:disabled):not(.disabled):is(:active, .active),
body .show > :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark).dropdown-toggle {
  color: var(--ds-ofg);
  background-color: var(--ds-o);
  border-color: var(--ds-o);
}
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark):is(:focus, .focus),
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark):not(:disabled):not(.disabled):is(:active, .active):focus,
body .show > :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark).dropdown-toggle:focus {
  box-shadow: 0 0 0 0.25rem rgba(var(--ds-oring), 0.5);
}
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark).disabled,
body :is(.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark):disabled {
  color: var(--ds-o);
  background-color: transparent;
}
body .btn {
  border-radius: 0.5rem;
}

/* Navbar: Bootstrap 4's .bg-dark is #343a40; the design system's dark is #212529 (white text). The same
   rule covers every other .bg-* / .text-* utility whose Bootstrap 4 colour differs from Bootstrap 5.
   Exception (D15, WCAG AA): .text-info is #087990, not #0dcaf0 (1.96:1 on white); .bg-info stays #0dcaf0. Muted text on a
   .bg-light surface is #5c636a (Bootstrap 4's #6c757d is 4.45:1 there). Both keep cyan / the default on dark surfaces. */
body .bg-dark {
  background-color: #212529 !important;
}
body .bg-primary {
  background-color: #0d6efd !important;
}
body .bg-success {
  background-color: #198754 !important;
}
body .bg-info {
  background-color: #0dcaf0 !important;
}
body .text-dark {
  color: #212529 !important;
}
body .text-primary {
  color: #0d6efd !important;
}
body .text-success {
  color: #198754 !important;
}
body .text-info {
  color: #087990 !important;
}
body .bg-light .text-muted,
body .bg-light .text-secondary {
  color: #5c636a !important;
}
body .bg-dark .text-info,
body .navbar-dark .text-info {
  color: #0dcaf0 !important;
}
body .navbar {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Cards: the design system's card is white, .6rem radius, a 1px soft shadow. The header / footer
   corners follow the card's radius. */
body .card, body .panel {
  border-radius: 0.6rem;
}
body .card-header:first-child {
  border-radius: calc(0.6rem - 1px) calc(0.6rem - 1px) 0 0;
}
body .card-footer:last-child {
  border-radius: 0 0 calc(0.6rem - 1px) calc(0.6rem - 1px);
}
body .card, body .panel, body .modal-content {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
body .modal-content {
  border-radius: 0.5rem;
}

/* Tables are stock Bootstrap (no custom head or cell colours); .table-dark / .thead-dark are the design
   system's dark (#212529), not Bootstrap 4's #343a40. Only the old, non-colour head weight stays. */
body .table thead:not(.table-dark) th,
body table.dataTable thead:not(.table-dark) th {
  border-bottom-width: 1px;
  font-weight: 600;
}
body .table-dark,
body .table-dark > th,
body .table-dark > td,
body .thead-dark th {
  background-color: #212529;
}

/* Form controls: slightly softer corners; text #212529 (Bootstrap 4: #495057); focus is the design
   system's #86b7fe border and a .25rem ring (Bootstrap 4: #80bdff, .2rem). */
body .form-control {
  border-radius: 0.375rem;
}
body .form-control,
body .form-control:focus,
body .custom-select,
body .custom-select:focus {
  color: #212529;
}
body .form-control:focus,
body .custom-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badges: a touch more legible at small size; info is dark-on-cyan as in Bootstrap 5. */
body .badge, body .label {
  font-weight: 600;
  letter-spacing: 0.01em;
}
body .badge-primary {
  background-color: #0d6efd;
}
body .badge-success {
  background-color: #198754;
}
body .badge-info {
  color: #000;
  background-color: #0dcaf0;
}
body .badge-dark {
  background-color: #212529;
}

/* Alerts: the Bootstrap 5.3.8 subtle colours (text, background, border). */
body .alert-primary { color: #052c65; background-color: #cfe2ff; border-color: #9ec5fe; }
body .alert-secondary { color: #2b2f32; background-color: #e2e3e5; border-color: #c4c8cb; }
body .alert-success { color: #0a3622; background-color: #d1e7dd; border-color: #a3cfbb; }
body .alert-danger { color: #58151c; background-color: #f8d7da; border-color: #f1aeb5; }
body .alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffe69c; }
body .alert-info { color: #055160; background-color: #cff4fc; border-color: #9eeaf9; }
body .alert-light { color: #495057; background-color: #fcfcfd; border-color: #e9ecef; }
body .alert-dark { color: #495057; background-color: #ced4da; border-color: #adb5bd; }

/* Primary-blue states: pagination, pills, list groups, dropdown items, progress bars. */
body .page-link {
  color: #0d6efd;
}
body .page-link:hover {
  color: #0a58ca;
}
body .page-link:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
body .page-item.active .page-link,
body .list-group-item.active {
  background-color: #0d6efd;
  border-color: #0d6efd;
}
body .nav-pills .nav-link.active,
body .nav-pills .show > .nav-link,
body .dropdown-item.active,
body .dropdown-item:active,
body .progress-bar {
  background-color: #0d6efd;
}

/* QA-F31 (2026-09-29, readiness pass): the navbar brand is the tenant's name
   ("Riverside Mechanical — BidCITE Demo"), and it did not wrap, so on a 375 px phone every
   page laid out 448 px wide and scrolled sideways. Below Bootstrap's sm breakpoint it may now
   wrap onto a second line instead. */
@media (max-width: 575.98px) {
  html:root .us_brand,
  html:root .us_brand a {
    /* !important is required, not decoration: the brand link is the menu's brand_html (tenant data,
       rendered by users/classes/Menu.php), and it can carry an INLINE style="white-space:nowrap".
       An inline style beats every stylesheet rule that is not !important. Measured on the public
       demo after #52 (2026-09-29): this rule matched and lost, and the page stayed 448 px wide. */
    white-space: normal !important;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: 100%;
  }
}

/* QA-F31 (2026-09-29): the standard template's text wordmark (usersc/templates/standard/navigation.php).
   One line on wider screens, as before; below Bootstrap's sm breakpoint it may wrap. */
.us-wl-brand { white-space: nowrap; }
@media (max-width: 575.98px) {
  .us-wl-brand { white-space: normal; overflow-wrap: anywhere; }
}

/* Regression N01 (2026-09-29): the login page's show-password button (#togglePassword, a real
   <button> since #52) had no visible keyboard focus: .input-group-text sets no focus style.
   WCAG 2.4.7. focus-visible so a mouse click does not draw the ring. */
html:root #togglePassword:focus-visible {
  outline: 2px solid #0d6efd !important;
  outline-offset: 2px;
  z-index: 3;
}

/* F30 (readiness QA 2026-09-29): UserSpice 6 core pages (users/login.php and others) print Bootstrap 5
   dismissible alerts -- <button class="btn-close" data-bs-dismiss="alert">, an EMPTY button -- but this
   template loads Bootstrap 4, which has no .btn-close rule. Measured in Chromium on a failed sign-in:
   a 16 x 6 px grey sliver after the last word, not positioned, and it did nothing when clicked. This
   draws it the way Bootstrap 4 draws its own .close (top right, a multiplication sign) at a 44 px touch
   size; usersc/templates/standard/footer.php makes the click close the alert. The modal header's
   "close btn-close" link is not inside an alert and is untouched. */
body .alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.6;
}
body .alert-dismissible .btn-close::before {
  content: "\00d7";
}
body .alert-dismissible .btn-close:hover {
  opacity: 0.9;
}
body .alert-dismissible .btn-close:focus-visible {
  opacity: 0.9;
  outline: 2px solid #0d6efd;
  outline-offset: -4px;
}
