/* ============================================================
   AMS Dark Theme
   Override --ams-* variables for the "dark" colour scheme.
   Applied when <html data-theme="dark"> via ThemeService.
   ============================================================ */

/* Remove the grey bottom border Bootstrap draws under .nav-tabs — applies to both themes.
   Placed here (loaded last) so it wins over bootstrap.min.css and style.css without !important. */
.nav-tabs {
  border-bottom: none !important;
}

/* Dark theme: re-introduce the horizontal line spanning the full tab row */

[data-theme="dark"] {
  /* Backgrounds — pure grey/black, no blue or purple tints */
  --ams-bg-white:       #1e1e1e;
  --ams-bg-surface:     #252525;
  --ams-bg-light:       #2c2c2c;
  --ams-bg-ibox:        #353535;   /* ibox-content panel background */

  /* Text */
  --ams-text-muted:     #a0a0a0;
  --ams-text-dark:      #cccccc;
  --ams-text-subdued:   #999;

  /* Borders */
  --ams-border-light:   #3a3a3a;
  --ams-border-subtle:  #333333;
  --ams-border-disabled:#4a4a4a;

  /* Finance rows */
  --ams-row-success-bg: #1a3a2a;
  --ams-row-danger-bg:  #3a1a1a;

  /* Survey section */
  --ams-section-bg:     #2c2c2c;

  /* Misc */
  --ams-divider-bar:    #666666;

  /* col-left-divider panel separator */
  --col-divider-color:  #3a3a3a;
}

/* ============================================================
   Dark mode: override Inspinia / Bootstrap hardcoded colors
   ============================================================ */

/* Page body background and default text */
[data-theme="dark"] body {
  background-color: #131313;
  color: #cccccc;
}

/* Main page-wrapper background */
[data-theme="dark"] #page-wrapper,
[data-theme="dark"] .gray-bg,
[data-theme="dark"] .bg-muted {
  background-color: #252525;
}

/* Client-select screen — standalone full-page layout that bypasses #page-wrapper.
   The .content div has background-color: #f9f9f9 as an inline style;
   !important overrides inline styles. Confirmed: .content is only used here. */
[data-theme="dark"] .content {
  background-color: #1a1a1a !important;
}

/* ============================================================
   Login page (Views/Account/Login.cshtml via _Layout.cshtml)
   All login styles are inline so !important is required throughout.
   ============================================================ */

/* Login page theme toggle button — darken the pill slightly in dark mode */
[data-theme="dark"] #loginThemeToggle {
  border-color: rgba(170, 170, 170, 0.45) !important;
  background: rgba(40, 40, 40, 0.6) !important;
  color: #e0e0e0 !important;
}
[data-theme="dark"] #loginThemeToggle:hover {
  background: rgba(60, 60, 60, 0.85) !important;
}

/* Login page background image darkening overlay.
   The image is applied as an inline background-image on .container-login100.
   A ::before pseudo-element places a semi-transparent dark layer over the image
   without affecting the login card sitting above it (z-index). */
[data-theme="dark"] .container-login100 {
  position: relative !important;
}
[data-theme="dark"] .container-login100::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: grayscale(90%) !important ;
  background: rgba(10, 10, 10, 0.65);
  z-index: 0;
  pointer-events: none;
}
/* Ensure the card stays above the overlay */
[data-theme="dark"] .wrap-login100 {
  position: relative !important;
  z-index: 1;
}

/* Left panel (amsWelcome) — inline background-color: #283340 (bluish), override to dark grey */
[data-theme="dark"] #amsWelcome {
  background-color: #101010 !important;
  color: #cccccc !important;
}

/* Card wrapper — right panel background should be black in dark mode */
[data-theme="dark"] .wrap-login100 {
  background-color: #000000 !important;
}

/* Right panel (loginForm) — inline background is set via wrap-login100, but also
   override the form element directly in case it has its own inline style */
[data-theme="dark"] #loginForm {
  background-color: #1e1e1e !important;
}

/* Username / password input fields — dark grey, no blue tint */
[data-theme="dark"] #username,
[data-theme="dark"] #password {
  background: #2e2e2e !important;
  color: #cccccc !important;
  border: 1px solid #4a4a4a !important;
}
[data-theme="dark"] #username::placeholder,
[data-theme="dark"] #password::placeholder {
  color: #6a6a6a !important;
}

/* Input icon overlays — inline color: #666 */
[data-theme="dark"] #userIcon,
[data-theme="dark"] #pwdIcon {
  color: #888888 !important;
}

/* "Welcome Back" title */
[data-theme="dark"] .login100-form-title {
  color: #cccccc !important;
}

/* "Forgot your password?" link */
[data-theme="dark"] #loginForm a {
  color: #888888 !important;
}

/* "Logged in on another tab" and mobile prompt headings — inline color: #000000 */
[data-theme="dark"] #loggedInOnAnotherTab h3,
[data-theme="dark"] #loggedInOnAnotherTab h4,
[data-theme="dark"] #mobilePrompt h3,
[data-theme="dark"] #mobilePrompt h4 {
  color: #cccccc !important;
}

/* ibox-footer */
[data-theme="dark"] .ibox-footer {
  background: #252525 !important;
  border-top-color: #3a3a3a !important;
  color: #cccccc;
}

[data-theme="dark"] .ibox-heading,
[data-theme="dark"] .ibox-content.ibox-heading {
  background-color: #353535 !important;
}

/* bg-muted — match the body background so widget stat tiles blend with the container */
[data-theme="dark"] .bg-muted {
  background-color: #292929 !important;
}

/* White background utility — page heading area; slightly lighter than body to create contrast */
[data-theme="dark"] .white-bg {
  background-color: #2f2f2f !important;
}

/* (btn-white overrides are in the dedicated buttons section below) */

/* Form labels — Bootstrap inherits color from parent but component-scoped styles and
   browser defaults can render <label> as near-black. Force light color globally. */
[data-theme="dark"] label {
  color: #cccccc !important;
}

/* Form inputs */
[data-theme="dark"] .form-control {
  background-color: #212121;
  border: none !important;
  color: #cccccc;
}

[data-theme="dark"] .form-control:focus {
  background-color: #2c2c2c;
  border-color: #6a6a6a;
  color: #e0e0e0;
}

[data-theme="dark"] .form-control[disabled],
[data-theme="dark"] .form-control[readonly] {
  background-color: #2a2a2a;
  color: #888;
}

/* ============================================================
   angular2-multiselect-dropdown — matches form-control dark style
   ============================================================ */

/* Trigger button (the visible "input-like" box) */
[data-theme="dark"] .c-btn {
  background-color: #2c2c2c !important;
  border-color: #4a4a4a !important;
  color: #cccccc !important;
}

/* Chevron arrow inside the trigger */
[data-theme="dark"] .selected-list .c-angle-down svg,
[data-theme="dark"] .selected-list .c-angle-up svg {
  fill: #888888 !important;
}

/* Dropdown list panel */
[data-theme="dark"] .list-area {
  background: #2c2c2c !important;
  border-color: #4a4a4a !important;
  box-shadow: 0px 2px 8px rgba(0,0,0,0.6) !important;
}

/* Arrow above the dropdown */
[data-theme="dark"] .arrow-up,
[data-theme="dark"] .arrow-down {
  border-bottom-color: #2c2c2c !important;
}
[data-theme="dark"] .arrow-2 {
  border-bottom-color: #4a4a4a !important;
}

/* Search / filter row */
[data-theme="dark"] .list-filter {
  border-bottom-color: #4a4a4a !important;
  background-color: #252525 !important;
}
[data-theme="dark"] .list-filter input {
  background-color: #252525 !important;
  color: #cccccc !important;
}
[data-theme="dark"] .list-filter .c-search svg,
[data-theme="dark"] .list-filter .c-clear svg {
  fill: #888888 !important;
}

/* Select-all row */
[data-theme="dark"] .select-all {
  border-bottom-color: #4a4a4a !important;
  background-color: #252525 !important;
}

/* List item hover */
[data-theme="dark"] .dropdown-list ul li:hover {
  background: #333333 !important;
}

/* Checkbox labels inside the dropdown */
[data-theme="dark"] .pure-checkbox input[type="checkbox"] + label,
[data-theme="dark"] .single-select-mode .pure-checkbox input[type="checkbox"] + label {
  color: #cccccc !important;
}

/* Checkbox border: white outline, no blue fill */
[data-theme="dark"] .pure-checkbox input[type="checkbox"] + label:before,
[data-theme="dark"] .single-select-mode .pure-checkbox input[type="checkbox"] + label:before {
  border-color: #ffffff !important;
}

/* Checked state: keep white border, fill with a subtle dark accent */
[data-theme="dark"] .pure-checkbox input[type="checkbox"]:checked + label:before,
[data-theme="dark"] .single-select-mode .pure-checkbox input[type="checkbox"]:checked + label:before {
  background: #5a5a5a !important;
  border-color: #ffffff !important;
}

/* Selected (checked) rows in the dropdown list */
[data-theme="dark"] .selected-item {
  background: #333333 !important;
}

/* Selected item token chips */
[data-theme="dark"] .selected-list .c-list .c-token {
  background: #404040 !important;
}
[data-theme="dark"] .selected-list .c-list .c-token .c-label {
  color: #e0e0e0 !important;
}

/* Input groups — Bootstrap 3 (.input-group-addon) and Bootstrap 4 (.input-group-prepend / .input-group-append).
   !important required here because the catalog-edit HTML uses inline background-color: #fff on these elements. */
[data-theme="dark"] .input-group-addon,
[data-theme="dark"] .input-group-prepend,
[data-theme="dark"] .input-group-append {
  background-color: #333333 !important;
  border-color: #4a4a4a !important;
  color: #b0b0b0 !important;
}

/* Contract price read-only input (#iPrice) also has an inline background-color: #fff */
[data-theme="dark"] #iPrice {
  background-color: #252525 !important;
  color: #b0b0b0 !important;
}

/* Tables */

/* Bare <table> elements (no Bootstrap .table class) — e.g. layout tables used in .ibox-title
   scanner bars and ibox-tools rows. Browsers default table cells to white; force transparent
   so they inherit the parent container's dark background. */
