/* ============================================================
   MsgBurst Dark Theme — app shell
   Injected by nav.js on every app-shell page. Light is default;
   dark consumes the neutral slate tokens from design-system.css
   (html[data-theme="dark"] block). Channel colors, status colors
   and brand-green accents are preserved.
   ============================================================ */

/* --- theme toggle button (renders in both themes) --- */
#theme-toggle {
  min-width: 38px;
  min-height: 34px;
  margin-right: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}
#theme-toggle:hover {
  border-color: var(--mb-brand);
  background: var(--mb-surface-hover);
}
html[data-theme="dark"] #theme-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] #theme-toggle:hover {
  border-color: var(--mb-brand-light);
  background: #243349;
}

/* --- canvas & base text --- */
html[data-theme="dark"] {
  --beautiful-bg: #0b1120;
  --beautiful-card-bg: #131c30;
  --mb-canvas: #0b1120;
  --mb-surface: #131c30;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-container,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] main.container {
  background: #0b1120 !important;
  color: #e2e8f0;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5 {
  color: #f1f5f9;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] .text-muted {
  color: #cbd5e1;
}

/* --- topbar --- */
html[data-theme="dark"] #topbar,
html[data-theme="dark"] .topbar {
  background: rgba(13, 18, 32, 0.96) !important;
  border-bottom: 1px solid #1e293b;
}
html[data-theme="dark"] .topbar-title { color: #f1f5f9; }
html[data-theme="dark"] .menu-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .balance-display {
  background: #3a2d0a;
  border-color: var(--mb-billing);
  color: #fcd34d;
}
html[data-theme="dark"] .logout-btn,
html[data-theme="dark"] #logout-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .logout-btn:hover,
html[data-theme="dark"] #logout-btn:hover {
  border-color: var(--error);
  color: #fca5a5;
}

