/**
 * Dark theme overrides — scoped to html.app-theme-dark only.
 * Loaded after Sneat core + theme-default + CRM main.css.
 */

html.app-theme-dark {
  color-scheme: dark;
  --app-dark-bg: #25293c;
  --app-dark-surface: #2f3349;
  --app-dark-surface-2: #3a3f5c;
  --app-dark-border: rgba(255, 255, 255, 0.08);
  --app-dark-text: #e4e6eb;
  --app-dark-text-muted: #a1a6bd;
  --app-dark-heading: #f2f3f5;
  --bs-body-bg: var(--app-dark-bg);
  --bs-body-color: var(--app-dark-text);
  --bs-body-color-rgb: 228, 230, 235;
  --bs-secondary-color: var(--app-dark-text-muted);
  --bs-secondary-rgb: 161, 166, 189;
  --bs-border-color: var(--app-dark-border);
  --bs-border-color-translucent: rgba(255, 255, 255, 0.12);
  --bs-heading-color: var(--app-dark-heading);
  --bs-emphasis-color: #fff;
}

html.app-theme-dark body {
  background-color: var(--app-dark-bg);
  color: var(--app-dark-text);
}

html.app-theme-dark h1,
html.app-theme-dark h2,
html.app-theme-dark h3,
html.app-theme-dark h4,
html.app-theme-dark h5,
html.app-theme-dark h6,
html.app-theme-dark .h1,
html.app-theme-dark .h2,
html.app-theme-dark .h3,
html.app-theme-dark .h4,
html.app-theme-dark .h5,
html.app-theme-dark .h6 {
  color: var(--app-dark-heading);
}