[data-theme="dark"] table:not([class]) tr,
[data-theme="dark"] table:not([class]) td,
[data-theme="dark"] table:not([class]) th {
  background-color: transparent;
  color: #cccccc;
}

/* Catalog replacements page section header cells use a hardcoded inline background (#dedede).
   Override with !important so the dark theme background wins over the inline style. */
[data-theme="dark"] .replacements-section-header {
  background-color: #252525 !important;
  color: #cccccc !important;
}

[data-theme="dark"] table.table,
[data-theme="dark"] .table > thead > tr > th,
[data-theme="dark"] .table > tbody > tr > td,
[data-theme="dark"] .table > tfoot > tr > td {
  color: #cccccc;
  border-color: #3a3a3a;
}

/* .table-bordered cell borders — style.css hardcodes #e7e7e7 which appears white on dark bg */
[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered > thead > tr > th,
[data-theme="dark"] .table-bordered > thead > tr > td,
[data-theme="dark"] .table-bordered > tbody > tr > td,
[data-theme="dark"] .table-bordered > tbody > tr > th,
[data-theme="dark"] .table-bordered > tfoot > tr > td,
[data-theme="dark"] .table-bordered > tfoot > tr > th {
  border-color: #3a3a3a !important;
}

/* thead header cell background — style.css sets #f5f5f6 which looks bright in dark mode */
[data-theme="dark"] .table-bordered > thead > tr > th,
[data-theme="dark"] .table-bordered > thead > tr > td {
  background-color: #252525 !important;
}

/* .devcss — the delivery scanning row; style.css hardcodes background:#fff and a light border */
[data-theme="dark"] .devcss {
  background: #1e1e1e !important;
  border-top-color: #3a3a3a !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #252525;
}

/* Bootstrap .table-hover rows — override the light-theme highlight (#f5f5f5 / transparent) */
[data-theme="dark"] .table-hover > tbody > tr:hover,
[data-theme="dark"] .table-hover > tbody > tr:hover > td,
[data-theme="dark"] .table-hover > tbody > tr:hover > th {
  background-color: #2e2e2e !important;
  color: #e0e0e0;
}

/* Bare <table> row hover — tables without the .table-hover class still benefit from
   a subtle highlight so any click-target rows are visible in dark mode */
[data-theme="dark"] table:not([class]) > tbody > tr:hover > td,
[data-theme="dark"] table:not([class]) > tbody > tr:hover > th {
  background-color: #2e2e2e;
  color: #e0e0e0;
}

[data-theme="dark"] .table > thead > tr > th {
  background-color: #101010;
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
  background-color: #252525;
  border-color: #3a3a3a;
}

[data-theme="dark"] .dropdown-menu > li > a {
  color: #cccccc;
}

[data-theme="dark"] .dropdown-menu > li > a:hover,
[data-theme="dark"] .dropdown-menu > li > a:focus {
  background-color: #333333;
  color: #e0e0e0;
}

[data-theme="dark"] .dropdown-menu .divider {
  background-color: #3a3a3a;
}

/* Modals */
[data-theme="dark"] .modal-content {
  background-color: #2a2a2a;
  color: #cccccc;
  border-radius: 7px !important;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #3a3a3a;
}

[data-theme="dark"] .modal-footer {
  border-top-color: #3a3a3a;
}

/* Nav active state */
[data-theme="dark"] .nav > li.active {
  background: #252525;
}

/* Page headings — slightly lighter than the page body (#1a1a1a) to create contrast */
[data-theme="dark"] .page-heading {
  color: #cccccc;
}

/* Breadcrumb has its own white bg in style.css */
[data-theme="dark"] .breadcrumb {
  background-color: transparent !important;
}

[data-theme="dark"] .border-bottom {
  border-bottom-color: transparent !important;
}

/* Panels / wells */
[data-theme="dark"] .panel {
  background-color: #1e1e1e;
  border-color: #3a3a3a;
}

[data-theme="dark"] .panel-heading {
  background-color: #252525;
  border-color: #3a3a3a;
  color: #cccccc;
}

[data-theme="dark"] .well {
  background-color: #252525;
  border-color: #3a3a3a;
}

/* Breadcrumbs */
[data-theme="dark"] .breadcrumb {
  background-color: #252525;
  color: #cccccc;
}

/* Popovers & tooltips */
[data-theme="dark"] .popover {
  background-color: #252525;
  border-color: #3a3a3a;
  color: #cccccc;
}

[data-theme="dark"] .popover-title {
  background-color: #333333;
  border-bottom-color: #3a3a3a;
}

/* Select2 dropdowns */
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: #2c2c2c;
  border-color: #4a4a4a;
  color: #cccccc;
}

[data-theme="dark"] .select2-container--default .select2-results__option {
  background-color: #252525;
  color: #cccccc;
}

[data-theme="dark"] .select2-container--default .select2-results__option--highlighted {
  background-color: #333333;
  color: #e0e0e0;
}

[data-theme="dark"] .select2-dropdown {
  background-color: #252525;
  border-color: #3a3a3a;
}

[data-theme="dark"] .select2-search--dropdown .select2-search__field {
  background-color: #2c2c2c;
  border-color: #4a4a4a;
  color: #cccccc;
}

/* Toastr notifications */
[data-theme="dark"] #toast-container > .toast-info {
  background-color: #2d3a50;
}

/* hr dividers */
[data-theme="dark"] hr {
  border-top-color: #3a3a3a;
}

/* ============================================================
   Help tab (floating "HELP" button on page heading)
   AMS.css: .page-heading-help-tab { background-color: #ececef; border-color: #e7eaec }
   ============================================================ */

[data-theme="dark"] .page-heading-help-tab {
  background-color: #252525 !important;
  border: none !important;
  top: 53px;
}