/* --- cards & panels (generic + home-console) --- */
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .cc-kpi-card,
html[data-theme="dark"] .cc-status-card,
html[data-theme="dark"] .cex-card,
html[data-theme="dark"] .contact-panel,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .cc-table-wrap {
  background: #131c30;
  border-color: #243349;
  box-shadow: none;
  color: #e2e8f0;
}
html[data-theme="dark"] .cc-kpi-card,
html[data-theme="dark"] .cc-status-card,
html[data-theme="dark"] .cex-card,
html[data-theme="dark"] .contact-panel {
  background: #131c30;
  border-color: #243349;
  box-shadow: none;
}
html[data-theme="dark"] .home-console .home-console-hero,
html[data-theme="dark"] .home-console .cc-head.home-console-hero {
  background: linear-gradient(135deg, #16213a 0%, #0f2a22 48%, #12203a 100%) !important;
  border-color: rgba(18, 140, 126, 0.25);
}
html[data-theme="dark"] .home-console-kicker {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .topbar .campaign-monitor-btn,
html[data-theme="dark"] .topbar .campaign-monitor-refresh,
html[data-theme="dark"] .campaign-monitor-btn,
html[data-theme="dark"] .campaign-monitor-refresh {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .topbar .logout-btn,
html[data-theme="dark"] .topbar .btn-logout,
html[data-theme="dark"] .topbar button[data-logout] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .home-console .cc-kpi-card,
html[data-theme="dark"] .home-console .cc-status-card,
html[data-theme="dark"] .home-console .cex-card,
html[data-theme="dark"] .home-console .contact-panel {
  background: #131c30;
}
html[data-theme="dark"] .platform-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .platform-card .platform-title,
html[data-theme="dark"] .platform-card .platform-status {
  color: #f1f5f9;
}
/* channel icon wrappers keep their channel colors */
html[data-theme="dark"] .cc-kpi-label,
html[data-theme="dark"] .cc-kpi-value {
  color: #f1f5f9;
}

/* --- inputs --- */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}
html[data-theme="dark"] label,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .form-label {
  color: #cbd5e1;
}

/* --- tables --- */
html[data-theme="dark"] table thead th,
html[data-theme="dark"] .table-wrap thead th,
html[data-theme="dark"] .cc-table-wrap thead th {
  background: #101a2e;
  color: #94a3b8;
  border-color: #243349;
}
html[data-theme="dark"] table td,
html[data-theme="dark"] .table-wrap td,
html[data-theme="dark"] .cc-table-wrap td {
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* --- buttons (secondary surfaces) --- */
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-ghost {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-ghost:hover {
  border-color: var(--mb-brand-light);
  background: #243349;
  color: #f1f5f9;
}

/* --- tabs & pills --- */
html[data-theme="dark"] .cc-tabs button,
html[data-theme="dark"] .nav-tabs .nav-link {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .cc-tabs button.active,
html[data-theme="dark"] .nav-tabs .nav-link.active {
  background: var(--mb-brand);
  border-color: var(--mb-brand);
  color: #ffffff;
}
html[data-theme="dark"] .badge,
html[data-theme="dark"] .pill {
  color: #e2e8f0;
}

/* --- modals & dialogs --- */
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dialog,
html[data-theme="dark"] .cs-modal .cs-modal-inner {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}

/* --- scrollbars (webkit) --- */
html[data-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 6px;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0f172a;
}

/* --- settings console specifics --- */
html[data-theme="dark"] .settings-console .settings-hero,
html[data-theme="dark"] .settings-console .settings-kicker {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .settings-console .sender-mode-option,
html[data-theme="dark"] .settings-console .sender-legacy-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .settings-console .sender-mode-option.is-active {
  background: linear-gradient(180deg, rgba(13, 139, 111, 0.22), #1e293b);
  border-color: var(--mb-brand);
}
html[data-theme="dark"] .sender-readiness,
html[data-theme="dark"] .meta-readiness-items {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .sender-method-line,
html[data-theme="dark"] .sender-readiness p {
  color: #cbd5e1;
}
html[data-theme="dark"] .settings-status-tile {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .settings-status-tile span,
html[data-theme="dark"] .settings-status-tile small {
  color: #94a3b8;
}
html[data-theme="dark"] .settings-status-tile strong {
  color: #f1f5f9;
}

/* --- console pages: email-bulk / telegram-bulk / contacts / inbox --- */

/* topbar: beat beautiful-ui's !important light rules (background, border, color) */
html[data-theme="dark"] .topbar .balance-display,
html[data-theme="dark"] .topbar .balance-badge {
  background: #3a2d0a !important;
  border-color: var(--mb-billing) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .topbar .logout-btn,
html[data-theme="dark"] .topbar .btn-logout,
html[data-theme="dark"] .topbar button[data-logout] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .campaign-monitor-dropdown {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .campaign-monitor-dropdown a,
html[data-theme="dark"] .campaign-monitor-dropdown .cm-item {
  color: #cbd5e1;
}
html[data-theme="dark"] .campaign-monitor-head {
  background: #1e293b;
  border-color: #243349;
}
html[data-theme="dark"] .campaign-monitor-head strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .campaign-monitor-head small {
  color: #94a3b8;
}
html[data-theme="dark"] .campaign-console .chat-hero,
html[data-theme="dark"] .crm-console .chat-hero,
html[data-theme="dark"] .chat-page .chat-hero {
  background: #131c30 !important;
  border-color: #243349;
}

/* email-bulk surfaces (email-bulk.css unscoped classes) */
html[data-theme="dark"] .email-console .card,
html[data-theme="dark"] .email-console .capacity-banner,
html[data-theme="dark"] .email-console .table-wrap,
html[data-theme="dark"] .email-console .logs-wrap,
html[data-theme="dark"] .email-console .dnd-blocks-panel,
html[data-theme="dark"] .email-console .mode-switch,
html[data-theme="dark"] .email-console .source-tabs,
html[data-theme="dark"] .email-console .preview-stat-card,
html[data-theme="dark"] .email-console .slider-container,
html[data-theme="dark"] .email-console .column-mapping,
html[data-theme="dark"] .email-console .hint,
html[data-theme="dark"] .email-console .attachment-mode-toggle {
  background: #131c30;
  border-color: #243349;
  box-shadow: none;
}
/* email-settings SMTP accounts table */
html[data-theme="dark"] .email-console .smtp-accounts-table th {
  background: #1a2744 !important;
  color: var(--text) !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .smtp-accounts-table td {
  background: transparent !important;
  color: var(--text-muted) !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .smtp-accounts-table tbody tr:hover td {
  background: #1e293b !important;
}
html[data-theme="dark"] .email-console .smtp-provider-cell { color: var(--text) !important; }
html[data-theme="dark"] .email-console .smtp-mono-cell { color: var(--text-muted) !important; }
html[data-theme="dark"] .email-console .smtp-from-cell { color: var(--text-muted) !important; }
html[data-theme="dark"] .email-console .email-table-shell {
  background: #131c30 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .account-select-control {
  background: #1e293b !important;
  border-color: #243349 !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .email-console .table-scroll {
  background: transparent !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .smtp-accounts-table tbody tr {
  border-bottom-color: #243349 !important;
}
html[data-theme="dark"] .email-console .smtp-accounts-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}



html[data-theme="dark"] .email-console .chip-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .email-console .chip-btn:hover {
  border-color: var(--mb-brand-light);
}
html[data-theme="dark"] .email-console .chip-btn.active,
html[data-theme="dark"] .email-console .chip-btn.is-active,
html[data-theme="dark"] .email-console .chip-btn[aria-selected="true"] {
  background: var(--mb-brand);
  border-color: var(--mb-brand);
  color: #ffffff;
}
html[data-theme="dark"] body.email-console-shell .modal-header,
html[data-theme="dark"] .modal-header {
  background: #131c30;
  border-color: #243349;
  color: #f1f5f9;
}
html[data-theme="dark"] .email-option-check-box {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .email-option-check-input:checked + .email-option-check-box {
  background: var(--mb-brand);
  border-color: var(--mb-brand);
}
html[data-theme="dark"] .email-option-check-copy strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .drop-zone-icon-clean {
  background: rgba(37, 99, 235, 0.14);
}
html[data-theme="dark"] .email-console-kicker {
  background: rgba(13, 139, 111, 0.14);
  border-color: rgba(13, 139, 111, 0.32);
  color: #a7f3d0;
}

/* status tints — dark-adaptive, hue preserved */
html[data-theme="dark"] .check-item.pass {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.38);
  color: #86efac;
}
html[data-theme="dark"] .check-item.fail {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.38);
  color: #fca5a5;
}
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge.badge-success {
  background: rgba(22, 163, 74, 0.16) !important;
  border-color: rgba(22, 163, 74, 0.4) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .badge.badge-warning {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fcd34d;
}
html[data-theme="dark"] .sender-settings-status.is-saved {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.38);
  color: #86efac;
}

/* telegram-bulk (inline unscoped classes) */
html[data-theme="dark"] .telegram-console-hero {
  background: linear-gradient(135deg, #16213a 0%, #101a2e 52%, #0f172a 100%);
  border-color: rgba(34, 158, 217, 0.25);
}
html[data-theme="dark"] .telegram-console .tg-dropzone,
html[data-theme="dark"] .tg-dropzone {
  background: linear-gradient(180deg, #101a2e, #0f172a) !important;
  border-color: rgba(34, 158, 217, 0.3) !important;
}
html[data-theme="dark"] .telegram-console .tg-dropzone.dragover,
html[data-theme="dark"] .telegram-console .tg-dropzone:hover {
  background: rgba(13, 139, 111, 0.12) !important;
  border-color: rgba(13, 139, 111, 0.4) !important;
}
html[data-theme="dark"] .tg-preview-media {
  background: linear-gradient(180deg, #101a2e, #0f172a);
  border-color: #243349;
}
html[data-theme="dark"] .tg-preview-shell {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .tg-upload-box {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .tg-modal-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .tg-progress {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .telegram-console .tg-warning {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fcd34d;
}

/* status badges — design-system .badge-success/.badge-warning use !important; match it */
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge.badge-success,
html[data-theme="dark"] .badge-green {
  border-color: rgba(22, 163, 74, 0.4) !important;
  background: rgba(22, 163, 74, 0.16) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .badge.badge-warning,
html[data-theme="dark"] .badge-gold,
html[data-theme="dark"] .badge-yellow {
  border-color: rgba(217, 119, 6, 0.4) !important;
  background: rgba(217, 119, 6, 0.14) !important;
  color: #fcd34d !important;
}

/* email-bulk stat boxes, progress, drop-zone, remaining surfaces */
html[data-theme="dark"] .stat-box {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .stat-box.stat-sent-box {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.38);
}
html[data-theme="dark"] .stat-box.stat-failed-box {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.38);
}
html[data-theme="dark"] .stat-box.stat-pending-box {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.38);
}
html[data-theme="dark"] .stat-box strong,
html[data-theme="dark"] .stat-box .stat-value {
  color: #f1f5f9;
}
html[data-theme="dark"] .progress-bar {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .campaign-stats {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .success-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .success-card--warning {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}
html[data-theme="dark"] .success-card--error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
}
html[data-theme="dark"] .success-icon-clean {
  background: rgba(22, 163, 74, 0.16);
}
html[data-theme="dark"] .success-card--warning .success-icon-clean {
  background: rgba(217, 119, 6, 0.16);
}
html[data-theme="dark"] .success-card--error .success-icon-clean {
  background: rgba(220, 38, 38, 0.16);
}
html[data-theme="dark"] .email-option-check--schedule {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .dropzone,
html[data-theme="dark"] .drop-zone,
html[data-theme="dark"] .sms-dropzone,
html[data-theme="dark"] .tg-dropzone {
  background: linear-gradient(180deg, #101a2e, #0f172a) !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .dropzone:hover,
html[data-theme="dark"] .drop-zone:hover,
html[data-theme="dark"] .sms-dropzone:hover,
html[data-theme="dark"] .tg-dropzone:hover,
html[data-theme="dark"] .dropzone.dragover,
html[data-theme="dark"] .drop-zone.dragover {
  background: #16213a !important;
  border-color: var(--mb-tool) !important;
}
html[data-theme="dark"] .hint {
  background: transparent !important;
  color: #94a3b8 !important;
}

/* email-bulk compose editor (Quill) */
html[data-theme="dark"] .card.compact-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .ql-editor {
  background: #131c30 !important;
  color: #e2e8f0;
}
html[data-theme="dark"] .info-box {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .editor-container {
  background: #131c30;
  border-color: #243349;
  box-shadow: none;
}
html[data-theme="dark"] .compose-titlebar {
  background: #16213a;
  border-color: #243349;
  color: #cbd5e1;
}
html[data-theme="dark"] #editor,
html[data-theme="dark"] #editor .ql-editor {
  background: #131c30;
  color: #e2e8f0;
}
html[data-theme="dark"] #editor .ql-toolbar {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] #editor .ql-toolbar button {
  color: #cbd5e1;
}
html[data-theme="dark"] .editor-footer,
html[data-theme="dark"] .compose-bottom {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .contact-list {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .contact-list-item:hover {
  background: #1e293b;
}
html[data-theme="dark"] .mail-preview,
html[data-theme="dark"] .mail-preview-head,
html[data-theme="dark"] .mail-preview-body {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .mail-preview-head strong,
html[data-theme="dark"] .mail-preview-head div {
  color: #cbd5e1;
}
html[data-theme="dark"] .preview-toggle,
html[data-theme="dark"] .preview-content,
html[data-theme="dark"] .preview-content-card {
  background: #131c30;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .emoji-picker {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .emoji-btn {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .ab-test-label {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* smtp-rotation widget — dark-adaptive (brand identity) */
html[data-theme="dark"] .smtp-rotation-meter {
  background: rgba(13, 139, 111, 0.08);
  border-color: rgba(13, 139, 111, 0.3);
}
html[data-theme="dark"] .smtp-rotation-gap span {
  color: var(--mb-brand-light);
}
html[data-theme="dark"] .smtp-rotation-apply {
  background: #131c30;
  border-color: rgba(13, 139, 111, 0.35);
  color: var(--mb-brand-light);
}
html[data-theme="dark"] .smtp-rotation-apply:hover {
  background: rgba(13, 139, 111, 0.14);
}

/* sms-portal console hero (translucent white gradient → dark blue-teal) */
html[data-theme="dark"] .sms-console .sms-console-hero {
  background: linear-gradient(135deg, #14203a 0%, #0f1e2e 52%, #0f172a 100%) !important;
  border-color: rgba(13, 139, 111, 0.25) !important;
}
html[data-theme="dark"] .sms-console .sms-hero-copy::before {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

/* wallet/balance pills — !important beats design-system's generic dark div rule (0,5,2) */
html[data-theme="dark"] .sms-balance-pill,
html[data-theme="dark"] .sms-console .sms-balance-pill,
html[data-theme="dark"] .balance-badge {
  background: #3a2d0a !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
  color: #fcd34d !important;
}

/* dashboard: table zebra (design-system tbody tr:nth-child(even) is white), KPI icons, status badges */
html[data-theme="dark"] tbody tr:nth-child(even) {
  background: #101a2e;
}
html[data-theme="dark"] .plan-badge,
html[data-theme="dark"] .home-console .plan-badge {
  background: rgba(22, 163, 74, 0.16) !important;
  border-color: rgba(22, 163, 74, 0.38) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .cc-kpi-icon.is-sent {
  background: rgba(37, 99, 235, 0.14) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .cc-kpi-icon.is-delivered {
  background: rgba(22, 163, 74, 0.14) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .cc-kpi-icon.is-failed {
  background: rgba(220, 38, 38, 0.14) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .cc-kpi-icon.is-campaign {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .platform-status-badge.is-error {
  background: rgba(220, 38, 38, 0.14) !important;
  color: #fca5a5 !important;
}
html[data-theme="dark"] .platform-status-badge.is-ok {
  background: rgba(22, 163, 74, 0.16) !important;
  color: #86efac !important;
}

/* settings dark-audit: section-nav contrast, radio dots, password toggle, sticky bar, readiness pill */
html[data-theme="dark"] .settings-section-nav a {
  color: #cbd5e1;
}
html[data-theme="dark"] .settings-section-nav a:hover,
html[data-theme="dark"] .settings-section-nav a:focus-visible {
  background: #1e293b;
  border-color: rgba(13, 139, 111, 0.4);
  color: #a7f3d0;
}
html[data-theme="dark"] .settings-console .password-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .sender-radio-dot {
  background: #0f172a;
  border-color: var(--mb-text);
}
html[data-theme="dark"] .sender-mode-option.is-active .sender-radio-dot,
html[data-theme="dark"] .sender-legacy-btn.is-active .sender-radio-dot {
  background: var(--mb-brand);
  border-color: var(--mb-brand);
}
html[data-theme="dark"] .sticky-save-copy strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .meta-ready-pill.is-ready {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.38);
  color: #86efac;
}

/* contacts header chips */
html[data-theme="dark"] .home-console-chip {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.35);
  color: #86efac;
}
html[data-theme="dark"] .home-console-chip.home-console-chip-accent {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fcd34d;
}

/* wa-groups console (inline unscoped classes) */
html[data-theme="dark"] .wa-page-header,
html[data-theme="dark"] .setup-card,
html[data-theme="dark"] .groups-panel,
html[data-theme="dark"] .send-section {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .wa-metric {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .wa-metric strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .wa-metric span {
  color: #94a3b8;
}
html[data-theme="dark"] .wa-title {
  color: #f1f5f9;
}
html[data-theme="dark"] .wa-subtitle {
  color: #94a3b8;
}
html[data-theme="dark"] .media-upload-section {
  background: #101a2e;
  border-top-color: #243349;
}
html[data-theme="dark"] .file-summary {
  background: #101a2e;
  border-color: #243349;
  color: #cbd5e1;
}
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .loading-state {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .empty-state strong,
html[data-theme="dark"] .loading-state strong {
  color: #f1f5f9;
}
html[data-theme="dark"] .group-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .group-card:hover,
html[data-theme="dark"] .group-card:focus-visible {
  border-color: rgba(13, 139, 111, 0.45);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .group-card.selected {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.45);
}
html[data-theme="dark"] .group-check {
  background: #0f172a;
  border-color: #334155;
}
html[data-theme="dark"] .group-name {
  color: #f1f5f9;
}
html[data-theme="dark"] .group-meta {
  color: #94a3b8;
}
html[data-theme="dark"] .member-pill {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #86efac;
}
html[data-theme="dark"] .compose-shell {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .compose-bottom {
  background: #101a2e;
  border-top-color: #243349;
}
html[data-theme="dark"] .panel-header,
html[data-theme="dark"] .composer-header {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .composer-title {
  color: #f1f5f9;
}
html[data-theme="dark"] .panel-count-pill,
html[data-theme="dark"] .selected-count {
  background: rgba(22, 163, 74, 0.14);
  border-color: rgba(22, 163, 74, 0.4);
  color: #86efac;
}
html[data-theme="dark"] .send-progress {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
}
html[data-theme="dark"] .send-progress small {
  color: #94a3b8;
}

/* telegram-console additions (mode switch row/tabs, sidecards, kicker) */
html[data-theme="dark"] .telegram-console .tg-mode-row,
html[data-theme="dark"] .telegram-console .tg-tabs,
html[data-theme="dark"] .telegram-console .tg-mode-switch {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .telegram-console .tg-sidecard,
html[data-theme="dark"] .telegram-console .tg-collapse,
html[data-theme="dark"] .telegram-console .bot-card,
html[data-theme="dark"] .telegram-console .table-container,
html[data-theme="dark"] .telegram-console .tg-log-table-wrap {
  background: #131c30;
  border-color: #243349;
  box-shadow: none;
}
html[data-theme="dark"] .telegram-console #templates-list > div {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .telegram-console-kicker {
  background: rgba(34, 158, 217, 0.14);
  border-color: rgba(34, 158, 217, 0.35);
  color: #7dd3fc;
}

/* sms-console additions (method switch, checkline, table header, compose, disabled inputs) */
html[data-theme="dark"] .sms-console .sms-method-switch {
  background: #101a2e;
  border-color: #243349;
}
html[data-theme="dark"] .sms-console .sms-checkline {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .sms-console .sms-table th {
  background: #101a2e;
}
html[data-theme="dark"] .sms-console .compose-bottom {
  background: #101a2e;
  border-top-color: #243349;
}
html[data-theme="dark"] .sms-console input[readonly],
html[data-theme="dark"] .sms-console input:disabled,
html[data-theme="dark"] .sms-console select:disabled,
html[data-theme="dark"] .sms-console textarea:disabled {
  background: #101a2e;
  border-color: #243349;
  color: #94a3b8;
}
html[data-theme="dark"] .sms-console .btn-secondary {
  background: #131c30;
  border-color: #334155;
  color: #cbd5e1;
}
html[data-theme="dark"] .sms-table-wrap {
  background: #131c30;
}

/* === Business Broadcasts dark mode === */
html[data-theme="dark"] .bb-card,
html[data-theme="dark"] .bb-preview-card,
html[data-theme="dark"] .bb-summary-card {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .bb-card h3,
html[data-theme="dark"] .bb-preview-card h3,
html[data-theme="dark"] .bb-summary-card h3,
html[data-theme="dark"] .bb-title,
html[data-theme="dark"] .bb-create-header h1 {
  color: #f1f5f9;
}
html[data-theme="dark"] .bb-card-desc,
html[data-theme="dark"] .bb-label-optional,
html[data-theme="dark"] .bb-summary-row {
  color: #94a3b8;
}
html[data-theme="dark"] .bb-input,
html[data-theme="dark"] .bb-select,
html[data-theme="dark"] .bb-textarea {
  background: #0f172a;
  border-color: #243349;
  color: #e2e8f0;
}
html[data-theme="dark"] .bb-table td {
  color: #e2e8f0;
  border-color: #243349;
}
html[data-theme="dark"] .bb-table th {
  border-color: #243349;
}
html[data-theme="dark"] .bb-dropdown-menu {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .bb-dropdown-item {
  color: #e2e8f0;
}
html[data-theme="dark"] .bb-dropdown-item:hover {
  background: #1e293b;
}
html[data-theme="dark"] .bb-btn-outline {
  border-color: var(--mb-brand);
  color: var(--mb-brand);
}
html[data-theme="dark"] .bb-btn-add {
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .bb-btn-send:disabled {
  background: #334155;
  color: #64748b;
}
html[data-theme="dark"] .bb-attachment-menu {
  background: #131c30;
  border-color: #243349;
}
html[data-theme="dark"] .bb-attachment-option:hover {
  background: #1e293b;
}
html[data-theme="dark"] .bb-selected-audience {
  background: rgba(13, 139, 111, 0.15);
  color: #34d399;
}
html[data-theme="dark"] .bb-phone-preview {
  background: #0f172a;
}
html[data-theme="dark"] .bb-msg-bubble {
  background: #1e3a2f;
}
html[data-theme="dark"] .bb-msg-time {
  color: #64748b;
}
html[data-theme="dark"] .bb-modal {
  background: #131c30;
}
html[data-theme="dark"] .bb-modal-header h2 {
  color: #f1f5f9;
}
html[data-theme="dark"] .bb-dropzone {
  border-color: #334155;
}
html[data-theme="dark"] .bb-empty-state h2 {
  color: #f1f5f9;
}
html[data-theme="dark"] .bb-summary-total {
  color: #f1f5f9;
}

/* ═══════════════════════════════════════════════════════════════
   SWEEP: catch-all dark overrides for remaining white surfaces
   across crm-console, campaign-console, whatsapp-console,
   email-console, email-bulk, telegram-console, admin-console,
   home-console, bulk-with-name, business-broadcasts, etc.
   ═══════════════════════════════════════════════════════════════ */

/* Generic card/panel/table/tile surface sweep */
html[data-theme="dark"] .crm-console .tool-card,
html[data-theme="dark"] .crm-console .integration-card,
html[data-theme="dark"] .crm-console .endpoint-card,
html[data-theme="dark"] .crm-console .referral-card,
html[data-theme="dark"] .crm-console .crm-section,
html[data-theme="dark"] .campaign-console .table-wrap,
html[data-theme="dark"] .campaign-console .chart-card,
html[data-theme="dark"] .whatsapp-console .wa-card,
html[data-theme="dark"] .whatsapp-console .setup-card,
html[data-theme="dark"] .home-console .home-card,
html[data-theme="dark"] .home-console .tool-card,
html[data-theme="dark"] .admin-console .admin-card,
html[data-theme="dark"] .admin-console .tool-card,
html[data-theme="dark"] .telegram-console .tg-card,
html[data-theme="dark"] .telegram-console .setup-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

/* Email console surfaces */
html[data-theme="dark"] .email-console .email-card,
html[data-theme="dark"] .email-console .smtp-card,
html[data-theme="dark"] .email-console .template-card,
html[data-theme="dark"] .email-console .capacity-card,
html[data-theme="dark"] .email-console .editor-card,
html[data-theme="dark"] .email-console .info-box,
html[data-theme="dark"] .email-console .source-tab,
html[data-theme="dark"] .email-console .active,
html[data-theme="dark"] .email-console .sender-settings-status,
html[data-theme="dark"] .email-console .report-track,
html[data-theme="dark"] .email-console .column-mapping,
html[data-theme="dark"] .email-console .chip,
html[data-theme="dark"] .email-console .editor-container,
html[data-theme="dark"] .email-console .compose-titlebar,
html[data-theme="dark"] .email-console .editor-footer,
html[data-theme="dark"] .email-console .compose-bottom,
html[data-theme="dark"] .email-console .compose-more-menu,
html[data-theme="dark"] .email-console .smtp-preset,
html[data-theme="dark"] .email-console .contact-list,
html[data-theme="dark"] .email-console .mail-preview,
html[data-theme="dark"] .email-console .mail-preview-head,
html[data-theme="dark"] .email-console .slider-container,
html[data-theme="dark"] .email-console .mode-switch,
html[data-theme="dark"] .email-console .drop-zone,
html[data-theme="dark"] .email-console .drop-zone-icon-clean {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .email-console .ql-toolbar,
html[data-theme="dark"] .email-console .ql-toolbar.ql-snow {
  background: #1a2744 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .ql-container.ql-snow {
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-console .info-box,
html[data-theme="dark"] .email-console .badge-success {
  background: rgba(22, 163, 74, 0.14) !important;
  border-color: rgba(22, 163, 74, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .email-console .badge-warning {
  background: rgba(234, 179, 8, 0.12) !important;
  border-color: rgba(234, 179, 8, 0.35) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .email-console .btn-secondary,
html[data-theme="dark"] .email-console button.btn-secondary {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* WhatsApp console extra surfaces */
html[data-theme="dark"] .whatsapp-console .card-toggle,
html[data-theme="dark"] .whatsapp-console .sender-settings-status,
html[data-theme="dark"] .whatsapp-console .fail,
html[data-theme="dark"] .whatsapp-console .pass {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}

/* Telegram console extra surfaces */
html[data-theme="dark"] .telegram-console .card,
html[data-theme="dark"] .telegram-console .setup-card,
html[data-theme="dark"] .telegram-console .tg-tool-card,
html[data-theme="dark"] .telegram-console .mode-switch,
html[data-theme="dark"] .telegram-console .editor-container,
html[data-theme="dark"] .telegram-console .compose-titlebar,
html[data-theme="dark"] .telegram-console .editor-footer,
html[data-theme="dark"] .telegram-console .compose-bottom,
html[data-theme="dark"] .telegram-console .drop-zone,
html[data-theme="dark"] .telegram-console .badge-success,
html[data-theme="dark"] .telegram-console .badge-warning,
html[data-theme="dark"] .telegram-console .info-box {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .telegram-console .ql-toolbar,
html[data-theme="dark"] .telegram-console .ql-toolbar.ql-snow {
  background: #1a2744 !important;
  border-color: #243349 !important;
}

/* Admin console extra surfaces */
html[data-theme="dark"] .admin-console .card,
html[data-theme="dark"] .admin-console .panel,
html[data-theme="dark"] .admin-console .admin-card,
html[data-theme="dark"] .admin-console .admin-section,
html[data-theme="dark"] .admin-console .setup-card,
html[data-theme="dark"] .admin-console .tool-card,
html[data-theme="dark"] .admin-console .endpoint-card,
html[data-theme="dark"] .admin-console .integration-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

/* Home console / contacts / dashboard */
html[data-theme="dark"] .home-console .home-card,
html[data-theme="dark"] .home-console .tool-card,
html[data-theme="dark"] .home-console .contact-card,
html[data-theme="dark"] .home-console .stats-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

/* Bulk-with-name extra surfaces */
html[data-theme="dark"] .bulk-send-container .step-strip,
html[data-theme="dark"] .bulk-send-container .upload-area,
html[data-theme="dark"] .bulk-send-container .preview-card,
html[data-theme="dark"] .bulk-send-container .result-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}

/* Campaign modal */
html[data-theme="dark"] .campaign-modal,
html[data-theme="dark"] .campaign-modal-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .campaign-modal .modal-body,
html[data-theme="dark"] .campaign-modal .modal-section {
  background: #0f172a !important;
  border-color: #243349 !important;
}

/* Global input/select overrides for dark mode */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #0f172a !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: var(--mb-brand) !important;
}

/* Global table overrides */
html[data-theme="dark"] table,
html[data-theme="dark"] .table-wrap {
  background: transparent !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] table th {
  background: #1a2744 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] table td {
  border-color: #243349 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Generic badge/tag overrides */
html[data-theme="dark"] .badge-success {
  background: rgba(22, 163, 74, 0.14) !important;
  border-color: rgba(22, 163, 74, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .badge-warning {
  background: rgba(234, 179, 8, 0.12) !important;
  border-color: rgba(234, 179, 8, 0.35) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .badge-danger,
html[data-theme="dark"] .badge-error {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

/* Toggle switches, sliders, mode-switch */
html[data-theme="dark"] .mode-switch,
html[data-theme="dark"] .slider-container,
html[data-theme="dark"] .toggle-switch {
  background: #1a2744 !important;
  border-color: #334155 !important;
}

/* Drop zones */
html[data-theme="dark"] .drop-zone,
html[data-theme="dark"] .upload-area {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

/* Info boxes, alerts */
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  color: #93c5fd !important;
}
html[data-theme="dark"] .alert-success {
  background: rgba(22, 163, 74, 0.1) !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .alert-warning {
  background: rgba(234, 179, 8, 0.1) !important;
  border-color: rgba(234, 179, 8, 0.3) !important;
  color: #fcd34d !important;
}
html[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

/* Password toggles */
html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] button[class*="password"] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* WhatsApp reports — stat cards, tables, toolbar in dark mode */
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] .campaign-console .report-card-grid > *,
html[data-theme="dark"] .report-card-header,
html[data-theme="dark"] .report-table-card {
  background: #131c30 !important;
  border-color: #243349 !important;n}
html[data-theme="dark"] .report-stat-card.success {
  background: rgba(22, 101, 52, 0.25) !important;
  border-color: rgba(22, 163, 74, 0.35) !important;n}
html[data-theme="dark"] .report-stat-card.warning {
  background: rgba(120, 53, 15, 0.22) !important;
  border-color: rgba(180, 83, 9, 0.35) !important;
}
html[data-theme="dark"] .report-stat-card.danger {
  background: rgba(127, 29, 29, 0.22) !important;
  border-color: rgba(220, 38, 38, 0.35) !important;
}
html[data-theme="dark"] .report-stat-card strong,
html[data-theme="dark"] .report-card-header h2 {
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .report-stat-card span {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .report-stat-card small {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .report-card-header p {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .report-table th,
html[data-theme="dark"] .report-table td {
  color: #e2e8f0 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .report-table th {
  background: #1a2744 !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .report-toolbar label {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .report-toolbar input,
html[data-theme="dark"] .report-toolbar select {
  background: #1a2540 !important;
  border-color: #243349 !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .report-toolbar .btn-secondary {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .whatsapp-reports .wr-card,
html[data-theme="dark"] .whatsapp-reports .wr-stat,
html[data-theme="dark"] .whatsapp-reports .wr-table-wrap {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .status-badge {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .status-badge.success {
  background: rgba(22, 101, 52, 0.3) !important;
  color: #4ade80 !important;
}
html[data-theme="dark"] .status-badge.warning {
  background: rgba(120, 53, 15, 0.25) !important;
  color: #fbbf24 !important;
}
html[data-theme="dark"] .status-badge.danger {
  background: rgba(127, 29, 29, 0.25) !important;
  color: #f87171 !important;
}
html[data-theme="dark"] .wa-chip {
  background: rgba(22, 163, 74, 0.18) !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
  color: #4ade80 !important;
}
html[data-theme="dark"] .wa-chip-muted {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .report-empty,
html[data-theme="dark"] .report-error {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .report-table-wrap {
  background: transparent !important;
}

/* Quill editor dark mode */
html[data-theme="dark"] .ql-editor,
html[data-theme="dark"] .ql-editor.ql-blank::before {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: #94a3b8 !important;
}
html[data-theme="dark"] .ql-snow .ql-fill {
  fill: #94a3b8 !important;
}
html[data-theme="dark"] .ql-snow .ql-picker {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .ql-snow .ql-picker-options {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Modals / dialogs */
html[data-theme="dark"] .modal,
html[data-theme="dark"] dialog,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .modal-body {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.6) !important;
}

/* Pagination / page controls */
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .page-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .page-btn.active,
html[data-theme="dark"] .pagination .active {
  background: var(--mb-brand) !important;
  color: #fff !important;
}

/* Tooltip / popover */
html[data-theme="dark"] .tooltip,
html[data-theme="dark"] .popover {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Step indicators / wizard */
html[data-theme="dark"] .step-indicator,
html[data-theme="dark"] .wizard-step,
html[data-theme="dark"] .step-circle {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .step-indicator.active,
html[data-theme="dark"] .wizard-step.active,
html[data-theme="dark"] .step-circle.active {
  background: var(--mb-brand) !important;
  color: #fff !important;
}

/* File / attachment cards */
html[data-theme="dark"] .file-card,
html[data-theme="dark"] .attachment-card,
html[data-theme="dark"] .doc-card {
  background: #1e293b !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}

/* History / log rows */
html[data-theme="dark"] .history-row,
html[data-theme="dark"] .log-row,
html[data-theme="dark"] .report-row {
  background: transparent !important;
  border-color: #243349 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .history-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Empty state */
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .no-results {
  color: #64748b !important;
}
html[data-theme="dark"] .empty-state h3,
html[data-theme="dark"] .no-results h3 {
  color: #94a3b8 !important;
}

/* Status pills */
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .is-active-pill,
html[data-theme="dark"] .is-ready-pill {
  background: rgba(22, 163, 74, 0.14) !important;
  border-color: rgba(22, 163, 74, 0.35) !important;
  color: #86efac !important;
}
html[data-theme="dark"] .status-pill.is-inactive,
html[data-theme="dark"] .is-error-pill {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

/* Consent / compliance banners */
html[data-theme="dark"] .consent-banner,
html[data-theme="dark"] .compliance-bar {
  background: #1a2744 !important;
  border-color: #243349 !important;
  color: #94a3b8 !important;
}

/* marketing pages — public-card, public-button, topnav, sections */
html[data-theme="dark"] .topnav,
html[data-theme="dark"] body.marketing-polish-shell .topnav {
  background: rgba(11, 17, 32, 0.98) !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] body.marketing-polish-shell .topnav .nav-links > a,
html[data-theme="dark"] body.marketing-polish-shell .topnav .dropdown-trigger > button {
  color: #e2e8f0 !important;
  text-shadow: none !important;
}
html[data-theme="dark"] body.marketing-polish-shell .topnav .nav-links > a:hover,
html[data-theme="dark"] body.marketing-polish-shell .topnav .dropdown-trigger > button:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] body.marketing-polish-shell .topnav .nav-toggle {
  color: #e2e8f0 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
/* dark mobile dropdown container — Target 3 sets white bg */
html[data-theme="dark"] body.marketing-polish-shell .topnav .nav-links {
  background: rgba(15, 23, 42, 0.96) !important;
  border-color: #243349 !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme="dark"] .public-card {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: var(--text) !important;
}
html[data-theme="dark"] .public-card h2,
html[data-theme="dark"] .public-card h3,
html[data-theme="dark"] .public-card strong {
  color: var(--text) !important;
}
html[data-theme="dark"] .public-card p,
html[data-theme="dark"] .public-card span {
  color: var(--text-muted) !important;
}
html[data-theme="dark"] .public-button.secondary {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .public-section {
  background: transparent !important;
}
html[data-theme="dark"] .public-pricing-card {
  background: #131c30 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .public-pricing-card.featured {
  background: #1a2f24 !important;
  border-color: var(--mb-brand) !important;
}
html[data-theme="dark"] .public-faq-item {
  background: #131c30 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .public-faq-question {
  color: var(--text) !important;
}
html[data-theme="dark"] .public-faq-answer {
  color: var(--text-muted) !important;
}
html[data-theme="dark"] .public-footer {
  background: #0a100d !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .public-footer h4,
html[data-theme="dark"] .public-footer strong {
  color: var(--text) !important;
}
html[data-theme="dark"] .public-footer a {
  color: var(--text-muted) !important;
}
html[data-theme="dark"] .public-hero-inner {
  background: transparent !important;
}
html[data-theme="dark"] .public-hero h1,
html[data-theme="dark"] .public-hero h2 {
  color: var(--text) !important;
}
html[data-theme="dark"] .public-hero p {
  color: var(--text-muted) !important;
}
html[data-theme="dark"] .feature-matrix-card {
  background: #131c30 !important;
  border-color: #243349 !important;
}

html[data-theme="dark"] .matrix-row { background: #131c30 !important; border-color: #243349 !important; }
html[data-theme="dark"] .matrix-row td, html[data-theme="dark"] .matrix-row th { color: var(--text) !important; border-color: #243349 !important; }

/* ═══════════════════════════════════════════════════════════════
   SWEEP-2: email-bulk.css, voice-console, topbar, topbar buttons
   ═══════════════════════════════════════════════════════════════ */

/* email-bulk.css — card surfaces use var(--be-card) which is #fff */
html[data-theme="dark"] .email-page .card,
html[data-theme="dark"] .email-page .compact-card,
html[data-theme="dark"] .email-page .mode-card-no-margin,
html[data-theme="dark"] .email-page .card-mb-16,
html[data-theme="dark"] .email-page .contact-table th,
html[data-theme="dark"] .email-page .contact-table td,
html[data-theme="dark"] .email-page .radio-label,
html[data-theme="dark"] .email-page .template-select,
html[data-theme="dark"] .email-page .step-pill,
html[data-theme="dark"] .email-page .email-option-check--compact {
  background: #131c30 !important;
  border-color: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .email-page input[type="text"],
html[data-theme="dark"] .email-page input[type="email"],
html[data-theme="dark"] .email-page input.test-email-input,
html[data-theme="dark"] .email-page .file-input-hidden {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .email-page .mode-switch,
html[data-theme="dark"] .email-page .source-tabs {
  background: #1a2744 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .email-page .hint {
  background: transparent !important;
  color: #94a3b8 !important;
}
html[data-theme="dark"] .email-page .email-option-check-box {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* Topbar buttons — campaign-monitor-btn, logout-btn, menu-toggle, theme-toggle */
html[data-theme="dark"] .campaign-monitor-btn,
html[data-theme="dark"] .topbar .campaign-monitor-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .menu-toggle {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] body.auth-page .right-form {
  background: #14241c !important;
}

/* ═══════════════════════════════════════════════════════════════
   email-templates.html — DnD editor dark mode
   Inline styles use #fff / #f8fafc / #1a2e22 — all need dark overrides
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .dnd-blocks-panel {
  background: #131c30 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .dnd-block-item {
  background: #1a2744 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .dnd-block-item:hover {
  border-color: var(--mb-brand) !important;
  box-shadow: 0 4px 12px rgba(13, 139, 111, 0.2) !important;
}
html[data-theme="dark"] .dnd-block-label {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .dnd-editor-area {
  background: #0f172a !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .dnd-editor-canvas {
  background: #131c30 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .dnd-editor-canvas .block-header h1,
html[data-theme="dark"] .dnd-editor-canvas .block-header p {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .dnd-editor-canvas .block-text,
html[data-theme="dark"] .dnd-editor-canvas .block-text * {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .dnd-editor-canvas .block-footer,
html[data-theme="dark"] .dnd-editor-canvas .block-footer a {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .dnd-editor-canvas .block-divider {
  border-color: #243349 !important;
}
html[data-theme="dark"] .dnd-block {
  border-color: transparent !important;
}
html[data-theme="dark"] .dnd-block:hover {
  border-color: var(--mb-brand) !important;
  background: rgba(13, 139, 111, 0.08) !important;
}
html[data-theme="dark"] .dnd-block-action-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .et-composer {
  background: #131c30 !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .et-tools-wrap {
  background: #101a2e !important;
  border-color: #243349 !important;
}
html[data-theme="dark"] .et-tools {
  background: #1e293b !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .et-btn {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .et-btn:hover {
  background: #243349 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .block-header h1 { color: #f1f5f9 !important; }
html[data-theme="dark"] .block-header p { color: #94a3b8 !important; }
html[data-theme="dark"] .block-text { color: #e2e8f0 !important; }
html[data-theme="dark"] .block-footer { color: #94a3b8 !important; }
html[data-theme="dark"] .block-footer a { color: #7dd3fc !important; }
html[data-theme="dark"] .saved-templates-card .card { background: #131c30 !important; }