html.app-theme-dark .text-muted {
  color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark .text-body {
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .text-body-secondary {
  color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark hr,
html.app-theme-dark .dropdown-divider {
  border-color: var(--app-dark-border);
  opacity: 1;
}

/* Layout page background */
html.app-theme-dark .layout-page {
  background-color: var(--app-dark-bg);
}

html.app-theme-dark .content-wrapper,
html.app-theme-dark .container-xxl.flex-grow-1.container-p-y {
  color: inherit;
}

/* Navbar (Sneat .bg-navbar-theme uses !important) */
html.app-theme-dark .bg-navbar-theme {
  background-color: var(--app-dark-surface) !important;
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-navbar-theme .navbar-brand,
html.app-theme-dark .bg-navbar-theme .navbar-brand a,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-link,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-item > .nav-link,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav > .nav-item > .nav-link {
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-navbar-theme .navbar-brand:hover,
html.app-theme-dark .bg-navbar-theme .navbar-brand:focus,
html.app-theme-dark .bg-navbar-theme .navbar-brand a:hover,
html.app-theme-dark .bg-navbar-theme .navbar-brand a:focus,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-link:hover,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-link:focus,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-item > .nav-link:hover,
html.app-theme-dark .bg-navbar-theme .navbar-nav > .nav-item > .nav-link:focus {
  color: #fff !important;
}

html.app-theme-dark .bg-navbar-theme .navbar-search-wrapper .navbar-search-icon,
html.app-theme-dark .bg-navbar-theme .navbar-search-wrapper .search-input,
html.app-theme-dark .bg-navbar-theme .search-input-wrapper .search-input,
html.app-theme-dark .bg-navbar-theme .search-input-wrapper .search-toggler {
  background-color: var(--app-dark-surface-2) !important;
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-navbar-theme .navbar-toggler {
  color: var(--app-dark-text);
  border-color: var(--app-dark-border);
}

html.app-theme-dark .layout-navbar {
  background-color: rgba(47, 51, 73, 0.92) !important;
}

html.app-theme-dark .layout-navbar-fixed .layout-page:before {
  background: rgba(37, 41, 60, 0.75);
}

html.app-theme-dark .navbar-detached {
  box-shadow: 0 0 0.375rem 0.25rem rgba(0, 0, 0, 0.35);
}

/* Sidebar menu */
html.app-theme-dark .bg-menu-theme {
  background-color: var(--app-dark-surface) !important;
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-menu-theme .menu-link,
html.app-theme-dark .bg-menu-theme .menu-horizontal-prev,
html.app-theme-dark .bg-menu-theme .menu-horizontal-next {
  color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark .bg-menu-theme .menu-link:hover,
html.app-theme-dark .bg-menu-theme .menu-link:focus,
html.app-theme-dark .bg-menu-theme .menu-horizontal-prev:hover,
html.app-theme-dark .bg-menu-theme .menu-horizontal-next:hover {
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-menu-theme .menu-text,
html.app-theme-dark .bg-menu-theme .menu-link.active,
html.app-theme-dark .bg-menu-theme .menu-item.open:not(.menu-item-closing) > .menu-toggle,
html.app-theme-dark .bg-menu-theme .menu-item.active > .menu-link {
  color: var(--app-dark-text) !important;
}

html.app-theme-dark .bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
  background-color: var(--app-dark-surface-2) !important;
}

html.app-theme-dark .bg-menu-theme .menu-inner-shadow {
  background: linear-gradient(
    var(--app-dark-surface) 41%,
    rgba(47, 51, 73, 0.2) 95%,
    rgba(47, 51, 73, 0)
  ) !important;
}

html.app-theme-dark .bg-menu-theme .menu-header,
html.app-theme-dark .bg-menu-theme .menu-header-text {
  color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark .bg-menu-theme .menu-header:before {
  background-color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark:not(.layout-menu-collapsed) .bg-menu-theme .menu-inner .menu-item.open > .menu-link,
html.app-theme-dark.layout-menu-hover.layout-menu-collapsed .bg-menu-theme .menu-inner .menu-item.open > .menu-link,
html.app-theme-dark:not(.layout-menu-collapsed) .bg-menu-theme .menu-inner .menu-item .menu-link:not(.active):hover,
html.app-theme-dark.layout-menu-hover.layout-menu-collapsed .bg-menu-theme .menu-inner .menu-item .menu-link:not(.active):hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

html.app-theme-dark .bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.85) !important;
}

html.app-theme-dark .bg-menu-theme .menu-inner > .menu-item.active:before {
  background: #fff !important;
}

html.app-theme-dark .bg-menu-theme .menu-sub > .menu-item > .menu-link:before {
  background-color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark .bg-menu-theme .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle):before {
  border-color: rgba(0, 137, 252, 0.35) !important;
}

html.app-theme-dark .bg-menu-theme.menu-vertical {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.35);
}

html.app-theme-dark .app-brand .layout-menu-toggle {
  border-color: var(--app-dark-bg) !important;
}

/* Footer */
html.app-theme-dark .bg-footer-theme {
  background-color: var(--app-dark-surface) !important;
  color: var(--app-dark-text-muted) !important;
}

html.app-theme-dark .bg-footer-theme .footer-link,
html.app-theme-dark .bg-footer-theme .footer-text {
  color: var(--app-dark-text-muted) !important;
}

/* Cards */
html.app-theme-dark .card {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .card-header,
html.app-theme-dark .card-footer {
  background-color: rgba(0, 0, 0, 0.15);
  border-color: var(--app-dark-border);
  color: inherit;
}

html.app-theme-dark .card-header.bg-white {
  background-color: var(--app-dark-surface-2) !important;
  border-color: var(--app-dark-border) !important;
  color: var(--app-dark-text);
}

html.app-theme-dark .card-title {
  color: var(--app-dark-heading);
}

/* Tables — Sneat uses inset box-shadow + --bs-table-accent-bg for stripes/hover */
html.app-theme-dark .table {
  --bs-table-bg: var(--app-dark-surface);
  --bs-table-color: var(--app-dark-text);
  --bs-table-accent-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.07);
  --bs-table-striped-color: var(--app-dark-text);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.11);
  --bs-table-hover-color: var(--app-dark-text);
  --bs-table-active-bg: rgba(255, 255, 255, 0.14);
  --bs-table-active-color: var(--app-dark-text);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .table > :not(caption) > * > * {
  background-color: transparent;
  border-bottom-color: var(--app-dark-border);
  color: inherit;
}

/* Lead lists & other CRM list tables (lists_list.html) */
html.app-theme-dark .crm-lists-table a.text-primary.fw-bold {
  color: #fff !important;
}

html.app-theme-dark .crm-lists-table a.text-primary.fw-bold:hover,
html.app-theme-dark .crm-lists-table a.text-primary.fw-bold:focus {
  color: #a8d4ff !important;
}

/* Forms */
html.app-theme-dark .form-control,
html.app-theme-dark .form-select {
  background-color: var(--app-dark-surface-2);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .form-control:focus,
html.app-theme-dark .form-select:focus {
  background-color: var(--app-dark-surface-2);
  border-color: #006fcc;
  color: var(--app-dark-text);
}

html.app-theme-dark .form-control::placeholder {
  color: var(--app-dark-text-muted);
  opacity: 0.85;
}

html.app-theme-dark .input-group-text {
  background-color: var(--app-dark-bg);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text-muted);
}

html.app-theme-dark .form-label,
html.app-theme-dark .col-form-label {
  color: var(--app-dark-text);
}

html.app-theme-dark .form-text {
  color: var(--app-dark-text-muted);
}

/* Dropdowns */
html.app-theme-dark .dropdown-menu {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.45);
}

html.app-theme-dark .dropdown-item {
  color: var(--app-dark-text);
}

html.app-theme-dark .dropdown-item:hover,
html.app-theme-dark .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Nav tabs / pills */
html.app-theme-dark .nav-tabs {
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .nav-tabs .nav-link {
  color: var(--app-dark-text-muted);
}

html.app-theme-dark .nav-tabs .nav-link:hover,
html.app-theme-dark .nav-tabs .nav-link:focus {
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .nav-tabs .nav-link.active,
html.app-theme-dark .nav-tabs .nav-item.show .nav-link {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border) var(--app-dark-border) var(--app-dark-surface);
  color: var(--app-dark-text);
}

/* Breadcrumb */
html.app-theme-dark .breadcrumb-item a,
html.app-theme-dark .breadcrumb-item + .breadcrumb-item::before {
  color: var(--app-dark-text-muted);
}

html.app-theme-dark .breadcrumb-item.active {
  color: var(--app-dark-text);
}

/* Pagination */
html.app-theme-dark .page-link {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .page-link:hover {
  background-color: var(--app-dark-surface-2);
  border-color: var(--app-dark-border);
  color: #fff;
}

html.app-theme-dark .page-item.disabled .page-link {
  background-color: var(--app-dark-bg);
  color: var(--app-dark-text-muted);
}

/* List group */
html.app-theme-dark .list-group-item {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

/* Modal */
html.app-theme-dark .modal-content {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .modal-header,
html.app-theme-dark .modal-footer {
  border-color: var(--app-dark-border);
}

/* Accordion */
html.app-theme-dark .accordion-item {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border);
}

html.app-theme-dark .accordion-button {
  background-color: var(--app-dark-surface);
  color: var(--app-dark-text);
}

html.app-theme-dark .accordion-button:not(.collapsed) {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--app-dark-heading);
}

html.app-theme-dark .accordion-button::after {
  filter: invert(0.85);
}

/* Alerts — keep semantic hues, soften backgrounds */
html.app-theme-dark .alert {
  border-color: var(--app-dark-border);
}

/* Badges on dark */
html.app-theme-dark .bg-label-secondary {
  background-color: rgba(133, 146, 163, 0.2) !important;
  color: #c8cdd5 !important;
}

html.app-theme-dark .bg-label-primary {
  background-color: rgba(0, 111, 204, 0.25) !important;
  color: #6eb8ff !important;
}

/*
 * Label success / info (global): CRM main.css uses dark text on translucent tints for .badge.* etc.;
 * specificity must beat .campaign-detail-page .badge.bg-label-success (0,3,0). :is() uses max branch.
 */
html.app-theme-dark
  :is(
    .badge.bg-label-success,
    .badge.rounded-pill.bg-label-success,
    .avatar-initial.bg-label-success,
    .rounded-3.bg-label-success,
    .bg-label-success
  ) {
  background-color: rgba(46, 213, 130, 0.26) !important;
  color: #c4fad9 !important;
}

html.app-theme-dark .bg-label-success.bg-opacity-10 {
  background-color: rgba(46, 213, 130, 0.12) !important;
}

html.app-theme-dark
  :is(
    .badge.bg-label-info,
    .badge.rounded-pill.bg-label-info,
    .avatar-initial.bg-label-info,
    .rounded-3.bg-label-info,
    .bg-label-info
  ) {
  background-color: rgba(62, 201, 255, 0.26) !important;
  color: #c8f5ff !important;
}

html.app-theme-dark .bg-label-info.bg-opacity-10 {
  background-color: rgba(62, 201, 255, 0.12) !important;
}

/* Border utilities */
html.app-theme-dark .border-bottom,
html.app-theme-dark .border-top,
html.app-theme-dark .border-start,
html.app-theme-dark .border-end {
  border-color: var(--app-dark-border) !important;
}

/* Theme toggle button */
html.app-theme-dark .app-theme-toggle-btn.btn-outline-secondary {
  border-color: var(--app-dark-border);
  color: var(--app-dark-text);
}

html.app-theme-dark .app-theme-toggle-btn.btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--app-dark-text-muted);
  color: #fff;
}

.app-theme-toggle__when-dark {
  display: none;
}

html.app-theme-dark .app-theme-toggle__when-light {
  display: none !important;
}

html.app-theme-dark .app-theme-toggle__when-dark {
  display: inline-block !important;
}

/* CRM main.css — upload / spinner */
html.app-theme-dark #drop-area {
  border-color: var(--app-dark-border);
  background-color: rgba(255, 255, 255, 0.03);
}

html.app-theme-dark #drop-area.hover {
  border-color: #006fcc;
  background-color: rgba(0, 111, 204, 0.12);
}

html.app-theme-dark .spinner {
  border-color: var(--app-dark-surface-2);
  border-top-color: #2e93e6;
}

html.app-theme-dark #overlay {
  background: rgba(0, 0, 0, 0.75);
}

/* CRM campaign hero divider */
html.app-theme-dark .campaign-hero-card .campaign-hero-divider {
  color: var(--app-dark-text-muted);
}

/* Campaign detail — readability on dark cards (campaign_detail.html) */
html.app-theme-dark .campaign-detail-page h1.text-heading,
html.app-theme-dark .campaign-detail-page .campaign-hero-aside h2.text-primary {
  color: #fff !important;
}

html.app-theme-dark .campaign-detail-page .campaign-table-card .card-header h2.text-primary {
  color: #fff !important;
}

html.app-theme-dark .campaign-detail-page .btn-outline-primary {
  color: #fff !important;
  border-color: rgba(110, 184, 255, 0.88) !important;
}

html.app-theme-dark .campaign-detail-page .btn-outline-primary:hover,
html.app-theme-dark .campaign-detail-page .btn-outline-primary:focus {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.38) !important;
  border-color: #8ec8ff !important;
}

html.app-theme-dark .campaign-detail-page .btn-outline-primary:active,
html.app-theme-dark .campaign-detail-page .show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.52) !important;
  border-color: #b6d9ff !important;
}