[data-theme="dark"] .page-heading-help-tab a {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .page-heading-help-tab:hover {
  background-color: #2e2e2e !important;
}

[data-theme="dark"] .settings-full-row {
  background: none !important;
}

/* ============================================================
   Bootstrap nav-tabs — inactive, active, hover, tab-content
   ============================================================ */

/* Inactive tab — Bootstrap 3 (li > a) and Bootstrap 4 (a.nav-link).
   Background and text color are left intentionally unchanged; only border is removed
   and tabs are shifted 1px down so they visually align with the content area. */
[data-theme="dark"] .nav-tabs > li {
  margin-bottom: 1px;
}

   [data-theme="dark"] .nav-tabs > li > a,
[data-theme="dark"] .nav-tabs .nav-link:not(.active) {
  background-color: #141414 !important;
  color: #808080 !important;
  border: none !important;
  position: relative;
  top: 1px;
}

/* Inactive tab hover/focus */
[data-theme="dark"] .nav-tabs > li > a:hover,
[data-theme="dark"] .nav-tabs > li > a:focus,
[data-theme="dark"] .nav-tabs .nav-link:not(.active):hover,
[data-theme="dark"] .nav-tabs .nav-link:not(.active):focus {
  background-color: #2e2e2e !important;
  color: #cccccc !important;
  border: none !important;
}

/* Active tab — #141414 background blends toward the page chrome; no border so it
   flows cleanly into the tab-content panel below it.
   Targets both Bootstrap 3 (li.active > a) and Bootstrap 4 (a.nav-link.active) patterns. */
[data-theme="dark"] .nav-tabs > li.active > a,
[data-theme="dark"] .nav-tabs > li.active > a:hover,
[data-theme="dark"] .nav-tabs > li.active > a:focus,
[data-theme="dark"] .nav-tabs .nav-link.active,
[data-theme="dark"] .nav-tabs .nav-link.active:hover,
[data-theme="dark"] .nav-tabs .nav-link.active:focus,
[data-theme="dark"] .tabs-container .nav-tabs > li.active > a,
[data-theme="dark"] .tabs-container .nav-tabs > li.active > a:hover,
[data-theme="dark"] .tabs-container .nav-tabs > li.active > a:focus,
[data-theme="dark"] .tabs-container .nav-tabs .nav-link.active,
[data-theme="dark"] .tabs-container .nav-tabs .nav-link.active:hover,
[data-theme="dark"] .tabs-container .nav-tabs .nav-link.active:focus {
  background-color: #353535 !important;
  color: #e8e8f0 !important;
  border: none !important;
  position: relative;
  top: 1px;
}

/* Tab bar bottom border */
[data-theme="dark"] .nav-tabs,
[data-theme="dark"] .tabs-container .nav-tabs {
  border-bottom-color: #3a3a3a !important;
}

/* Generic tab-content outside a tabs-container */
[data-theme="dark"] .tab-content {
  background-color: #1e1e1e !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
  border-top-left-radius: 0 !important;
}

/* Tab content pane inside a tabs-container — matches the active tab background (#353535)
   so the content area merges seamlessly with the selected tab, same as the light-theme
   white-on-white Inspinia effect. Upper-left radius is 0 so the leftmost tab sits flush. */
[data-theme="dark"] .tabs-container .tab-content {
  background-color: #353535 !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
  border-top-left-radius: 0 !important;
}

/* ============================================================
   Left navigation sidebar
   ============================================================ */

/* Sidebar background — must override Bootstrap's .navbar-default: #f8f8f8
   AND Inspinia's transparent override. Use !important on the nav + its contents. */
[data-theme="dark"] .navbar-static-side,
[data-theme="dark"] nav.navbar-static-side,
[data-theme="dark"] nav.navbar-default.navbar-static-side {
  background: #1a1a1a !important;
}

[data-theme="dark"] .navbar-static-side .sidebar-collapse,
[data-theme="dark"] .navbar-static-side #side-menu,
[data-theme="dark"] .navbar-static-side .nav.metismenu {
  background: #1a1a1a !important;
}

/* Sidebar list items — default transparent, but need explicit dark bg */
[data-theme="dark"] .navbar-static-side .nav > li {
  background: #1a1a1a !important;
}

/* AMS.css has `.mini-navbar .nav .nav-second-level { background-color: #e1e1e7 !important }`
   — override it for dark mode */
[data-theme="dark"] .mini-navbar .nav .nav-second-level,
[data-theme="dark"] .navbar-static-side .nav-second-level {
  background-color: #1a1a1a !important;
}

/* Nav link text — Inspinia sets color: #293846 (very dark) */
[data-theme="dark"] .nav > li > a {
  color: #b0b0b0;
}

[data-theme="dark"] .nav > li > a i {
  color: #b9b9b9;
}

[data-theme="dark"] .nav > li.active > a {
  color: #ec5767;
}

/* Hover state */
[data-theme="dark"] .navbar-default .nav > li > a:hover,
[data-theme="dark"] .navbar-default .nav > li > a:focus {
  background-color: #252525;
  color: #e0e0e0;
}

/* Remove the browser default focus outline on sidebar nav links — it renders as a white
   ring in dark mode after clicking a menu item. Keyboard users still get the hover
   background-color change as a visual indicator. */
[data-theme="dark"] .navbar-static-side .nav > li > a:focus,
[data-theme="dark"] .navbar-static-side .nav > li > a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Active/selected item highlight */
[data-theme="dark"] .nav > li.active {
  background: #131313 !important;
  border-left-color: #ee5253;
}

/* Nav section labels */
[data-theme="dark"] .nav-label,
[data-theme="dark"] .nav-second-level li a {
  color: #808080;
}

[data-theme="dark"] .nav-second-level li.active a {
  color: #fff;
}

/* Nav header (logo area at top of sidebar) — Inspinia hardcodes #293846 (teal) with !important.
   Override to a neutral dark grey to match the all-grey/black dark theme.
   Also covers the client-select page (#side-menu) which lacks .navbar-static-side.
   style.css has border-bottom: solid 1px #405366 !important — hide it since the color
   change to #2a2a2a below already provides visual separation. */
[data-theme="dark"] .navbar-static-side .nav > li.nav-header,
[data-theme="dark"] .nav > li.nav-header {
  background-color: #000000 !important;
  border-bottom-color: transparent !important;
}

[data-theme="dark"] .profile-element a span.text-muted {
  color: #808080 !important;
}

/* Sidebar scrollbar track */
[data-theme="dark"] .slimScrollBar {
  background: #4a4a4a !important;
}

/* ============================================================
   Top navbar bar — override Inspinia's teal #293846 with neutral dark grey.
   Bootstrap gives .navbar-static-top a 1px bottom border via .navbar-default { border-color: #e7e7e7 }
   — hide it in dark mode.
   ============================================================ */

[data-theme="dark"] .navbar-static-top {
  /* style.css sets background: #293846 (teal/blue-green) — override to neutral dark grey */
  background: #000000 !important;
  border-bottom-color: transparent !important;
}

/* ============================================================
   Easy pie chart / donut chart widget bg
   ============================================================ */

/* The white card is `.pie-chart` in easypiechart.css (component-scoped, background: #fcfcfc).
   !important beats ViewEncapsulation attribute selectors. */
[data-theme="dark"] .pie-chart {
  background: transparent !important;
  color: #cccccc !important;
  border-color: #3a3a3a !important;
}

[data-theme="dark"] .pie-chart .name {
  color: #cccccc !important;
}

/* Canvas itself should be transparent (easypiechart draws on it directly) */
[data-theme="dark"] .easypiechart canvas,
[data-theme="dark"] .pie-chart canvas {
  background: transparent !important;
}

/* Facility health score card and similar dashboard widgets.
   Transparent background lets the chart/card inherit the parent container colour,
   so the chart area blends with the surrounding page section (e.g. white-bg header). */
/* Procedures chart on the client dashboard matches the parent container (#2f2f2f).
   Higher specificity than the generic .ibox-content rule below overrides it. */
[data-theme="dark"] [tourAnchor="ams-procedure-chart"] .ibox-content {
  background-color: #2f2f2f !important;
}

[data-theme="dark"] .ibox-content,
[data-theme="dark"] .ibox-title {
  background-color: #353535 !important;
  border-radius: 15px;
  border:none !important;
  color: #cccccc !important;
}

[data-theme="dark"] .dashboard-widget {
  background: #1a1a1a !important;
  border-radius: 15px;
}

/* Ensure the .ibox wrapper itself doesn't inherit any light background or border from
   Bootstrap / Inspinia — keeps card outlines consistently dark. */
[data-theme="dark"] .ibox {
  background-color: #353535;
  border-color: #3a3a3a;
  border-radius: 10px;
}

/* Payment option iboxes in group settings — lighter background and a visible border
   so they stand out against the #252525 page background. */
[data-theme="dark"] .group-payment-option,
[data-theme="dark"] .group-payment-option .ibox-title,
[data-theme="dark"] .group-payment-option .ibox-content {
  background-color: #424242 !important;
}
[data-theme="dark"] .group-payment-option {
  border: none !important;
  border-radius: 10px;
}

/* Light mode omits the .ibox-title bottom border (border-style: solid solid none)
   because the white background provides visual separation. In dark mode with
   transparent backgrounds there is no visual edge at the bottom — restore it. */
[data-theme="dark"] .ibox-title {
  border:none !important;
}

/* Prevent a doubled border where .ibox-content or a second .ibox-title immediately
   follows .ibox-title — the bottom border of the first serves as the divider. */
[data-theme="dark"] .ibox-title + .ibox-content,
[data-theme="dark"] .ibox-title + .ibox-title {
  border-top: none !important;
}

/* Create divider when ibox-title is stacked. */
[data-theme="dark"] .ibox-title + .ibox-title {
  border-bottom: 2px solid #252525 !important;
  border-radius: 0px !important;
}

/* Restore the top border for section separators (e.g. Resources Used on procedure detail)
   even when they directly follow another .ibox-title (e.g. when inventory is collapsed). */
[data-theme="dark"] .ibox-title + .ibox-title.ibox-title-section-separator {
  border-top: 1px solid #3a3a3a !important;
}

/* ============================================================
   Outlook-style list — selected/active item
   ============================================================ */

/* style.css has `.elements-list .list-group-item.active { background-color: #fce8ea }` (light pink).
   Override to a dark highlight matching the theme. */
[data-theme="dark"] .elements-list .list-group-item.active,
[data-theme="dark"] .elements-list .list-group-item.active:hover {
  background-color: #131313 !important;
  color: #d0d0d0 !important;
  border-color: #131313 !important;
}

[data-theme="dark"] .elements-list .list-group-item:hover {
  background-color: #2e2e2e !important;
  color: #d0d0d0 !important;
}

/* Base item bg is one step above the sidebar (#1a1a1a) so the list visually separates from the nav */
[data-theme="dark"] .elements-list .list-group-item {
  background-color: #1e1e1e !important;
  border-color: #131313 !important;
  color: #b0b0b0 !important;
}

/* CDK virtual scroll viewport background — matches the list item bg so the
   empty space below the last item doesn't show as light/white */
[data-theme="dark"] cdk-virtual-scroll-viewport {
  background-color: #1e1e1e !important;
}

/* .outlook-items container background — shown while the list is loading */
[data-theme="dark"] .outlook-items {
  background-color: #252525 !important;
  top: 177px !important;
}

/* ============================================================
   Outlook-style filter bar background
   ============================================================ */

/* btn-grey (AMS.css has background-color: #eee) — make it match btn-white in dark mode.
   Use both background shorthand and background-color to beat any Bootstrap shorthand override. */
[data-theme="dark"] .btn-grey,
[data-theme="dark"] .btn.btn-grey,
[data-theme="dark"] a.btn-grey,
[data-theme="dark"] #gotoReportDetail {
  background: #2c2c2c !important;
  background-color: #2c2c2c !important;
  color: #cccccc !important;
  border-color: #4a4a4a !important;
}

[data-theme="dark"] .btn-grey:hover,
[data-theme="dark"] .btn-grey:focus,
[data-theme="dark"] .btn-grey:active {
  background: #333333 !important;
  background-color: #333333 !important;
  color: #e0e0e0 !important;
}


[data-theme="dark"] .btn-white,
[data-theme="dark"] .btn.btn-white {
  background: #1a1a1a !important;
  border: none !important;
  color: #cccccc !important;
}

[data-theme="dark"] .btn-white:hover,
[data-theme="dark"] .btn-white:focus,
[data-theme="dark"] .btn-white:active,
[data-theme="dark"] .btn.btn-white:hover,
[data-theme="dark"] .btn.btn-white:focus,
[data-theme="dark"] .btn.btn-white:active {
  background: #2d2c2c !important;
  border-color: #5a5a5a !important;
  color: #e0e0e0 !important;
}

/* Active / selected state for btn-white toggle buttons.
   Used across the app in btn-groups: daysback selector, payment type,
   tax update mode, facility admin picker, resource type tabs, etc.
   Without this, active buttons are visually identical to unselected ones
   in dark mode. */
[data-theme="dark"] .btn-white.active,
[data-theme="dark"] .btn.btn-white.active,
[data-theme="dark"] .btn-white.active:focus,
[data-theme="dark"] .btn-white.active:hover,
[data-theme="dark"] .btn.btn-white.active:focus,
[data-theme="dark"] .btn.btn-white.active:hover {
  background: #454545 !important;
  border-color: #707070 !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4) !important;
}

/* btn-default — used by .btn-group toggle buttons (e.g. pages/all view switcher) */
[data-theme="dark"] .btn-default,
[data-theme="dark"] .btn.btn-default {
  background-color: #2c2c2c !important;
  border: none !important;
  color: #cccccc !important;
}

