/* Project-wide Bootstrap palette tweaks. Loaded together with
   bootstrap.min.css (via the `bootstrap` fanstatic Group) so the
   adjustments apply uniformly across the authenticated app, the
   patient interface, and the login / exception screens. */

/* Tone down Bootstrap's default primary (#0d6efd) to its darker
   hover-tone — same hue, a touch less bright, which reads calmer in a
   clinical context without abandoning the Bootstrap palette. */
:root {
    --bs-primary: #0a58ca;
    --bs-primary-rgb: 10, 88, 202;
    --bs-link-color: #0a58ca;
    --bs-link-color-rgb: 10, 88, 202;
}

/* .btn-primary / .btn-outline-primary don't read var(--bs-primary) —
   the compiled CSS bakes in the colour. Restate the bootstrap-button
   custom properties so primary buttons follow the new tone too. */
.btn-primary {
    --bs-btn-bg: #0a58ca;
    --bs-btn-border-color: #0a58ca;
    --bs-btn-hover-bg: #094ab0;
    --bs-btn-hover-border-color: #08469a;
    --bs-btn-active-bg: #08469a;
    --bs-btn-active-border-color: #074086;
    --bs-btn-disabled-bg: #0a58ca;
    --bs-btn-disabled-border-color: #0a58ca;
}

.btn-outline-primary {
    --bs-btn-color: #0a58ca;
    --bs-btn-border-color: #0a58ca;
    --bs-btn-hover-bg: #0a58ca;
    --bs-btn-hover-border-color: #0a58ca;
    --bs-btn-active-bg: #0a58ca;
    --bs-btn-active-border-color: #0a58ca;
    --bs-btn-disabled-color: #0a58ca;
    --bs-btn-disabled-border-color: #0a58ca;
}

/* The Button control (and the timerecord calendar/now buttons) emit a bare
   `.btn` without a colour variant; Bootstrap renders those transparent. Give
   any variant-less button a default light-button look. Lives here (not in
   app_bootstrap.css) so it also applies to the login / verification / patient
   interface screens, which have such buttons too. The :not() chain excludes
   the colour variants (which keep their own colours). */
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark):not(.btn-link):not([class*="btn-outline"]) {
    --bs-btn-color: #212529;
    --bs-btn-bg: #f8f9fa;
    --bs-btn-border-color: #ced4da;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: #e9ecef;
    --bs-btn-hover-border-color: #adb5bd;
    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: #dde0e3;
    --bs-btn-active-border-color: #adb5bd;
}

/* Same story for the list-group and pagination "active" states — the
   filter sidebars (patients, issues, …) render the selected item as
   .list-group-item.active, which keys off these custom properties
   rather than var(--bs-primary). (.nav-pills is intentionally toned
   down to a neutral grey in app_bootstrap.css, so it stays out of
   this set.) */
.list-group {
    --bs-list-group-active-bg: #0a58ca;
    --bs-list-group-active-border-color: #0a58ca;
}

.pagination {
    --bs-pagination-active-bg: #0a58ca;
    --bs-pagination-active-border-color: #0a58ca;
}

/* Progress bars (e.g. the PI form-step indicator) also bake in the
   original Bootstrap primary at compile time. Point them at the same
   toned-down blue so the fill matches the navbar/masthead. */
.progress {
    --bs-progress-bar-bg: #0a58ca;
}