html.app-theme-dark
  .campaign-detail-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .campaign-detail-page .campaign-table-card thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .campaign-detail-page .campaign-table-card thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .campaign-detail-page .campaign-table-card tbody td.table-secondary {
  background-color: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
  border-color: var(--app-dark-border);
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone {
  background: rgba(220, 53, 69, 0.2) !important;
  border-color: rgba(255, 140, 150, 0.75) !important;
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone h2.text-danger {
  color: #ffb3b9 !important;
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone .alert.alert-warning {
  background-color: rgba(255, 193, 7, 0.16) !important;
  color: var(--app-dark-text) !important;
  border: 1px solid rgba(255, 210, 120, 0.45) !important;
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone .alert.alert-warning .alert-heading {
  color: #fff4d6 !important;
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone .btn-outline-danger {
  color: #ffc9cd !important;
  border-color: rgba(255, 130, 145, 0.95) !important;
}

html.app-theme-dark .campaign-detail-page .campaign-danger-zone .btn-outline-danger:hover,
html.app-theme-dark .campaign-detail-page .campaign-danger-zone .btn-outline-danger:focus {
  color: #fff !important;
  background-color: rgba(220, 53, 69, 0.55) !important;
  border-color: #ff8a95 !important;
}

/* Lead list detail (lavalist_detail.html) — primary label badges & outline buttons */
html.app-theme-dark .lavalist-detail-page .btn-outline-primary {
  color: #fff !important;
  border-color: rgba(110, 184, 255, 0.88) !important;
}

html.app-theme-dark .lavalist-detail-page .btn-outline-primary:hover,
html.app-theme-dark .lavalist-detail-page .btn-outline-primary:focus {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.38) !important;
  border-color: #8ec8ff !important;
}

html.app-theme-dark .lavalist-detail-page .btn-outline-primary:active,
html.app-theme-dark .lavalist-detail-page .show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.52) !important;
  border-color: #b6d9ff !important;
}

html.app-theme-dark
  .lavalist-detail-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .lavalist-detail-page .rounded-3.bg-label-primary .text-primary {
  color: #fff !important;
}

/* CSV / source file list (csv_file_list.html, upload_file.html) — headers, names, primary accents */
html.app-theme-dark .csv-file-list-page .card-title .text-primary,
html.app-theme-dark .csv-file-list-page .card-header h5 .text-primary {
  color: #fff !important;
}

html.app-theme-dark
  .csv-file-list-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .csv-file-list-page thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .csv-file-list-page thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .csv-file-list-page .table tbody td a.fw-semibold.text-decoration-none {
  color: #fff !important;
}

html.app-theme-dark .csv-file-list-page .table tbody td a.fw-semibold.text-decoration-none:hover,
html.app-theme-dark .csv-file-list-page .table tbody td a.fw-semibold.text-decoration-none:focus {
  color: #a8d4ff !important;
}

html.app-theme-dark .csv-file-list-page .table tbody td a.fw-semibold.text-decoration-none .text-primary {
  color: #b6d9ff !important;
}

html.app-theme-dark
  .csv-file-list-page
  .table
  tbody
  td
  a.fw-semibold.text-decoration-none:hover
  .text-primary,
html.app-theme-dark
  .csv-file-list-page
  .table
  tbody
  td
  a.fw-semibold.text-decoration-none:focus
  .text-primary {
  color: #d6e9ff !important;
}

/* Client list (client_list.html) — headers, names, primary accents */
html.app-theme-dark .client-list-page .card-title .text-primary {
  color: #fff !important;
}

html.app-theme-dark
  .client-list-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .client-list-page thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .client-list-page thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .client-list-page .table tbody td a.fw-semibold.text-decoration-none {
  color: #fff !important;
}

html.app-theme-dark .client-list-page .table tbody td a.fw-semibold.text-decoration-none:hover,
html.app-theme-dark .client-list-page .table tbody td a.fw-semibold.text-decoration-none:focus {
  color: #a8d4ff !important;
}

html.app-theme-dark .client-list-page .table tbody td a.fw-semibold.text-decoration-none .text-primary {
  color: #b6d9ff !important;
}

html.app-theme-dark
  .client-list-page
  .table
  tbody
  td
  a.fw-semibold.text-decoration-none:hover
  .text-primary,
html.app-theme-dark
  .client-list-page
  .table
  tbody
  td
  a.fw-semibold.text-decoration-none:focus
  .text-primary {
  color: #d6e9ff !important;
}

html.app-theme-dark .client-list-page .table tbody td a.fw-semibold.text-decoration-none .text-secondary {
  color: #c5c9d8 !important;
}

html.app-theme-dark
  .client-list-page
  .table
  tbody
  td
  a.text-decoration-none:not(.fw-semibold) {
  color: #a8d4ff !important;
}

html.app-theme-dark
  .client-list-page
  .table
  tbody
  td
  a.text-decoration-none:not(.fw-semibold):hover,
html.app-theme-dark
  .client-list-page
  .table
  tbody
  td
  a.text-decoration-none:not(.fw-semibold):focus {
  color: #d6e9ff !important;
}

/* Campaign list (campaign_list.html) — headers, names, primary accents */
html.app-theme-dark .campaign-list-page h1.text-heading,
html.app-theme-dark .campaign-list-page h1.text-heading .text-primary {
  color: #fff !important;
}

html.app-theme-dark .campaign-list-page .card-header .text-primary {
  color: #fff !important;
}

html.app-theme-dark
  .campaign-list-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  background-color: rgba(0, 111, 204, 0.38) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

/*
 * Campaign list — label + solid badges: main.css uses dark text on translucent tints on table rows;
 * success/info are global; these stay scoped to the list (Completed, Paused, errors, spam chips).
 */
html.app-theme-dark .campaign-list-page .badge.bg-label-secondary,
html.app-theme-dark .campaign-list-page .badge.rounded-pill.bg-label-secondary {
  background-color: rgba(174, 184, 198, 0.32) !important;
  color: #eef1f6 !important;
  border-color: rgba(200, 210, 225, 0.42) !important;
}

html.app-theme-dark .campaign-list-page .badge.bg-label-danger,
html.app-theme-dark .campaign-list-page .badge.rounded-pill.bg-label-danger {
  background-color: rgba(255, 99, 121, 0.28) !important;
  color: #ffd8dc !important;
  border-color: rgba(255, 160, 172, 0.5) !important;
}

html.app-theme-dark .campaign-list-page .badge.bg-label-warning.text-dark,
html.app-theme-dark .campaign-list-page .badge.rounded-pill.bg-label-warning.text-dark {
  background-color: rgba(255, 210, 120, 0.4) !important;
  color: #1f1a0d !important;
  border-color: rgba(255, 200, 90, 0.55) !important;
}

html.app-theme-dark .campaign-list-page .badge.bg-warning:not(.text-dark) {
  color: #1a1400 !important;
}

html.app-theme-dark .campaign-list-page .badge.bg-secondary {
  background-color: #5c636a !important;
  color: #f4f6f8 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

html.app-theme-dark .campaign-list-page thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .campaign-list-page thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .campaign-list-page a.campaign-list-name {
  color: #fff !important;
}

html.app-theme-dark .campaign-list-page a.campaign-list-name:hover,
html.app-theme-dark .campaign-list-page a.campaign-list-name:focus {
  color: #a8d4ff !important;
}

html.app-theme-dark .campaign-list-page .campaign-list-pct.text-primary {
  color: #e8f2ff !important;
}

html.app-theme-dark .campaign-list-page a.campaign-list-client-link {
  color: #c5c9d8 !important;
}

html.app-theme-dark .campaign-list-page a.campaign-list-client-link:hover,
html.app-theme-dark .campaign-list-page a.campaign-list-client-link:focus {
  color: #e4e6ec !important;
}

html.app-theme-dark .campaign-list-page .campaign-list-hint a {
  color: #a8d4ff !important;
}

html.app-theme-dark .campaign-list-page .campaign-list-hint a:hover,
html.app-theme-dark .campaign-list-page .campaign-list-hint a:focus {
  color: #d6e9ff !important;
}

/* Client detail (client_detail.html) — contrast + dark surfaces for locations/niches */
html.app-theme-dark .client-detail-page h1.text-dark {
  color: #fff !important;
}

html.app-theme-dark .client-detail-page .card-header .text-primary {
  color: #fff !important;
}

html.app-theme-dark .client-detail-page .card-header .text-secondary {
  color: #c5c9d8 !important;
}

html.app-theme-dark
  .client-detail-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .client-detail-page .client-detail-meta a.text-primary {
  color: #a8d4ff !important;
}

html.app-theme-dark .client-detail-page .client-detail-meta a.text-primary:hover,
html.app-theme-dark .client-detail-page .client-detail-meta a.text-primary:focus {
  color: #d6e9ff !important;
}

html.app-theme-dark .client-detail-page .btn-outline-primary {
  color: #fff !important;
  border-color: rgba(110, 184, 255, 0.88) !important;
}

html.app-theme-dark .client-detail-page .btn-outline-primary:hover,
html.app-theme-dark .client-detail-page .btn-outline-primary:focus {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.38) !important;
  border-color: #8ec8ff !important;
}

html.app-theme-dark .client-detail-page .btn-outline-primary:active,
html.app-theme-dark .client-detail-page .show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.52) !important;
  border-color: #b6d9ff !important;
}