[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-default:focus {
  background-color: #333333 !important;
  border: none !important;
  color: #e0e0e0 !important;
}

/* Active / selected state for btn-default toggle buttons */
[data-theme="dark"] .btn-default.active,
[data-theme="dark"] .btn.btn-default.active,
[data-theme="dark"] .btn-default.active:focus,
[data-theme="dark"] .btn-default.active:hover {
  background-color: #454545 !important;
  color: #ffffff !important;
}

/* Active state for btn-group toggle buttons */
[data-theme="dark"] .btn-group > .btn-default.active,
[data-theme="dark"] .btn-group > .btn.btn-default.active {
  background-color: #4a4a4a !important;
  color: #ffffff !important;
  border: none !important;
}

/* ============================================================
   Section spinner (ams-section-spinner)
   .ss-background / .ss-background-large use rgba(255,255,255,0.8) in
   component-scoped styles. !important overrides the encapsulated specificity.
   This also fixes the donut chart showing white while loading — the spinner
   overlay sits on top of .pie-chart and its white bg shows through.
   ============================================================ */

[data-theme="dark"] .ss-background,
[data-theme="dark"] .ss-background-large {
  /* Pure grey overlay � no blue tint */
  background-color: rgba(26, 26, 26, 0.85) !important;
}

/* Spinner wave bars — keep the existing red brand colour (#ee5253) */
[data-theme="dark"] .sk-spinner-wave div {
  background-color: #ee5253 !important;
}

/* ============================================================
   ams-checkbox — override hardcoded white background on the icon
   The icon <i> has style="background-color: #fff" to fill the
   checkbox interior; in dark mode, use the dark page background.
   ============================================================ */

[data-theme="dark"] ams-checkbox i.fal {
  background-color: #1a1a1a !important;
}

/* ============================================================
   Additional Bootstrap overrides
   ============================================================ */

/* Badge/label backgrounds stay readable — ensure white text on dark background */
[data-theme="dark"] .label-default {
  background-color: #4a4a4a;
  color: #ffffff !important;
}

/* List groups */
[data-theme="dark"] .list-group-item {
  background-color: #1e1e1e;
  border-color: #3a3a3a;
  color: #cccccc;
}

[data-theme="dark"] .list-group-item:hover,
[data-theme="dark"] .list-group-item:focus {
  background-color: #2e2e2e;
}

/* Pagination — Bootstrap 3 selectors */
[data-theme="dark"] .pagination > li > a,
[data-theme="dark"] .pagination > li > span {
  background-color: #252525;
  border: none !important;
  color: #b0b0b0;
}

[data-theme="dark"] .pagination > .active > a,
[data-theme="dark"] .pagination > .active > span {
  background-color: #5a5a5a;
  border: none !important;
  color: #fff;
}

/* Pagination — Bootstrap 4 selectors (page-item / page-link).
   !important is required here because Angular's View Encapsulation injects
   component styles after global CSS, which would otherwise win at equal specificity. */
[data-theme="dark"] .pagination .page-item .page-link {
  background-color: #252525 !important;
  border: none !important;
  color: #b0b0b0 !important;
}

[data-theme="dark"] .pagination .page-item.active .page-link {
  background-color: #5a5a5a !important;
  border-color: #707070 !important;
  color: #fff !important;
}

[data-theme="dark"] .v_content_class, .v_button {
  background-color: #555555 !important;
}

[data-theme="dark"] .ams-footer {
  background-color: #000000 !important;
  color: #444;
  border-top: none;
}

[data-theme="dark"] .btn-warning {
  background-color: #ec5767 !important;
  color: #444;
  border: none;
}


/* ============================================================
   Expiration report — expanded sub-table
   The inner <table> and its price <td> both carry inline
   style="background-color:#f9f9f9". !important is required to
   override inline styles. Using tr.bg-surface as the scope so
   only these nested tables are affected.
   ============================================================ */
[data-theme="dark"] tr.bg-surface table {
  background-color: #1e1e1e !important;
}

[data-theme="dark"] tr.bg-surface td {
  background-color: transparent !important;
  color: #cccccc;
}

[data-theme="dark"] tr.bg-surface th {
  color: #8080a0;
  border-bottom-color: #3a3a3a;
}

/* ============================================================
   Expired / error row highlight (.input-error)
   Light mode uses a pale pink (#fce8ea) which is illegible on dark
   backgrounds. In dark mode we use a muted deep red so the row is
   clearly flagged without washing out the text.
   !important is required because AMS.css already uses !important.
   ============================================================ */
[data-theme="dark"] .input-error,
[data-theme="dark"] .input-error:focus {
  background-color: #3d1a1e !important;
  border-color: #7a3040 !important;
}

/* ============================================================
   SweetAlert2 v6 — Dark theme overrides
   SweetAlert2 appends .swal2-modal to <body>, which is inside
   <html data-theme="dark">, so these selectors apply correctly.
   !important is required on button colours because sweetalert2.css
   already uses !important on .swal2-confirm and .swal2-cancel.
   ============================================================ */

/* Modal backdrop overlay — slightly darker in dark mode */
[data-theme="dark"] .swal2-container.swal2-shown {
  background-color: rgba(0, 0, 0, 0.65);
}

/* Popup box.
   SweetAlert2 v6 sets background as an inline style via JS defaults,
   so !important is required to override it. */
[data-theme="dark"] .swal2-modal {
  background: #252525 !important;
  color: #cccccc;
}

/* Success icon fix — this build of SweetAlert2 uses ::before, ::after (white
   half-circle masks that rotate during animation), and an inner .fix element
   (a white diagonal rectangle) to shape the ring. All must match the modal
   background, and !important is required to override the hardcoded #fff values. */
[data-theme="dark"] .swal2-modal .swal2-icon.swal2-success::before,
[data-theme="dark"] .swal2-modal .swal2-icon.swal2-success::after {
  background: #252525 !important;
}
[data-theme="dark"] .swal2-modal .swal2-icon.swal2-success .fix {
  background-color: #252525 !important;
}

/* Title text */
[data-theme="dark"] .swal2-modal .swal2-title {
  color: #e0e0e0;
}

/* Body / content text */
[data-theme="dark"] .swal2-modal .swal2-content {
  color: #b0b0b0;
}

/* Confirm button — primary action, red */
[data-theme="dark"] .swal2-confirm {
  background-color: #b03030 !important;
  color: #ffffff !important;
  border: 1px solid #c94040 !important;
}

[data-theme="dark"] .swal2-confirm:hover {
  background-color: #c94040 !important;
}

/* Cancel / secondary button */
[data-theme="dark"] .swal2-cancel {
  background-color: #3a3a3a !important;
  color: #cccccc !important;
  border: 1px solid #4a4a4a !important;
}

[data-theme="dark"] .swal2-cancel:hover {
  background-color: #4a4a4a !important;
}

/* Close (×) button */
[data-theme="dark"] .swal2-modal .swal2-close {
  color: #707070;
}

[data-theme="dark"] .swal2-modal .swal2-close:hover {
  color: #e06060;
}

/* Text inputs / textarea / select inside swal2 */
[data-theme="dark"] .swal2-modal .swal2-input,
[data-theme="dark"] .swal2-modal .swal2-file,
[data-theme="dark"] .swal2-modal .swal2-textarea,
[data-theme="dark"] .swal2-modal .swal2-select {
  background-color: #1e1e1e;
  color: #cccccc;
  border-color: #3a3a3a;
}

[data-theme="dark"] .swal2-modal .swal2-input:focus,
[data-theme="dark"] .swal2-modal .swal2-file:focus,
[data-theme="dark"] .swal2-modal .swal2-textarea:focus,
[data-theme="dark"] .swal2-modal .swal2-select:focus {
  border-color: #5a5a5a;
  box-shadow: 0 0 3px #4a4a4a;
}

/* Validation error message */
[data-theme="dark"] .swal2-modal .swal2-validationerror {
  background-color: #3a1a1a;
  color: #e08080;
  border-color: #6a3a3a;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: #1e1e1e !important;
  border: none !important;
  color: #555555 !important;
}

/* ProcPro favorites toolbar fade-edge overlay.
   The gradient fades right into the card background; in dark mode
   that background is #1a1a1a (transparent ibox-content over page-wrapper). */
[data-theme="dark"] .fade-edge {
  background: linear-gradient(to right, rgba(26, 26, 26, 0), rgba(26, 26, 26, 1)) !important;
}

/* Alerts — base border override */
[data-theme="dark"] .alert {
  border-color: #3a3a3a;
}

/* alert-info: Bootstrap uses a light-blue wash (#d9edf7 bg, #31708f text).
   Replace with a dark navy tint that reads clearly on the dark surface. */
[data-theme="dark"] .alert-info {
  background-color: #000000 !important;
  color: #8ab4d4 !important;
  border: none !important;
}

/* alert-success: Bootstrap uses a light-green wash.
   Replace with a dark green tint. */
[data-theme="dark"] .alert-success {
  background-color: #192a1e !important;
  color: #7ab98a !important;
  border-color: #2a5a3a !important;
}

/* alert-warning: Bootstrap uses a light-yellow wash.
   Replace with a dark amber tint. */
[data-theme="dark"] .alert-warning {
  background-color: #2a2010 !important;
  color: #c8a055 !important;
  border-color: #5a4010 !important;
}

/* alert-danger: Bootstrap uses a light-red wash (#f2dede bg, #a94442 text).
   Replace with a dark red tint that reads clearly on the dark surface. */
[data-theme="dark"] .alert-danger {
  background-color: #000000 !important;
  color: #ec5767 !important;
  border: none !important;
}

/* Physician preferences — "Available Inventory/Resources/Bundles" right-hand panels.
   Each panel has an inline style="border-left: solid 3px #efefef; background-color:#ffffff".
   The background is removed from the HTML; the border-left colour is overridden here. */
[data-theme="dark"] ams-physician-preferences-edit .col-sm-8,
[data-theme="dark"] ams-physician-preferences-edit .col-sm-7 {
  border-left-color: #3a3a3a !important;
}

/* Pre / code blocks */
[data-theme="dark"] pre,
[data-theme="dark"] code {
  background-color: #252525;
  color: #cccccc;
  border-color: #3a3a3a;
}

/* ============================================================
   Easypiechart / donut chart — .pie-chart has background: #fcfcfc in its component CSS.
   ViewEncapsulation means we can't override from global CSS without a host selector trick,
   but since theme-dark.css loads last we can target it directly.
   ============================================================ */
[data-theme="dark"] .pie-chart {
  background: transparent !important;
  color: #cccccc !important;
}

/* ============================================================
   Bootstrap modals
   ============================================================ */

/* Modal backdrop, container, header, body, footer */

/* ============================================================
   ams-autocomplete dropdown list — overrides hard-coded #FFFFFF in component CSS.
   Applies to the quantity dropdown in Provider Preferences (Resources tab) and
   anywhere else the autocomplete component is used.
   ============================================================ */
[data-theme="dark"] .autocomplete-list {
  background-color: #2c2c2c !important;
  border-color: #4a4a4a !important;
}

[data-theme="dark"] .autocomplete-list li {
  background-color: #2c2c2c !important;
  color: #cccccc !important;
}

[data-theme="dark"] .autocomplete-list li:hover {
  background-color: #3a3a3a !important;
}

/* ============================================================
   bwizard step indicator (Cycle Count, Survey, Sales Campaign)
   AMS.css hardcodes #fff / #e6e6e6 for the step pills and the
   arrow-notch pseudo-elements. Override each piece for dark mode.
   ============================================================ */

/* Container strip behind the pills. */
[data-theme="dark"] .bwizard-steps {
  background: #1e1e1e !important;
}

/* Inactive step pill. */
[data-theme="dark"] .bwizard-steps li {
  background: #2c2c2c !important;
  color: #cccccc !important;
}

/* Left notch (cut from the page background colour). */
[data-theme="dark"] .bwizard-steps li:before {
  border-left-color: #1e1e1e !important;
}

/* Right arrow (same colour as the pill itself). */
[data-theme="dark"] .bwizard-steps li:after {
  border-left-color: #2c2c2c !important;
}

/* Inactive step link text. */
[data-theme="dark"] .bwizard-steps a {
  color: #a0a0a0 !important;
}

/* Inactive step number badge. */
[data-theme="dark"] .bwizard-steps li .label-default {
  background: #4a4a4a !important;
}

/* Active (current) step — match the light-theme red pill. */
[data-theme="dark"] .bwizard-steps .active {
  background: #ec4758 !important;
  color: #fff !important;
}

[data-theme="dark"] .bwizard-steps .active:after {
  border-left-color: #ec4758 !important;
}

[data-theme="dark"] .bwizard-steps .active a {
  color: #fff !important;
}

[data-theme="dark"] .bwizard-steps .active span.label {
  color: #fff !important;
}

/* Hover on clickable inactive steps. */
[data-theme="dark"] .bwizard-steps.clickable li:hover:not(.active) {
  background: #3a3a3a !important;
}

[data-theme="dark"] .bwizard-steps.clickable li:hover:not(.active):after {
  border-left-color: #3a3a3a !important;
}

[data-theme="dark"] .bwizard-steps.clickable li:hover:not(.active) a {
  color: #cccccc !important;
}

/* ============================================================
   Year-end Annual Summary report — dark mode overrides.
   The report embeds a <style> block with hardcoded light/grey
   values that would otherwise show through on a dark page.
   ============================================================ */

/* Replace the 15px grey gap between sections with a dark separator. */
[data-theme="dark"] .annualSummary tr.theTrChart {
  background-color: #1e1e1e !important;
  border-bottom: solid 15px #2c2c2c !important;
}

/* Dark background for the stat/data rows — override the hardcoded #fff. */
[data-theme="dark"] .annualSummary tr.theTr {
  background-color: #1e1e1e !important;
  color: #cccccc !important;
}

/* Dashed dividers between stat cells use hardcoded #efefef — replace with a dark border. */
[data-theme="dark"] .annualSummary tr.theTr td {
  border-right-color: #3a3a3a !important;
}

/* Replace the grey dashed border below each chart cell with a dark one. */
[data-theme="dark"] .annualSummary .theTdChart {
  border-bottom-color: #3a3a3a !important;
}

/* Replace the explicitly grey stat boxes (Wasted Items, Expired Items)
   with a dark equivalent so they don't look jarring. */
[data-theme="dark"] .statFtr {
  background-color: #2c2c2c !important;
  color: #cccccc !important;
}

[data-theme="dark"] .autocomplete-selected-item {
  background-color: #4a4a4a !important;
}
[data-theme="dark"] .modal-header {
  background-color: #2a2a2a !important;
  border-bottom-color: #3a3a3a !important;
  color: #cccccc !important;
}
[data-theme="dark"] .modal-body {
  background-color: #2a2a2a !important;
}
[data-theme="dark"] .modal-footer {
  background-color: #2a2a2a !important;
  border-top-color: #3a3a3a !important;
}
[data-theme="dark"] .modal-title {
  color: #cccccc !important;
}

/* Close (×) button */
[data-theme="dark"] .modal-header .close {
  color: #888888 !important;
  opacity: 0.8;
}

/* List group items inside the notification modal */
[data-theme="dark"] .modal-body .list-group-item {
  background-color: #1a1a1a !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
}

/* Priority notification highlight — dark red-pink tint to mirror light theme's #fce8ea pink,
   with a left border accent so items are visually distinct even at a glance.
   More specific selector needed to beat .modal-body .list-group-item override above. */
[data-theme="dark"] .modal-body .list-group-item.priority-notification,
[data-theme="dark"] .priority-notification {
  /* Subtle muted-red tint — communicates priority without being visually jarring */
  background-color: #2a1520 !important;
  color: #c0a0a8 !important;
  border-left: 3px solid #ee5253 !important;
}

/* Par Level table — the global .priority-notification rule above adds a left border accent
   intended for notification list items. Table cells (td/th) in the par-level table use
   this class purely for the background colour; suppress the border so no red line appears. */
[data-theme="dark"] td.priority-notification,
[data-theme="dark"] th.priority-notification {
  border-left: none !important;
}

/* bg-primary-light — light theme is #d2eaf9 (pale blue); no dark override exists so
   the colour is invisible against the dark surface. Use a muted dark-navy blue tint. */
[data-theme="dark"] .bg-primary-light {
  background-color: #1a2e4a !important;
  color: #b0b0b0 !important;
}
[data-theme="dark"] .priority-notification a {
  color: #c0a0a8 !important;
}

/* ============================================================
   Task list panel (sidebar-panel)
   ============================================================ */

/* Panel background */
[data-theme="dark"] .sidebar-panel {
  background: #2a2a2a !important;
  color: #cccccc !important;
}

/* Task title text and "assigned by" label */
[data-theme="dark"] .sidebar-panel .media-body,
[data-theme="dark"] .sidebar-panel .feed-element,
[data-theme="dark"] .sidebar-panel p {
  color: #cccccc !important;
}
[data-theme="dark"] .sidebar-panel .text-muted {
  color: #888888 !important;
}

/* "Tasks" heading */
[data-theme="dark"] .sidebar-panel h4 {
  color: #cccccc !important;
}

/* Close (×) icon */
[data-theme="dark"] #hideTasksTab {
  color: #888888 !important;
}

