
/* Dark mode: Classic refined. */
[data-crm-theme="dark"] .dir-classic {
  --bg: #0d0f14;
  --bg-elevated: #15181f;
  --bg-sunken: #090b0f;
  --bg-hover: #1c1f28;
  --bg-active: #232732;
  --border: #232732;
  --border-strong: #2e3340;
  --divider: #1c1f28;
  --text: #f0f2f7;
  --text-secondary: #b4bac8;
  --text-tertiary: #858ca0;
  --text-quaternary: #596071;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1e1b4b;
  --accent-text: #ffffff;
  --accent-fg: #a5b4fc;
  --success: #34d399;
  --success-soft: #064e3b;
  --warning: #fbbf24;
  --warning-soft: #451a03;
  --danger: #f87171;
  --danger-soft: #450a0a;
  --info: #38bdf8;
  --info-soft: #0c4a6e;
  --crm-accent: var(--accent);
  --crm-accent-dark: var(--accent-hover);
  --crm-ink: var(--text);
  --crm-muted: var(--text-tertiary);
  --crm-soft: var(--bg-sunken);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.38);
}

[data-crm-theme="dark"] body,
[data-crm-theme="dark"] .wrapper,
[data-crm-theme="dark"] .main-panel,
[data-crm-theme="dark"] .content,
[data-crm-theme="dark"] .dir-classic.crm-modal-page {
  background: var(--bg);
  color: var(--text);
}

.dir-classic .crm-theme-toggle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  color: var(--text-secondary) !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