html.app-theme-dark .client-detail-page .btn-outline-warning {
  color: #fff4d6 !important;
  border-color: rgba(255, 210, 120, 0.75) !important;
}

html.app-theme-dark .client-detail-page .btn-outline-warning:hover,
html.app-theme-dark .client-detail-page .btn-outline-warning:focus {
  color: #1a1406 !important;
  background-color: rgba(255, 193, 7, 0.42) !important;
  border-color: #ffd666 !important;
}

html.app-theme-dark .client-detail-page .btn-outline-danger {
  color: #ffc9cd !important;
  border-color: rgba(255, 130, 145, 0.9) !important;
}

html.app-theme-dark .client-detail-page .btn-outline-danger:hover,
html.app-theme-dark .client-detail-page .btn-outline-danger:focus {
  color: #fff !important;
  background-color: rgba(220, 53, 69, 0.45) !important;
  border-color: #ff8a95 !important;
}

html.app-theme-dark .client-detail-page thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .client-detail-page thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .client-detail-page .table tbody td a.fw-semibold.text-decoration-none {
  color: #fff !important;
}

html.app-theme-dark .client-detail-page .table tbody td a.fw-semibold.text-decoration-none:hover,
html.app-theme-dark .client-detail-page .table tbody td a.fw-semibold.text-decoration-none:focus {
  color: #a8d4ff !important;
}