/* Textarea */
[data-theme="dark"] .sidebar-panel textarea.form-control-small {
  background-color: #1a1a1a !important;
  color: #cccccc !important;
  border-color: #3a3a3a !important;
}
[data-theme="dark"] .sidebar-panel textarea.form-control-small::placeholder {
  color: #5a5a5a !important;
}

/* General input.form-control-small (e.g. Fee Breakdown inputs on client fee invoice detail) */
[data-theme="dark"] input.form-control-small {
  background-color: #2c2c2c;
  border-color: #4a4a4a;
  color: #cccccc;
}
[data-theme="dark"] input.form-control-small:focus {
  background-color: #2c2c2c;
  border-color: #6a6a6a;
  color: #e0e0e0;
}
[data-theme="dark"] input.form-control-small::placeholder {
  color: #5a5a5a;
}

/* ============================================================
   Scrollbars
   WebKit (Chrome/Edge/Safari) + Firefox scrollbar-color
   ============================================================ */

/* Firefox */
[data-theme="dark"] * {
  scrollbar-color: #4a4a4a #1a1a1a;
  scrollbar-width: thin;
}

/* WebKit / Chromium */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #4a4a4a;
  border-radius: 4px;
  border: 2px solid #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background-color: #5a5a5a;
}

[data-theme="dark"] ::-webkit-scrollbar-corner {
  background: #1a1a1a;
}

/* ============================================================
   Vertical timeline (Item History, Rolling Inventory, etc.)
   ============================================================ */

/* Central connecting line */
[data-theme="dark"] #vertical-timeline::before {
  background: #4a4a4a !important;
}

/* Card background and text */
[data-theme="dark"] .vertical-timeline-content,
[data-theme="dark"] .dark-timeline .vertical-timeline-content,
[data-theme="dark"] .dark-timeline.center-orientation .vertical-timeline-content {
  background: #2c2c2c !important;
  color: #cccccc !important;
}

[data-theme="dark"] .vertical-timeline-content h2 {
  color: #e8e8f0 !important;
}

[data-theme="dark"] .vertical-timeline-content p {
  color: #cccccc !important;
}

/* The small arrow/triangle that points from the card toward the icon */
[data-theme="dark"] .vertical-timeline-content::before {
  border-right-color: #2c2c2c !important;
  border-left-color: transparent !important;
}

/* Triangles on the dark-timeline variant */
[data-theme="dark"] .dark-timeline .vertical-timeline-content:before,
[data-theme="dark"] .dark-timeline.center-orientation .vertical-timeline-content:before {
  border-color: transparent #2c2c2c transparent transparent !important;
}

[data-theme="dark"] .dark-timeline .vertical-timeline-block:nth-child(2n) .vertical-timeline-content:before,
[data-theme="dark"] .dark-timeline.center-orientation .vertical-timeline-block:nth-child(2n) .vertical-timeline-content:before {
  border-color: transparent #2c2c2c transparent transparent !important;
}

/* Center-orientation: right-side cards point left */
[data-theme="dark"] .center-orientation .vertical-timeline-content::before {
  border-left-color: #2c2c2c !important;
  border-right-color: transparent !important;
}

/* Even cards (right side) point back left toward the icon */
[data-theme="dark"] .center-orientation .vertical-timeline-block:nth-child(even) .vertical-timeline-content::before {
  border-right-color: #2c2c2c !important;
  border-left-color: transparent !important;
}

/* Date text beside the card */
[data-theme="dark"] .vertical-timeline-content .vertical-date,
[data-theme="dark"] .vertical-date small {
  color: #aaaaaa !important;
}

/* ============================================================
   Floating update buttons + record navigator panel — dark mode
   ============================================================ */

/* The generic .ibox-content override uses transparent background, which is
   wrong for fixed/floating panels that need to cover page content below them.
   Give these panels a solid dark background and a subtle matching border.
   Note: background-color in floating-update-buttons.html is an inline style
   (#ebebef); CSS !important overrides inline styles per the CSS cascade. */