.dir-classic .crm-theme-toggle:hover,
.dir-classic .crm-theme-toggle:focus,
.dir-classic .crm-theme-toggle.is-active {
  background: var(--bg-sunken);
  border-color: var(--border);
  box-shadow: none;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .main-header,
[data-crm-theme="dark"] .dir-classic .main-header .logo-header,
[data-crm-theme="dark"] .dir-classic .navbar-header,
[data-crm-theme="dark"] .dir-classic .sidebar,
[data-crm-theme="dark"] .dir-classic .card,
[data-crm-theme="dark"] .dir-classic .card-header,
[data-crm-theme="dark"] .dir-classic .modal-content,
[data-crm-theme="dark"] .dir-classic .dropdown-menu,
[data-crm-theme="dark"] .dir-classic .crm-company-profile-head,
[data-crm-theme="dark"] .dir-classic .crm-breadcrumbs,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor,
[data-crm-theme="dark"] .dir-classic .crm-rich-preview,
[data-crm-theme="dark"] .dir-classic .crm-signature-preview,
[data-crm-theme="dark"] .dir-classic .crm-cleanup-panel,
[data-crm-theme="dark"] .dir-classic .crm-activity-filter-bar button,
[data-crm-theme="dark"] .dir-classic .crm-company-tab-panel[data-company-tab-panel="activity"] .crm-profile-timeline-content {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-global-search .input-group,
[data-crm-theme="dark"] .dir-classic .nav-search .input-group,
[data-crm-theme="dark"] .dir-classic .crm-company-note-composer,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-variable-chip-row,
[data-crm-theme="dark"] .dir-classic .crm-avatar-upload,
[data-crm-theme="dark"] .dir-classic .crm-company-note-tabs span.is-active,
[data-crm-theme="dark"] .dir-classic .crm-calendar-view-tabs a.is-active,
[data-crm-theme="dark"] .dir-classic .crm-calendar-view-tabs strong,
[data-crm-theme="dark"] .dir-classic .crm-week-day-column:hover,
[data-crm-theme="dark"] .dir-classic .crm-cleanup-panel-danger {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-breadcrumbs a:hover,
[data-crm-theme="dark"] .dir-classic .crm-breadcrumbs span:last-child,
[data-crm-theme="dark"] .dir-classic .crm-company-hero,
[data-crm-theme="dark"] .dir-classic .crm-ai-note-panel.is-error,
[data-crm-theme="dark"] .dir-classic .crm-ai-status-error,
[data-crm-theme="dark"] .dir-classic .crm-ai-error-card,
[data-crm-theme="dark"] .dir-classic .crm-confirm-code {
  background: var(--bg-active);
  border-color: var(--border-strong);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .form-control,
[data-crm-theme="dark"] .dir-classic .custom-select,
[data-crm-theme="dark"] .dir-classic select.form-control,
[data-crm-theme="dark"] .dir-classic textarea.form-control,
[data-crm-theme="dark"] .dir-classic .crm-html-source-textarea {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .form-control::placeholder,
[data-crm-theme="dark"] .dir-classic textarea.form-control::placeholder,
[data-crm-theme="dark"] .dir-classic .nav-search .form-control::placeholder {
  color: var(--text-quaternary);
}

[data-crm-theme="dark"] .dir-classic .table thead th,
[data-crm-theme="dark"] .dir-classic .crm-calendar-weekday,
[data-crm-theme="dark"] .dir-classic .crm-week-corner,
[data-crm-theme="dark"] .dir-classic .crm-week-day-head,
[data-crm-theme="dark"] .dir-classic .crm-week-hours {
  background: var(--bg-sunken);
  border-color: var(--border);
}

[data-crm-theme="dark"] .dir-classic .table tbody td,
[data-crm-theme="dark"] .dir-classic .crm-company-profile-metrics article,
[data-crm-theme="dark"] .dir-classic .crm-company-tabs,
[data-crm-theme="dark"] .dir-classic .crm-profile-timeline-content,
[data-crm-theme="dark"] .dir-classic .crm-detail-list article,
[data-crm-theme="dark"] .dir-classic .crm-history-record,
[data-crm-theme="dark"] .dir-classic .crm-contact-item,
[data-crm-theme="dark"] .dir-classic .crm-calendar-list-item,
[data-crm-theme="dark"] .dir-classic .crm-action-stat-strip {
  border-color: var(--border);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-grid,
[data-crm-theme="dark"] .dir-classic .crm-week-planner-card {
  background: var(--border);
  border-color: var(--border);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-week-day-column {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      var(--divider) 32px,
      transparent 33px,
      transparent 63px,
      var(--border) 64px
    ),
    var(--bg-elevated);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day {
  background: var(--bg-elevated);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day:hover,
[data-crm-theme="dark"] .dir-classic .table-hover tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .crm-action-row:hover,
[data-crm-theme="dark"] .dir-classic .crm-step:hover,
[data-crm-theme="dark"] .dir-classic .card .card-body .crm-ai-button:hover {
  background: var(--bg-hover);
}

[data-crm-theme="dark"] .dir-classic .badge-info {
  background: var(--info-soft);
  color: #bae6fd;
}

[data-crm-theme="dark"] .dir-classic .badge-success {
  background: var(--success-soft);
  color: #bbf7d0;
}

[data-crm-theme="dark"] .dir-classic .badge-warning {
  background: var(--warning-soft);
  color: #fde68a !important;
}

[data-crm-theme="dark"] .dir-classic .badge-danger {
  background: var(--danger-soft);
  color: #fecaca;
}

[data-crm-theme="dark"] .dir-classic .badge-default {
  background: var(--bg-active);
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .alert-success {
  background: var(--success-soft);
  color: #bbf7d0;
}

[data-crm-theme="dark"] .dir-classic .alert-warning {
  background: var(--warning-soft);
  color: #fde68a;
}

[data-crm-theme="dark"] .dir-classic .alert-danger {
  background: var(--danger-soft);
  color: #fecaca;
}

[data-crm-theme="dark"] .dir-classic .crm-logo-text,
[data-crm-theme="dark"] .dir-classic .main-header .logo-header .logo,
[data-crm-theme="dark"] .dir-classic .page-title,
[data-crm-theme="dark"] .dir-classic .card-title,
[data-crm-theme="dark"] .dir-classic .modal-title,
[data-crm-theme="dark"] .dir-classic .crm-company-title-row .page-title,
[data-crm-theme="dark"] .dir-classic .crm-company-deals-table strong,
[data-crm-theme="dark"] .dir-classic .crm-company-deals-table b,
[data-crm-theme="dark"] .dir-classic .crm-history-heading strong {
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-company-meta,
[data-crm-theme="dark"] .dir-classic .crm-company-profile-meta i,
[data-crm-theme="dark"] .dir-classic .crm-company-owner-line i,
[data-crm-theme="dark"] .dir-classic .card-category,
[data-crm-theme="dark"] .dir-classic .page-subtitle,
[data-crm-theme="dark"] .dir-classic .crm-history-facts span,
[data-crm-theme="dark"] .dir-classic .crm-company-deals-table span {
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-week-event {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

[data-crm-theme="dark"] .dir-classic .flatpickr-calendar {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle {
  background: #1b2130;
  border-color: #2a3447;
  box-shadow: none;
  color: #c7d2fe !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:hover,
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:focus,
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle.is-active {
  background: #222a3b;
  border-color: var(--accent);
  box-shadow: none;
  color: #c7d2fe !important;
}

[data-crm-theme="dark"] .dir-classic .topbar-nav .nav-link:hover,
[data-crm-theme="dark"] .dir-classic .topbar-nav .dropdown.show .nav-link,
[data-crm-theme="dark"] .dir-classic .btn-default:hover,
[data-crm-theme="dark"] .dir-classic .btn-default:focus,
[data-crm-theme="dark"] .dir-classic .dropdown-item:hover,
[data-crm-theme="dark"] .dir-classic .dropdown-item:focus {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-private-mode-indicator {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(52, 211, 153, 0.38);
  color: #86efac;
}

[data-crm-theme="dark"] .dir-classic .crm-user-dropdown .dropdown-menu,
[data-crm-theme="dark"] .dir-classic .crm-user-dropdown .user-box,
[data-crm-theme="dark"] .dir-classic .crm-user-menu .dropdown-item {
  background: var(--bg-elevated);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-user-menu .dropdown-item:hover,
[data-crm-theme="dark"] .dir-classic .crm-user-menu .dropdown-item:focus {
  background: var(--bg-hover);
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-user-menu .dropdown-item.active {
  background: var(--accent-soft);
  color: #c7d2fe !important;
}

[data-crm-theme="dark"] .dir-classic .crm-user-menu .dropdown-item small,
[data-crm-theme="dark"] .dir-classic .dropdown-menu .text-muted {
  color: var(--text-tertiary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-dashboard-queue-group,
[data-crm-theme="dark"] .dir-classic .crm-empty-mini,
[data-crm-theme="dark"] .dir-classic .crm-kpi-card,
[data-crm-theme="dark"] .dir-classic .crm-operational-tile,
[data-crm-theme="dark"] .dir-classic .crm-dashboard-side-card,
[data-crm-theme="dark"] .dir-classic .crm-focus-row,
[data-crm-theme="dark"] .dir-classic .crm-activity-feed-row,
[data-crm-theme="dark"] .dir-classic .crm-activity-feed-note,
[data-crm-theme="dark"] .dir-classic .crm-filter-shell,
[data-crm-theme="dark"] .dir-classic .crm-company-profile-metrics article,
[data-crm-theme="dark"] .dir-classic .crm-customer-tabs-card,
[data-crm-theme="dark"] .dir-classic .crm-company-tab-panel,
[data-crm-theme="dark"] .dir-classic .crm-profile-main,
[data-crm-theme="dark"] .dir-classic .crm-profile-side,
[data-crm-theme="dark"] .dir-classic .crm-profile-stat,
[data-crm-theme="dark"] .dir-classic .crm-profile-health,
[data-crm-theme="dark"] .dir-classic .crm-detail-list article,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-card,
[data-crm-theme="dark"] .dir-classic .crm-contact-item,
[data-crm-theme="dark"] .dir-classic .crm-contact-item-compact,
[data-crm-theme="dark"] .dir-classic .crm-contact-action-compact,
[data-crm-theme="dark"] .dir-classic .crm-contact-summary-pill,
[data-crm-theme="dark"] .dir-classic .crm-action-context,
[data-crm-theme="dark"] .dir-classic .crm-action-context-clean,
[data-crm-theme="dark"] .dir-classic .crm-action-owner-meta,
[data-crm-theme="dark"] .dir-classic .crm-action-contacts-overview-compact article,
[data-crm-theme="dark"] .dir-classic .crm-action-history-record,
[data-crm-theme="dark"] .dir-classic .crm-action-history-note,
[data-crm-theme="dark"] .dir-classic .crm-company-deals-table article.crm-company-deal-card,
[data-crm-theme="dark"] .dir-classic .crm-company-data-grid div,
[data-crm-theme="dark"] .dir-classic .crm-form-check-row,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-block pre,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-response,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context pre {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-dashboard-queue-group > strong,
[data-crm-theme="dark"] .dir-classic .crm-table-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-company-tabs,
[data-crm-theme="dark"] .dir-classic .crm-company-note-tabs,
[data-crm-theme="dark"] .dir-classic .crm-customer-tab-nav,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-action-history-record .crm-history-time,
[data-crm-theme="dark"] .dir-classic .crm-history-time-chip,
[data-crm-theme="dark"] .dir-classic .crm-filter-count,
[data-crm-theme="dark"] .dir-classic .crm-admin-metric-strip span {
  background: var(--bg-sunken);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-empty-mini,
[data-crm-theme="dark"] .dir-classic .crm-activity-filter-empty,
[data-crm-theme="dark"] .dir-classic .crm-contact-filter-empty,
[data-crm-theme="dark"] .dir-classic .crm-deal-filter-empty,
[data-crm-theme="dark"] .dir-classic .crm-offer-filter-empty,
[data-crm-theme="dark"] .dir-classic .crm-topic-filter-empty {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-directory-table,
[data-crm-theme="dark"] .dir-classic .table,
[data-crm-theme="dark"] .dir-classic .table tbody tr,
[data-crm-theme="dark"] .dir-classic .table tbody td,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody td {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .table-striped tbody tr:nth-of-type(odd),
[data-crm-theme="dark"] .dir-classic .table-hover tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:focus-within,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-card:hover,
[data-crm-theme="dark"] .dir-classic .crm-contact-item:hover,
[data-crm-theme="dark"] .dir-classic .crm-contact-item-compact:hover,
[data-crm-theme="dark"] .dir-classic .crm-calendar-list-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover td,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:focus-within td {
  background: transparent;
}

[data-crm-theme="dark"] .dir-classic .crm-row-link,
[data-crm-theme="dark"] .dir-classic .crm-directory-title,
[data-crm-theme="dark"] .dir-classic .crm-contact-main strong,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-name,
[data-crm-theme="dark"] .dir-classic .crm-action-history-title strong,
[data-crm-theme="dark"] .dir-classic .crm-action-history-facts strong,
[data-crm-theme="dark"] .dir-classic .crm-company-task-main p,
[data-crm-theme="dark"] .dir-classic .crm-company-deal-value strong {
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-directory-meta,
[data-crm-theme="dark"] .dir-classic .crm-directory-meta span,
[data-crm-theme="dark"] .dir-classic .crm-contact-main small,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-meta,
[data-crm-theme="dark"] .dir-classic .crm-action-history-title > span:not(.crm-history-action-name),
[data-crm-theme="dark"] .dir-classic .crm-action-history-note,
[data-crm-theme="dark"] .dir-classic .crm-company-task-main small,
[data-crm-theme="dark"] .dir-classic .crm-company-deal-main span,
[data-crm-theme="dark"] .dir-classic .crm-company-deal-stage span,
[data-crm-theme="dark"] .dir-classic .crm-company-deal-value small {
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-calendar-toolbar .card-body,
[data-crm-theme="dark"] .dir-classic .crm-calendar-workspace,
[data-crm-theme="dark"] .dir-classic .crm-calendar-agenda,
[data-crm-theme="dark"] .dir-classic .crm-calendar-agenda .card-body,
[data-crm-theme="dark"] .dir-classic .crm-month-week-row,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days,
[data-crm-theme="dark"] .dir-classic .crm-month-segment-layer {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-muted {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-muted {
  background: #10131a;
  color: var(--text-tertiary);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day-number {
  color: inherit;
}

[data-crm-theme="dark"] .dir-classic .crm-month-event,
[data-crm-theme="dark"] .dir-classic .crm-week-event,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment {
  background: color-mix(in srgb, var(--event-color, var(--accent)) 22%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--event-color, var(--accent)) 50%, var(--border));
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-week-event.is-all-day,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment.is-all-day {
  background: color-mix(in srgb, var(--event-color, #ef4444) 24%, var(--bg-elevated));
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-pill,
[data-crm-theme="dark"] .dir-classic .crm-calendar-pill.is-event,
[data-crm-theme="dark"] .dir-classic .crm-calendar-more,
[data-crm-theme="dark"] .dir-classic .crm-month-event-time,
[data-crm-theme="dark"] .dir-classic .crm-week-event small,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment span,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment small {
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .crm-mini-calendar,
[data-crm-theme="dark"] .dir-classic .crm-mini-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-slot-button,
[data-crm-theme="dark"] .dir-classic .crm-range-slot-button {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}

[data-crm-theme="dark"] .dir-classic .crm-range-slot-button.is-selected,
[data-crm-theme="dark"] .dir-classic .crm-slot-button.is-selected,
[data-crm-theme="dark"] .dir-classic .crm-range-slot-button:hover,
[data-crm-theme="dark"] .dir-classic .crm-slot-button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #c7d2fe;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid,
[data-crm-theme="dark"] .dir-classic .crm-week-grid {
  background: var(--border) !important;
  border-color: var(--border) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted {
  background: #111827 !important;
  color: var(--text-tertiary) !important;
  opacity: 0.78;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day:hover,
[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day:focus-within {
  background: var(--bg-hover) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-week-corner,
[data-crm-theme="dark"] .dir-classic .crm-week-day-head,
[data-crm-theme="dark"] .dir-classic .crm-week-hours,
[data-crm-theme="dark"] .dir-classic .crm-week-hour-label {
  background: var(--bg-sunken) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-week-day-column,
[data-crm-theme="dark"] .dir-classic .crm-week-day-body {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(148, 163, 184, 0.10) 32px,
      transparent 33px,
      transparent 63px,
      rgba(148, 163, 184, 0.16) 64px
    ),
    var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-week-offhours,
[data-crm-theme="dark"] .dir-classic .crm-week-day-column.is-day-off {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(148, 163, 184, 0.08),
      rgba(148, 163, 184, 0.08) 8px,
      rgba(148, 163, 184, 0.03) 8px,
      rgba(148, 163, 184, 0.03) 16px
    ),
    #10131a !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-month-event,
[data-crm-theme="dark"] .dir-classic .crm-week-event,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment {
  background: color-mix(in srgb, var(--event-color, var(--accent)) 22%, var(--bg-elevated)) !important;
  border-color: color-mix(in srgb, var(--event-color, var(--accent)) 52%, var(--border)) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-month-event strong,
[data-crm-theme="dark"] .dir-classic .crm-week-event strong,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment strong {
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-month-event small,
[data-crm-theme="dark"] .dir-classic .crm-week-event small,
[data-crm-theme="dark"] .dir-classic .crm-month-event-segment small,
[data-crm-theme="dark"] .dir-classic .crm-month-event-time {
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .btn-default,
[data-crm-theme="dark"] .dir-classic .btn-outline-secondary,
[data-crm-theme="dark"] .dir-classic .crm-filter-pills a,
[data-crm-theme="dark"] .dir-classic .crm-activity-filter-bar button,
[data-crm-theme="dark"] .dir-classic .crm-square-btn,
[data-crm-theme="dark"] .dir-classic .crm-check-toggle,
[data-crm-theme="dark"] .dir-classic .crm-switch-field {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-crm-theme="dark"] .dir-classic .btn-default.active,
[data-crm-theme="dark"] .dir-classic .crm-filter-pills a.is-active,
[data-crm-theme="dark"] .dir-classic .crm-activity-filter-bar button.is-active,
[data-crm-theme="dark"] .dir-classic .crm-company-tabs button.is-active,
[data-crm-theme="dark"] .dir-classic .crm-customer-tab-nav button.is-active {
  background: var(--accent-soft);
  border-color: rgba(129, 140, 248, 0.36);
  color: #c7d2fe;
}

[data-crm-theme="dark"] .dir-classic .crm-filter-panel,
[data-crm-theme="dark"] .dir-classic .crm-bulk-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-all-day-toggle,
[data-crm-theme="dark"] .dir-classic .crm-range-toggle,
[data-crm-theme="dark"] .dir-classic .crm-readonly-field,
[data-crm-theme="dark"] .dir-classic .crm-offers-overview article,
[data-crm-theme="dark"] .dir-classic .crm-offer-record-card,
[data-crm-theme="dark"] .dir-classic .crm-topic-record-card,
[data-crm-theme="dark"] .dir-classic .crm-offer-mail-panel,
[data-crm-theme="dark"] .dir-classic .crm-offer-products-preview,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor.is-disabled,
[data-crm-theme="dark"] .dir-classic .crm-card,
[data-crm-theme="dark"] .dir-classic .crm-card-muted,
[data-crm-theme="dark"] .dir-classic .crm-danger-zone,
[data-crm-theme="dark"] .dir-classic .crm-admin-metric-strip,
[data-crm-theme="dark"] .dir-classic .crm-admin-metric-strip span,
[data-crm-theme="dark"] .dir-classic .crm-model-recommendation-card,
[data-crm-theme="dark"] .dir-classic .crm-conditional-panel,
[data-crm-theme="dark"] .dir-classic .crm-upload-card,
[data-crm-theme="dark"] .dir-classic .crm-attachment-card,
[data-crm-theme="dark"] .dir-classic .crm-conflict-box {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-check-toggle-box,
[data-crm-theme="dark"] .dir-classic input[type="file"],
[data-crm-theme="dark"] .dir-classic input[type="file"]::file-selector-button {
  background: var(--bg-sunken) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic input:disabled,
[data-crm-theme="dark"] .dir-classic select:disabled,
[data-crm-theme="dark"] .dir-classic textarea:disabled,
[data-crm-theme="dark"] .dir-classic .form-control:disabled,
[data-crm-theme="dark"] .dir-classic .form-control[readonly],
[data-crm-theme="dark"] .dir-classic .flatpickr-input.form-control[readonly] {
  background: #111827 !important;
  border-color: var(--border) !important;
  color: var(--text-tertiary) !important;
  opacity: 1;
}

[data-crm-theme="dark"] .dir-classic .crm-switch-copy strong,
[data-crm-theme="dark"] .dir-classic .crm-offer-mail-panel strong,
[data-crm-theme="dark"] .dir-classic .crm-offer-record-card strong,
[data-crm-theme="dark"] .dir-classic .crm-topic-record-card strong,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-card strong,
[data-crm-theme="dark"] .dir-classic .crm-card strong {
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .text-muted,
[data-crm-theme="dark"] .dir-classic label,
[data-crm-theme="dark"] .dir-classic .crm-switch-copy,
[data-crm-theme="dark"] .dir-classic .crm-help-text,
[data-crm-theme="dark"] .dir-classic .crm-offer-products-preview,
[data-crm-theme="dark"] .dir-classic .crm-offer-record-card small,
[data-crm-theme="dark"] .dir-classic .crm-topic-record-card small,
[data-crm-theme="dark"] .dir-classic .crm-contact-record-card small {
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:focus-within,
[data-crm-theme="dark"] .dir-classic .crm-clickable-row:hover,
[data-crm-theme="dark"] .dir-classic .crm-clickable-row:focus,
[data-crm-theme="dark"] .dir-classic tr.is-selected,
[data-crm-theme="dark"] .dir-classic tr.table-active,
[data-crm-theme="dark"] .dir-classic .table-active,
[data-crm-theme="dark"] .dir-classic .table-active > td {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover td,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:focus-within td,
[data-crm-theme="dark"] .dir-classic tr.is-selected td,
[data-crm-theme="dark"] .dir-classic tr.table-active td {
  background: transparent !important;
  color: inherit !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle i {
  font-size: 19px;
  line-height: 1;
}

[data-crm-theme="dark"] .dir-classic .crm-action-hero .card-body,
[data-crm-theme="dark"] .dir-classic .crm-action-list-card,
[data-crm-theme="dark"] .dir-classic .crm-action-list-table,
[data-crm-theme="dark"] .dir-classic .crm-action-row,
[data-crm-theme="dark"] .dir-classic .crm-action-row td,
[data-crm-theme="dark"] .dir-classic .crm-action-company-tabs-card,
[data-crm-theme="dark"] .dir-classic .crm-action-company-tabs-card .crm-company-tabs,
[data-crm-theme="dark"] .dir-classic .crm-action-company-tabs-card .crm-company-tab-panel,
[data-crm-theme="dark"] .dir-classic .crm-action-tab-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-item,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-item-compact,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-opportunity,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-next,
[data-crm-theme="dark"] .dir-classic .crm-action-contact-summary-strip,
[data-crm-theme="dark"] .dir-classic .crm-action-contact-summary-strip article,
[data-crm-theme="dark"] .dir-classic .crm-contact-summary-pill,
[data-crm-theme="dark"] .dir-classic .crm-contact-summary-pill-muted,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-action-compact,
[data-crm-theme="dark"] .dir-classic .crm-action-progress--large,
[data-crm-theme="dark"] .dir-classic .crm-action-progress,
[data-crm-theme="dark"] .dir-classic .crm-action-progress span,
[data-crm-theme="dark"] .dir-classic .crm-action-stat-strip-opportunities .crm-action-stat-item,
[data-crm-theme="dark"] .dir-classic button.crm-action-stat-item,
[data-crm-theme="dark"] .dir-classic .crm-action-history-facts,
[data-crm-theme="dark"] .dir-classic .crm-action-history-value-row,
[data-crm-theme="dark"] .dir-classic .crm-profile-timeline,
[data-crm-theme="dark"] .dir-classic .crm-profile-timeline-row,
[data-crm-theme="dark"] .dir-classic .crm-company-tab-panel[data-company-tab-panel="activity"] .crm-profile-timeline-row,
[data-crm-theme="dark"] .dir-classic .crm-company-tab-panel[data-company-tab-panel="activity"] .crm-profile-timeline-content,
[data-crm-theme="dark"] .dir-classic .crm-company-task-card,
[data-crm-theme="dark"] .dir-classic .crm-company-deal-card,
[data-crm-theme="dark"] .dir-classic .crm-company-topic-card,
[data-crm-theme="dark"] .dir-classic .crm-company-offer-card,
[data-crm-theme="dark"] .dir-classic .crm-quick-add-drawer,
[data-crm-theme="dark"] .dir-classic .crm-quick-add-option,
[data-crm-theme="dark"] .dir-classic .crm-admin-form-card,
[data-crm-theme="dark"] .dir-classic .crm-form-card,
[data-crm-theme="dark"] .dir-classic .crm-mail-compose-card,
[data-crm-theme="dark"] .dir-classic .crm-mail-offer-preview,
[data-crm-theme="dark"] .dir-classic .crm-mail-offer-summary,
[data-crm-theme="dark"] .dir-classic .crm-mail-history-card,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-help,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-recommendations,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-recommendation,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-summary,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-summary article,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-row,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-modal-meta,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-modal-box,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context-box,
[data-crm-theme="dark"] .dir-classic .crm-cleanup-confirm-box,
[data-crm-theme="dark"] .dir-classic .crm-system-note,
[data-crm-theme="dark"] .dir-classic .crm-checkbox-card,
[data-crm-theme="dark"] .dir-classic .crm-check-card,
[data-crm-theme="dark"] .dir-classic .crm-toggle-card {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid,
[data-crm-theme="dark"] .dir-classic .crm-calendar-grid,
[data-crm-theme="dark"] .dir-classic .crm-week-planner,
[data-crm-theme="dark"] .dir-classic .crm-week-grid,
[data-crm-theme="dark"] .dir-classic .crm-month-week-row,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days {
  background-color: var(--border) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic button.crm-calendar-day,
[data-crm-theme="dark"] .dir-classic a.crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-month-day,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days > *,
[data-crm-theme="dark"] .dir-classic .crm-week-day-column,
[data-crm-theme="dark"] .dir-classic .crm-week-day-body {
  background-color: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-month-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days > .is-muted {
  background-color: #111827 !important;
  color: var(--text-tertiary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day:hover,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day:focus,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day:focus-visible,
[data-crm-theme="dark"] .dir-classic .crm-month-day:hover,
[data-crm-theme="dark"] .dir-classic .crm-month-day:focus {
  background-color: var(--bg-hover) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .table-active > th,
[data-crm-theme="dark"] .dir-classic .table-active > td,
[data-crm-theme="dark"] .dir-classic .table-hover .table-active:hover > th,
[data-crm-theme="dark"] .dir-classic .table-hover .table-active:hover > td,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr.is-selected,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr.is-selected td {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-action-row:hover td,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-item:hover,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-item-compact:hover,
[data-crm-theme="dark"] .dir-classic .crm-quick-add-option:hover,
[data-crm-theme="dark"] .dir-classic .crm-quick-add-option:focus,
[data-crm-theme="dark"] .dir-classic .crm-check-card:hover,
[data-crm-theme="dark"] .dir-classic .crm-checkbox-card:hover,
[data-crm-theme="dark"] .dir-classic .crm-toggle-card:hover {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-contact-summary-pill strong,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-subline,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-links,
[data-crm-theme="dark"] .dir-classic .crm-contact-result-value-compact,
[data-crm-theme="dark"] .dir-classic .crm-action-history-meta,
[data-crm-theme="dark"] .dir-classic .crm-action-history-facts span,
[data-crm-theme="dark"] .dir-classic .crm-action-history-note,
[data-crm-theme="dark"] .dir-classic .crm-mail-offer-preview small,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-help p,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-recommendation p,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-modal-box,
[data-crm-theme="dark"] .dir-classic .crm-system-note,
[data-crm-theme="dark"] .dir-classic .crm-cleanup-confirm-box {
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-contact-summary-pill em,
[data-crm-theme="dark"] .dir-classic .crm-action-contact-title,
[data-crm-theme="dark"] .dir-classic .crm-action-company-contact-list .crm-contact-name,
[data-crm-theme="dark"] .dir-classic .crm-action-history-title strong,
[data-crm-theme="dark"] .dir-classic .crm-action-history-facts strong,
[data-crm-theme="dark"] .dir-classic .crm-mail-offer-preview strong,
[data-crm-theme="dark"] .dir-classic .crm-ai-prompt-recommendation strong {
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-upload-card,
[data-crm-theme="dark"] .dir-classic .crm-attachment-card,
[data-crm-theme="dark"] .dir-classic .crm-conditional-panel,
[data-crm-theme="dark"] .dir-classic .crm-check-toggle-box {
  box-shadow: none !important;
}

/* Dark mode final sweep for legacy CRM surfaces with hard-coded light fills. */
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #171a23 !important;
  border: 1px solid #293142 !important;
  border-radius: 8px !important;
  color: #c7d2fe !important;
  box-shadow: none !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:hover,
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:focus {
  background: #20263a !important;
  border-color: #818cf8 !important;
  color: #eef2ff !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle i {
  font-size: 18px;
  line-height: 1;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid,
[data-crm-theme="dark"] .dir-classic .crm-calendar-grid,
[data-crm-theme="dark"] .dir-classic .crm-week-grid,
[data-crm-theme="dark"] .dir-classic .crm-month-week-row,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days,
[data-crm-theme="dark"] .dir-classic .crm-month-segment-layer {
  background: var(--border) !important;
  background-color: var(--border) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-grid .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic button.crm-calendar-day,
[data-crm-theme="dark"] .dir-classic a.crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-month-day,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days > *,
[data-crm-theme="dark"] .dir-classic .crm-calendar-cell,
[data-crm-theme="dark"] .dir-classic .crm-week-day-column,
[data-crm-theme="dark"] .dir-classic .crm-week-day-body {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(148, 163, 184, 0.10) 32px,
      transparent 33px,
      transparent 63px,
      rgba(148, 163, 184, 0.14) 64px
    ),
    var(--bg-elevated) !important;
  background-color: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-grid .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-month-day,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days > * {
  background-image: none !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-calendar-grid .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-month-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-month-week-days > .is-muted {
  background: #111827 !important;
  background-color: #111827 !important;
  color: var(--text-tertiary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-list,
[data-crm-theme="dark"] .dir-classic .crm-calendar-list-item,
[data-crm-theme="dark"] .dir-classic .crm-calendar-side-card,
[data-crm-theme="dark"] .dir-classic .crm-calendar-controls-card,
[data-crm-theme="dark"] .dir-classic .crm-calendar-empty,
[data-crm-theme="dark"] .dir-classic .crm-calendar-detail-card,
[data-crm-theme="dark"] .dir-classic .crm-calendar-event-modal,
[data-crm-theme="dark"] .dir-classic .crm-calendar-event-details,
[data-crm-theme="dark"] .dir-classic .crm-calendar-event-card,
[data-crm-theme="dark"] .dir-classic .crm-quick-slot-panel,
[data-crm-theme="dark"] .dir-classic .crm-quick-slot-day,
[data-crm-theme="dark"] .dir-classic .crm-quick-slot,
[data-crm-theme="dark"] .dir-classic .crm-free-busy-card,
[data-crm-theme="dark"] .dir-classic .crm-event-summary,
[data-crm-theme="dark"] .dir-classic .crm-event-conflict-box {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-quick-slot:hover,
[data-crm-theme="dark"] .dir-classic .crm-quick-slot:focus,
[data-crm-theme="dark"] .dir-classic .crm-quick-slot.is-selected,
[data-crm-theme="dark"] .dir-classic .crm-calendar-list-item:hover,
[data-crm-theme="dark"] .dir-classic .crm-calendar-event-card:hover {
  background: var(--bg-hover) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-quick-slot.is-selected {
  box-shadow: inset 0 0 0 1px var(--accent) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-card,
[data-crm-theme="dark"] .dir-classic .crm-card-flat,
[data-crm-theme="dark"] .dir-classic .crm-panel,
[data-crm-theme="dark"] .dir-classic .crm-section-card,
[data-crm-theme="dark"] .dir-classic .crm-stat-card,
[data-crm-theme="dark"] .dir-classic .crm-metric-card,
[data-crm-theme="dark"] .dir-classic .crm-filter-card,
[data-crm-theme="dark"] .dir-classic .crm-directory-shell,
[data-crm-theme="dark"] .dir-classic .crm-directory-row,
[data-crm-theme="dark"] .dir-classic .crm-directory-table,
[data-crm-theme="dark"] .dir-classic .crm-empty-state,
[data-crm-theme="dark"] .dir-classic .crm-form-section,
[data-crm-theme="dark"] .dir-classic .crm-form-panel,
[data-crm-theme="dark"] .dir-classic .crm-upload-zone,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor-body,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor-preview,
[data-crm-theme="dark"] .dir-classic .crm-preview-panel,
[data-crm-theme="dark"] .dir-classic .crm-attachment-list,
[data-crm-theme="dark"] .dir-classic .crm-ai-modal-answer,
[data-crm-theme="dark"] .dir-classic .crm-ai-answer,
[data-crm-theme="dark"] .dir-classic .crm-json-context,
[data-crm-theme="dark"] .dir-classic details,
[data-crm-theme="dark"] .dir-classic summary {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-rich-editor-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-rich-editor-variable-row,
[data-crm-theme="dark"] .dir-classic .crm-variable-chip-row,
[data-crm-theme="dark"] .dir-classic .crm-table-header,
[data-crm-theme="dark"] .dir-classic .crm-directory-table thead th,
[data-crm-theme="dark"] .dir-classic .crm-tabs,
[data-crm-theme="dark"] .dir-classic .crm-tab-list,
[data-crm-theme="dark"] .dir-classic .crm-tab-header,
[data-crm-theme="dark"] .dir-classic .crm-admin-card-highlight {
  background: var(--bg-sunken) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .form-check,
[data-crm-theme="dark"] .dir-classic .custom-control,
[data-crm-theme="dark"] .dir-classic .custom-checkbox,
[data-crm-theme="dark"] .dir-classic .crm-checkbox-row,
[data-crm-theme="dark"] .dir-classic .crm-switch-row,
[data-crm-theme="dark"] .dir-classic .crm-admin-flag,
[data-crm-theme="dark"] .dir-classic .crm-admin-flag span,
[data-crm-theme="dark"] .dir-classic .crm-setting-box,
[data-crm-theme="dark"] .dir-classic .crm-setting-panel,
[data-crm-theme="dark"] .dir-classic .crm-help-card,
[data-crm-theme="dark"] .dir-classic .crm-warning-card,
[data-crm-theme="dark"] .dir-classic .crm-danger-card,
[data-crm-theme="dark"] .dir-classic .crm-info-card {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic input[type="file"],
[data-crm-theme="dark"] .dir-classic input[type="color"] {
  background: var(--bg-sunken) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic input[type="file"]::file-selector-button {
  background: var(--bg-hover) !important;
  border: 0 !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .btn-light,
[data-crm-theme="dark"] .dir-classic .btn-outline-secondary,
[data-crm-theme="dark"] .dir-classic .btn-outline-dark,
[data-crm-theme="dark"] .dir-classic .dropdown-item,
[data-crm-theme="dark"] .dir-classic .page-link {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .btn-light:hover,
[data-crm-theme="dark"] .dir-classic .btn-outline-secondary:hover,
[data-crm-theme="dark"] .dir-classic .btn-outline-dark:hover,
[data-crm-theme="dark"] .dir-classic .dropdown-item:hover,
[data-crm-theme="dark"] .dir-classic .dropdown-item:focus,
[data-crm-theme="dark"] .dir-classic .page-link:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .text-muted,
[data-crm-theme="dark"] .dir-classic .small,
[data-crm-theme="dark"] .dir-classic small,
[data-crm-theme="dark"] .dir-classic .help-text,
[data-crm-theme="dark"] .dir-classic .form-text,
[data-crm-theme="dark"] .dir-classic .crm-muted,
[data-crm-theme="dark"] .dir-classic .crm-subtitle,
[data-crm-theme="dark"] .dir-classic .crm-meta,
[data-crm-theme="dark"] .dir-classic .crm-card-subtitle,
[data-crm-theme="dark"] .dir-classic .crm-list-note {
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .badge-light,
[data-crm-theme="dark"] .dir-classic .badge-secondary,
[data-crm-theme="dark"] .dir-classic .crm-badge-muted {
  background: var(--bg-hover) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-alert-soft-danger,
[data-crm-theme="dark"] .dir-classic .crm-alert-soft-warning,
[data-crm-theme="dark"] .dir-classic .alert-warning,
[data-crm-theme="dark"] .dir-classic .alert-danger {
  background: rgba(127, 29, 29, 0.18) !important;
  border-color: rgba(248, 113, 113, 0.32) !important;
  color: #fecaca !important;
}

[data-crm-theme="dark"] .dir-classic .alert-success,
[data-crm-theme="dark"] .dir-classic .crm-alert-soft-success {
  background: rgba(6, 78, 59, 0.25) !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
  color: #bbf7d0 !important;
}

/* Dark mode pass for framework cards/tables and remaining light CRM blocks. */
[data-crm-theme="dark"] .dir-classic .card,
[data-crm-theme="dark"] .dir-classic .card-body,
[data-crm-theme="dark"] .dir-classic .card-header,
[data-crm-theme="dark"] .dir-classic .card-action,
[data-crm-theme="dark"] .dir-classic .table-responsive,
[data-crm-theme="dark"] .dir-classic .modal-content,
[data-crm-theme="dark"] .dir-classic .modal-header,
[data-crm-theme="dark"] .dir-classic .modal-body,
[data-crm-theme="dark"] .dir-classic .modal-footer,
[data-crm-theme="dark"] .dir-classic .crm-modal-shell,
[data-crm-theme="dark"] .dir-classic .crm-modal-card {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .table,
[data-crm-theme="dark"] .dir-classic .table th,
[data-crm-theme="dark"] .dir-classic .table td,
[data-crm-theme="dark"] .dir-classic .crm-table,
[data-crm-theme="dark"] .dir-classic .crm-table th,
[data-crm-theme="dark"] .dir-classic .crm-table td {
  background: transparent !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .table thead th,
[data-crm-theme="dark"] .dir-classic .crm-table thead th,
[data-crm-theme="dark"] .dir-classic .table-light th,
[data-crm-theme="dark"] .dir-classic .table-light td {
  background: var(--bg-sunken) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .table-hover tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .table-hover tbody tr:hover td,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover,
[data-crm-theme="dark"] .dir-classic .crm-directory-table tbody tr:hover td {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle {
  width: 36px !important;
  height: 36px !important;
  background: #171a23 !important;
  border-color: #2f3a52 !important;
  color: #c7d2fe !important;
}

[data-crm-theme="dark"] .dir-classic .crm-theme-toggle.is-active,
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:hover,
[data-crm-theme="dark"] .dir-classic .crm-theme-toggle:focus {
  background: #1f2440 !important;
  border-color: #818cf8 !important;
  color: #eef2ff !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-weekday,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day,
[data-crm-theme="dark"] .dir-classic .crm-calendar-day.is-muted,
[data-crm-theme="dark"] .dir-classic .crm-week-header,
[data-crm-theme="dark"] .dir-classic .crm-week-time-column,
[data-crm-theme="dark"] .dir-classic .crm-week-hour-label,
[data-crm-theme="dark"] .dir-classic .crm-week-time-label,
[data-crm-theme="dark"] .dir-classic .crm-week-all-day-row,
[data-crm-theme="dark"] .dir-classic .crm-week-all-day-cell,
[data-crm-theme="dark"] .dir-classic .crm-month-week-header,
[data-crm-theme="dark"] .dir-classic .crm-month-week-day-header,
[data-crm-theme="dark"] .dir-classic .crm-calendar-header-cell {
  background: var(--bg-sunken) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day:not(.is-muted),
[data-crm-theme="dark"] .dir-classic .crm-week-day-column,
[data-crm-theme="dark"] .dir-classic .crm-week-slot,
[data-crm-theme="dark"] .dir-classic .crm-week-hour-row {
  background: var(--bg-elevated) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-calendar-day:hover,
[data-crm-theme="dark"] .dir-classic .crm-week-slot:hover,
[data-crm-theme="dark"] .dir-classic .crm-week-hour-row:hover {
  background: var(--bg-hover) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-dashboard-queue-group,
[data-crm-theme="dark"] .dir-classic .crm-dashboard-queue-group > strong,
[data-crm-theme="dark"] .dir-classic .crm-muted-panel,
[data-crm-theme="dark"] .dir-classic .crm-model-option,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-response,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context pre,
[data-crm-theme="dark"] .dir-classic .crm-action-stat-strip,
[data-crm-theme="dark"] .dir-classic .crm-action-stat-item,
[data-crm-theme="dark"] .dir-classic .crm-action-company-tabs-card .crm-company-tabs,
[data-crm-theme="dark"] .dir-classic .crm-action-history-note,
[data-crm-theme="dark"] .dir-classic .crm-switch-field,
[data-crm-theme="dark"] .dir-classic .crm-visible-checkbox > span,
[data-crm-theme="dark"] .dir-classic .crm-ai-question-chip,
[data-crm-theme="dark"] .dir-classic .crm-variable-chip-row,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar button,
[data-crm-theme="dark"] .dir-classic .crm-editor-header-actions,
[data-crm-theme="dark"] .dir-classic .crm-work-schedule-table tr.is-day-off td {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

[data-crm-theme="dark"] .dir-classic .crm-dashboard-queue-group > strong,
[data-crm-theme="dark"] .dir-classic .crm-ai-audit-context pre,
[data-crm-theme="dark"] .dir-classic .crm-variable-chip-row,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar button,
[data-crm-theme="dark"] .dir-classic .crm-work-schedule-table tr.is-day-off td {
  background: var(--bg-sunken) !important;
  color: var(--text-secondary) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-switch-field:hover,
[data-crm-theme="dark"] .dir-classic .crm-ai-question-chip:hover,
[data-crm-theme="dark"] .dir-classic .crm-ai-question-chip:focus,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar button:hover,
[data-crm-theme="dark"] .dir-classic .crm-editor-toolbar button:focus {
  background: var(--bg-hover) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .crm-visible-checkbox input:checked + span {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-text) !important;
}

[data-crm-theme="dark"] .dir-classic .form-control,
[data-crm-theme="dark"] .dir-classic .custom-select,
[data-crm-theme="dark"] .dir-classic select,
[data-crm-theme="dark"] .dir-classic textarea,
[data-crm-theme="dark"] .dir-classic input[type="text"],
[data-crm-theme="dark"] .dir-classic input[type="email"],
[data-crm-theme="dark"] .dir-classic input[type="number"],
[data-crm-theme="dark"] .dir-classic input[type="password"],
[data-crm-theme="dark"] .dir-classic input[type="search"],
[data-crm-theme="dark"] .dir-classic input[type="tel"],
[data-crm-theme="dark"] .dir-classic input[type="url"],
[data-crm-theme="dark"] .dir-classic input[type="date"],
[data-crm-theme="dark"] .dir-classic input[type="datetime-local"],
[data-crm-theme="dark"] .dir-classic input[type="time"] {
  background: var(--bg-sunken) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .form-control:focus,
[data-crm-theme="dark"] .dir-classic .custom-select:focus,
[data-crm-theme="dark"] .dir-classic select:focus,
[data-crm-theme="dark"] .dir-classic textarea:focus,
[data-crm-theme="dark"] .dir-classic input:focus {
  background: var(--bg-elevated) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.16) !important;
}

[data-crm-theme="dark"] .dir-classic .form-control::placeholder,
[data-crm-theme="dark"] .dir-classic input::placeholder,
[data-crm-theme="dark"] .dir-classic textarea::placeholder {
  color: var(--text-tertiary) !important;
}

[data-crm-theme="dark"] .dir-classic .form-control:disabled,
[data-crm-theme="dark"] .dir-classic .form-control[readonly],
[data-crm-theme="dark"] .dir-classic input:disabled,
[data-crm-theme="dark"] .dir-classic input[readonly],
[data-crm-theme="dark"] .dir-classic select:disabled,
[data-crm-theme="dark"] .dir-classic textarea:disabled,
[data-crm-theme="dark"] .dir-classic textarea[readonly] {
  background: #111827 !important;
  color: var(--text-tertiary) !important;
  opacity: 1 !important;
}

[data-crm-theme="dark"] .dir-classic .alert,
[data-crm-theme="dark"] .dir-classic .alert-info,
[data-crm-theme="dark"] .dir-classic .alert-light,
[data-crm-theme="dark"] .dir-classic .alert-secondary {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

[data-crm-theme="dark"] .dir-classic .dropdown-menu,
[data-crm-theme="dark"] .dir-classic .notif-box,
[data-crm-theme="dark"] .dir-classic .quick-actions,
[data-crm-theme="dark"] .dir-classic .user-switcher-menu {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32) !important;
}

[data-crm-theme="dark"] .dir-classic .dropdown-divider {
  border-color: var(--border) !important;
}

[data-crm-theme="dark"] .dir-classic .user-box,
[data-crm-theme="dark"] .dir-classic .user-box:hover,
[data-crm-theme="dark"] .dir-classic .user-box:focus,
[data-crm-theme="dark"] .dir-classic .dropdown-item.active,
[data-crm-theme="dark"] .dir-classic .dropdown-item:active {
  background: var(--bg-hover) !important;
  color: var(--text) !important;
}

/* Final dark-mode hardening for legacy Ready/Bootstrap surfaces. */
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  background: #171a23 !important;
  border: 1px solid #3f4a66 !important;
  border-radius: 8px !important;
  color: #c7d2fe !important;
  display: inline-flex !important;
  height: 36px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 36px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle.is-active,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #1f2440 !important;
  border-color: #818cf8 !important;
  color: #eef2ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle i {
  font-size: 18px !important;
  line-height: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .table,
html[data-crm-theme="dark"] body.dir-classic .table > :not(caption) > * > *,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table th,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table th,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table td {
  background-color: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-corner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head,
html[data-crm-theme="dark"] body.dir-classic .crm-week-hours {
  background-color: #090b0f !important;
  color: #9ca3af !important;
}

html[data-crm-theme="dark"] body.dir-classic .table tbody tr:hover > *,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover > *,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover > * {
  background-color: #1d2430 !important;
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-workspace {
  background: #2a3140 !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-cell,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days > *,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-body {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #10131a !important;
  color: #6b7280 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(148, 163, 184, 0.10) 32px,
      transparent 33px,
      transparent 63px,
      rgba(148, 163, 184, 0.14) 64px
    ),
    #15181f !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column:hover {
  background: #1d2430 !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.62) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-offhours,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column.is-day-off {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(148, 163, 184, 0.10),
      rgba(148, 163, 184, 0.10) 8px,
      rgba(148, 163, 184, 0.03) 8px,
      rgba(148, 163, 184, 0.03) 16px
    ),
    #10131a !important;
  color: #9ca3af !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-form-card,
html[data-crm-theme="dark"] body.dir-classic .crm-form-section,
html[data-crm-theme="dark"] body.dir-classic .crm-admin-card,
html[data-crm-theme="dark"] body.dir-classic .crm-settings-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-switch-field,
html[data-crm-theme="dark"] body.dir-classic .crm-attachment-card,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable],
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor textarea,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-tabs-card,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-tabs-card .crm-company-tabs,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-card,
html[data-crm-theme="dark"] body.dir-classic .crm-company-tab-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-company-tab-card,
html[data-crm-theme="dark"] body.dir-classic .crm-company-tab-section,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong,
html[data-crm-theme="dark"] body.dir-classic .crm-muted-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-model-option,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-response,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-context,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-context pre {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-variable-chip-row {
  background: #090b0f !important;
  border-color: #2a3140 !important;
  color: #9ca3af !important;
}

html[data-crm-theme="dark"] body.dir-classic input[type="file"] {
  background: #090b0f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input[type="file"]::file-selector-button {
  background: #1d2430 !important;
  border: 1px solid #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle i,
body.dir-classic .crm-theme-toggle i {
  color: currentColor !important;
  display: inline-block !important;
  font-size: 18px !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

body.dir-classic .crm-theme-toggle [data-crm-theme-icon]::before {
  content: "\263E" !important;
  font-family: Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle [data-crm-theme-icon]::before {
  content: "\2600" !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search {
  background: #15181f !important;
  border: 1px solid #2a3140 !important;
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search:focus-within {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.16) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .form-control {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .form-control::placeholder {
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  height: 26px !important;
  justify-content: center !important;
  min-width: 26px !important;
  opacity: 1 !important;
  overflow: visible !important;
  padding: 0 !important;
  position: relative !important;
  text-indent: 0 !important;
  z-index: 4 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #64748b !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #818cf8 !important;
  border-radius: 999px !important;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.16) !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(129, 140, 248, 0.9) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  z-index: 2 !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .modal-header,
html[data-crm-theme="dark"] body.dir-classic .modal-body,
html[data-crm-theme="dark"] body.dir-classic .modal-footer {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal .card,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-form-section,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-muted-panel,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-offer-mail-panel {
  background: #171a23 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal .crm-offer-mail-details[hidden] {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  color: currentColor !important;
  display: inline-flex !important;
  font-family: Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  height: 20px !important;
  justify-content: center !important;
  line-height: 1 !important;
  width: 20px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle [data-crm-theme-icon]::before,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle [data-crm-theme-icon]::before {
  content: none !important;
  display: none !important;
}

body.dir-classic .crm-month-segment-layer {
  pointer-events: none !important;
}

body.dir-classic .crm-month-segment-layer .is-calendar-event,
body.dir-classic .is-calendar-event {
  pointer-events: auto !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-week {
  background: #15181f !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted {
  background: #202530 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  color: #dbeafe !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 26px !important;
  opacity: 1 !important;
  text-shadow: none !important;
  visibility: visible !important;
  z-index: 12 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number::after,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number::after {
  content: none !important;
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-offer-attachments,
html[data-crm-theme="dark"] body.dir-classic .crm-help-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-checkbox-card,
html[data-crm-theme="dark"] body.dir-classic .crm-form-hint-card {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic input::selection,
html[data-crm-theme="dark"] body.dir-classic textarea::selection,
html[data-crm-theme="dark"] body.dir-classic [contenteditable]::selection {
  background: #4338ca !important;
  color: #ffffff !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 2 !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: inline-flex !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-week,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day {
  background: #15181f !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted {
  background: #202530 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  background: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  background: transparent !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
  opacity: 1 !important;
  position: relative !important;
  visibility: visible !important;
  z-index: 20 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #818cf8 !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .form-control,
html[data-crm-theme="dark"] body.dir-classic input.form-control,
html[data-crm-theme="dark"] body.dir-classic textarea.form-control,
html[data-crm-theme="dark"] body.dir-classic select.form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select {
  background-color: #090b0f !important;
  border-color: #303848 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic input.form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea.form-control::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

/* Final dark-mode hardening: keep this block last. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  height: 42px !important;
  justify-content: center !important;
  min-height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  width: 42px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  display: none !important;
}

body.dir-classic .crm-theme-toggle::before {
  color: #24324a !important;
  content: "\263E" !important;
  display: block !important;
  font-family: Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle::before {
  color: #c7d2fe !important;
  content: "\2600" !important;
}

body.dir-classic .crm-calendar-day,
body.dir-classic .crm-week-day-column {
  cursor: pointer;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  background: #15181f !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-week,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
  overflow: hidden !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202530 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day::after,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day::after {
  content: none !important;
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: #e5e7eb !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  line-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  text-indent: 0 !important;
  visibility: visible !important;
  -webkit-text-fill-color: #e5e7eb !important;
  z-index: 40 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #818cf8 !important;
  border-radius: 999px !important;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(129, 140, 248, 0.9) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  background: transparent !important;
  pointer-events: none !important;
}

/* Dark-mode stability pass: final overrides after historical emergency blocks. */
body.dir-classic .crm-theme-toggle::before,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle::before {
  content: none !important;
  display: none !important;
}

body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #d8dee9 !important;
  box-shadow: none !important;
  color: #334155 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #1d1b4f !important;
  border-color: #6366f1 !important;
  color: #c7d2fe !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  color: inherit !important;
  display: none !important;
  height: 18px !important;
  justify-content: center !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 2 !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-table-wrap,
html[data-crm-theme="dark"] body.dir-classic .crm-table,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-filter,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-shell,
html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .modal-body,
html[data-crm-theme="dark"] body.dir-classic .modal-footer {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .input-group,
html[data-crm-theme="dark"] body.dir-classic .input-group-text {
  background: #090b0f !important;
  border-color: #303848 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select {
  background-color: #090b0f !important;
  border-color: #303848 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-kpi-card,
html[data-crm-theme="dark"] body.dir-classic .crm-stat-card,
html[data-crm-theme="dark"] body.dir-classic .crm-metric-card,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-metric,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-section,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head {
  background: #090b0f !important;
  border-color: #2a3140 !important;
  color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #15181f !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202530 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  color: #f8fafc !important;
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Dark mode correction pass 2026-05-08. Keep this block last. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  height: 38px !important;
  justify-content: center !important;
  line-height: 1 !important;
  min-width: 38px !important;
  padding: 0 !important;
  width: 38px !important;
}

body.dir-classic .crm-theme-toggle::before,
body.dir-classic .crm-theme-toggle::after {
  content: none !important;
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  color: inherit !important;
  height: 18px !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  height: 18px !important;
  overflow: visible !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark svg path {
  fill: currentColor !important;
  stroke: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light svg circle,
body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light svg path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-width: 2 !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #d8dee9 !important;
  color: #334155 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #15181f !important;
  border-color: #6366f1 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #1f2440 !important;
  border-color: #818cf8 !important;
  color: #eef2ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  background: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  background-color: #2a3140 !important;
  border: 1px solid #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row {
  background: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
  min-height: 150px !important;
  overflow: hidden !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #10131a !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day {
  padding: 106px 10px 10px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  align-items: center !important;
  background: rgba(15, 23, 42, 0.02) !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #dbeafe !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  position: absolute !important;
  text-indent: 0 !important;
  top: 10px !important;
  visibility: visible !important;
  -webkit-text-fill-color: #dbeafe !important;
  z-index: 70 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day .crm-calendar-day-number {
  top: 10px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #818cf8 !important;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:focus-within {
  background: #1d2430 !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.65) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column,
html[data-crm-theme="dark"] body.dir-classic .crm-week-hours,
html[data-crm-theme="dark"] body.dir-classic .crm-week-time-column {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-corner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday {
  background: #090b0f !important;
  border-color: #2a3140 !important;
  color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-hour-label,
html[data-crm-theme="dark"] body.dir-classic .crm-week-time-label {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong {
  background: #15181f !important;
  border-bottom: 1px solid #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody td {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover td {
  background: #1d2430 !important;
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .form-select,
html[data-crm-theme="dark"] body.dir-classic .custom-select {
  background-color: #10131a !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder,
html[data-crm-theme="dark"] body.dir-classic .form-control::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic input:focus,
html[data-crm-theme="dark"] body.dir-classic select:focus,
html[data-crm-theme="dark"] body.dir-classic textarea:focus,
html[data-crm-theme="dark"] body.dir-classic .form-control:focus,
html[data-crm-theme="dark"] body.dir-classic .form-select:focus,
html[data-crm-theme="dark"] body.dir-classic .custom-select:focus {
  background-color: #10131a !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18) !important;
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-card,
html[data-crm-theme="dark"] body.dir-classic .card,
html[data-crm-theme="dark"] body.dir-classic .crm-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-form-card,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-card,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-summary-tile {
  background-color: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

/* Dark mode final polish pass 2026-05-08. Keep this block last. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  background: #f8fafc !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #334155 !important;
  display: inline-flex !important;
  height: 38px !important;
  justify-content: center !important;
  min-width: 38px !important;
  padding: 0 !important;
  width: 38px !important;
}

body.dir-classic .crm-theme-toggle:hover,
body.dir-classic .crm-theme-toggle:focus {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #4338ca !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  display: none !important;
  height: 100% !important;
  justify-content: center !important;
  width: 100% !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
  color: currentColor !important;
  display: block !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #1b1f2a !important;
  border-color: #6366f1 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #26215f !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-card,
html[data-crm-theme="dark"] body.dir-classic .crm-table-wrap,
html[data-crm-theme="dark"] body.dir-classic .crm-table-shell,
html[data-crm-theme="dark"] body.dir-classic .crm-form-card,
html[data-crm-theme="dark"] body.dir-classic .crm-inline-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-form,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-editable-html,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-metric,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-empty,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .btn,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .btn,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .form-control,
html[data-crm-theme="dark"] body.dir-classic input.form-control,
html[data-crm-theme="dark"] body.dir-classic textarea.form-control,
html[data-crm-theme="dark"] body.dir-classic select.form-control,
html[data-crm-theme="dark"] body.dir-classic .form-control {
  background-color: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::selection,
html[data-crm-theme="dark"] body.dir-classic textarea::selection,
html[data-crm-theme="dark"] body.dir-classic .form-control::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable]::selection {
  background: #312e81 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic input.form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea.form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .form-control::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary,
html[data-crm-theme="dark"] body.dir-classic .btn-light,
html[data-crm-theme="dark"] body.dir-classic .crm-btn-soft,
html[data-crm-theme="dark"] body.dir-classic .crm-chip,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-chip,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-pill {
  background: #15181f !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-light:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-btn-soft:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-chip:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-chip:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-pill:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-chip.is-active,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-pill.is-active {
  background: #26215f !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover td {
  background: #1b2130 !important;
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: #252b36 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-hours,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-time-label {
  background: #0b0f16 !important;
  border-color: #2a3140 !important;
  color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  background: transparent !important;
  pointer-events: none !important;
  z-index: 30 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #cbd5e1 !important;
  min-height: 136px !important;
  overflow: hidden !important;
  padding: 38px 10px 10px !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #111827 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #e5e7eb !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  position: absolute !important;
  text-indent: 0 !important;
  top: 10px !important;
  visibility: visible !important;
  -webkit-text-fill-color: #e5e7eb !important;
  z-index: 90 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event,
html[data-crm-theme="dark"] body.dir-classic .crm-event-pill {
  color: #ffffff !important;
  z-index: 60 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .nav-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .nav-search .input-group-text {
  background: #1b1f2a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-global-search:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel:focus-within {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-outline-primary,
html[data-crm-theme="dark"] body.dir-classic .crm-segmented-control,
html[data-crm-theme="dark"] body.dir-classic .crm-segmented-control a,
html[data-crm-theme="dark"] body.dir-classic .crm-segmented-control button,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch a,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch button {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbeafe !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-outline-primary:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-segmented-control a:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-segmented-control button:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch a:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch button:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch .active,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-view-switch [aria-current="page"] {
  background: #26215f !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-stat-card,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-card,
html[data-crm-theme="dark"] body.dir-classic .crm-action-card,
html[data-crm-theme="dark"] body.dir-classic .crm-company-hero,
html[data-crm-theme="dark"] body.dir-classic .crm-company-profile-card,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-empty,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-content,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-pane,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-card,
html[data-crm-theme="dark"] body.dir-classic .crm-quick-add-card,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-send-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-settings-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-help-panel {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-empty {
  background: #15181f !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-card:hover,
html[data-crm-theme="dark"] body.dir-classic .card:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-card:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-contact-card:hover {
  background-color: #1b2130 !important;
  border-color: #3b4558 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:nth-child(even),
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:nth-child(odd),
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:nth-child(even),
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:nth-child(odd),
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:nth-child(even),
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:nth-child(odd) {
  background-color: #15181f !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day *,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day a,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day button {
  -webkit-text-fill-color: currentColor;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number span,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number a,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number button {
  color: #e5e7eb !important;
  opacity: 1 !important;
  text-shadow: none !important;
  visibility: visible !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected {
  background: #1a2030 !important;
  outline-color: #6366f1 !important;
}

/* Final dark-mode contrast pass for controls and calendar surfaces. */
body.dir-classic .crm-theme-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0 !important;
  border-radius: 8px;
  overflow: visible;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
  display: block !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-dark {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-light {
  display: none !important;
}

body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-dark {
  display: none !important;
}

body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #d8dee8 !important;
  color: #1d2540 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #211b63 !important;
  border: 1px solid #6366f1 !important;
  box-shadow: none !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #2a2473 !important;
  border-color: #818cf8 !important;
  color: #fff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search {
  background: #151a24 !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search .form-control,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .form-control,
html[data-crm-theme="dark"] body.dir-classic .nav-search .form-control {
  background: #151a24 !important;
  caret-color: #e5e7eb !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search .form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic .nav-search .form-control::placeholder {
  color: #7f8aa3 !important;
  -webkit-text-fill-color: #7f8aa3 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: #11161f !important;
  border-color: #2a3140 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #242a35 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  min-height: 24px !important;
  color: #dbe4ff !important;
  opacity: 1 !important;
  position: absolute !important;
  visibility: visible !important;
  z-index: 100 !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  border-radius: 999px !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head,
html[data-crm-theme="dark"] body.dir-classic .crm-week-corner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-hours {
  background: #0b0f16 !important;
  border-color: #2a3140 !important;
  color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong {
    background: #10151e !important;
    border-color: #2a3140 !important;
    color: #a5b4fc !important;
}

/* Dark mode stabilization pass. Keep this block last. */
body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
    display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::before {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark::before {
    content: "\263e";
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light::before {
    content: "\2600";
}

body.dir-classic .crm-theme-toggle {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #d8dee8 !important;
    border-radius: 8px !important;
    color: #1f2a44 !important;
    display: inline-flex !important;
    height: 38px !important;
    justify-content: center !important;
    min-width: 38px !important;
    padding: 0 !important;
}

body.dir-classic .crm-theme-toggle:hover,
body.dir-classic .crm-theme-toggle:focus {
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
    color: #4f46e5 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
    background: #151a24 !important;
    border-color: #3f4c68 !important;
    color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
    background: #211b63 !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select {
    background: #111827 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder,
html[data-crm-theme="dark"] body.dir-classic .form-control::placeholder {
    color: #7d89a3 !important;
    -webkit-text-fill-color: #7d89a3 !important;
}

html[data-crm-theme="dark"] body.dir-classic input:disabled,
html[data-crm-theme="dark"] body.dir-classic select:disabled,
html[data-crm-theme="dark"] body.dir-classic textarea:disabled,
html[data-crm-theme="dark"] body.dir-classic .form-control:disabled {
    background: #0f141d !important;
    border-color: #252c3a !important;
    color: #65728a !important;
    -webkit-text-fill-color: #65728a !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-row {
    background: #151a24 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .modal-header,
html[data-crm-theme="dark"] body.dir-classic .modal-body,
html[data-crm-theme="dark"] body.dir-classic .modal-footer,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-card,
html[data-crm-theme="dark"] body.dir-classic .crm-drawer-dialog .modal-content {
    background: #151a24 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-card,
html[data-crm-theme="dark"] body.dir-classic .crm-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-form-card,
html[data-crm-theme="dark"] body.dir-classic .crm-form-section,
html[data-crm-theme="dark"] body.dir-classic .crm-settings-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-help-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-info-box,
html[data-crm-theme="dark"] body.dir-classic .crm-switch-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-send-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-attachment-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-recommendation-card,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-table,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state {
    background: #151a24 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-variable-bar,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-surface {
    background: #111827 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table,
html[data-crm-theme="dark"] body.dir-classic .crm-table,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table {
    background: #151a24 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table thead th {
    background: #0b0f16 !important;
    border-color: #2a3140 !important;
    color: #9aa7c7 !important;
}

html[data-crm-theme="dark"] body.dir-classic .table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody td {
    background: #151a24 !important;
    border-color: #242b39 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover {
    background: #1b2230 !important;
}

html[data-crm-theme="dark"] body.dir-classic .dropdown-menu,
html[data-crm-theme="dark"] body.dir-classic .list-group-item,
html[data-crm-theme="dark"] body.dir-classic .bg-light,
html[data-crm-theme="dark"] body.dir-classic .alert-light {
    background: #151a24 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .dropdown-item,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item-text {
    color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .dropdown-item:hover,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item:focus,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item.active {
    background: #1f2540 !important;
    color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-filter-chip,
html[data-crm-theme="dark"] body.dir-classic .crm-metric-card,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong {
    background: #151a24 !important;
    border-color: #2a3140 !important;
    color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong {
    color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card {
    background: #0b0f16 !important;
    border-color: #293244 !important;
    color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
    background: #151a24 !important;
    border: 1px solid #293244 !important;
    color: #dbe4ff !important;
    opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
    background: #202734 !important;
    color: #9aa7c7 !important;
    opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    color: #dbe4ff !important;
    display: inline-flex !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    height: 26px !important;
    justify-content: center !important;
    left: 10px !important;
    line-height: 1 !important;
    min-width: 26px !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 10px !important;
    visibility: visible !important;
    z-index: 40 !important;
    -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
    background: #6366f1 !important;
    border-radius: 999px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected {
    box-shadow: inset 0 0 0 2px #818cf8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events {
    background: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column,
html[data-crm-theme="dark"] body.dir-classic .crm-week-slot,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda {
    background: #151a24 !important;
    border-color: #293244 !important;
    color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-offhours {
    background: rgba(148, 163, 184, 0.08) !important;
}

/* Dark-mode hardening pass. Keep this as the last block. */
body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::before {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark::before {
  content: "\263E";
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light::before {
  content: "\2600";
}

body.dir-classic .crm-theme-toggle {
  border-radius: 8px !important;
  height: 38px !important;
  width: 38px !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border-color: #d8dee8 !important;
  color: #334155 !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:hover,
html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:focus {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #4f46e5 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #151a24 !important;
  border-color: #4f46e5 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #211b63 !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-surface,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-html-editor {
  background: #111827 !important;
  border-color: #2a3140 !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder,
html[data-crm-theme="dark"] body.dir-classic .form-control::placeholder {
  color: #7f8aa3 !important;
  -webkit-text-fill-color: #7f8aa3 !important;
}

html[data-crm-theme="dark"] body.dir-classic input:disabled,
html[data-crm-theme="dark"] body.dir-classic select:disabled,
html[data-crm-theme="dark"] body.dir-classic textarea:disabled,
html[data-crm-theme="dark"] body.dir-classic .form-control:disabled {
  background: #1b2130 !important;
  border-color: #2a3140 !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .nav-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .nav-search .input-group-text {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input {
  background: transparent !important;
  border-color: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .card,
html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .modal-header,
html[data-crm-theme="dark"] body.dir-classic .modal-body,
html[data-crm-theme="dark"] body.dir-classic .modal-footer,
html[data-crm-theme="dark"] body.dir-classic .dropdown-menu,
html[data-crm-theme="dark"] body.dir-classic .list-group-item,
html[data-crm-theme="dark"] body.dir-classic .crm-card,
html[data-crm-theme="dark"] body.dir-classic .crm-form-section,
html[data-crm-theme="dark"] body.dir-classic .crm-form-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-settings-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-help-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-info-box,
html[data-crm-theme="dark"] body.dir-classic .crm-switch-card,
html[data-crm-theme="dark"] body.dir-classic .crm-switch-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-variable-bar,
html[data-crm-theme="dark"] body.dir-classic .crm-attachment-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-send-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-email-card,
html[data-crm-theme="dark"] body.dir-classic .crm-admin-card,
html[data-crm-theme="dark"] body.dir-classic .crm-recommendation-card,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-table {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .bg-light,
html[data-crm-theme="dark"] body.dir-classic .alert-light,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-queue-group > strong,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-mini,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-empty {
  background: #111827 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table,
html[data-crm-theme="dark"] body.dir-classic .crm-table,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table {
  background: #151a24 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table thead th {
  background: #0b0f16 !important;
  border-color: #2a3140 !important;
  color: #9fb0c9 !important;
}

html[data-crm-theme="dark"] body.dir-classic .table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody td {
  background: #151a24 !important;
  border-color: #242b3a !important;
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .table-hover tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .table-hover tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-directory-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-action-list-table tbody tr:hover td,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item:hover,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item:focus {
  background: #1b2130 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card {
  background: #0b0f16 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head,
html[data-crm-theme="dark"] body.dir-classic .crm-week-corner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-hours {
  background: #0b0f16 !important;
  border-color: #293244 !important;
  color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202733 !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column:hover {
  background: #1b2130 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day > .crm-calendar-day-number {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #dbe4ff !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  min-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  position: absolute !important;
  text-shadow: none !important;
  top: 10px !important;
  visibility: visible !important;
  width: auto !important;
  z-index: 25 !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row {
  background: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-more {
  background: #1b2130 !important;
  border-color: #334155 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda .card,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

/* Dark-mode final override 2026-05-08. Keep at EOF. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  display: inline-flex !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: relative !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  display: none !important;
  height: 100% !important;
  justify-content: center !important;
  width: 100% !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-dark,
body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-light,
body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-dark {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::before {
  color: currentColor !important;
  display: block !important;
  font-family: Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark::before {
  content: "\263E" !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light::before {
  content: "\2600" !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search {
  background: #151a24 !important;
  border: 1px solid #2a3140 !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
  outline: 0 !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search:focus-within,
html[data-crm-theme="dark"] body.dir-classic .nav-search:focus-within {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row {
  background: #0b0f16 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #dbe4ff !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202733 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  align-items: center !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #dbe4ff !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 1 !important;
  min-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  position: absolute !important;
  text-shadow: none !important;
  top: 10px !important;
  visibility: visible !important;
  width: auto !important;
  z-index: 80 !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted.is-today .crm-calendar-day-number {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Dark-mode modal form override 2026-05-08. Keep at EOF. */
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-page-content,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog .modal-content,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog .modal-header,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog .modal-body,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog .modal-footer,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal-dialog .crm-modal-frame-body,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-form,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-form > .card-body,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form > .card-body,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .card-body,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-line-row,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-switch-field,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-ai-note-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .bg-light {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-line-row,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-switch-field,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-ai-note-panel {
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form label,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .form-label,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-panel-title-row,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-panel-title-row strong,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-mini-calendar-title,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-switch-copy strong,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-probability-row strong {
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form small,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .text-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-help-text,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-switch-copy span,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-mini-calendar-header span,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-panel-title-row small {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .form-control,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form input,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form select,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form textarea,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-rich-editor [contenteditable],
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-rich-editor textarea {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .form-control::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form input::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form textarea::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-outcome-option span,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-range-slot-button,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-rich-editor-variable-row,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-variable-chip,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .btn-outline-secondary,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .btn-light {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-outcome-option input:checked + span,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-outcome-option span:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-form .crm-range-slot-button.is-in-range {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Dark-mode stabilization pass 2026-05-08. Keep this block last. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  border: 1px solid #d8e0ec !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  height: 38px !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  width: 38px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::before {
  content: none !important;
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon i {
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: currentColor !important;
  width: 18px !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border-color: #d8e0ec !important;
  color: #24324a !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:hover,
html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:focus {
  background: #eef2ff !important;
  border-color: #a5b4fc !important;
  color: #4f46e5 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #211b63 !important;
  border-color: #6366f1 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #312e81 !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-card,
html[data-crm-theme="dark"] body.dir-classic .crm-table-card,
html[data-crm-theme="dark"] body.dir-classic .crm-index-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-tabs-shell,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-card,
html[data-crm-theme="dark"] body.dir-classic .crm-metric-card,
html[data-crm-theme="dark"] body.dir-classic .crm-stat-card,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable] {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

html[data-crm-theme="dark"] body.dir-classic input::selection,
html[data-crm-theme="dark"] body.dir-classic textarea::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable]::selection {
  background: #4f46e5 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-page-content,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .container,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .container-fluid,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card-body,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-form,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-activity-form,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-line-row,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-field,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-ai-note-panel {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor-variable-row,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-variable-chip,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .btn-light,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .btn-outline-secondary {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option input:checked + span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option span:hover,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-in-range {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row,
html[data-crm-theme="dark"] body.dir-classic .crm-week-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-panel {
  background: #151a24 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202733 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  align-items: center !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #e5e7eb !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 1 !important;
  min-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  position: absolute !important;
  text-shadow: none !important;
  top: 10px !important;
  visibility: visible !important;
  width: auto !important;
  z-index: 120 !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::after,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events::after,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::after {
  background: transparent !important;
  content: none !important;
  display: none !important;
}

/* Dark-mode hardening pass 2026-05-08. Keep this block last. */
html[data-crm-theme="dark"] body.dir-classic {
  color-scheme: dark;
  --bg: #0b0f16;
  --bg-elevated: #151a24;
  --bg-sunken: #0f141d;
  --bg-hover: #1b2130;
  --bg-active: #20283a;
  --border: #293244;
  --border-strong: #334155;
  --divider: #242b3a;
  --text: #e5e7eb;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
}

body.dir-classic .crm-theme-toggle,
body.dir-classic .topbar .crm-theme-toggle {
  align-items: center !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  flex: 0 0 38px !important;
  height: 38px !important;
  justify-content: center !important;
  line-height: 1 !important;
  min-height: 38px !important;
  min-width: 38px !important;
  overflow: visible !important;
  padding: 0 !important;
  width: 38px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  display: none !important;
  height: 18px !important;
  justify-content: center !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::before,
body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon::after {
  content: none !important;
  display: none !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  fill: none !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  width: 18px !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-dark,
body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #d8e0ec !important;
  color: #24324a !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:hover,
html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle:focus-visible {
  background: #eef2ff !important;
  border-color: #a5b4fc !important;
  color: #4f46e5 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #1e1b4b !important;
  border: 1px solid #6366f1 !important;
  box-shadow: none !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus-visible {
  background: #312e81 !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .topbar,
html[data-crm-theme="dark"] body.dir-classic .sidebar,
html[data-crm-theme="dark"] body.dir-classic .app-shell,
html[data-crm-theme="dark"] body.dir-classic .main-content,
html[data-crm-theme="dark"] body.dir-classic .page-content,
html[data-crm-theme="dark"] body.dir-classic .crm-page,
html[data-crm-theme="dark"] body.dir-classic .crm-page-main {
  background: #0b0f16 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-card,
html[data-crm-theme="dark"] body.dir-classic .card,
html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .dropdown-menu,
html[data-crm-theme="dark"] body.dir-classic .crm-index-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-card,
html[data-crm-theme="dark"] body.dir-classic .crm-table-card,
html[data-crm-theme="dark"] body.dir-classic .crm-tabs-shell,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-metric-card,
html[data-crm-theme="dark"] body.dir-classic .crm-stat-card,
html[data-crm-theme="dark"] body.dir-classic .crm-empty-state,
html[data-crm-theme="dark"] body.dir-classic .crm-side-card,
html[data-crm-theme="dark"] body.dir-classic .crm-quick-add-drawer,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-signature-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-note-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic .crm-dashboard-card,
html[data-crm-theme="dark"] body.dir-classic .crm-company-card,
html[data-crm-theme="dark"] body.dir-classic .crm-action-company-card {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-subpanel,
html[data-crm-theme="dark"] body.dir-classic .crm-line-row,
html[data-crm-theme="dark"] body.dir-classic .crm-row,
html[data-crm-theme="dark"] body.dir-classic .crm-list-row,
html[data-crm-theme="dark"] body.dir-classic .crm-table-row,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-variable-row,
html[data-crm-theme="dark"] body.dir-classic .crm-variable-chip-row,
html[data-crm-theme="dark"] body.dir-classic .crm-switch-field,
html[data-crm-theme="dark"] body.dir-classic .crm-pill,
html[data-crm-theme="dark"] body.dir-classic .crm-pill-filter,
html[data-crm-theme="dark"] body.dir-classic .crm-tab-content,
html[data-crm-theme="dark"] body.dir-classic .crm-dropdown-list,
html[data-crm-theme="dark"] body.dir-classic .crm-user-menu,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-summary,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-attachment,
html[data-crm-theme="dark"] body.dir-classic .bg-light {
  background: #111827 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table,
html[data-crm-theme="dark"] body.dir-classic table,
html[data-crm-theme="dark"] body.dir-classic thead,
html[data-crm-theme="dark"] body.dir-classic tbody,
html[data-crm-theme="dark"] body.dir-classic tr,
html[data-crm-theme="dark"] body.dir-classic td,
html[data-crm-theme="dark"] body.dir-classic th {
  background: transparent !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic thead th,
html[data-crm-theme="dark"] body.dir-classic .table thead th,
html[data-crm-theme="dark"] body.dir-classic .crm-table-header {
  background: #0b0f16 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-list-row:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-table-row:hover,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item:hover,
html[data-crm-theme="dark"] body.dir-classic .dropdown-item:focus {
  background: #1b2130 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable],
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor textarea,
html[data-crm-theme="dark"] body.dir-classic .crm-html-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search-input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor [contenteditable]:empty::before {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

html[data-crm-theme="dark"] body.dir-classic input:disabled,
html[data-crm-theme="dark"] body.dir-classic select:disabled,
html[data-crm-theme="dark"] body.dir-classic textarea:disabled,
html[data-crm-theme="dark"] body.dir-classic .form-control:disabled,
html[data-crm-theme="dark"] body.dir-classic .form-control[readonly] {
  background: #1b2130 !important;
  border-color: #293244 !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-light,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-primary,
html[data-crm-theme="dark"] body.dir-classic .crm-icon-button,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-button,
html[data-crm-theme="dark"] body.dir-classic .crm-toolbar-button {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-light:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-primary:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-icon-button:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-editor-button:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-toolbar-button:hover {
  background: #20283a !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .text-muted,
html[data-crm-theme="dark"] body.dir-classic .small,
html[data-crm-theme="dark"] body.dir-classic small,
html[data-crm-theme="dark"] body.dir-classic .crm-help-text,
html[data-crm-theme="dark"] body.dir-classic .crm-subtitle,
html[data-crm-theme="dark"] body.dir-classic .crm-meta,
html[data-crm-theme="dark"] body.dir-classic .crm-secondary-text {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .modal-body,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-page-content,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .container,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .container-fluid,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card-body,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-form,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-activity-form {
  background: #0b0f16 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-activity-form > *,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-ai-note-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-field {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor-variable-row,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-variable-chip {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option input:checked + span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option span:hover,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-in-range {
  background: rgba(99, 102, 241, 0.22) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .nav-search,
html[data-crm-theme="dark"] body.dir-classic .crm-search-box {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .nav-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-search-box input {
  background: transparent !important;
  border-color: transparent !important;
  color: #e5e7eb !important;
  outline: none !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-board,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-week-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-panel {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row {
  background: transparent !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
  cursor: pointer !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column:hover {
  background: #1b2130 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202733 !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  align-items: center !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #e5e7eb !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 1 !important;
  min-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 7px !important;
  pointer-events: auto !important;
  position: absolute !important;
  text-shadow: none !important;
  top: 10px !important;
  visibility: visible !important;
  width: auto !important;
  z-index: 200 !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::after,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days::after,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events::after,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::after {
  background: transparent !important;
  content: none !important;
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment,
html[data-crm-theme="dark"] body.dir-classic .crm-week-event,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item {
  box-shadow: none !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-variable-row,
html[data-crm-theme="dark"] body.dir-classic .crm-variable-chip,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-html-editor.is-fullscreen,
html[data-crm-theme="dark"] body.dir-classic .crm-html-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-mail-compose-panel {
  background: #111827 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

/* Dark-mode final corrections 2026-05-08. Keep this block last. */
body.dir-classic .crm-theme-toggle {
  position: relative !important;
}

body.dir-classic .crm-theme-toggle svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 1 !important;
  visibility: visible !important;
  fill: none !important;
  stroke: currentColor !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #d8e0ec !important;
  color: #334155 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle {
  background: #1e1b4b !important;
  border: 1px solid #6366f1 !important;
  color: #c7d2fe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group-prepend,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group-text,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search,
html[data-crm-theme="dark"] body.dir-classic .crm-search-box,
html[data-crm-theme="dark"] body.dir-classic .crm-search-shell {
  background: #151a24 !important;
  border-color: #2a3140 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input,
html[data-crm-theme="dark"] body.dir-classic .crm-search-box input,
html[data-crm-theme="dark"] body.dir-classic .crm-search-shell input {
  background: #0b0f16 !important;
  border-color: transparent !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-search input::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-global-search input::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-search-box input::selection,
html[data-crm-theme="dark"] body.dir-classic .crm-search-shell input::selection {
  background: #4f46e5 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-board,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid > *,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-week-grid {
  background: #151a24 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-header,
html[data-crm-theme="dark"] body.dir-classic .crm-week-time-column {
  background: #0b0f16 !important;
  border-color: #293244 !important;
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted {
  background: #202733 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  display: inline-flex !important;
  color: #e5e7eb !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 250 !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #6366f1 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row {
  pointer-events: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment,
html[data-crm-theme="dark"] body.dir-classic .crm-week-event,
html[data-crm-theme="dark"] body.dir-classic [data-calendar-agenda-key] {
  pointer-events: auto !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal,
html[data-crm-theme="dark"] body.dir-classic .modal-dialog,
html[data-crm-theme="dark"] body.dir-classic .modal-content,
html[data-crm-theme="dark"] body.dir-classic .modal-header,
html[data-crm-theme="dark"] body.dir-classic .modal-body,
html[data-crm-theme="dark"] body.dir-classic .modal-footer {
  background: #111827 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal iframe,
html[data-crm-theme="dark"] body.dir-classic .crm-modal-iframe,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-modal-page-content,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-activity-form,
html[data-crm-theme="dark"] body.dir-classic .modal .card,
html[data-crm-theme="dark"] body.dir-classic .modal .card-body,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic .modal .crm-ai-note-panel {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .modal input,
html[data-crm-theme="dark"] body.dir-classic .modal select,
html[data-crm-theme="dark"] body.dir-classic .modal textarea,
html[data-crm-theme="dark"] body.dir-classic .modal .form-control,
html[data-crm-theme="dark"] body.dir-classic .modal .custom-select {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-outcome-option span,
html[data-crm-theme="dark"] body.dir-classic .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic .crm-range-slot-button,
html[data-crm-theme="dark"] body.dir-classic .crm-mini-calendar-day {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-outcome-option input:checked + span,
html[data-crm-theme="dark"] body.dir-classic .crm-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic .crm-range-slot-button.is-in-range {
  background: rgba(99, 102, 241, .22) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-metric-card,
html[data-crm-theme="dark"] body.dir-classic .crm-stat-card,
html[data-crm-theme="dark"] body.dir-classic .crm-kpi-card {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-metric-card:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-stat-card:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-kpi-card:hover {
  background: #1b2130 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-page-content {
  background: #0b0f16 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-form-card,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-modal-form,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card-body,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card-action,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conditional-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-ai-note-panel,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-offer-products-preview,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-rich-editor-toolbar {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page label,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-title,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-panel-title-row strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-copy strong {
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page small,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-card-muted,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar p,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-copy small,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page [data-offer-send-note] {
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .form-control,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .custom-select,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page input,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page select,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page textarea {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .btn-default {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .btn-default:hover {
  background: #1b2130 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-outcome-option input:checked + span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-in-range {
  background: rgba(99, 102, 241, .22) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

/* Dark-mode polish pass 2026-05-08. Keep this block last. */
body.dir-classic .crm-theme-toggle {
  align-items: center !important;
  display: inline-flex !important;
  height: 38px !important;
  justify-content: center !important;
  min-width: 38px !important;
  overflow: visible !important;
  padding: 0 !important;
  width: 38px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon {
  align-items: center !important;
  color: currentColor !important;
  height: 20px !important;
  justify-content: center !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 20px !important;
}

body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon svg {
  display: block !important;
  height: 20px !important;
  overflow: visible !important;
  stroke: currentColor !important;
  width: 20px !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-dark,
html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-light,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light {
  display: inline-flex !important;
}

body.dir-classic .crm-theme-toggle:not(.is-active) .crm-theme-toggle-icon-light,
body.dir-classic .crm-theme-toggle.is-active .crm-theme-toggle-icon-dark,
html:not([data-crm-theme="dark"]) body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-light,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle .crm-theme-toggle-icon-dark {
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-theme-toggle:focus {
  background: #312e81 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-board {
  overflow: visible !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day {
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  color: #dbeafe !important;
  display: inline-flex !important;
  min-height: 28px !important;
  min-width: 28px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  visibility: visible !important;
  z-index: 300 !important;
  -webkit-text-fill-color: #dbeafe !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic input,
html[data-crm-theme="dark"] body.dir-classic select,
html[data-crm-theme="dark"] body.dir-classic textarea,
html[data-crm-theme="dark"] body.dir-classic .form-control,
html[data-crm-theme="dark"] body.dir-classic .custom-select {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
  caret-color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic input::placeholder,
html[data-crm-theme="dark"] body.dir-classic textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic input:focus,
html[data-crm-theme="dark"] body.dir-classic select:focus,
html[data-crm-theme="dark"] body.dir-classic textarea:focus,
html[data-crm-theme="dark"] body.dir-classic .form-control:focus,
html[data-crm-theme="dark"] body.dir-classic .custom-select:focus {
  background: #0b0f16 !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .24) !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-filter-card,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-bar,
html[data-crm-theme="dark"] body.dir-classic .crm-filter-shell,
html[data-crm-theme="dark"] body.dir-classic .crm-search-field,
html[data-crm-theme="dark"] body.dir-classic .crm-search-control,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search,
html[data-crm-theme="dark"] body.dir-classic .crm-index-search .input-group {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-table tbody tr:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-list-row:hover {
  background: #1b2130 !important;
}

/* Calendar dark-mode month layout: explicit grid, visible dates and lighter empty cells. */
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-workspace,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  background: #0b0f16 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  border: 1px solid #293244 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-weekday {
  background: #0f1724 !important;
  border-color: #293244 !important;
  color: #a8b5d8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row {
  background: transparent !important;
  border-color: #293244 !important;
  min-height: 168px !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: transparent !important;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
  height: 100% !important;
  position: relative !important;
  z-index: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day {
  background: #151a24 !important;
  border-bottom: 1px solid #293244 !important;
  border-color: #293244 !important;
  border-right: 1px solid #293244 !important;
  color: #e5e7eb !important;
  min-height: 168px !important;
  padding: 42px 10px 10px !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted {
  background: #111827 !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day:hover {
  background: #1b2130 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days button.crm-calendar-day-number {
  align-items: center !important;
  background: transparent !important;
  border: 0 !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  font-weight: 700 !important;
  height: 28px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 28px !important;
  margin: 0 !important;
  min-height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  position: absolute !important;
  top: 9px !important;
  width: 28px !important;
  z-index: 5 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day > .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day > .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-more {
  position: relative !important;
  z-index: 6 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-muted .crm-calendar-day-number {
  color: #7f8ca8 !important;
  -webkit-text-fill-color: #7f8ca8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-selected .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-selected .crm-calendar-day-number {
  background: #6366f1 !important;
  border-radius: 999px !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .22) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-events,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-rail,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-row {
  background: transparent !important;
  border-color: transparent !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  padding: 38px 8px 0 !important;
  z-index: 4 !important;
}

/* Dark-mode calendar and modal hardening 2026-05-08. Keep after prior WIP blocks. */
html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda .card-body {
  background: #0b0f16 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: #0b0f16 !important;
  border-color: #293244 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  min-width: 826px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day {
  align-content: start !important;
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
  cursor: pointer !important;
  min-height: 168px !important;
  padding: 42px 10px 10px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-muted {
  background: #111827 !important;
  color: #94a3b8 !important;
  opacity: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column:focus-within {
  background-color: #1b2130 !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .36) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday,
html[data-crm-theme="dark"] body.dir-classic .crm-week-corner,
html[data-crm-theme="dark"] body.dir-classic .crm-week-day-head,
html[data-crm-theme="dark"] body.dir-classic .crm-week-hours {
  background: #0f1724 !important;
  border-color: #293244 !important;
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(148, 163, 184, .12) 32px,
      transparent 33px,
      transparent 63px,
      rgba(148, 163, 184, .18) 64px
    ),
    #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
  cursor: pointer !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-day-column.is-today,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(129, 140, 248, .56) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-offhours {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(148, 163, 184, .10),
      rgba(148, 163, 184, .10) 8px,
      rgba(148, 163, 184, .04) 8px,
      rgba(148, 163, 184, .04) 16px
    ),
    #10131a !important;
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-item.is-agenda-selected {
  background: #1b2130 !important;
  border-color: #818cf8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-content strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-time strong {
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-content p,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-note,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-list-time span {
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-week-event,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment {
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event strong,
html[data-crm-theme="dark"] body.dir-classic .crm-week-event strong,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment strong {
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event small,
html[data-crm-theme="dark"] body.dir-classic .crm-week-event small,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment span,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment small,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-time {
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .modal-content,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .modal-content,
html[data-crm-theme="dark"] body.dir-classic .crm-drawer-modal .modal-content {
  background: #111827 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .modal-header,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .modal-header,
html[data-crm-theme="dark"] body.dir-classic .crm-drawer-modal .modal-header,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .modal-body,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .modal-body,
html[data-crm-theme="dark"] body.dir-classic .crm-drawer-modal .modal-body {
  background: #111827 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .card-action,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-form-actions {
  background: #151a24 !important;
  border-color: #293244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-line-table,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-line-row,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-offer-products-preview pre {
  background: #0b0f16 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-control {
  background: #0b0f16 !important;
  border-color: #475569 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-switch-field input:checked + .crm-switch-control {
  background: #4f46e5 !important;
  border-color: #818cf8 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page input[type="range"] {
  accent-color: #818cf8 !important;
  -webkit-text-fill-color: initial !important;
}

/* Dark calendar readability fix 2026-05-08. This intentionally overrides older dark-mode patches. */
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-page {
  background: #070b12 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-toolbar .card-body {
  background: #111827 !important;
  border-color: #263244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-workspace {
  background: #070b12 !important;
  gap: 20px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-week-planner-card {
  background: #0d131f !important;
  border: 1px solid #263244 !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28) !important;
  overflow: auto !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid {
  background: #263244 !important;
  border: 1px solid #263244 !important;
  border-radius: 12px !important;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
  min-width: 826px !important;
  overflow: hidden !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::before,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid::after,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row::after,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days::before,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days::after {
  content: none !important;
  display: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-weekday {
  background: #111827 !important;
  border: 0 !important;
  border-bottom: 1px solid #263244 !important;
  color: #a5b4fc !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  min-height: 38px !important;
  padding: 12px 14px !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-row {
  background: #263244 !important;
  border: 0 !important;
  display: grid !important;
  grid-column: 1 / -1 !important;
  min-height: 156px !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days {
  background: #263244 !important;
  display: grid !important;
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
  min-height: 156px !important;
  position: relative !important;
  z-index: 1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day {
  align-content: start !important;
  background: #121a28 !important;
  border: 0 !important;
  border-right: 1px solid #263244 !important;
  border-bottom: 1px solid #263244 !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
  cursor: pointer !important;
  display: block !important;
  min-height: 156px !important;
  opacity: 1 !important;
  padding: 44px 10px 10px !important;
  position: relative !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day:nth-child(6),
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day:nth-child(7) {
  background: #101827 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-muted {
  background: #0c111b !important;
  color: #7f8ca8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day:focus-within,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day:focus-within {
  background: #182235 !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .42) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
  align-items: center !important;
  appearance: none !important;
  background: rgba(15, 23, 36, .92) !important;
  border: 1px solid rgba(148, 163, 184, .28) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #f8fafc !important;
  display: inline-flex !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  height: 26px !important;
  justify-content: center !important;
  left: 10px !important;
  line-height: 1 !important;
  margin: 0 !important;
  min-height: 26px !important;
  min-width: 26px !important;
  opacity: 1 !important;
  padding: 0 8px !important;
  pointer-events: auto !important;
  position: absolute !important;
  text-shadow: none !important;
  top: 10px !important;
  visibility: visible !important;
  width: auto !important;
  z-index: 1000 !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-muted .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-muted .crm-calendar-day-number {
  background: rgba(8, 13, 22, .92) !important;
  border-color: rgba(100, 116, 139, .22) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-today {
  background: #172033 !important;
  box-shadow: inset 0 0 0 2px #6366f1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day.is-today .crm-calendar-day-number,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day.is-today .crm-calendar-day-number {
  background: #6366f1 !important;
  border-color: #a5b4fc !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  background: transparent !important;
  border: 0 !important;
  display: grid !important;
  gap: 5px !important;
  grid-template-columns: repeat(7, minmax(118px, 1fr)) !important;
  grid-template-rows: repeat(4, 24px) !important;
  left: 0 !important;
  padding: 44px 8px 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  z-index: 20 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-month-event,
html[data-crm-theme="dark"] body.dir-classic .crm-month-event-segment {
  background: color-mix(in srgb, var(--event-color, #818cf8) 32%, #111827) !important;
  border: 1px solid color-mix(in srgb, var(--event-color, #818cf8) 62%, #263244) !important;
  color: #f8fafc !important;
  pointer-events: auto !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-more {
  background: #0b1020 !important;
  border: 1px solid #263244 !important;
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda {
  background: #111827 !important;
  border: 1px solid #263244 !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28) !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda .card-header,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda .card-body {
  background: #111827 !important;
  border-color: #263244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-agenda .crm-empty-state {
  background: #0d131f !important;
  border: 1px solid #263244 !important;
  color: #e5e7eb !important;
}

/* Dark modal alert fix 2026-05-08: Bootstrap alerts inside iframe modals. */
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert {
  border-width: 1px !important;
  box-shadow: none !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert-success,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert-success,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert-success {
  background: rgba(6, 78, 59, .82) !important;
  border-color: rgba(52, 211, 153, .42) !important;
  color: #bbf7d0 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert-success strong,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert-success strong,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert-success strong {
  color: #dcfce7 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert-warning,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert-warning,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert-warning {
  background: rgba(69, 26, 3, .86) !important;
  border-color: rgba(251, 191, 36, .42) !important;
  color: #fde68a !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert-danger,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert-danger,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert-danger {
  background: rgba(69, 10, 10, .86) !important;
  border-color: rgba(248, 113, 113, .42) !important;
  color: #fecaca !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .alert-info,
html[data-crm-theme="dark"] body.dir-classic .crm-iframe-modal .alert-info,
html[data-crm-theme="dark"] body.dir-classic .crm-activity-modal .alert-info {
  background: rgba(12, 74, 110, .84) !important;
  border-color: rgba(56, 189, 248, .42) !important;
  color: #bae6fd !important;
}

/* Dark mode completion pass 2026-05-08: calendar forms, mail compose and modal controls. */
html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-grid article,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-card,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-products-preview,
html[data-crm-theme="dark"] body.dir-classic .crm-muted-panel,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-free-box,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-conflict-box,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-range-toggle,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-check-toggle,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-free-box,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conflict-box,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-toggle,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-check-toggle {
  background: #111827 !important;
  border-color: #263244 !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel strong,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-card strong,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-grid strong,
html[data-crm-theme="dark"] body.dir-classic .crm-muted-panel strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-free-box strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-conflict-box strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar-title,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar-day > strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-range-toggle label strong,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-check-toggle strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-free-box strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conflict-box strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-title,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day > strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-toggle label strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-check-toggle strong {
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel p,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel small,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-grid span,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-compose-preview-grid small,
html[data-crm-theme="dark"] body.dir-classic .crm-muted-panel p,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-free-box p,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-conflict-box p,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar-header p,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-mini-calendar-day > span,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-check-toggle small,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-free-box p,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conflict-box p,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-header p,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-day > span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-check-toggle small,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .form-text,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .text-muted {
  color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-free-box,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-free-box {
  background: rgba(6, 78, 59, .28) !important;
  border-color: rgba(52, 211, 153, .38) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-free-box strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-free-box strong {
  color: #bbf7d0 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-conflict-box,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conflict-box {
  background: rgba(69, 10, 10, .35) !important;
  border-color: rgba(248, 113, 113, .38) !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-calendar-event-form .crm-conflict-box strong,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-conflict-box strong {
  color: #fecaca !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-toggle label,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-controls .btn,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-mini-calendar-controls .form-control,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-panel .form-control,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-html-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-offer-mail-editor,
html[data-crm-theme="dark"] body.dir-classic .crm-html-source-textarea {
  background: #0b1220 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button small,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-slot-button small {
  color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-free {
  background: rgba(6, 78, 59, .28) !important;
  border-color: rgba(52, 211, 153, .34) !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-busy {
  background: rgba(69, 10, 10, .3) !important;
  border-color: rgba(248, 113, 113, .34) !important;
}

html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-selected,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-slot-button.is-in-range,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-range-toggle input:checked + span,
html[data-crm-theme="dark"] body.dir-classic.crm-modal-page .crm-check-toggle input:checked + .crm-check-toggle-box {
  background: #4f46e5 !important;
  border-color: #a5b4fc !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar {
  background: #0b1220 !important;
  border-color: #334155 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar .btn,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar .btn {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-editor-toolbar .btn:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-rich-editor-toolbar .btn:hover {
  background: #1f2937 !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-meta,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-block,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-context,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-context pre,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-rules ul {
  background: #111827 !important;
  border-color: #263244 !important;
  color: #e5e7eb !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-context summary,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-rules li,
html[data-crm-theme="dark"] body.dir-classic .crm-ai-audit-block strong {
  color: #f8fafc !important;
}

/* Calendar dark layout hardening 2026-05-08: keep all seven month columns visible. */
.dir-classic .crm-calendar-workspace {
  min-width: 0;
}

.dir-classic .crm-calendar-workspace > .crm-week-planner-card,
.dir-classic .crm-calendar-workspace > .crm-calendar-agenda {
  min-width: 0;
}

.dir-classic .crm-calendar-month-grid,
.dir-classic .crm-month-week-days,
.dir-classic .crm-month-segment-layer,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days,
html[data-crm-theme="dark"] body.dir-classic .crm-month-segment-layer {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

.dir-classic .crm-calendar-month-grid .crm-calendar-day,
.dir-classic .crm-month-week-days .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day {
  min-width: 0 !important;
}

@media (max-width: 1480px) {
  .dir-classic .crm-calendar-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dir-classic .crm-calendar-agenda {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .dir-classic .crm-calendar-month-grid .crm-calendar-day,
  .dir-classic .crm-month-week-days .crm-calendar-day,
  html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day,
  html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day {
    min-height: 128px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }

  html[data-crm-theme="dark"] body.dir-classic .crm-calendar-month-grid .crm-calendar-day-number,
  html[data-crm-theme="dark"] body.dir-classic .crm-month-week-days .crm-calendar-day-number,
  html[data-crm-theme="dark"] body.dir-classic button.crm-calendar-day-number {
    left: 7px !important;
    top: 8px !important;
  }
}

/* Topbar layout hardening 2026-05-12: keep profile compact and page titles below the fixed header. */
.dir-classic .navbar-header .container-fluid {
  display: flex !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}

.dir-classic .crm-topbar-workspace {
  flex: 1 1 auto !important;
  grid-template-columns: minmax(220px, 300px) minmax(260px, 1fr) !important;
  min-width: 0 !important;
}

.dir-classic .topbar-nav {
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.dir-classic .crm-user-dropdown .profile-pic {
  align-items: center !important;
  display: inline-flex !important;
  gap: 8px !important;
  max-width: 174px !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}

.dir-classic .crm-user-dropdown .profile-pic .crm-avatar,
.dir-classic .crm-user-dropdown .profile-pic .crm-avatar-image {
  flex: 0 0 auto !important;
  margin-right: 0 !important;
}

.dir-classic .crm-user-dropdown .profile-pic > span:not(.crm-avatar) {
  color: var(--text) !important;
  display: inline-block !important;
  max-width: 118px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dir-classic .main-panel > .content {
  padding-top: 42px !important;
}

@media (max-width: 1200px) {
  .dir-classic .crm-topbar-workspace {
    grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) !important;
  }

  .dir-classic .crm-user-dropdown .profile-pic {
    max-width: 138px !important;
  }

  .dir-classic .crm-user-dropdown .profile-pic > span:not(.crm-avatar) {
    max-width: 84px !important;
  }
}

/* UI audit polish 2026-05-12: repeated list tabs, selects, file inputs and compact topbar controls. */
.dir-classic select.form-control,
.dir-classic select.custom-select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: right 12px center !important;
  background-repeat: no-repeat !important;
  background-size: 14px 14px !important;
  padding-right: 38px !important;
}

.dir-classic input[type="file"].form-control,
.dir-classic input[type="file"] {
  min-height: 42px;
}

.dir-classic input[type="file"]::file-selector-button {
  background: #eef2ff;
  border: 0;
  border-right: 1px solid #d8e0ec;
  color: #3730a3;
  font-weight: 700;
  height: 100%;
  margin: -7px 12px -7px -12px;
  padding: 9px 14px;
}

.dir-classic .crm-index-tabs a,
.dir-classic .crm-index-tabs span {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.dir-classic .crm-index-tabs a:focus-visible,
.dir-classic .crm-index-tabs span:focus-visible,
.dir-classic .btn:focus-visible,
.dir-classic .form-control:focus-visible {
  outline: 2px solid rgba(99, 102, 241, .42);
  outline-offset: 2px;
}

html[data-crm-theme="dark"] body.dir-classic .btn-default,
html[data-crm-theme="dark"] body.dir-classic .dropdown-toggle.btn-default,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary,
html[data-crm-theme="dark"] body.dir-classic .btn-light {
  background: #111827 !important;
  border-color: #334155 !important;
  box-shadow: none !important;
  color: #dbe4ff !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .btn-default:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-default:focus,
html[data-crm-theme="dark"] body.dir-classic .dropdown-toggle.btn-default:hover,
html[data-crm-theme="dark"] body.dir-classic .dropdown-toggle.btn-default:focus,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-outline-secondary:focus,
html[data-crm-theme="dark"] body.dir-classic .btn-light:hover,
html[data-crm-theme="dark"] body.dir-classic .btn-light:focus {
  background: #20283a !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a,
html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs span {
  background: #111827 !important;
  border-color: #334155 !important;
  box-shadow: none !important;
  color: #dbe4ff !important;
  -webkit-text-fill-color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a:focus,
html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a.active {
  background: #312e81 !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs strong,
html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a span {
  background: transparent !important;
  border: 0 !important;
  color: #a5b4fc !important;
  -webkit-text-fill-color: #a5b4fc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a:hover span,
html[data-crm-theme="dark"] body.dir-classic .crm-index-tabs a.active span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic select.form-control,
html[data-crm-theme="dark"] body.dir-classic select.custom-select {
  background-color: #0b0f16 !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' fill='none' stroke='%23cbd5e1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position: right 12px center !important;
  background-repeat: no-repeat !important;
  background-size: 14px 14px !important;
}

html[data-crm-theme="dark"] body.dir-classic input[type="file"]::file-selector-button {
  background: #111827;
  border-right: 1px solid #334155;
  color: #dbe4ff;
}

html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a[aria-expanded="true"],
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a[aria-expanded="true"] {
  background: transparent !important;
  border-color: transparent !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a:hover,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a:focus,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a:hover,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a:focus,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a[aria-expanded="true"] {
  background: #20283a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a i,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a p,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item > a .caret,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a i,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a p,
html[data-crm-theme="dark"] body.dir-classic .sidebar .nav > .nav-item.active > a .caret {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sidebar-subnav li a {
  background: transparent !important;
  border-color: transparent !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sidebar-subnav li.active a,
html[data-crm-theme="dark"] body.dir-classic .crm-sidebar-subnav li a:hover,
html[data-crm-theme="dark"] body.dir-classic .crm-sidebar-subnav li a:focus {
  background: #20283a !important;
  border-color: #334155 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-action-chip {
  background: #172033 !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line {
  background: #0f172a !important;
  border-color: #263348 !important;
  color: #dbe4ff !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line span,
html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line small {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line strong {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line.is-open {
  border-left-color: #818cf8 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line.is-lost {
  border-left-color: #f87171 !important;
}

html[data-crm-theme="dark"] body.dir-classic .crm-sales-opportunity-line.is-won {
  border-left-color: #34d399 !important;
}