/* Associated lists table (lists_list.html on this page) */
html.app-theme-dark .client-detail-page .crm-lists-table thead th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-color: var(--app-dark-border);
}

html.app-theme-dark .client-detail-page .crm-lists-table a.text-primary.fw-bold {
  color: #fff !important;
}

html.app-theme-dark .client-detail-page .crm-lists-table a.text-primary.fw-bold:hover,
html.app-theme-dark .client-detail-page .crm-lists-table a.text-primary.fw-bold:focus {
  color: #a8d4ff !important;
}

html.app-theme-dark .client-detail-page .crm-lists-table a.text-primary.fw-bold .text-primary {
  color: #b6d9ff !important;
}

html.app-theme-dark
  .client-detail-page
  .crm-lists-table
  a.text-primary.fw-bold:hover
  .text-primary,
html.app-theme-dark
  .client-detail-page
  .crm-lists-table
  a.text-primary.fw-bold:focus
  .text-primary {
  color: #d6e9ff !important;
}

/* Target locations & niches — replace harsh bg-light on dark cards */
html.app-theme-dark .client-detail-page .client-detail-scroll-box.bg-light {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--app-dark-text) !important;
  border-color: var(--app-dark-border) !important;
}

html.app-theme-dark .client-detail-page .client-detail-bio-box {
  background-color: rgba(0, 111, 204, 0.16) !important;
  border-color: rgba(110, 184, 255, 0.35) !important;
  color: var(--app-dark-text) !important;
}