[data-theme="dark"] .buttons-float-bottom .ibox-content,
[data-theme="dark"] .buttons-float-top .ibox-content,
[data-theme="dark"] .buttons-float-bottom-tablet .ibox-content {
  background-color: transparent !important;
  border: none !important;
}

/* Remove rounded corners from ibox elements inside floating button bars in dark theme */
[data-theme="dark"] .buttons-float-bottom .ibox,
[data-theme="dark"] .buttons-float-top .ibox,
[data-theme="dark"] .buttons-float-bottom-tablet .ibox {
  border-radius: 0 !important;
}

/* The optional "action" buttons inside the floating panel use
   btn-danger btn-outline with an inline style="background:#ffffff".
   Override to a transparent/dark background so they don't flash white
   on a dark panel. */
[data-theme="dark"] .buttons-float-bottom .btn-danger.btn-outline,
[data-theme="dark"] .buttons-float-top .btn-danger.btn-outline,
[data-theme="dark"] .buttons-float-bottom-tablet .btn-danger.btn-outline {
  background: transparent !important;
  color: #ed5565 !important;
  border-color: #ed5565 !important;
}

[data-theme="dark"] .btn-danger {
  border: none !important;
}

[data-theme="dark"] .outlook-filter {
  background-color: #1a1a1a !important;
}

/* ============================================================
   Predictive Modeling — slider reference labels (month, count, reimbursement)
   These inherit a dark color in dark mode; force them to be readable.
   ============================================================ */
[data-theme="dark"] .slider-ref-month,
[data-theme="dark"] .slider-ref-count,
[data-theme="dark"] .slider-ref-reimb {
  color: #cccccc !important;
}

/* ============================================================
   Predictive Modeling — "Your Growth Rates" panel.
   Background/border are set in component-scoped report.css so
   !important is needed to override Angular's scoped specificity.
   ============================================================ */
[data-theme="dark"] .growth-rates-panel {
  background-color: #252525 !important;
  border-color: #4a4a4a !important;
  color: #cccccc !important;
}

[data-theme="dark"] .growth-rates-divider {
  border-top-color: #4a4a4a !important;
}

/* ============================================================
   Predictive Modeling — forecast year toggle buttons (3/5/10 Years).
   These use class="btn" with no variant, plus [active] binding.
   ============================================================ */
[data-theme="dark"] .btn-group > .btn:not(.btn-danger):not(.btn-primary):not(.btn-success):not(.btn-warning):not(.btn-white):not(.btn-default) {
  background-color: #2c2c2c !important;
  border: none !important;
  color: #cccccc !important;
}

