/*
 * XDEYE dark mode for the whole staff area.
 * Loaded after every other stylesheet (Theme Style colours, custom admin CSS, dashboard CSS),
 * so html[data-itheme="dark"] + !important wins everywhere. Light mode is not touched.
 */
html[data-itheme="dark"] {
    --xd-bg: #0b1020;
    --xd-surface: #111830;
    --xd-surface-2: #162040;
    --xd-surface-3: #1c2850;
    --xd-input: #0d1428;
    --xd-line: #232e52;
    --xd-line-2: #2d3a66;
    --xd-ink: #f1f5f9;
    --xd-text: #cbd5e1;
    --xd-muted: #8b95b0;
    --xd-accent: #3d7bff;
    --xd-accent-soft: rgba(52,211,153, .16);
    color-scheme: dark;
    background: var(--xd-bg) !important;
}

/* ── Page ─────────────────────────────────────────────── */
html[data-itheme="dark"] body,
html[data-itheme="dark"] #wrapper,
html[data-itheme="dark"] .content,
html[data-itheme="dark"] #cds-overview-container,
html[data-itheme="dark"] .cds-dashboard-placeholder,
html[data-itheme="dark"] .screen-options-area,
html[data-itheme="dark"] .page-header { background: var(--xd-bg) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body h1, html[data-itheme="dark"] body h2, html[data-itheme="dark"] body h3,
html[data-itheme="dark"] body h4, html[data-itheme="dark"] body h5, html[data-itheme="dark"] body h6,
html[data-itheme="dark"] body .bold, html[data-itheme="dark"] body strong, html[data-itheme="dark"] body b,
html[data-itheme="dark"] body label, html[data-itheme="dark"] body .control-label { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body p, html[data-itheme="dark"] body span:not([class*="label"]):not([class*="badge"]):not(.m),
html[data-itheme="dark"] body li, html[data-itheme="dark"] body td, html[data-itheme="dark"] body dd, html[data-itheme="dark"] body small { color: inherit; }
html[data-itheme="dark"] body .text-muted, html[data-itheme="dark"] body .text-dark-gray,
html[data-itheme="dark"] body .tw-text-neutral-400, html[data-itheme="dark"] body .tw-text-neutral-500 { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .tw-text-neutral-600, html[data-itheme="dark"] body .tw-text-neutral-700,
html[data-itheme="dark"] body .tw-text-neutral-800, html[data-itheme="dark"] body .tw-text-neutral-900,
html[data-itheme="dark"] body .tw-text-gray-700, html[data-itheme="dark"] body .tw-text-gray-800, html[data-itheme="dark"] body .tw-text-gray-900,
html[data-itheme="dark"] body .text-dark, html[data-itheme="dark"] body .text-black { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body hr { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body a:not(.btn):not(.label):not([class*="text-"]):not([style*="color"]) { color: #4ade80; }
html[data-itheme="dark"] ::selection { background: rgba(52,211,153, .35); }
html[data-itheme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; background: var(--xd-bg); }
html[data-itheme="dark"] ::-webkit-scrollbar-thumb { background: var(--xd-line-2); border-radius: 10px; border: 2px solid var(--xd-bg); }

/* ── Sidebar ──────────────────────────────────────────── */
html[data-itheme="dark"] body #menu,
html[data-itheme="dark"] body aside#menu,
html[data-itheme="dark"] body .sidebar,
html[data-itheme="dark"] body #side-menu,
html[data-itheme="dark"] body #side-menu > li,
html[data-itheme="dark"] body #side-menu .nav-second-level,
html[data-itheme="dark"] body #side-menu .nav-second-level > li { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body #menu { border-right: 1px solid var(--xd-line) !important; }
html[data-itheme="dark"] body #side-menu li a,
html[data-itheme="dark"] body #side-menu li a span,
html[data-itheme="dark"] body #side-menu li a i,
html[data-itheme="dark"] body #side-menu li a .menu-icon { color: var(--xd-text) !important; background: transparent !important; }
html[data-itheme="dark"] body #side-menu li a:hover,
html[data-itheme="dark"] body #side-menu li a:focus { background: var(--xd-surface-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #side-menu > li.active > a,
html[data-itheme="dark"] body #side-menu li ul.collapse li.active > a { background: var(--xd-accent-soft) !important; color: #ffffff !important; font-weight: 600; }
/* The text and icon of the open item sit on the row's colour, with no box of their own */
html[data-itheme="dark"] body #side-menu li.active > a span,
html[data-itheme="dark"] body #side-menu li.active > a i { background: transparent !important; color: #ffffff !important; font-weight: 600; }
html[data-itheme="dark"] body #side-menu > li.active > a { box-shadow: inset 3px 0 0 var(--xd-accent) !important; }
html[data-itheme="dark"] body .sidebar-user-profile,
html[data-itheme="dark"] body .sidebar-user-profile > a,
html[data-itheme="dark"] body .sidebar-user-profile .dropdown-toggle { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }

/* ── Top bar ──────────────────────────────────────────── */
html[data-itheme="dark"] body #header,
html[data-itheme="dark"] body #header .navbar { background: var(--xd-surface) !important; border-bottom: 1px solid var(--xd-line) !important; }
html[data-itheme="dark"] body #header .navbar-nav > li > a,
html[data-itheme="dark"] body #header .navbar-nav > li > a i { color: var(--xd-text) !important; }
html[data-itheme="dark"] body #search_input { background: var(--xd-input) !important; border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }

/* ── Cards, panels, wells ─────────────────────────────── */
html[data-itheme="dark"] body .panel,
html[data-itheme="dark"] body .panel_s,
html[data-itheme="dark"] body .panel-body,
html[data-itheme="dark"] body .panel-heading,
html[data-itheme="dark"] body .panel-footer,
html[data-itheme="dark"] body .well,
html[data-itheme="dark"] body .top_stats_wrapper,
html[data-itheme="dark"] body .widget,
html[data-itheme="dark"] body .card,
html[data-itheme="dark"] body .cds-card,
html[data-itheme="dark"] body .list-group-item,
html[data-itheme="dark"] body .tw-bg-white,
html[data-itheme="dark"] body .bg-white { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .panel_s, html[data-itheme="dark"] body .cds-card { box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.25) !important; }
html[data-itheme="dark"] body .tw-bg-neutral-50, html[data-itheme="dark"] body .tw-bg-neutral-100,
html[data-itheme="dark"] body .tw-bg-gray-50, html[data-itheme="dark"] body .tw-bg-gray-100,
html[data-itheme="dark"] body .tw-bg-slate-50, html[data-itheme="dark"] body .tw-bg-slate-100 { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body [class*="tw-border-neutral"], html[data-itheme="dark"] body [class*="tw-border-gray"],
html[data-itheme="dark"] body [class*="tw-divide-neutral"] > * { border-color: var(--xd-line) !important; }

/* inline light backgrounds written by modules */
html[data-itheme="dark"] body #wrapper [style*="background:#fff"], html[data-itheme="dark"] body #wrapper [style*="background: #fff"],
html[data-itheme="dark"] body #wrapper [style*="background:#ffffff"], html[data-itheme="dark"] body #wrapper [style*="background: #ffffff"],
html[data-itheme="dark"] body #wrapper [style*="background-color:#fff"], html[data-itheme="dark"] body #wrapper [style*="background-color: #fff"],
html[data-itheme="dark"] body #wrapper [style*="background:white"], html[data-itheme="dark"] body #wrapper [style*="background: white"],
html[data-itheme="dark"] body #wrapper [style*="background:#f9fafb"], html[data-itheme="dark"] body #wrapper [style*="background:#f8fafc"],
html[data-itheme="dark"] body #wrapper [style*="background:#f3f4f6"], html[data-itheme="dark"] body #wrapper [style*="background:#f4f4f5"],
html[data-itheme="dark"] body #wrapper [style*="background: #f3f4f6"], html[data-itheme="dark"] body #wrapper [style*="background:#f1f5f9"],
html[data-itheme="dark"] body #wrapper [style*="background:#eff6ff"], html[data-itheme="dark"] body #wrapper [style*="background:#f0f3ff"] { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body #wrapper [style*="color:#374151"], html[data-itheme="dark"] body #wrapper [style*="color: #374151"],
html[data-itheme="dark"] body #wrapper [style*="color:#111827"], html[data-itheme="dark"] body #wrapper [style*="color:#1f2937"],
html[data-itheme="dark"] body #wrapper [style*="color:#1e293b"], html[data-itheme="dark"] body #wrapper [style*="color:#333"],
html[data-itheme="dark"] body #wrapper [style*="color:#000"], html[data-itheme="dark"] body #wrapper [style*="color: #000"] { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #wrapper [style*="color:#6b7280"], html[data-itheme="dark"] body #wrapper [style*="color:#9ca3af"],
html[data-itheme="dark"] body #wrapper [style*="color:#64748b"] { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body #wrapper [style*="border-color:#f0f0f0"], html[data-itheme="dark"] body #wrapper [style*="border:1px solid #e5e7eb"] { border-color: var(--xd-line) !important; }

/* ── Dashboard (custom stats) ─────────────────────────── */
html[data-itheme="dark"] body .cds-tab,
html[data-itheme="dark"] body .cds-external-link,
html[data-itheme="dark"] body .cds-custom-popup,
html[data-itheme="dark"] body [class*="cds-weather-badge"]:not(.cds-weather-badge-temp) { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .cds-tab.active { background: var(--xd-accent) !important; border-color: var(--xd-accent) !important; color: #fff !important; }
html[data-itheme="dark"] body .cds-title, html[data-itheme="dark"] body .cds-header-left h4 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .cds-header-subtitle { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .highcharts-background { fill: transparent !important; }

/* ── Tables ───────────────────────────────────────────── */
html[data-itheme="dark"] body .table, html[data-itheme="dark"] body table.dataTable,
html[data-itheme="dark"] body .table > thead > tr > th, html[data-itheme="dark"] body .table > tbody > tr > td,
html[data-itheme="dark"] body .table > tfoot > tr > td, html[data-itheme="dark"] body table.dataTable thead th { background: transparent !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .table > thead > tr > th, html[data-itheme="dark"] body table.dataTable thead th { color: var(--xd-muted) !important; background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .table-striped > tbody > tr:nth-of-type(odd) > td { background: rgba(255,255,255,.015) !important; }
html[data-itheme="dark"] body .table-hover > tbody > tr:hover > td, html[data-itheme="dark"] body table.dataTable tbody tr:hover > td { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .dataTables_wrapper .dataTables_info, html[data-itheme="dark"] body .dataTables_wrapper .dataTables_length,
html[data-itheme="dark"] body .dataTables_wrapper .dataTables_filter { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .pagination > li > a, html[data-itheme="dark"] body .pagination > li > span { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .pagination > .active > a, html[data-itheme="dark"] body .pagination > .active > span { background: var(--xd-accent) !important; border-color: var(--xd-accent) !important; color: #fff !important; }

/* ── Forms ────────────────────────────────────────────── */
html[data-itheme="dark"] body .form-control, html[data-itheme="dark"] body input[type="text"], html[data-itheme="dark"] body input[type="email"],
html[data-itheme="dark"] body input[type="number"], html[data-itheme="dark"] body input[type="password"], html[data-itheme="dark"] body input[type="search"],
html[data-itheme="dark"] body input[type="date"], html[data-itheme="dark"] body input[type="tel"], html[data-itheme="dark"] body textarea, html[data-itheme="dark"] body select,
html[data-itheme="dark"] body .input-group-addon, html[data-itheme="dark"] body .bootstrap-select > .dropdown-toggle,
html[data-itheme="dark"] body .bootstrap-select .bs-searchbox input, html[data-itheme="dark"] body .select2-container .select2-selection,
html[data-itheme="dark"] body .dataTables_filter input, html[data-itheme="dark"] body .dataTables_length select { background: var(--xd-input) !important; border-color: var(--xd-line-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .form-control::placeholder, html[data-itheme="dark"] body input::placeholder, html[data-itheme="dark"] body textarea::placeholder { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .form-control:focus { border-color: var(--xd-accent) !important; box-shadow: 0 0 0 3px var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .bootstrap-select .filter-option, html[data-itheme="dark"] body .bootstrap-select .filter-option-inner-inner { color: var(--xd-ink) !important; }

/* ── Buttons ──────────────────────────────────────────── */
html[data-itheme="dark"] body .btn-default, html[data-itheme="dark"] body .btn-white, html[data-itheme="dark"] body .btn-secondary { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .btn-default:hover, html[data-itheme="dark"] body .btn-default:focus { background: var(--xd-surface-3) !important; }

/* ── Dropdowns, notifications, popovers, modals ───────── */
html[data-itheme="dark"] body .dropdown-menu,
html[data-itheme="dark"] body .popover, html[data-itheme="dark"] body .popover-content, html[data-itheme="dark"] body .popover-title,
html[data-itheme="dark"] body .modal-content, html[data-itheme="dark"] body .modal-header, html[data-itheme="dark"] body .modal-body, html[data-itheme="dark"] body .modal-footer,
html[data-itheme="dark"] body .daterangepicker, html[data-itheme="dark"] body .datepicker, html[data-itheme="dark"] body .xdsoft_datetimepicker,
html[data-itheme="dark"] body .select2-dropdown, html[data-itheme="dark"] body .tooltip-inner { background: var(--xd-surface) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .dropdown-menu > li > a, html[data-itheme="dark"] body .dropdown-menu li a { color: var(--xd-text) !important; background: transparent !important; }
html[data-itheme="dark"] body .dropdown-menu > li > a:hover, html[data-itheme="dark"] body .dropdown-menu li a:focus,
html[data-itheme="dark"] body .dropdown-menu > .active > a { background: var(--xd-surface-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .dropdown-menu .divider { background: var(--xd-line) !important; }
/* notifications list (unread rows were light blue) */
html[data-itheme="dark"] body .notifications li, html[data-itheme="dark"] body .notifications li > a,
html[data-itheme="dark"] body .notifications .notification-box, html[data-itheme="dark"] body .notifications [class*="unread"],
html[data-itheme="dark"] body #header .dropdown-menu [class*="unread"], html[data-itheme="dark"] body #header .dropdown-menu li { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .notifications [class*="unread"], html[data-itheme="dark"] body #header .dropdown-menu [class*="unread"] { background: var(--xd-surface-2) !important; box-shadow: inset 3px 0 0 var(--xd-accent); }
html[data-itheme="dark"] body .notifications li *, html[data-itheme="dark"] body #header .dropdown-menu li * { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .notifications [class*="unread"] *, html[data-itheme="dark"] body #header .dropdown-menu [class*="unread"] * { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .notifications .text-muted, html[data-itheme="dark"] body .notifications time,
html[data-itheme="dark"] body .notifications [class*="date"] { color: #4ade80 !important; }
html[data-itheme="dark"] body .modal-backdrop.in { opacity: .7; }
html[data-itheme="dark"] body .close { color: var(--xd-ink) !important; opacity: .7; text-shadow: none; }

/* ── Tabs, labels, badges, alerts, kanban ─────────────── */
html[data-itheme="dark"] body .nav-tabs, html[data-itheme="dark"] body .horizontal-tabs { border-color: var(--xd-line) !important; background: transparent !important; }
html[data-itheme="dark"] body .nav-tabs > li > a { color: var(--xd-muted) !important; background: transparent !important; border-color: transparent !important; }
html[data-itheme="dark"] body .nav-tabs > li.active > a, html[data-itheme="dark"] body .nav-tabs > li > a:hover { color: var(--xd-ink) !important; border-bottom-color: var(--xd-accent) !important; }
html[data-itheme="dark"] body .label-default, html[data-itheme="dark"] body .badge:not([style]) { background: var(--xd-surface-3) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .alert-info { background: rgba(52,211,153,.12) !important; border-color: rgba(52,211,153,.35) !important; color: #c7d7ff !important; }
html[data-itheme="dark"] body .alert-success { background: rgba(34,211,166,.1) !important; border-color: rgba(34,211,166,.35) !important; color: #b7f3e3 !important; }
html[data-itheme="dark"] body .alert-warning { background: rgba(255,176,32,.1) !important; border-color: rgba(255,176,32,.35) !important; color: #ffe2a8 !important; }
html[data-itheme="dark"] body .alert-danger { background: rgba(255,93,115,.1) !important; border-color: rgba(255,93,115,.35) !important; color: #ffc4cd !important; }
html[data-itheme="dark"] body .kan-ban-col, html[data-itheme="dark"] body .kan-ban-col .panel-heading,
html[data-itheme="dark"] body .kanban-item, html[data-itheme="dark"] body .kan-ban-content-wrapper { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }

/* ── Setup menu (right-hand panel) ────────────────────── */
html[data-itheme="dark"] body #setup-menu-wrapper,
html[data-itheme="dark"] body #setup-menu,
html[data-itheme="dark"] body #setup-menu > div { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body #setup-menu-wrapper { border-left: 1px solid var(--xd-line) !important; box-shadow: -18px 0 40px rgba(0,0,0,.35) !important; }
html[data-itheme="dark"] body #setup-menu .customizer-heading { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #setup-menu .close-customizer { color: var(--xd-muted) !important; background: transparent !important; }
html[data-itheme="dark"] body #setup-menu > li,
html[data-itheme="dark"] body #setup-menu > li:first-child,
html[data-itheme="dark"] body #setup-menu li .nav-second-level,
html[data-itheme="dark"] body #setup-menu li .nav-second-level > li { background: transparent !important; border-color: var(--xd-line) !important; box-shadow: none !important; }
html[data-itheme="dark"] body #setup-menu li a,
html[data-itheme="dark"] body #setup-menu li a span,
html[data-itheme="dark"] body #setup-menu li a i { background: var(--xd-surface-2) !important; color: var(--xd-text) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body #setup-menu li .nav-second-level li a,
html[data-itheme="dark"] body #setup-menu li .nav-second-level li a span { background: transparent !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body #setup-menu li a:hover,
html[data-itheme="dark"] body #setup-menu li a:hover span,
html[data-itheme="dark"] body #setup-menu li a:focus,
html[data-itheme="dark"] body #setup-menu li .nav-second-level li a:hover { background: var(--xd-surface-3) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #setup-menu li.active > a,
html[data-itheme="dark"] body #setup-menu li.active > a span,
html[data-itheme="dark"] body #setup-menu li .nav-second-level li.active > a { background: var(--xd-accent-soft) !important; color: #ffffff !important; }
html[data-itheme="dark"] body #setup-menu .badge { background: var(--xd-surface-3) !important; color: var(--xd-ink) !important; }

/* ── Menu badges: white numbers in light and dark mode ── */
html[data-itheme] body #side-menu .badge, html[data-itheme] body #side-menu .badge *,
html[data-itheme] body #side-menu [class*="menu-badge"], html[data-itheme] body #side-menu li a span.badge,
html[data-itheme] body #setup-menu .badge { color: #ffffff !important; font-weight: 700 !important; }

/* ── XDEYE yellow accent (from the logo) in dark mode ── */
html[data-itheme="dark"] { --xd-yellow: #ffcc00; }
html[data-itheme="dark"] body .sidebar-user-profile .profile .tw-font-semibold { color: var(--xd-yellow) !important; }
html[data-itheme="dark"] body .sidebar-user-profile .profile { border-color: rgba(255, 204, 0, .28) !important; }
html[data-itheme="dark"] body .sidebar-user-profile .profile:hover { border-color: rgba(255, 204, 0, .55) !important; }
html[data-itheme="dark"] body .sidebar-user-profile .staff-profile-image-small { box-shadow: 0 0 0 2px var(--xd-yellow) !important; }
html[data-itheme="dark"] body #header .hide-menu,
html[data-itheme="dark"] body #header .hide-menu i,
html[data-itheme="dark"] body #header .hide-menu svg { color: var(--xd-yellow) !important; }
html[data-itheme="dark"] body #header .hide-menu:hover { background: rgba(255, 204, 0, .12) !important; }

/* ── Menu shine (light and dark): active item + Vexa AI ── */
html[data-itheme] body #side-menu > li > a { position: relative; overflow: hidden; }
/* active item: flowing gradient edge and a soft sheen */
html[data-itheme] body #side-menu > li.active > a { box-shadow: none !important; }
html[data-itheme] body #side-menu > li.active > a::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #16a34a, #0d9488, #00c2ff, #16a34a); background-size: 100% 300%;
  animation: xd-menu-flow 4s ease-in-out infinite; }
html[data-itheme] body #side-menu > li.active > a::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(13,148,136, .14) 50%, transparent 65%); background-size: 250% 100%;
  animation: xd-menu-sheen 5s ease-in-out infinite; }
html[data-itheme="dark"] body #side-menu > li.active > a::after { background-image: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .09) 50%, transparent 65%); }
/* Vexa AI: gradient name and icon, glowing AI chip */
html[data-itheme] body #side-menu > li.menu-item-crm-ai > a .menu-text,
html[data-itheme] body #side-menu > li.menu-item-crm-ai > a i.menu-icon {
  background: linear-gradient(90deg, #16a34a, #0d9488, #ff5da2, #0d9488, #16a34a) !important; background-size: 250% 100% !important;
  -webkit-background-clip: text !important; background-clip: text !important; color: transparent !important; -webkit-text-fill-color: transparent !important;
  animation: xd-menu-ai 6s linear infinite; font-weight: 600; }
html[data-itheme="dark"] body #side-menu > li.menu-item-crm-ai > a .menu-text,
html[data-itheme="dark"] body #side-menu > li.menu-item-crm-ai > a i.menu-icon { background: linear-gradient(90deg, #4ade80, #b9a6ff, #ff9fc4, #b9a6ff, #4ade80) !important; background-size: 250% 100% !important; -webkit-background-clip: text !important; background-clip: text !important; }
html[data-itheme] body #side-menu > li.menu-item-crm-ai > a .menu-text::after {
  content: "AI"; display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 999px; vertical-align: 1px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: #fff; -webkit-text-fill-color: #fff;
  background: linear-gradient(135deg, #16a34a, #0d9488); box-shadow: 0 0 0 0 rgba(13,148,136, .55);
  animation: xd-menu-glow 2.4s ease-out infinite; }
@keyframes xd-menu-flow { 0%, 100% { background-position: 50% 0%; } 50% { background-position: 50% 100%; } }
@keyframes xd-menu-sheen { 0%, 55% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes xd-menu-ai { to { background-position: -250% 0; } }
@keyframes xd-menu-glow { 0% { box-shadow: 0 0 0 0 rgba(13,148,136, .55); } 80%, 100% { box-shadow: 0 0 0 6px rgba(13,148,136, 0); } }
@media (prefers-reduced-motion: reduce) {
  html[data-itheme] body #side-menu > li > a::before, html[data-itheme] body #side-menu > li > a::after,
  html[data-itheme] body #side-menu > li.menu-item-crm-ai > a .menu-text, html[data-itheme] body #side-menu > li.menu-item-crm-ai > a i.menu-icon,
  html[data-itheme] body #side-menu > li.menu-item-crm-ai > a .menu-text::after { animation: none !important; } }

/* ── Dashboard weather chips: readable in dark mode ── */
html[data-itheme="dark"] body .cds-weather-badge { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .cds-weather-badge-city { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .cds-weather-badge-temp { color: #ffffff !important; font-weight: 700 !important; }
html[data-itheme="dark"] body .cds-weather-badge-sep { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .cds-weather-message { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #cds-weather-strip { border-bottom: 0 !important; }

/* ── Setup > Menu Setup (drag-and-drop menu builder) ─── */
html[data-itheme="dark"] body .dd .dd3-content,
html[data-itheme="dark"] body .dd .sub-items .dd3-content { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .dd .dd3-handle,
html[data-itheme="dark"] body .dd .dd-handle { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .dd .dd3-handle:hover { background: var(--xd-surface-3) !important; }
html[data-itheme="dark"] body .dd .dd3-handle:before,
html[data-itheme="dark"] body .dd .dd-item > button:before { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .dd .toggle-menu-options,
html[data-itheme="dark"] body .dd .toggle-menu-options i { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .dd .toggle-menu-options:hover i { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .dd .menu-options { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .dd-placeholder { background: var(--xd-accent-soft) !important; border: 1px dashed var(--xd-accent) !important; }
html[data-itheme="dark"] body .dd-dragel .dd3-content { background: var(--xd-surface-3) !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .45) !important; }

/* ── Inline-style catch-all for the whole page (modals, drawers and fixed bars sit outside #wrapper).
   Case-insensitive, with and without a space after the colon. Tints keep their meaning. */
html[data-itheme="dark"] body [style*="background:#fff" i],
html[data-itheme="dark"] body [style*="background: #fff" i],
html[data-itheme="dark"] body [style*="background-color:#fff" i],
html[data-itheme="dark"] body [style*="background-color: #fff" i],
html[data-itheme="dark"] body [style*="background:#ffffff" i],
html[data-itheme="dark"] body [style*="background: #ffffff" i],
html[data-itheme="dark"] body [style*="background-color:#ffffff" i],
html[data-itheme="dark"] body [style*="background-color: #ffffff" i],
html[data-itheme="dark"] body [style*="background:white" i],
html[data-itheme="dark"] body [style*="background: white" i],
html[data-itheme="dark"] body [style*="background-color:white" i],
html[data-itheme="dark"] body [style*="background-color: white" i],
html[data-itheme="dark"] body [style*="background:#fafafa" i],
html[data-itheme="dark"] body [style*="background: #fafafa" i],
html[data-itheme="dark"] body [style*="background-color:#fafafa" i],
html[data-itheme="dark"] body [style*="background-color: #fafafa" i],
html[data-itheme="dark"] body [style*="background:#fafbfc" i],
html[data-itheme="dark"] body [style*="background: #fafbfc" i],
html[data-itheme="dark"] body [style*="background-color:#fafbfc" i],
html[data-itheme="dark"] body [style*="background-color: #fafbfc" i],
html[data-itheme="dark"] body [style*="background:#f5f5f5" i],
html[data-itheme="dark"] body [style*="background: #f5f5f5" i],
html[data-itheme="dark"] body [style*="background-color:#f5f5f5" i],
html[data-itheme="dark"] body [style*="background-color: #f5f5f5" i],
html[data-itheme="dark"] body [style*="background:#f7f7f7" i],
html[data-itheme="dark"] body [style*="background: #f7f7f7" i],
html[data-itheme="dark"] body [style*="background-color:#f7f7f7" i],
html[data-itheme="dark"] body [style*="background-color: #f7f7f7" i],
html[data-itheme="dark"] body [style*="background:#f8f9fa" i],
html[data-itheme="dark"] body [style*="background: #f8f9fa" i],
html[data-itheme="dark"] body [style*="background-color:#f8f9fa" i],
html[data-itheme="dark"] body [style*="background-color: #f8f9fa" i],
html[data-itheme="dark"] body [style*="background:#f9fafb" i],
html[data-itheme="dark"] body [style*="background: #f9fafb" i],
html[data-itheme="dark"] body [style*="background-color:#f9fafb" i],
html[data-itheme="dark"] body [style*="background-color: #f9fafb" i],
html[data-itheme="dark"] body [style*="background:#fcfcfc" i],
html[data-itheme="dark"] body [style*="background: #fcfcfc" i],
html[data-itheme="dark"] body [style*="background-color:#fcfcfc" i],
html[data-itheme="dark"] body [style*="background-color: #fcfcfc" i],
html[data-itheme="dark"] body [style*="background:#f8fafc" i],
html[data-itheme="dark"] body [style*="background: #f8fafc" i],
html[data-itheme="dark"] body [style*="background-color:#f8fafc" i],
html[data-itheme="dark"] body [style*="background-color: #f8fafc" i],
html[data-itheme="dark"] body [style*="background:#f3f4f6" i],
html[data-itheme="dark"] body [style*="background: #f3f4f6" i],
html[data-itheme="dark"] body [style*="background-color:#f3f4f6" i],
html[data-itheme="dark"] body [style*="background-color: #f3f4f6" i],
html[data-itheme="dark"] body [style*="background:#f4f4f5" i],
html[data-itheme="dark"] body [style*="background: #f4f4f5" i],
html[data-itheme="dark"] body [style*="background-color:#f4f4f5" i],
html[data-itheme="dark"] body [style*="background-color: #f4f4f5" i],
html[data-itheme="dark"] body [style*="background:#f1f5f9" i],
html[data-itheme="dark"] body [style*="background: #f1f5f9" i],
html[data-itheme="dark"] body [style*="background-color:#f1f5f9" i],
html[data-itheme="dark"] body [style*="background-color: #f1f5f9" i],
html[data-itheme="dark"] body [style*="background:#edf2f7" i],
html[data-itheme="dark"] body [style*="background: #edf2f7" i],
html[data-itheme="dark"] body [style*="background-color:#edf2f7" i],
html[data-itheme="dark"] body [style*="background-color: #edf2f7" i],
html[data-itheme="dark"] body [style*="background:#eef3fc" i],
html[data-itheme="dark"] body [style*="background: #eef3fc" i],
html[data-itheme="dark"] body [style*="background-color:#eef3fc" i],
html[data-itheme="dark"] body [style*="background-color: #eef3fc" i],
html[data-itheme="dark"] body [style*="background:#f0f3ff" i],
html[data-itheme="dark"] body [style*="background: #f0f3ff" i],
html[data-itheme="dark"] body [style*="background-color:#f0f3ff" i],
html[data-itheme="dark"] body [style*="background-color: #f0f3ff" i],
html[data-itheme="dark"] body [style*="background:#f8fbff" i],
html[data-itheme="dark"] body [style*="background: #f8fbff" i],
html[data-itheme="dark"] body [style*="background-color:#f8fbff" i],
html[data-itheme="dark"] body [style*="background-color: #f8fbff" i],
html[data-itheme="dark"] body [style*="background:#eee" i],
html[data-itheme="dark"] body [style*="background: #eee" i],
html[data-itheme="dark"] body [style*="background-color:#eee" i],
html[data-itheme="dark"] body [style*="background-color: #eee" i],
html[data-itheme="dark"] body [style*="background:#eeeeee" i],
html[data-itheme="dark"] body [style*="background: #eeeeee" i],
html[data-itheme="dark"] body [style*="background-color:#eeeeee" i],
html[data-itheme="dark"] body [style*="background-color: #eeeeee" i],
html[data-itheme="dark"] body [style*="background:#f0f0f0" i],
html[data-itheme="dark"] body [style*="background: #f0f0f0" i],
html[data-itheme="dark"] body [style*="background-color:#f0f0f0" i],
html[data-itheme="dark"] body [style*="background-color: #f0f0f0" i]
 { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body [style*="background:#e5e7eb" i],
html[data-itheme="dark"] body [style*="background: #e5e7eb" i],
html[data-itheme="dark"] body [style*="background-color:#e5e7eb" i],
html[data-itheme="dark"] body [style*="background-color: #e5e7eb" i],
html[data-itheme="dark"] body [style*="background:#e2e8f0" i],
html[data-itheme="dark"] body [style*="background: #e2e8f0" i],
html[data-itheme="dark"] body [style*="background-color:#e2e8f0" i],
html[data-itheme="dark"] body [style*="background-color: #e2e8f0" i],
html[data-itheme="dark"] body [style*="background:#cbd5e0" i],
html[data-itheme="dark"] body [style*="background: #cbd5e0" i],
html[data-itheme="dark"] body [style*="background-color:#cbd5e0" i],
html[data-itheme="dark"] body [style*="background-color: #cbd5e0" i],
html[data-itheme="dark"] body [style*="background:#cbd5e1" i],
html[data-itheme="dark"] body [style*="background: #cbd5e1" i],
html[data-itheme="dark"] body [style*="background-color:#cbd5e1" i],
html[data-itheme="dark"] body [style*="background-color: #cbd5e1" i],
html[data-itheme="dark"] body [style*="background:#ddd" i],
html[data-itheme="dark"] body [style*="background: #ddd" i],
html[data-itheme="dark"] body [style*="background-color:#ddd" i],
html[data-itheme="dark"] body [style*="background-color: #ddd" i],
html[data-itheme="dark"] body [style*="background:#dddddd" i],
html[data-itheme="dark"] body [style*="background: #dddddd" i],
html[data-itheme="dark"] body [style*="background-color:#dddddd" i],
html[data-itheme="dark"] body [style*="background-color: #dddddd" i]
 { background: var(--xd-line) !important; }
html[data-itheme="dark"] body [style*="background:#eff6ff" i],
html[data-itheme="dark"] body [style*="background: #eff6ff" i],
html[data-itheme="dark"] body [style*="background-color:#eff6ff" i],
html[data-itheme="dark"] body [style*="background-color: #eff6ff" i],
html[data-itheme="dark"] body [style*="background:#f0f9ff" i],
html[data-itheme="dark"] body [style*="background: #f0f9ff" i],
html[data-itheme="dark"] body [style*="background-color:#f0f9ff" i],
html[data-itheme="dark"] body [style*="background-color: #f0f9ff" i],
html[data-itheme="dark"] body [style*="background:#eaf1ff" i],
html[data-itheme="dark"] body [style*="background: #eaf1ff" i],
html[data-itheme="dark"] body [style*="background-color:#eaf1ff" i],
html[data-itheme="dark"] body [style*="background-color: #eaf1ff" i],
html[data-itheme="dark"] body [style*="background:#dbeafe" i],
html[data-itheme="dark"] body [style*="background: #dbeafe" i],
html[data-itheme="dark"] body [style*="background-color:#dbeafe" i],
html[data-itheme="dark"] body [style*="background-color: #dbeafe" i]
 { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body [style*="background:#ecfdf5" i],
html[data-itheme="dark"] body [style*="background: #ecfdf5" i],
html[data-itheme="dark"] body [style*="background-color:#ecfdf5" i],
html[data-itheme="dark"] body [style*="background-color: #ecfdf5" i],
html[data-itheme="dark"] body [style*="background:#f0fdf4" i],
html[data-itheme="dark"] body [style*="background: #f0fdf4" i],
html[data-itheme="dark"] body [style*="background-color:#f0fdf4" i],
html[data-itheme="dark"] body [style*="background-color: #f0fdf4" i],
html[data-itheme="dark"] body [style*="background:#dcfce7" i],
html[data-itheme="dark"] body [style*="background: #dcfce7" i],
html[data-itheme="dark"] body [style*="background-color:#dcfce7" i],
html[data-itheme="dark"] body [style*="background-color: #dcfce7" i],
html[data-itheme="dark"] body [style*="background:#cff5e1" i],
html[data-itheme="dark"] body [style*="background: #cff5e1" i],
html[data-itheme="dark"] body [style*="background-color:#cff5e1" i],
html[data-itheme="dark"] body [style*="background-color: #cff5e1" i]
 { background: rgba(16,185,129,.12) !important; }
html[data-itheme="dark"] body [style*="background:#fef2f2" i],
html[data-itheme="dark"] body [style*="background: #fef2f2" i],
html[data-itheme="dark"] body [style*="background-color:#fef2f2" i],
html[data-itheme="dark"] body [style*="background-color: #fef2f2" i],
html[data-itheme="dark"] body [style*="background:#fff8f8" i],
html[data-itheme="dark"] body [style*="background: #fff8f8" i],
html[data-itheme="dark"] body [style*="background-color:#fff8f8" i],
html[data-itheme="dark"] body [style*="background-color: #fff8f8" i],
html[data-itheme="dark"] body [style*="background:#fff7f7" i],
html[data-itheme="dark"] body [style*="background: #fff7f7" i],
html[data-itheme="dark"] body [style*="background-color:#fff7f7" i],
html[data-itheme="dark"] body [style*="background-color: #fff7f7" i],
html[data-itheme="dark"] body [style*="background:#fff1f2" i],
html[data-itheme="dark"] body [style*="background: #fff1f2" i],
html[data-itheme="dark"] body [style*="background-color:#fff1f2" i],
html[data-itheme="dark"] body [style*="background-color: #fff1f2" i],
html[data-itheme="dark"] body [style*="background:#fee2e2" i],
html[data-itheme="dark"] body [style*="background: #fee2e2" i],
html[data-itheme="dark"] body [style*="background-color:#fee2e2" i],
html[data-itheme="dark"] body [style*="background-color: #fee2e2" i]
 { background: rgba(239,68,68,.12) !important; }
html[data-itheme="dark"] body [style*="background:#fffbeb" i],
html[data-itheme="dark"] body [style*="background: #fffbeb" i],
html[data-itheme="dark"] body [style*="background-color:#fffbeb" i],
html[data-itheme="dark"] body [style*="background-color: #fffbeb" i],
html[data-itheme="dark"] body [style*="background:#fff7ed" i],
html[data-itheme="dark"] body [style*="background: #fff7ed" i],
html[data-itheme="dark"] body [style*="background-color:#fff7ed" i],
html[data-itheme="dark"] body [style*="background-color: #fff7ed" i],
html[data-itheme="dark"] body [style*="background:#fffbf0" i],
html[data-itheme="dark"] body [style*="background: #fffbf0" i],
html[data-itheme="dark"] body [style*="background-color:#fffbf0" i],
html[data-itheme="dark"] body [style*="background-color: #fffbf0" i],
html[data-itheme="dark"] body [style*="background:#fef3c7" i],
html[data-itheme="dark"] body [style*="background: #fef3c7" i],
html[data-itheme="dark"] body [style*="background-color:#fef3c7" i],
html[data-itheme="dark"] body [style*="background-color: #fef3c7" i]
 { background: rgba(245,158,11,.14) !important; }
html[data-itheme="dark"] body [style*="color:#000" i],
html[data-itheme="dark"] body [style*="color: #000" i],
html[data-itheme="dark"] body [style*="color:#111" i],
html[data-itheme="dark"] body [style*="color: #111" i],
html[data-itheme="dark"] body [style*="color:#111827" i],
html[data-itheme="dark"] body [style*="color: #111827" i],
html[data-itheme="dark"] body [style*="color:#0f172a" i],
html[data-itheme="dark"] body [style*="color: #0f172a" i],
html[data-itheme="dark"] body [style*="color:#1f2937" i],
html[data-itheme="dark"] body [style*="color: #1f2937" i],
html[data-itheme="dark"] body [style*="color:#1e293b" i],
html[data-itheme="dark"] body [style*="color: #1e293b" i],
html[data-itheme="dark"] body [style*="color:#1e2235" i],
html[data-itheme="dark"] body [style*="color: #1e2235" i],
html[data-itheme="dark"] body [style*="color:#1a202c" i],
html[data-itheme="dark"] body [style*="color: #1a202c" i],
html[data-itheme="dark"] body [style*="color:#222" i],
html[data-itheme="dark"] body [style*="color: #222" i],
html[data-itheme="dark"] body [style*="color:#2d3748" i],
html[data-itheme="dark"] body [style*="color: #2d3748" i],
html[data-itheme="dark"] body [style*="color:#333" i],
html[data-itheme="dark"] body [style*="color: #333" i],
html[data-itheme="dark"] body [style*="color:#334155" i],
html[data-itheme="dark"] body [style*="color: #334155" i],
html[data-itheme="dark"] body [style*="color:#374151" i],
html[data-itheme="dark"] body [style*="color: #374151" i]
 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body [style*="color:#444" i],
html[data-itheme="dark"] body [style*="color: #444" i],
html[data-itheme="dark"] body [style*="color:#475569" i],
html[data-itheme="dark"] body [style*="color: #475569" i],
html[data-itheme="dark"] body [style*="color:#4a5568" i],
html[data-itheme="dark"] body [style*="color: #4a5568" i],
html[data-itheme="dark"] body [style*="color:#555" i],
html[data-itheme="dark"] body [style*="color: #555" i],
html[data-itheme="dark"] body [style*="color:#666" i],
html[data-itheme="dark"] body [style*="color: #666" i],
html[data-itheme="dark"] body [style*="color:#6b7280" i],
html[data-itheme="dark"] body [style*="color: #6b7280" i],
html[data-itheme="dark"] body [style*="color:#64748b" i],
html[data-itheme="dark"] body [style*="color: #64748b" i],
html[data-itheme="dark"] body [style*="color:#718096" i],
html[data-itheme="dark"] body [style*="color: #718096" i],
html[data-itheme="dark"] body [style*="color:#777" i],
html[data-itheme="dark"] body [style*="color: #777" i],
html[data-itheme="dark"] body [style*="color:#888" i],
html[data-itheme="dark"] body [style*="color: #888" i],
html[data-itheme="dark"] body [style*="color:#94a3b8" i],
html[data-itheme="dark"] body [style*="color: #94a3b8" i],
html[data-itheme="dark"] body [style*="color:#999" i],
html[data-itheme="dark"] body [style*="color: #999" i],
html[data-itheme="dark"] body [style*="color:#9ca3af" i],
html[data-itheme="dark"] body [style*="color: #9ca3af" i],
html[data-itheme="dark"] body [style*="color:#a0aec0" i],
html[data-itheme="dark"] body [style*="color: #a0aec0" i]
 { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body [style*="border:1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border: 1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #e5e7eb" i],
html[data-itheme="dark"] body [style*="border:1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border: 1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #e2e8f0" i],
html[data-itheme="dark"] body [style*="border:1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border: 1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #cbd5e0" i],
html[data-itheme="dark"] body [style*="border:1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border: 1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #cbd5e1" i],
html[data-itheme="dark"] body [style*="border:1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border: 1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #ddd" i],
html[data-itheme="dark"] body [style*="border:1px solid #eee" i],
html[data-itheme="dark"] body [style*="border: 1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #eee" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #eee" i],
html[data-itheme="dark"] body [style*="border:1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border: 1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #e8e8e8" i],
html[data-itheme="dark"] body [style*="border:1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border: 1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #e8eaed" i],
html[data-itheme="dark"] body [style*="border:1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border: 1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #f0f0f0" i],
html[data-itheme="dark"] body [style*="border:1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border: 1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #f1f5f9" i],
html[data-itheme="dark"] body [style*="border:1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border: 1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-top:1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-top: 1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-bottom:1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-bottom: 1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-left:1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-left: 1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-right:1px solid #d1d5db" i],
html[data-itheme="dark"] body [style*="border-right: 1px solid #d1d5db" i]
 { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body [style*="border-color:#e5e7eb" i],
html[data-itheme="dark"] body [style*="border-color: #e5e7eb" i],
html[data-itheme="dark"] body [style*="border-color:#e2e8f0" i],
html[data-itheme="dark"] body [style*="border-color: #e2e8f0" i],
html[data-itheme="dark"] body [style*="border-color:#cbd5e0" i],
html[data-itheme="dark"] body [style*="border-color: #cbd5e0" i],
html[data-itheme="dark"] body [style*="border-color:#cbd5e1" i],
html[data-itheme="dark"] body [style*="border-color: #cbd5e1" i],
html[data-itheme="dark"] body [style*="border-color:#ddd" i],
html[data-itheme="dark"] body [style*="border-color: #ddd" i],
html[data-itheme="dark"] body [style*="border-color:#eee" i],
html[data-itheme="dark"] body [style*="border-color: #eee" i],
html[data-itheme="dark"] body [style*="border-color:#e8e8e8" i],
html[data-itheme="dark"] body [style*="border-color: #e8e8e8" i],
html[data-itheme="dark"] body [style*="border-color:#f0f0f0" i],
html[data-itheme="dark"] body [style*="border-color: #f0f0f0" i],
html[data-itheme="dark"] body [style*="border-color:#d1d5db" i],
html[data-itheme="dark"] body [style*="border-color: #d1d5db" i],
html[data-itheme="dark"] body [style*="border-color:#f2dede" i],
html[data-itheme="dark"] body [style*="border-color: #f2dede" i],
html[data-itheme="dark"] body [style*="border-color:#f7e1a3" i],
html[data-itheme="dark"] body [style*="border-color: #f7e1a3" i],
html[data-itheme="dark"] body [style*="border-color:#bae6fd" i],
html[data-itheme="dark"] body [style*="border-color: #bae6fd" i]
 { border-color: var(--xd-line) !important; }

/* ── Communication Center ─────────────────────────────── */
/* Call / SMS report pagination */
html[data-itheme="dark"] body .pagination-info a { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .pagination-info a:hover { color: #4ade80 !important; }
html[data-itheme="dark"] body .pagination-page { color: var(--xd-muted) !important; }
/* Notification cards outside the Notifications page (profile tab / widget) */
html[data-itheme="dark"] body .notif-column-title { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .notif-column-title .mark-read-link { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .notification-card { background: var(--xd-surface) !important; box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25) !important; }
html[data-itheme="dark"] body .notification-card.unread-card { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .notification-card .notif-desc { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .notification-card .notif-meta, html[data-itheme="dark"] body .notification-card .notif-time { color: var(--xd-muted) !important; }
/* Settings page sections */
html[data-itheme="dark"] body .settings-section { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .settings-section-header { background: var(--xd-surface-2) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .settings-section-header h5 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .settings-section-header .section-desc, html[data-itheme="dark"] body .field-help { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .input-with-toggle .toggle-pass { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .input-with-toggle .toggle-pass:hover { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .webhook-row { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .webhook-row .webhook-label { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .webhook-row .webhook-url { color: var(--xd-ink) !important; }
/* Follow-up Sequences (blue hero stays) */
html[data-itheme="dark"] body .seq-stat-card,
html[data-itheme="dark"] body .seq-form-card,
html[data-itheme="dark"] body .seq-timing-widget,
html[data-itheme="dark"] body .seq-stage-widget,
html[data-itheme="dark"] body .seq-msg-panel { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-form-header,
html[data-itheme="dark"] body .seq-msg-panel-head { background: var(--xd-surface-2) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-sidebar { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-tpl-panel,
html[data-itheme="dark"] body .seq-timing-unit-wrap { background: var(--xd-input) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-sidebar-divider { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-stat-num,
html[data-itheme="dark"] body .seq-form-header-text h4,
html[data-itheme="dark"] body .seq-msg-panel-title,
html[data-itheme="dark"] body .seq-timing-unit-wrap input[type=number],
html[data-itheme="dark"] body .seq-sidebar .control-label,
html[data-itheme="dark"] body .seq-main-area .control-label { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .seq-stat-label, html[data-itheme="dark"] body .seq-form-header-text p,
html[data-itheme="dark"] body .seq-timing-label, html[data-itheme="dark"] body .seq-timing-unit-tag,
html[data-itheme="dark"] body .seq-timing-at, html[data-itheme="dark"] body .seq-stage-tag,
html[data-itheme="dark"] body .seq-save-bar .note-text, html[data-itheme="dark"] body .seq-merge-link { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .seq-sidebar .form-control, html[data-itheme="dark"] body .seq-main-area .form-control,
html[data-itheme="dark"] body .seq-stage-row select.form-control { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .seq-form-header-icon,
html[data-itheme="dark"] body .seq-stat-icon-wrap.color-blue,
html[data-itheme="dark"] body .seq-stat-icon-wrap.color-indigo,
html[data-itheme="dark"] body .seq-stat-icon-wrap.color-teal { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .seq-channel-pill { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .seq-channel-pill.is-active { background: var(--xd-accent-soft) !important; border-color: var(--xd-accent) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .seq-channel-pill.email-pill.is-active { background: rgba(8,145,178,.16) !important; border-color: #0891b2 !important; color: #67e8f9 !important; }
html[data-itheme="dark"] body .seq-info-note { background: var(--xd-accent-soft) !important; border-color: rgba(52,211,153,.35) !important; color: var(--xd-text) !important; }
/* Email campaign wizard (the email preview canvas stays white) */
html[data-itheme="dark"] body .campaign-steps,
html[data-itheme="dark"] body .filter-type-btn,
html[data-itheme="dark"] body .template-card-footer { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .campaign-step:not(.completed):not(.active) .step-number { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .step-label, html[data-itheme="dark"] body .campaign-title { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .filter-type-btn.active, html[data-itheme="dark"] body .filter-type-btn:hover { background: var(--xd-accent-soft) !important; border-color: var(--xd-accent) !important; }
html[data-itheme="dark"] body .template-card-preview { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .merge-fields-panel { background: rgba(245,158,11,.1) !important; border-color: rgba(245,158,11,.3) !important; }
html[data-itheme="dark"] body .merge-field-pill:not(:hover) { background: rgba(245,158,11,.16) !important; color: #fcd34d !important; }
/* Positive responses settings */
html[data-itheme="dark"] body .automation-guide-title,
html[data-itheme="dark"] body .reply-flow-title,
html[data-itheme="dark"] body .selected-step-copy strong { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .reply-flow-builder,
html[data-itheme="dark"] body .selected-step-banner { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .reply-step-card { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .reply-step-card.active { border-color: var(--xd-accent) !important; box-shadow: 0 0 0 3px var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .reply-flow-subtitle { color: var(--xd-muted) !important; }
/* Older SMS report widgets */
html[data-itheme="dark"] body .sms-widget { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .sms-widget .metric { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .sms-widget .metric .count { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .sms-widget .sms-title, html[data-itheme="dark"] body .sms-widget .metric .label { color: var(--xd-muted) !important; }

/* ── Announcements Plus (blue hero stays) ─────────────── */
html[data-itheme="dark"] body .ml-page { --ml-ink: var(--xd-ink); --ml-muted: var(--xd-muted); --ml-line: var(--xd-line); }
html[data-itheme="dark"] body:has(.ml-page) { background: var(--xd-bg) !important; }
html[data-itheme="dark"] body .ml-btn-light { background: var(--xd-surface) !important; border-color: var(--xd-surface) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .ml-btn-light:hover { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .ml-kpi { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ml-kpi-bar { background: var(--xd-surface-3) !important; }
html[data-itheme="dark"] body .ml-panel { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ml-panel .table > thead > tr > th { background: var(--xd-surface-2) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ml-panel .table > tbody > tr > td { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ml-panel .table > tbody > tr:hover > td { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .ml-panel .pagination > li > a, html[data-itheme="dark"] body .ml-panel .pagination > li > span { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .an-tab { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .an-tab span, html[data-itheme="dark"] body .an-chip { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .an-tab.is-active { background: var(--xd-accent) !important; border-color: var(--xd-accent) !important; color: #fff !important; }
html[data-itheme="dark"] body .an-tab.is-active span { background: rgba(255,255,255,.22) !important; color: #fff !important; }
html[data-itheme="dark"] body .an-search input { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .an-card { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .an-new { background: color-mix(in srgb, var(--ann) 22%, var(--xd-surface)) !important; }
html[data-itheme="dark"] body .an-chip-portal, html[data-itheme="dark"] body .anf-where span + span { background: rgba(16,185,129,.12) !important; color: #6ee7b7 !important; }
html[data-itheme="dark"] body .an-chip-ended { background: rgba(239,68,68,.12) !important; color: #fecaca !important; }
html[data-itheme="dark"] body .an-live { background: rgba(16,185,129,.14) !important; color: #6ee7b7 !important; }
html[data-itheme="dark"] body .an-foot { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .an-actions a:hover, html[data-itheme="dark"] body .an-empty-icon { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .an-actions a.an-del:hover { background: rgba(239,68,68,.12) !important; color: #fecaca !important; }
html[data-itheme="dark"] body .anf-main .form-control, html[data-itheme="dark"] body .anf-row .form-control,
html[data-itheme="dark"] body .anf-people .bootstrap-select > .dropdown-toggle { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .anf-main .tox-tinymce { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .anf-main .control-label, html[data-itheme="dark"] body .anf-check,
html[data-itheme="dark"] body .anf-info-label, html[data-itheme="dark"] body .anf-color .so-ann-color-field > .control-label { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .anf-label, html[data-itheme="dark"] body .anf-row label { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .anf-seg, html[data-itheme="dark"] body .anf-toggle-icon { background: var(--xd-surface-2) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .anf-seg label.is-on span { background: var(--xd-surface-3) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .anf-toggle:has(input:checked) .anf-toggle-icon { background: var(--xd-accent) !important; color: #fff !important; }
html[data-itheme="dark"] body .anf-tag { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .anf-repeat-summary { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .anf-warn { background: rgba(245,158,11,.14) !important; color: #fcd34d !important; }
html[data-itheme="dark"] body .anf-preview { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
/* Announcement shown on a page (staff side) */
html[data-itheme="dark"] body .so-ann-body { background: var(--xd-surface) !important; border-color: color-mix(in srgb, var(--ann) 35%, var(--xd-line)) !important; }
html[data-itheme="dark"] body .so-ann-chip.is-open { background: var(--xd-surface) !important; }
html[data-itheme="dark"] body .so-ann-head h4 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .so-ann-text { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .so-ann-head small, html[data-itheme="dark"] body .so-ann-tools a { color: var(--xd-muted) !important; }

/* ── Setup Hub ────────────────────────────────────────── */
html[data-itheme="dark"] body .xdsh-title, html[data-itheme="dark"] body .xdsh-cat-title,
html[data-itheme="dark"] body .xdsh-drawer-title, html[data-itheme="dark"] body .xdsh-help-icon { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xdsh-subtitle, html[data-itheme="dark"] body .xdsh-legend-pill,
html[data-itheme="dark"] body .xdsh-cat-desc, html[data-itheme="dark"] body .xdsh-drawer-desc,
html[data-itheme="dark"] body .xdsh-sdr-count, html[data-itheme="dark"] body .xdsh-no-results,
html[data-itheme="dark"] body .xdsh-item-desc, html[data-itheme="dark"] body .xdsh-sdr-desc { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .xdsh-item-name { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .xdsh-item, html[data-itheme="dark"] body .xdsh-sdr-item, html[data-itheme="dark"] body .xdsh-sdr-name,
html[data-itheme="dark"] body .xdsh-ditem, html[data-itheme="dark"] body .xdsh-ditem-name,
html[data-itheme="dark"] body .xdsh-cog-dd-title, html[data-itheme="dark"] body .xdsh-cog-label,
html[data-itheme="dark"] body #xdsh-ss-dd a { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xdsh-item:hover, html[data-itheme="dark"] body .xdsh-sdr-item:hover,
html[data-itheme="dark"] body .xdsh-ditem:hover, html[data-itheme="dark"] body #xdsh-ss-dd a:hover { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .xdsh-cat-card,
html[data-itheme="dark"] body .xdsh-cog-btn,
html[data-itheme="dark"] body .xdsh-cog-dropdown,
html[data-itheme="dark"] body .xdsh-sdr,
html[data-itheme="dark"] body .xdsh-drawer { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xdsh-cog-btn { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .xdsh-search { background: var(--xd-input) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xdsh-search-wrap { box-shadow: 0 0 0 1px var(--xd-line), 0 8px 28px rgba(0,0,0,.35) !important; }
html[data-itheme="dark"] body .xdsh-search-shortcut, html[data-itheme="dark"] body .xdsh-legend-pill b,
html[data-itheme="dark"] body .xdsh-item-panel-tag { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .xdsh-filter-btn, html[data-itheme="dark"] body .xdsh-feat-btn,
html[data-itheme="dark"] body .xdsh-all-btn { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .xdsh-filter-btn.active { background: var(--xd-accent) !important; border-color: var(--xd-accent) !important; color: #fff !important; }
html[data-itheme="dark"] body .xdsh-divider { background: var(--xd-line) !important; }
html[data-itheme="dark"] body .xdsh-card-footer, html[data-itheme="dark"] body .xdsh-sdr-head,
html[data-itheme="dark"] body .xdsh-drawer-head { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xdsh-ditem-icon { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xdsh-sdr-close:hover, html[data-itheme="dark"] body .xdsh-drawer-close:hover { background: var(--xd-surface-2) !important; color: var(--xd-ink) !important; }

/* ── Mailbox: legacy stylesheet lights ────────────────── */
html[data-itheme="dark"] body .dt-button-collection li, html[data-itheme="dark"] body .dt-button-collection li a { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .dt-button-collection li:hover, html[data-itheme="dark"] body .dt-button-collection li a:hover,
html[data-itheme="dark"] body .mailbox-tags-nav .mailbox-tag-item a:hover { background-color: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .table-mailbox a { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .email-autocomplete .receipts { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }

/* ── Vexa AI floating widget (leftovers; header stays white on blue) ── */
html[data-itheme="dark"] body .kbc-typing { background: #18213f !important; }
html[data-itheme="dark"] body .kbc-voice-note { background: rgba(245,158,11,.14) !important; border-color: rgba(245,158,11,.35) !important; color: #fcd34d !important; }
html[data-itheme="dark"] body .kbc-source-link { background: var(--xd-surface) !important; border-color: var(--xd-line-2) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .kbc-source-link:hover { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .kbc-source-link.is-static { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .kbc-sources-label, html[data-itheme="dark"] body .kbc-source-type { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .kbc-sugg-label { border-top-color: var(--xd-line) !important; }

/* ── Dashboard filters and popups (cards / tabs above) ── */
html[data-itheme="dark"] body .cds-global-loader-text { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body #crm-dash-filter-label { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body #cds-master-range,
html[data-itheme="dark"] body .cds-card-filter,
html[data-itheme="dark"] body .cds-custom-popup input[type="date"] { background-color: var(--xd-input) !important; border-color: var(--xd-line-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .cds-master-filter-content { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .cds-custom-popup-title { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .cds-custom-popup-label { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .cds-spark { background: var(--xd-surface-3) !important; }
html[data-itheme="dark"] body .cds-card-custom-btn { border-color: var(--xd-line-2) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .cds-card-custom-btn:hover, html[data-itheme="dark"] body .cds-card-custom-btn.active { background: var(--xd-accent-soft) !important; border-color: var(--xd-accent) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body a.cds-tab-reporthub { background: transparent !important; color: #a9c3ff !important; border-color: rgba(52,211,153,.35) !important; }

/* ── Website: page editor (staff). The visual builder and the live page are not themed. ── */
html[data-itheme="dark"] body .mwp-page-header h4, html[data-itheme="dark"] body .mwp-sec-info strong,
html[data-itheme="dark"] body .mwp-info-list li strong, html[data-itheme="dark"] body .mwp-form-block-title,
html[data-itheme="dark"] body .mwp-social-preview-title, html[data-itheme="dark"] body .mwp-pub-title,
html[data-itheme="dark"] body .mwp-pub-status-main { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-social-preview-desc, html[data-itheme="dark"] body .mwp-form-empty,
html[data-itheme="dark"] body .mwp-pub-status-sub { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .mwp-divider { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-form-block-card, html[data-itheme="dark"] body .mwp-upload-box,
html[data-itheme="dark"] body .mwp-sb-card, html[data-itheme="dark"] body .mwp-attr-view,
html[data-itheme="dark"] body .mwp-structure-pill-soft { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-form-empty { border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .mwp-social-preview { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-social-preview-image { background-color: var(--xd-surface-3) !important; }
html[data-itheme="dark"] body .mwp-social-preview-body { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-upload-remove, html[data-itheme="dark"] body .mwp-cta-color-swatch { background-color: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-structure-block.tone-primary { background: linear-gradient(135deg, rgba(52,211,153,.22), rgba(52,211,153,.08)) !important; border-color: rgba(52,211,153,.35) !important; }
html[data-itheme="dark"] body .mwp-structure-block.tone-accent { background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(99,102,241,.08)) !important; border-color: rgba(99,102,241,.35) !important; }
html[data-itheme="dark"] body .mwp-structure-block.tone-success { background: linear-gradient(135deg, rgba(16,185,129,.2), rgba(16,185,129,.07)) !important; border-color: rgba(16,185,129,.32) !important; }
html[data-itheme="dark"] body .mwp-structure-block.tone-warm { background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(245,158,11,.07)) !important; border-color: rgba(245,158,11,.32) !important; }
html[data-itheme="dark"] body .mwp-structure-block.tone-neutral,
html[data-itheme="dark"] body .mwp-structure-block.tone-soft { background: linear-gradient(135deg, var(--xd-surface-3), var(--xd-surface-2)) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-pub-badge--live, html[data-itheme="dark"] body .mwp-pub-status-icon--live { background: rgba(16,185,129,.14) !important; color: #6ee7b7 !important; }
html[data-itheme="dark"] body .mwp-pub-badge--draft, html[data-itheme="dark"] body .mwp-pub-status-icon--draft { background: rgba(245,158,11,.14) !important; color: #fcd34d !important; }
html[data-itheme="dark"] body .my-website-delete-modal .modal-header { background: rgba(239,68,68,.12) !important; border-bottom-color: rgba(239,68,68,.3) !important; }

/* ── Security: Update Security page ───────────────────── */
html[data-itheme="dark"] body .xds-tabs { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .xds-tab { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .xds-tab:hover, html[data-itheme="dark"] body .xds-tab-active { background: var(--xd-surface-3) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .xds-step-title { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xds-step-desc, html[data-itheme="dark"] body .xds-diff-file { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .xds-diff-col + .xds-diff-col { border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xds-patch-meta-host { background: var(--xd-surface-2) !important; border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xds-patch-meta-block + .xds-patch-meta-block { border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xds-diff-remove, html[data-itheme="dark"] body .xds-git-unknown { background: rgba(239,68,68,.12) !important; }
html[data-itheme="dark"] body .xds-diff-remove .xds-diff-label { background: rgba(239,68,68,.2) !important; color: #fecaca !important; }
html[data-itheme="dark"] body .xds-git-known { background: var(--xd-surface) !important; }
html[data-itheme="dark"] body .xds-alert-warn { background: rgba(245,158,11,.14) !important; color: #fcd34d !important; border-color: rgba(245,158,11,.35) !important; }

/* ── Mobile app settings (the app preview inside the phone frame keeps its own colours) ── */
html[data-itheme="dark"] body .mws-section { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mws-section-head { background: var(--xd-surface-2) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mws-section-head h5 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mws-section-head p, html[data-itheme="dark"] body .mws-field > label,
html[data-itheme="dark"] body .mws-label, html[data-itheme="dark"] body .mws-section-icon { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .mws-check { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mws-field .form-control { border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xd-color-wrap { background: var(--xd-input) !important; border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .xd-upload-btn { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .xd-upload-btn:hover { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .xd-media-item { background-color: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .xd-preview-frame { border-color: var(--xd-line) !important; box-shadow: 0 8px 28px rgba(0,0,0,.35) !important; }

/* ── Leads / customers list: activity bubbles and popups (unread red stays) ── */
html[data-itheme="dark"] body .lc-activity-bubble, html[data-itheme="dark"] body .cc-activity-bubble { background: var(--xd-surface-3) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .lc-activity-bubble:hover, html[data-itheme="dark"] body .cc-activity-bubble:hover,
html[data-itheme="dark"] body .lc-activity-bubble.is-open, html[data-itheme="dark"] body .cc-activity-bubble.is-open { background: var(--xd-line-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .lc-activity-bubble.is-unread, html[data-itheme="dark"] body .cc-activity-bubble.is-unread { background: #dc2626 !important; color: #fff !important; }
html[data-itheme="dark"] body .lc-activity-bubble.is-unread:hover, html[data-itheme="dark"] body .cc-activity-bubble.is-unread:hover { background: #b91c1c !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody tr.lc-has-unread > td,
html[data-itheme="dark"] body #clients_wrapper table.table-clients tbody tr.cc-has-unread > td,
html[data-itheme="dark"] body table.table-leads tbody tr.lc-activity-row-open > td,
html[data-itheme="dark"] body table.table-clients tbody tr.cc-activity-row-open > td { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody tr.lc-has-unread.lc-is-new > td { background: rgba(16,185,129,.12) !important; }
html[data-itheme="dark"] body .lc-activity-popup, html[data-itheme="dark"] body .cc-activity-popup,
html[data-itheme="dark"] body .lc-activity-popup::before, html[data-itheme="dark"] body .cc-activity-popup::before { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .lc-activity-popup { box-shadow: 0 14px 36px rgba(0,0,0,.45) !important; }
html[data-itheme="dark"] body .lc-activity-popup-sub, html[data-itheme="dark"] body .cc-activity-popup-sub,
html[data-itheme="dark"] body .lc-activity-empty, html[data-itheme="dark"] body .cc-activity-empty,
html[data-itheme="dark"] body .lc-activity-legend, html[data-itheme="dark"] body .cc-activity-legend { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .lc-activity-item:not(:last-child)::before, html[data-itheme="dark"] body .cc-activity-item:not(:last-child)::before { background: var(--xd-line) !important; }
html[data-itheme="dark"] body .lc-activity-icon { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }

/* ── Shared stat cards (Leads, Customers, Website, Campaigns, SMS…; Appointments has its own) ── */
html[data-itheme="dark"] body .xd-stat-box { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; box-shadow: none !important; }
html[data-itheme="dark"] body .xd-stat-label { background: var(--xd-surface-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .xd-stat-num, html[data-itheme="dark"] body .xd-stat-name { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .xd-stat-sub, html[data-itheme="dark"] body .xd-stat-meta { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .xd-stat-blue .xd-stat-label, html[data-itheme="dark"] body .xd-stat-box.s-total-email .xd-stat-label,
html[data-itheme="dark"] body .xd-stat-box.s-sent-email .xd-stat-label { background: hsl(218 83% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-green .xd-stat-label, html[data-itheme="dark"] body .xd-stat-box.s-executed-email .xd-stat-label,
html[data-itheme="dark"] body .xd-stat-box.s-clicks-email .xd-stat-label { background: hsl(141 46% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-orange .xd-stat-label, html[data-itheme="dark"] body .xd-stat-amber .xd-stat-label,
html[data-itheme="dark"] body .xd-stat-box.s-opens-email .xd-stat-label { background: hsl(31 90% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-purple .xd-stat-label { background: hsl(264 90% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-red .xd-stat-label { background: hsl(0 90% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-pink .xd-stat-label { background: hsl(330 80% 50% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-teal .xd-stat-label { background: hsl(180 60% 45% / .16) !important; }
html[data-itheme="dark"] body .xd-stat-gray .xd-stat-label, html[data-itheme="dark"] body .xd-stat-box.s-pending-email .xd-stat-label { background: var(--xd-input) !important; }

/* ── Shared tab bars (.app-tab-bar) ───────────────────── */
html[data-itheme="dark"] body .app-tab-bar { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .app-tab-btn { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .app-tab-btn:hover, html[data-itheme="dark"] body .app-tab-btn:focus { background: var(--xd-surface-3) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .app-tab-btn.active, html[data-itheme="dark"] body .app-tab-btn:active { background: var(--xd-surface) !important; color: #a9c3ff !important; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.3) !important; }
html[data-itheme="dark"] body .app-tab-btn:not(.active) .app-tab-badge { background: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .app-tab-content { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }

/* ── Communication Center: provider cards ─────────────── */
html[data-itheme="dark"] body .comm-provider-card { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .comm-provider-card.active, html[data-itheme="dark"] body .comm-provider-card.configured { background: rgba(82,196,26,.12) !important; border-color: #52c41a !important; }
html[data-itheme="dark"] body .comm-provider-card .provider-name { color: var(--xd-ink) !important; }

/* ── Website page editor: sections, sidebar, template structure ── */
html[data-itheme="dark"] body .mwp-section, html[data-itheme="dark"] body .mwp-sb-card { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-section-head, html[data-itheme="dark"] body .mwp-sb-head { background: var(--xd-surface-2) !important; border-bottom-color: var(--xd-line) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-section-head h5 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-section-head p { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .mwp-section-body .form-control { border-color: var(--xd-line) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-section-body .form-group label { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mwp-pub-status-row { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-structure-frame, html[data-itheme="dark"] body .mwp-structure-window,
html[data-itheme="dark"] body .mwp-structure-shell, html[data-itheme="dark"] body .mwp-structure-item { background: var(--xd-surface) !important; border-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-structure-window-bar, html[data-itheme="dark"] body .mwp-structure-note,
html[data-itheme="dark"] body .mwp-structure-details summary { background: var(--xd-surface-2) !important; border-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mwp-structure-fixed { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mwp-structure-fixed.is-muted { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .mwp-structure-dot { background: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .mwp-structure-item-code { background: rgba(255,255,255,.08) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-structure-pill { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .mwp-structure-pill-soft { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mwp-structure-title, html[data-itheme="dark"] body .mwp-structure-item-label { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-structure-desc, html[data-itheme="dark"] body .mwp-structure-window-title,
html[data-itheme="dark"] body .mwp-structure-details summary::after { color: var(--xd-muted) !important; }

/* ── Announcements form toggles ───────────────────────── */
html[data-itheme="dark"] body .anf-toggle { border-color: var(--xd-line) !important; background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .anf-toggle:has(input:checked) { border-color: rgba(52,211,153,.5) !important; background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .anf-toggle-text small { color: var(--xd-muted) !important; }

/* ── Setup Hub section titles ─────────────────────────── */
html[data-itheme="dark"] body .xdsh-section-title { color: var(--xd-ink) !important; }

/* ── Mobile app settings: upload cards ────────────────── */
html[data-itheme="dark"] body .xd-upload-card-box { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .xd-upload-card-box:hover { background: var(--xd-accent-soft) !important; border-color: var(--xd-accent) !important; }
html[data-itheme="dark"] body .xd-upload-card-label { color: var(--xd-text) !important; }

/* ── Intake field settings table ──────────────────────── */
html[data-itheme="dark"] body .ifs-table th { background: var(--xd-surface-2) !important; color: var(--xd-muted) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ifs-table td { border-bottom-color: var(--xd-line) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .ifs-table tr:hover td { background: var(--xd-surface-2) !important; }

/* ── Live Chat settings: flow builder (the visitor widget preview stays light) ── */
html[data-itheme="dark"] body .fb-toolbar { background: var(--xd-surface) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .fb-toolbar .fb-flow-title { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .fb-toolbar-hint, html[data-itheme="dark"] body .fb-node-opt { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .fb-canvas-wrap { background-color: var(--xd-bg) !important; background-image: radial-gradient(rgba(148,163,184,.18) 1px, transparent 1px) !important; }
html[data-itheme="dark"] body .fb-node-card, html[data-itheme="dark"] body .fb-start-node { background: var(--xd-surface) !important; }
html[data-itheme="dark"] body .fb-node-card { border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .fb-node.selected .fb-node-card { border-color: #0ea5e9 !important; }
html[data-itheme="dark"] body .fb-node-header { background: var(--xd-accent-soft) !important; }
html[data-itheme="dark"] body .fb-start-node-hdr { background: rgba(16,185,129,.14) !important; color: #6ee7b7 !important; }
html[data-itheme="dark"] body .fb-node-body { color: var(--xd-text) !important; border-top-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .fb-node-belongs { background: var(--xd-surface-2) !important; color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .fb-node-opt-dot { background: var(--xd-line-2) !important; }

/* ── Website: list and editor action buttons ──────────── */
html[data-itheme="dark"] body .mw-action-btn, html[data-itheme="dark"] body .mw-action-btn span,
html[data-itheme="dark"] body .mwp-pub-action, html[data-itheme="dark"] body .mwp-pub-action span { color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mw-action-btn, html[data-itheme="dark"] body .mwp-pub-action { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; }
html[data-itheme="dark"] body .mw-action-btn:hover, html[data-itheme="dark"] body .mwp-pub-action:hover { background: var(--xd-surface-3) !important; }
html[data-itheme="dark"] body .mwp-pub-action i { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-primary { background: var(--xd-accent) !important; border-color: var(--xd-accent) !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-primary, html[data-itheme="dark"] body .mw-action-btn.mw-action-primary span { color: #fff !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-success { background: rgba(16,185,129,.12) !important; border-color: rgba(16,185,129,.4) !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-success, html[data-itheme="dark"] body .mw-action-btn.mw-action-success span { color: #6ee7b7 !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-danger { background: rgba(239,68,68,.12) !important; border-color: rgba(239,68,68,.4) !important; }
html[data-itheme="dark"] body .mw-action-btn.mw-action-danger, html[data-itheme="dark"] body .mw-action-btn.mw-action-danger span { color: #fecaca !important; }
html[data-itheme="dark"] body .mwp-tab-section-title { color: var(--xd-muted) !important; border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .mwp-structure-code { color: var(--xd-ink) !important; }

/* ── Intake field settings tabs ───────────────────────── */
html[data-itheme="dark"] body .ifs-tabs { border-bottom-color: var(--xd-line) !important; }
html[data-itheme="dark"] body .ifs-tab { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body .ifs-tab.active, html[data-itheme="dark"] body .ifs-tab.active span { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body .ifs-tab:hover:not(.active) { background: var(--xd-surface-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .ifs-tab-wrap.ifs-tab-off .ifs-tab { background: var(--xd-surface-2) !important; color: var(--xd-muted) !important; }

/* ── Live Chat settings: the visitor widget preview stays light, so keep its text dark ── */
html[data-itheme="dark"] body .cb-widget-preview .cb-prev-cta-text { color: #374151 !important; }
html[data-itheme="dark"] body .cb-widget-preview .cb-prev-powered { color: #6b7280 !important; }

/* ── Inline dark-blue text and cyan tints ─────────────── */
html[data-itheme="dark"] body [style*="color:#1d4ed8" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]), html[data-itheme="dark"] body [style*="color: #1d4ed8" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]),
html[data-itheme="dark"] body [style*="color:#1e40af" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]), html[data-itheme="dark"] body [style*="color: #1e40af" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]),
html[data-itheme="dark"] body [style*="color:#1e3a8a" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]), html[data-itheme="dark"] body [style*="color: #1e3a8a" i]:not([style*="background-color:#1" i]):not([style*="background-color: #1" i]) { color: #a9c3ff !important; }
html[data-itheme="dark"] body [style*="background:#ecfeff" i], html[data-itheme="dark"] body [style*="background: #ecfeff" i],
html[data-itheme="dark"] body [style*="background-color:#ecfeff" i], html[data-itheme="dark"] body [style*="background-color: #ecfeff" i] { background: rgba(6,182,212,.14) !important; }

/* ── Leads list: source chips, dates, row hover ───────── */
html[data-itheme="dark"] body .lc-source-chip { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody td .is-date { color: var(--xd-muted) !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody tr:hover > td { background: var(--xd-surface-2) !important; }
html[data-itheme="dark"] body .mwp-structure-code { background: rgba(255,255,255,.08) !important; }

/* ── Tables loading: dark placeholder rows instead of the white image ── */
html[data-itheme="dark"] body .table-loading {
    background-color: transparent !important;
    background-image: repeating-linear-gradient(180deg, var(--xd-surface-2) 0 30px, transparent 30px 52px), linear-gradient(90deg, transparent 0, rgba(255,255,255,.05) 50%, transparent 100%) !important;
    background-size: 100% 156px, 40% 156px !important;
    background-repeat: no-repeat !important;
    background-position: 0 0, -40% 0 !important;
    animation: xd-dark-shimmer 1.3s linear infinite;
}
@keyframes xd-dark-shimmer { to { background-position: 0 0, 140% 0; } }
@media (prefers-reduced-motion: reduce) { html[data-itheme="dark"] body .table-loading { animation: none; } }

/* ── Website editor: block header and content backup buttons ── */
html[data-itheme="dark"] body .mwp-sec-hdr { background: linear-gradient(135deg, rgba(52,211,153,.14), var(--xd-surface-2)) !important; border-color: rgba(52,211,153,.3) !important; }
html[data-itheme="dark"] body .mwp-pub-bk-btn { background: var(--xd-surface-2) !important; border-color: var(--xd-line-2) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body .mwp-pub-bk-btn:hover { background: var(--xd-surface-3) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .mwp-pub-bk-btn--danger { color: #fca5a5 !important; }
html[data-itheme="dark"] body .mwp-pub-bk-btn--danger:hover { background: rgba(239,68,68,.12) !important; border-color: rgba(239,68,68,.4) !important; color: #fecaca !important; }

/* ── Leads: status pills keep their colour as a dark tint; contact buttons; lead window headings ── */
html[data-itheme="dark"] body a.label[class*="lead-status-"] {
    background: color-mix(in srgb, currentColor 14%, transparent) !important;
    border-color: color-mix(in srgb, currentColor 40%, transparent) !important;
}
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody td ul.list-inline li > a { background: var(--xd-surface-3) !important; color: var(--xd-text) !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody td ul.list-inline li > a:hover { background: var(--xd-accent-soft) !important; color: #a9c3ff !important; }
html[data-itheme="dark"] body #leads_wrapper table.table-leads tbody td .staff-profile-image-small { box-shadow: 0 0 0 2px var(--xd-surface), 0 0 0 3px var(--xd-line-2) !important; }
html[data-itheme="dark"] body .lead-info-heading { background: var(--xd-surface-2) !important; color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .lead-info-heading h4 { color: var(--xd-ink) !important; }
html[data-itheme="dark"] body .call-result.answered, html[data-itheme="dark"] body .call-result.missed, html[data-itheme="dark"] body .call-result.voicemail { color: #fff !important; }