/* Lead list create (lavalist_create.html) */
html.app-theme-dark .lavalist-create-page .card-title .text-primary {
  color: #fff !important;
}

html.app-theme-dark .lavalist-create-page .card-header .text-primary {
  color: #fff !important;
}

html.app-theme-dark .lavalist-create-page .card-header .text-success {
  color: #b8f0cc !important;
}

html.app-theme-dark
  .lavalist-create-page
  :is(.badge.bg-label-primary, .badge.rounded-pill.bg-label-primary) {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.32) !important;
}

html.app-theme-dark .lavalist-create-page .badge.bg-label-success.rounded-pill {
  color: #d1f5e0 !important;
  border-color: rgba(72, 180, 97, 0.5) !important;
}

html.app-theme-dark .lavalist-create-page .btn-outline-primary {
  color: #fff !important;
  border-color: rgba(110, 184, 255, 0.88) !important;
}

html.app-theme-dark .lavalist-create-page .btn-outline-primary:hover,
html.app-theme-dark .lavalist-create-page .btn-outline-primary:focus {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.38) !important;
  border-color: #8ec8ff !important;
}

html.app-theme-dark .lavalist-create-page .btn-outline-primary:active,
html.app-theme-dark .lavalist-create-page .show > .btn-outline-primary.dropdown-toggle {
  color: #fff !important;
  background-color: rgba(0, 111, 204, 0.52) !important;
  border-color: #b6d9ff !important;
}