[data-theme="dark"] .btn-group > .btn.active:not(.btn-danger):not(.btn-primary):not(.btn-success):not(.btn-warning) {
  background-color: #ec5767 !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* ============================================================
   Predictive Modeling — +/− adjustment slider buttons.
   .slider-btn has hard-coded background: #f5f5f5 in component CSS.
   ============================================================ */
[data-theme="dark"] .slider-btn {
  background: #2c2c2c !important;
  color: #cccccc !important;
  border: 1px solid #4a4a4a !important;
}

/* ============================================================
   Provider Detail — metric panel table divider (dark mode)
   Override the normalised #c8c8c8 top-border from AMS.css with a
   dark-theme-appropriate muted purple-grey.
   ============================================================ */
[data-theme="dark"] .metric-panel .table > tbody > tr > td {
  border-top-color: #4a4a4a !important;
  border-right: none !important;
}

[data-theme="dark"] .slider-btn:hover {
  background: #3a3a3a !important;
}

/* ============================================================
   Facility Summary — Profit Margin box
   client-summary.html adds class="profit-margin-box" to the h3 that
   carries inline style="background-color: #f9f9f9".  !important is
   required to beat the inline specificity.
   ============================================================ */
[data-theme="dark"] .profit-margin-box {
  background-color: var(--ams-bg-surface) !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
}

/* ============================================================
   Provider Detail — metric panel backgrounds
   physician-report-details.html: the four metric panels (Items Used,
   Reimbursement, Cost, Profit) use inline background colours
   (#f9f9f9 / #e1e1e7) that appear as bright patches in dark mode.
   Added classes metric-panel-gray / metric-panel-lavender target
   the first two; input-error is already handled; bg-light-green
   gets its own dark override below.
   ============================================================ */
[data-theme="dark"] .metric-panel-gray {
  background: #252525 !important;
}

[data-theme="dark"] .metric-panel-blue {
  background: #1d3550 !important;
}

/* bg-light-green (Total Profit panel) — light mode: #daf3ce.
   Dark equivalent: deep forest-green tint, clearly distinct from
   the surrounding dark surface. */
[data-theme="dark"] .bg-light-green {
  background-color: #1a3a25 !important;
}

/* Service selector cards (client self-service mode, archer/clients/clientsetting My Services tab).
   The "Current Monthly Fee" summary box has inline style="background-color:#f3f3f4" — override it.
   The outer .ibox wrapper inherits a white border from style.css; neutralise it to match the
   dark page surface. */
[data-theme="dark"] .ibox-content[style*="background-color: #f3f3f4"],
[data-theme="dark"] .ibox-content[style*="background-color:#f3f3f4"] {
  background-color: #252525 !important;
}

/* Service selector cards — .fee-box.bg-light-green marks a selected service.
   Override the green tint with a subtle dark highlight so selected services are
   visually distinct without colour clash. */
[data-theme="dark"] .fee-box.bg-light-green {
  background-color: #2e2e2e !important;
}

/* ============================================================
   Provider Finances / Provider Finance Details — table header rows
   In dark mode the .alert-danger + .finance-row-danger combo
   produces a near-invisible #3a1a1e background.  Override the
   EXPENSES header to a clearly-visible dark-red and the PROFIT
   header to near-black so the columns are easy to identify.
   Scoped to <thead> so data rows are unaffected.
   ============================================================ */
[data-theme="dark"] thead th.finance-row-danger {
  background-color: #5a1020 !important;
  color: #ffb0b8 !important;
  border-color: #7a2535 !important;
}

[data-theme="dark"] thead th.finance-header-dark {
  background-color: #111118 !important;
  color: #e8e8f0 !important;
}

/* ============================================================
   Spend Analysis — inventory tab panel outer row
   spend-report.html line ~155: the inventory tab content is wrapped in
   a <div class="row"> with inline style="background-color:#fff".
   This overrides the dark page background and creates a white rectangle
   behind all the "By Procedure / By Provider / By Product Type / By Vendor"
   sub-panels. spend-tab-panel is the class hook to neutralise it.
   ============================================================ */
[data-theme="dark"] .spend-tab-panel {
  background-color: transparent !important;
}

/* ============================================================
   Client Switcher dropdown — dark mode visibility fixes
   The facility/group picker in the top nav uses Bootstrap 4's
   .dropdown-item class.  Bootstrap 4 hardcodes color: #212529
   (very dark) on .dropdown-item, which is nearly invisible on the
   #252525 dark dropdown background.
   Also fixes: the filter input's #f5f5f5 bg and the Groups label #f3f3f4.
   ============================================================ */

/* Dropdown item text */
[data-theme="dark"] .client-switcher-items .dropdown-item {
  color: #cccccc !important;
  background-color: transparent !important;
}

/* Hover / keyboard-focus / selected-by-arrow-key states */
[data-theme="dark"] .client-switcher-items .dropdown-item:hover,
[data-theme="dark"] .client-switcher-items .dropdown-item:focus,
[data-theme="dark"] .client-switcher-items li.selected .dropdown-item {
  background-color: #333333 !important;
  color: #e0e0e0 !important;
}

/* Filter / search input inside the dropdown */
[data-theme="dark"] .client-switcher-items .outlook-filter {
  background-color: #1e1e1e !important;
  color: #cccccc !important;
  border-color: #3a3a3a !important;
}

[data-theme="dark"] .client-switcher-items .outlook-filter::placeholder {
  color: #5a5a5a !important;
}

/* "Groups" section header label */
[data-theme="dark"] .client-switcher-group-header {
  background: #2c2c2c !important;
  color: #cccccc !important;
}

/* ============================================================
   Predictive Modeling — zero marker label on sliders.
   .zero-label has color: #444 in component CSS, which is invisible
   against the dark page background.
   ============================================================ */
[data-theme="dark"] .zero-label {
  color: #cccccc !important;
}

/* ============================================================
   Vendor Contact List — parent vendor group row.
   The <tr class="vendor-header-row"> carries inline
   style="background-color: #ebebed" which renders as a bright white
   patch against the dark table. !important overrides the inline style.
   ============================================================ */
[data-theme="dark"] .vendor-header-row {
  background-color: #252525 !important;
}

/* ============================================================
   @kolkov/angular-editor — rich text editor dark theme
   The editor uses inline styles and its own stylesheet so most
   overrides require !important.
   ============================================================ */

/* Toolbar background and border */
[data-theme="dark"] .angular-editor-toolbar {
  background-color: #252525 !important;
  border-color: #4a4a4a !important;
}

/* Toolbar buttons */
[data-theme="dark"] .angular-editor-button {
  background-color: #2c2c2c !important;
  border-color: #4a4a4a !important;
  color: #cccccc !important;
}
[data-theme="dark"] .angular-editor-button:hover {
  background-color: #333333 !important;
}
[data-theme="dark"] .angular-editor-button.active {
  background-color: #404040 !important;
  color: #fff !important;
}

/* Font-family / font-size select dropdowns (ae-select) */
[data-theme="dark"] ae-select .ae-picker-label,
[data-theme="dark"] ae-select .ae-picker-options {
  background-color: #2c2c2c !important;
  border-color: #4a4a4a !important;
  color: #cccccc !important;
}
[data-theme="dark"] ae-select .ae-option:hover {
  background-color: #333333 !important;
}

/* The editable content area — AMS.css forces white via !important so we need it too */
[data-theme="dark"] .angular-editor-textarea {
  background-color: #1e1e1e !important;
  color: #cccccc !important;
  border-color: #4a4a4a !important;
  caret-color: #cccccc;
}

/* Outer wrapper / container */
[data-theme="dark"] .angular-editor-wrapper {
  background-color: #1e1e1e !important;
}

/* Toolbar separator lines */
[data-theme="dark"] .angular-editor-toolbar-set {
  border-right-color: #4a4a4a !important;
}

/* ============================================================
   Compliance doc read-only view (.agreement-text)
   The container has inline border and the inner div has inline
   background-color:#eee — both need !important to override.
   ============================================================ */
[data-theme="dark"] .agreement-text {
  background-color: #1e1e1e !important;
  color: #cccccc !important;
  border-color: #4a4a4a !important;
}

/* The outer wrapper div has inline border: 1px solid #d0cece */
[data-theme="dark"] div[style*="border: 1px solid #d0cece"] {
  border-color: #4a4a4a !important;
}

/* ============================================================
   Survey Add — selectable template cards (template-selector component)
   Default cards use a light grey background (#e3e3e3) and light border;
   the selected card flips to white. Override all for dark mode.
   ============================================================ */
[data-theme="dark"] .selectable-template {
  background-color: #2c2c2c !important;
  border-color: #4a4a4a !important;
  box-shadow: 4px 4px 8px #111111 !important;
  color: #cccccc !important;
}

/* Selected template card — was bright white, use a highlighted dark surface */
[data-theme="dark"] .selectable-template.selectable-template-selected {
  background-color: #1e1e1e !important;
  border-color: #7c7c7c !important;
}

/* Template name and description text */
[data-theme="dark"] .selectable-templateName {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .template-description {
  color: #aaaaaa !important;
}

/* Version label at bottom-left of card */
[data-theme="dark"] .selectable-template > div[style*="font-size: 10px"] {
  color: #888888 !important;
}

/* Patient guide list — inline border-bottom uses a hardcoded light color (#e7eaec)
   that shows as a white line in dark mode; override it with the dark theme border color */
[data-theme="dark"] .dataTables-example td[style*="border-bottom: 1px solid #e7eaec"] {
  border-bottom-color: #3a3a3a !important;
}

/* ============================================================
   .rounded-box � used on survey "Choose Your Sending Plan" cards
   and anywhere else a white-background rounded panel is used.
   Override the hardcoded white background for dark mode.
   ============================================================ */
[data-theme="dark"] .rounded-box {
  background: #2c2c2c !important;
  color: #cccccc !important;
  border: 1px solid #4a4a4a;
}

/* ============================================================
   Survey template editor � "Free-form input box will appear here"
   placeholder. The inner div has an inline background-color:#fff
   which must be overridden with !important for dark mode.
   ============================================================ */
[data-theme="dark"] .template-section-footer > div[style*="background-color:#fff"],
[data-theme="dark"] .template-section-footer > div[style*="background-color: #fff"] {
  background-color: #2c2c2c !important;
  color: #aaaaaa !important;
}

/* ============================================================
   Client invoice detail (invoices/of/client) � .invoice-content
   has a hardcoded white background. Override for dark mode.
   Also covers the subdued-color label/value columns.
   ============================================================ */
[data-theme="dark"] .invoice-content {
  background-color: #1e1e1e !important;
  border-color: #4a4a4a !important;
  color: #cccccc !important;
}

/* ============================================================
   .hr-line-dashed � the light theme sets color:#fff and
   background-color:#fff which creates a thick white bar in
   dark mode. Override to transparent background with a muted
   dashed border.
   ============================================================ */
[data-theme="dark"] .hr-line-dashed {
  border-top-color: #4a4a4a !important;
  background-color: transparent !important;
  color: transparent !important;
}

/* ============================================================
   Scan Test page (/scan-test)
   ============================================================ */

/* alert-white: style.css hardcodes background-color:#fff and border-color:#e7eaec.
   Replace with the dark surface colour so the info banner blends with the page. */
[data-theme="dark"] .alert-white {
  background-color: #252525 !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
}

/* QR code and barcode images are black-on-white PNGs.
   Invert them in dark mode so they read as white-on-dark — the scan marks
   remain clearly visible without a jarring white rectangle on the dark page. */
[data-theme="dark"] img[alt="QRCode"],
[data-theme="dark"] img[alt="Barcode"] {
  filter: invert(0.88);
  border-radius: 4px;
}

/* Prior-scans table rows use an inline border-bottom: dotted 1px #ccc.
   Override to the dark border colour so the row dividers are subtle, not bright. */
[data-theme="dark"] .scan-test-prior-scan-row {
  border-bottom-color: #3a3a3a !important;
}


/* ============================================================
   Stripe ACH payment host container � overrides the white
   background set by the component class so the Stripe 'night'
   iframe blends in with the dark UI.
   Placed here (global stylesheet) to bypass Angular view
   encapsulation which prevents ancestor selectors from
   reaching outside the component shadow.
   ============================================================ */
[data-theme="dark"] .ach-payment-host {
  background: #1e1e1e !important;
  border-color: #4a4a4a !important;
}

/* ============================================================
   .todo-list — validation error list on the Add Facility page
   (client-add-pending.html). style.css sets background: #f3f3f4
   and a light border on each <li> which appears bright on a dark page.
   ============================================================ */
[data-theme="dark"] .todo-list > li,
[data-theme="dark"] .todo-list.small-list > li {
  background: #252525 !important;
  border-left-color: #4a4a4a !important;
  border-right-color: #4a4a4a !important;
  color: #cccccc !important;
}

/* ============================================================
   Sorting column headers (ams-sorting-column)
   AMS.css hardcodes light-theme values:
     .sortActive  — background-color: #e1e1e1  (bright grey patch in dark mode)
     .sort span / .sort div — color: #337ab7  (mid-range blue; too dim on dark bg)
     .show-highlighted — color: #337ab7  (the active-sort indicator on the <span>)
   ============================================================ */

/* Active sorted column header — swap bright grey for a dark surface tint */
[data-theme="dark"] .sortActive {
  background-color: #2e2e2e !important;
}

/* Sortable (but not currently sorted) column header text/icons */
[data-theme="dark"] .sort span,
[data-theme="dark"] .sort div {
  color: #6ab0e0 !important;
}

/* Active sort indicator on the <span> inside the column header */
[data-theme="dark"] .show-highlighted {
  color: #6ab0e0 !important;
}

/* Catalog detail page — Master GTIN and Ref No readonly inputs use border:none inline style
   so they render as plain text. Override the browser's default white background in dark mode. */
[data-theme="dark"] .catalog-readonly-field {
  background-color: transparent;
  color: #cccccc;
}

/* ============================================================
   Prospects Board (archer/clients/leads) — dark mode fixes
   .agile-list li cards use hardcoded light backgrounds in style.css.
   .lead-phone-badge has an inline background-color:#fff set in lead-card.html.
   ============================================================ */
[data-theme="dark"] .agile-list li {
  background: #252525 !important;
  border-color: #3a3a3a !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li:hover {
  background: #2e2e2e !important;
}

/* Phone/URL badge pill inside each prospect card */
[data-theme="dark"] .lead-phone-badge {
  background-color: #1e1e1e !important;
  border-color: #3a3a3a !important;
}

/* ============================================================
   Lead history status timeline pills — restore label-* colors in dark mode.
   The broad .agile-list li rule above overrides everything with !important.
   These rules add one extra class to the selector (higher specificity [1,2,1]
   vs [1,1,1]) so they win the !important cascade.
   Each pill gets a dark background matching the kanban cards, with the
   label-* accent color applied as a thick left border (matching light mode).
   ============================================================ */
[data-theme="dark"] .agile-list li.label-default {
  background: #252525 !important;
  border-left: 4px solid #6a6a6a !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li.label-primary {
  background: #252525 !important;
  border-left: 4px solid #1ab394 !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li.label-success {
  background: #252525 !important;
  border-left: 4px solid #1c84c6 !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li.label-warning {
  background: #252525 !important;
  border-left: 4px solid #f8ac59 !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li.label-danger {
  background: #252525 !important;
  border-left: 4px solid #ed5565 !important;
  color: #cccccc !important;
}

[data-theme="dark"] .agile-list li.label-info {
  background: #252525 !important;
  border-left: 4px solid #23c6c8 !important;
  color: #cccccc !important;
}

/* ============================================================
   AMSiQ AI Insights panel (ai-analysis-panel component)
   The component uses scoped CSS with ::ng-deep for [innerHTML]
   content; !important overrides both the scoped rules and any
   inline styles that remain for structural purposes.
   ============================================================ */

/* Main sliding panel — swap white background for deep dark surface */
[data-theme="dark"] .ai-panel {
  background: #1e1e1e !important;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.55) !important;
}

/* Panel header bar — light grey (#f5f5f5) replaced with elevated dark surface */
[data-theme="dark"] .ai-panel-header {
  background: #252525 !important;
  border-bottom-color: #4a4a4a !important;
}

/* Panel title text */
[data-theme="dark"] .ai-panel-header h4 {
  color: #e0e0e0 !important;
}

/* Scrollable body — fallback text colour for any unsectioned content */
[data-theme="dark"] .ai-panel-body {
  color: #cccccc !important;
}

/* Loading spinner + "Analyzing…" message */
[data-theme="dark"] .ai-panel-loading {
  color: #aaaaaa !important;
}

/* Headings and horizontal rules inside the rendered AI content */
[data-theme="dark"] .ai-panel-body h1,
[data-theme="dark"] .ai-panel-body h2,
[data-theme="dark"] .ai-panel-body h3,
[data-theme="dark"] .ai-panel-body h4 {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .ai-panel-body hr {
  border-top-color: #4a4a4a !important;
}

[data-theme="dark"] .border-top {
  border-top: 1px solid #272727 !important;
}

/* Section card wrapper — dark border */
[data-theme="dark"] .ai-section {
  border-color: #4a4a4a !important;
}

/* Executive Summary card — darker teal border */
[data-theme="dark"] .ai-section-exec {
  border-color: #2a6a55 !important;
}

/* Regular section header — replace light grey with elevated dark surface */
[data-theme="dark"] .ai-section-hdr {
  background: #252525 !important;
  border-bottom-color: #4a4a4a !important;
}

/* Executive Summary header stays on-brand green (slightly deepened for dark) */
[data-theme="dark"] .ai-section-hdr-exec {
  background: #158a75 !important;
  border-bottom-color: #2a6a55 !important;
}

/* Section title — light text on dark header */
[data-theme="dark"] .ai-section-title {
  color: #e0e0e0 !important;
}

/* Executive Summary title stays white on its green header */
[data-theme="dark"] .ai-section-hdr-exec .ai-section-title {
  color: #fff !important;
}

/* Section body text */
[data-theme="dark"] .ai-section-body {
  color: #cccccc !important;
}

/* Executive Summary body — replace light teal tint with a deep dark surface */
[data-theme="dark"] .ai-section-body-exec {
  background: #1a2822 !important;
  color: #cccccc !important;
}

/* Sub-section heading labels within a section */
[data-theme="dark"] .ai-subtitle {
  color: #e0e0e0 !important;
}

/* ============================================================
   Tour (ams-tour) tooltip — dark mode
   The tooltip is rendered inside the component template, so its
   background and text must be overridden from the global theme
   sheet using !important to beat the component-scoped styles.
   ============================================================ */
[data-theme="dark"] .ams-tour-tooltip {
  background: #252525 !important;
  color: #cccccc !important;
  border: 1px solid #3a3a3a !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .ams-tour-tooltip h3 {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .ams-tour-tooltip p {
  color: #cccccc !important;
}

/* Arrow fill must match the tooltip background — one rule per placement direction */
[data-theme="dark"] .ams-tour-arrow.bottom {
  border-bottom-color: #252525 !important;
}

[data-theme="dark"] .ams-tour-arrow.top {
  border-top-color: #252525 !important;
}

[data-theme="dark"] .ams-tour-arrow.right {
  border-right-color: #252525 !important;
}

[data-theme="dark"] .ams-tour-arrow.left {
  border-left-color: #252525 !important;
}

/* ============================================================
   My Services tab — outer border on the col-lg-12 wrapper
   client-setting.html line ~470: the services tab content col has
   inline style="border-left:1px solid #dee2e6; border-right:1px solid #dee2e6"
   which creates bright white edges framing the entire service area.
   ============================================================ */
[data-theme="dark"] .settings-full-row > .col-lg-12 {
  border-left-color: #3a3a3a !important;
  border-right-color: #3a3a3a !important;
}

/* ============================================================
   Global search input ("Search all of AMSHub") in the top navbar.
   The input sits on the #2a2a2a navbar, so the default form-control
   background (#2c2c2c) is nearly invisible against it.
   ============================================================ */
[data-theme="dark"] #globalSearch,
[data-theme="dark"] .global-search-input {
  background-color: #3a3a3a !important;
  color: #e8e8e8 !important;
  border-color: #555555 !important;
}

[data-theme="dark"] #globalSearch::placeholder,
[data-theme="dark"] .global-search-input::placeholder {
  color: #999999 !important;
}

[data-theme="dark"] #globalSearch:focus,
[data-theme="dark"] .global-search-input:focus {
  background-color: #444444 !important;
  border-color: #777777 !important;
}

/* Highlighted row on the Client Payments report — amber tint readable on dark backgrounds */
[data-theme="dark"] .payment-highlighted {
  background-color: #4a3800 !important;
  outline: 2px solid #ffc107;
}

/* ============================================================
   Nested tab group -- applied via class="inner-tab-group" on any
   wrapper div that contains a secondary nav-tabs + ibox-content.
   Only styled in dark mode so light mode keeps its default look.
   ============================================================ */
[data-theme="dark"] .inner-tab-group .nav-tabs .nav-link.active {
  background-color: #474747 !important;
  border-color: transparent;
}

[data-theme="dark"] .inner-tab-group .ibox-content {
  background-color: #474747 !important;
}

/* ============================================================
   Nested tab group -- applied via class="inner-tab-group" on any
   wrapper div that contains a secondary nav-tabs + ibox-content.
   Only styled in dark mode so light mode keeps its default look.
   ============================================================ */
[data-theme="dark"] .inner-tab-group .nav-tabs .nav-link.active {
  background-color: #474747 !important;
  border-color: transparent;
}

[data-theme="dark"] .inner-tab-group .ibox-content {
  background-color: #474747 !important;
}

/* ============================================================
   Tab panel corner fix -- when a content panel sits directly below
   a nav-tabs row, zero the top-left radius so the active tab
   connects flush with the panel without a visible corner gap.
   Covers two structural patterns used across the app:
     1. .nav-tabs and .ibox are direct siblings
     2. .nav-tabs is wrapped in a div (e.g. <div class="row">)
   ============================================================ */

/* Pattern 1: nav-tabs and ibox are direct siblings */
[data-theme="dark"] .nav-tabs ~ .ibox,
[data-theme="dark"] .nav-tabs ~ .ibox .ibox-content {
  border-top-left-radius: 0 !important;
}

/* Pattern 2: nav-tabs is inside a wrapper div (e.g. <div class="row">) */
[data-theme="dark"] div:has(> .nav-tabs) ~ .ibox,
[data-theme="dark"] div:has(> .nav-tabs) ~ .ibox .ibox-content {
  border-top-left-radius: 0 !important;
}

/* Pattern 3: nav-tabs is in a row div, and the ibox is nested inside subsequent
   sibling rows via Bootstrap column wrappers (e.g. row > col-lg-12 > ibox) */
[data-theme="dark"] div:has(> .nav-tabs) ~ .row > [class*="col-"] > .ibox,
[data-theme="dark"] div:has(> .nav-tabs) ~ .row > [class*="col-"] > .ibox .ibox-content {
  border-top-left-radius: 0 !important;
}

/* Consolidated tab corner fix — covers all nesting depths:
   direct sibling, row > ibox, and row > col > ibox variants.
   Supersedes Patterns 1-3 above. */
[data-theme="dark"] .nav-tabs ~ .ibox,
[data-theme="dark"] .nav-tabs ~ .ibox .ibox-content,
[data-theme="dark"] div:has(> .nav-tabs) ~ .ibox,
[data-theme="dark"] div:has(> .nav-tabs) ~ .ibox .ibox-content,
[data-theme="dark"] div:has(> .nav-tabs) ~ .row .ibox,
[data-theme="dark"] div:has(> .nav-tabs) ~ .row .ibox .ibox-content {
  border-top-left-radius: 0 !important;
}

/* Pie chart percentage label — white text for readability against dark pie segments */
[data-theme="dark"] .small-pie-chart-label {
  color: #ffffff;
}

/* Override the earlier 'transparent' rule on spend-tab-panel so the entire
   content area behind the inventory tab panels matches the active tab color. */
[data-theme="dark"] .inner-tab-group .spend-tab-panel {
  background-color: #474747 !important;
}

/* spend-tab-panel sits as a sibling AFTER the inner-tab-group nav row (not inside it),
   so use the ~ sibling combinator to apply the #474747 background to the content area
   and the ibox-content panels within it. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel {
  background-color: #474747 !important;
}
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox-content {
  background-color: #474747 !important;
}

/* Give inner-tab-group itself the #474747 background so there is no gap between
   the tab nav row and the content area below (e.g. spend-tab-panel sibling) */
[data-theme="dark"] .inner-tab-group {
  background-color: #474747;
}

/* Remove top-left radius from ibox panels inside spend-tab-panel — they sit directly
   under the tab nav row so the top-left edge must be squared off, same as the active tab */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox,
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox .ibox-content {
  border-top-left-radius: 0 !important;
}

/* REVERT: cancel the full-width #474747 fill on the tab-nav row -- it's a Bootstrap
   .row so the colour spread to the right beyond the actual tab buttons */
[data-theme="dark"] .inner-tab-group {
  background-color: transparent !important;
}

/* REVERT: spend-tab-panel is also a full-width .row; keep it transparent and
   let only the ibox cards inside carry the colour */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel {
  background-color: transparent !important;
}

/* Apply #474747 to the .ibox wrapper (not just ibox-content) so the rounded-corner
   bleed area matches and there are no colour-mismatch gaps visible at the edges */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox {
  background-color: #474747;
}

/* Remove the float-e-margins top-margin so the ibox panel sits flush against
   the tab nav row with no wrong-colour gap between them */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox.float-e-margins {
  margin-top: 0;
}

/* ALIGNMENT: Bootstrap .row default is margin:0 -15px, but the inner tab nav
   row uses margin:0 15px. The 30px difference shifts the ibox panels 15px left
   of the tab buttons. Setting margin:0 on spend-tab-panel makes both start and
   end at the same x position as the nav row. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel {
  margin: 0 !important;
}

/* UNIFIED BLOCK: the [hidden] div that wraps both side-by-side ibox panels has
   no background, so the Bootstrap gutter between col-md-5 and col-md-7 shows
   the page colour. Filling it with #474747 makes the two panels look like one
   continuous block from top to bottom. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel > div {
  background-color: #474747;
}

/* Remove ibox card border so the panels blend into the unified background
   with no visible card outlines or colour-mismatch seams. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox {
  border: none !important;
}

/* TOP GAP: float-e-margins adds top/side spacing to ibox panels. Zeroing all
   margins removes the gap between the tab nav and the first ibox row, and any
   gap at the top of the second (detail) panel when it appears. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox.float-e-margins {
  margin: 0 !important;
}

/* UNIFIED BLOCK: add inner padding and rounded bottom corners to the [hidden]
   wrapper div so the whole content area reads as a single card with the same
   colour as the active tab; overflow:hidden clips the inset card corners cleanly */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel > div {
  padding: 8px;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

/* IBOX WRAPPER: make transparent so the unified block colour shows through the
   padding area around the table cards; border already removed in earlier rule */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox {
  background-color: transparent !important;
  border: none !important;
}

/* TABLE CARD (ibox-content): slightly darker shade than the #474747 block so the
   table areas stand out as separate inset cards; rounded corners + no border for
   a clean card-inside-panel appearance */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox-content {
  background-color: #3d3d3d !important;
  border-radius: 6px !important;
  border: none !important;
}

/* Reduce the horizontal padding on the ibox wrappers so the gap between the
   two side-by-side table cards (and the gap at the outer edges) is narrower.
   !important is required to override the inline padding-left/right:15px on the
   ibox elements. */
[data-theme="dark"] .inner-tab-group ~ .spend-tab-panel .ibox {
  padding-left: 4px !important;
  padding-right: 4px !important;
}
