:root {
    --primary-dark: #005461;
    --primary-medium: #018790;
    --primary-light: #00B7B5;
    --danger: #D32F2F;
    --danger-dark: #B71C1C;
    --bg-light: #F4F4F4;
    --white: #ffffff;
}
/* Global theme override. Loaded last in pages to ensure base theme applies. */
html, body {
  background: var(--bg-light);
  color: var(--primary-dark) !important;
}
/* Make buttons that expect light text keep white on colored backgrounds */
button, .btn { color: var(--white) !important; }
/* Inputs and selects default to white (now mapped) background and dark text */
input, select, textarea { background: var(--white) !important; color: var(--primary-dark) !important; border-color: #000000 !important; }
a { color: var(--primary-medium) !important; }
h1,h2,h3,h4,h5,h6 { color: var(--primary-dark) !important; }
/* Modal: transparent content with semi-opaque backdrop so page shows through
   but form controls inside remain readable */
.modal { background-color: rgba(0,0,0,0.45) !important; }
.modal-content, [role="dialog"] { background: transparent !important; color: var(--primary-dark) !important; box-shadow: none !important; border: none !important; }
/* Ensure form controls inside modals stay readable on top of page content */
.modal-content .form-control, .modal-content input, .modal-content select, .modal-content textarea {
  background: rgba(255,255,255,0.92) !important;
  color: var(--primary-dark) !important;
  border-color: rgba(0,0,0,0.08) !important;
}
/* Keep the modal body area fully white for consistent content background */
.modal-body {
  background: #ffffff !important;
  color: var(--primary-dark) !important;
  padding: 1rem !important;
  border-radius: 8px !important;
}
/* Override common bootstrap white utility classes to follow mapping white->black */
.text-white { color: #000000 !important; }
.text-white-50 { color: rgba(0,0,0,0.5) !important; }
.btn-outline-light { border-color: #000000 !important; color: #000000 !important; }

/* Global border/line color override requested: use #005461 for all borders and separators */
*:not(svg) {
  border-color: #005461 !important;
}
/* Specific border properties to ensure overrides for top/right/bottom/left */
*:not(svg) { border-top-color: #005461 !important; border-right-color: #005461 !important; border-bottom-color: #005461 !important; border-left-color: #005461 !important; }
/* Horizontal rules */
hr { border-color: #005461 !important; color: #005461 !important; }
/* Bootstrap utility classes that apply borders */
.border, .border-0, .border-top, .border-bottom, .border-start, .border-end { border-color: #005461 !important; }
/* Table borders */
table, .table { border-color: #005461 !important; }
/* Inputs/selects outline/border */
input, textarea, select, .form-control { border-color: #005461 !important; }
/* Ensure any element using the Bootstrap danger utility displays the new primary dark color */
.text-danger { color: #005461 !important; }
/* Icons or modal titles that rely on text-danger */
.text-danger i, .modal-title.text-danger, .bi.text-danger { color: #005461 !important; }
/* Catch inline style usages that embed the old red hex */
[style*="#ff2d55"] { color: #005461 !important; }
[style*="color:#ff2d55"] { color: #005461 !important; }
[style*="color: #ff2d55"] { color: #005461 !important; }

/* Force white or gray text to black per user request */
.text-light, .text-muted, .text-secondary, .text-white-50 { color: #000000 !important; }

/* Inline style catches for common white/gray color literals */
[style*="color:#fff"] , [style*="color:#ffffff"], [style*="color: #fff"], [style*="color: #ffffff"] { color: #000000 !important; }
[style*="color:#ddd"], [style*="color:#ccc"], [style*="color:#bbb"], [style*="color: #ddd"], [style*="color: #ccc"], [style*="color: #bbb"] { color: #000000 !important; }
[style*="rgba(255,255,255"], [style*="rgba(255, 255, 255"] { color: #000000 !important; }

/* Placeholder text should also be dark */
::placeholder, ::-webkit-input-placeholder, ::-moz-placeholder { color: #000000 !important; opacity: 0.9 !important; }