html.app-theme-dark .lavalist-create-page .btn-outline-success {
  color: #d1f5e0 !important;
  border-color: rgba(111, 214, 151, 0.75) !important;
}

html.app-theme-dark .lavalist-create-page .btn-outline-success:hover,
html.app-theme-dark .lavalist-create-page .btn-outline-success:focus {
  color: #0c1f12 !important;
  background-color: rgba(25, 135, 84, 0.42) !important;
  border-color: #7ddea0 !important;
}

/* Filter tab panels — replace harsh bg-light */
html.app-theme-dark .lavalist-create-page .tab-content.border.rounded-3.bg-light.bg-opacity-50 {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--app-dark-border) !important;
  color: var(--app-dark-text);
}

/* Applied filters drop zone — replace white */
html.app-theme-dark .lavalist-create-page .tab-content.border.rounded-3.bg-white {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--app-dark-border) !important;
  color: var(--app-dark-text);
}

html.app-theme-dark .lavalist-create-page #filterSnap {
  background-color: rgba(0, 111, 204, 0.14) !important;
  border-color: rgba(110, 184, 255, 0.35) !important;
}

html.app-theme-dark .lavalist-create-page #filterSnap .badge.bg-label-primary {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

html.app-theme-dark .lavalist-create-page .lavalist-form-nav.list-group {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border) !important;
}

html.app-theme-dark .lavalist-create-page .lavalist-form-nav .list-group-item {
  background-color: transparent;
  color: var(--app-dark-text);
  border-color: var(--app-dark-border);
}

html.app-theme-dark .lavalist-create-page .lavalist-form-nav .list-group-item:hover,
html.app-theme-dark .lavalist-create-page .lavalist-form-nav .list-group-item:focus {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

html.app-theme-dark .lavalist-create-page .collapse .card.border {
  background-color: var(--app-dark-surface);
  border-color: var(--app-dark-border) !important;
}

html.app-theme-dark .lavalist-create-page .collapse .card .card-header {
  background-color: rgba(0, 0, 0, 0.2) !important;
  border-color: var(--app-dark-border) !important;
  color: var(--app-dark-text);
}

/* CRM analytics dashboard (crm/dashboard/dashboard.html + analytics-dashboard.js) */
html.app-theme-dark .crm-analytics-page h1.text-heading,
html.app-theme-dark .crm-analytics-page h1.text-heading .text-primary {
  color: #fff !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-section h2.text-primary {
  color: #fff !important;
}

html.app-theme-dark .crm-analytics-page thead.table-light {
  --bs-table-bg: rgba(255, 255, 255, 0.1);
  --bs-table-color: #fff;
  color: #fff !important;
}

html.app-theme-dark .crm-analytics-page thead.table-light th {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  border-bottom-color: var(--app-dark-border);
}

html.app-theme-dark .crm-analytics-page table.data-table tbody td.text-start a {
  color: #fff !important;
  font-weight: 600;
}

html.app-theme-dark .crm-analytics-page table.data-table tbody td.text-start a:hover,
html.app-theme-dark .crm-analytics-page table.data-table tbody td.text-start a:focus {
  color: #a8d4ff !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-summary .rounded-3.bg-label-primary .text-primary {
  color: #fff !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-summary .rounded-3.bg-label-success .text-success {
  color: #d1f5e0 !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-summary .rounded-3.bg-label-warning .text-warning {
  color: #fff4d6 !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-summary .rounded-3.bg-label-secondary .text-secondary {
  color: #d8dbe8 !important;
}

html.app-theme-dark .crm-analytics-page .crm-analytics-summary .rounded-3.bg-label-info .text-info {
  color: #c5f4fc !important;
}

html.app-theme-dark .crm-analytics-page .chart-wrap.bg-label-secondary.bg-opacity-10 {
  background-color: rgba(255, 255, 255, 0.05) !important;
}
