.crm-theme-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
  padding: 7px 8px 10px;
  border-bottom: 1px solid #e6eaf0;
}
.crm-theme-control > span {
  color: #6c7582;
  font-size: 11px;
  font-weight: 750;
}
.crm-theme-control > div {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 3px;
  padding: 2px;
  border: 1px solid #dce2e8;
  border-radius: 6px;
  background: #f4f6f8;
}
.crm-user-menu .crm-theme-control button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
}
.crm-user-menu .crm-theme-control button.active {
  background: #fff;
  box-shadow: 0 1px 4px rgb(24 33 43 / 14%);
}
.crm-theme-control img { width: 15px; height: 15px; }

html[data-theme="dark"] {
  --crm-filter-surface: #171e26;
  --crm-table-header-surface: #222b35;
  --brand-accent: #20c1b1;
  --brand-accent-hover: #39cebf;
  --brand-accent-strong: #70ddd3;
  --brand-accent-soft: #173934;
  --brand-accent-soft-strong: #1c4942;
  --dark-page: #0f141a;
  --dark-surface: #171d24;
  --dark-elevated: #1d252e;
  --dark-soft: #222b35;
  --dark-border: #34404d;
  --dark-text: #e6edf3;
  --dark-muted: #9aa7b5;
  --dark-link: #70ddd3;
  --crm-detail-label-color: var(--dark-muted);
  --crm-detail-value-color: var(--dark-text);
  background: var(--dark-page);
  color: var(--dark-text);
}
html[data-theme="dark"] body,
html[data-theme="dark"] body.crm-mode,
html[data-theme="dark"] .auth-page {
  background: var(--dark-page);
  color: var(--dark-text);
}
html[data-theme="dark"] :is(h1, h2, h3, h4, strong, b, legend) { color: var(--dark-text); }
html[data-theme="dark"] :is(a, .link-button) { color: var(--dark-link); }
html[data-theme="dark"] :is(p, small, dt, .muted) { border-color: var(--dark-border); }
html[data-theme="dark"] hr { border-color: var(--dark-border); }

html[data-theme="dark"] :is(input, select, textarea) {
  border-color: var(--dark-border);
  background: #111820;
  color: var(--dark-text);
}
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #778594; }
html[data-theme="dark"] :is(input, select, textarea):focus {
  border-color: #4abfb4;
  box-shadow: 0 0 0 2px rgb(32 193 177 / 16%);
}
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--dark-text);
  box-shadow: 0 0 0 1000px #111820 inset;
}

html[data-theme="dark"] :is(.crm-global-header, .topbar) {
  border-color: var(--dark-border);
  background: #121820;
}
html[data-theme="dark"] :is(.crm-global-row, .crm-section-row) { border-color: var(--dark-border); }
html[data-theme="dark"] :is(.crm-section-row, .crm-subnav) { background: #121820; }
html[data-theme="dark"] .crm-workspace { background: var(--dark-page); }
html[data-theme="dark"] .crm-brand { color: var(--dark-text); }
html[data-theme="dark"] .crm-brand strong span { color: #dcecff; }
html[data-theme="dark"] .crm-brand-logo-light,
html[data-theme="dark"] .auth-brand-light { display: none; }
html[data-theme="dark"] .crm-brand-symbol .crm-brand-logo-dark {
  display: block;
  width: 64px;
  height: 64px;
  top: -12px;
  left: -12px;
}
html[data-theme="dark"] .auth-brand-dark { display: block; }
html[data-theme="dark"] .crm-global-nav a { color: #a6b2c0; }
html[data-theme="dark"] .crm-global-nav a.active {
  color: #fff;
  text-decoration-color: var(--brand-accent);
}
html[data-theme="dark"] .crm-subnav a { color: #9aa7b5; }
html[data-theme="dark"] .crm-subnav a.active { border-color: transparent; color: #fff; }
html[data-theme="dark"] .crm-app-grid i { background: #9aa7b5; }
html[data-theme="dark"] .crm-user-avatar { border-color: #121820; background: #2b3946; }
html[data-theme="dark"] .crm-user-copy small,
html[data-theme="dark"] .crm-user-chevron { color: var(--dark-muted); }
html[data-theme="dark"] :is(.crm-user-menu, .crm-action-menu > div) {
  border-color: var(--dark-border);
  background: var(--dark-elevated);
  box-shadow: 0 14px 34px rgb(0 0 0 / 36%);
}
html[data-theme="dark"] :is(.crm-user-menu a, .crm-user-menu button, .crm-action-menu > div a) { color: var(--dark-text); }
html[data-theme="dark"] :is(.crm-user-menu a, .crm-user-menu button, .crm-action-menu > div a):hover { background: #29343f; }
html[data-theme="dark"] .crm-theme-control { border-color: var(--dark-border); }
html[data-theme="dark"] .crm-theme-control > span { color: var(--dark-muted); }
html[data-theme="dark"] .crm-theme-control > div { border-color: var(--dark-border); background: #121920; }
html[data-theme="dark"] .crm-user-menu .crm-theme-control button.active { background: #34414d; box-shadow: 0 1px 5px rgb(0 0 0 / 45%); }
html[data-theme="dark"] .crm-theme-control img { filter: brightness(0) invert(1); }

html[data-theme="dark"] body :is(
  .crm-search-field,
  .crm-select-field,
  .crm-mine-filter,
  .crm-more-filters,
  .crm-employee-profile-metrics article,
  .crm-employee-profile-form,
  .crm-employee-profile-grid > article,
  .queue-view-tabs,
  .queue-list,
  .queue-list-heading,
  .assigned-base-filter-section,
  .operations-summary,
  .source-health-row,
  .operation-action,
  .analytics-detail-footer,
  .analytics-sales-date-range,
  .analytics-sales-presets
) {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text);
}
html[data-theme="dark"] body.crm-mode .crm-employee-metrics article {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text);
}
html[data-theme="dark"] body :is(.crm-search-field, .crm-select-field, .crm-mine-filter, .crm-more-filters) {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}
html[data-theme="dark"] body :is(.crm-mine-filter, .crm-more-filters, .crm-select-field > span) { color: var(--dark-muted); }
html[data-theme="dark"] body .queue-view-tabs a + a,
html[data-theme="dark"] body .operations-summary article {
  border-color: var(--dark-border);
}
html[data-theme="dark"] body .queue-view-tabs a { color: var(--dark-muted); }
html[data-theme="dark"] body .queue-view-tabs a strong { color: var(--dark-text); }
html[data-theme="dark"] body .queue-view-tabs a.active { background: var(--brand-accent-soft); color: var(--brand-accent-strong); }
html[data-theme="dark"] body .queue-list-heading { background: var(--dark-elevated); }
html[data-theme="dark"] body :is(.queue-company-row, .assigned-base-company-row, .source-health-row) { border-color: var(--dark-border); }

html[data-theme="dark"] body :is(.crm-table td, .crm-table th, .statistics-work-table th, .statistics-work-table td) {
  border-color: var(--dark-border);
}
html[data-theme="dark"] body.crm-mode .crm-table td { border-bottom-color: var(--dark-border); }
html[data-theme="dark"] body .bpm-reference-table .bpm-table-row + .bpm-table-row > td { border-top: 1px solid var(--dark-border); }
html[data-theme="dark"] body .bpm-reference-table .crm-entity-link { color: var(--dark-text); }
html[data-theme="dark"] body .bpm-reference-table .crm-entity-link:hover,
html[data-theme="dark"] body .bpm-reference-table .crm-entity-link:focus-visible { color: var(--brand-accent-strong); }
html[data-theme="dark"] body .statistics-work-table tbody tr[data-employee]:nth-of-type(4n+3) { background: #141b22; }
html[data-theme="dark"] body :is(.crm-table tbody tr, .statistics-work-table tbody tr[data-employee]):hover { background: #29343f; }

html[data-theme="dark"] .task-step-copy .task-status-label { color: #b8c3cf; }
html[data-theme="dark"] .task-step-copy .task-action-label { color: #9aa7b5; }

html[data-theme="dark"] :is(
  .task-step-date.overdue,
  .task-step-meta time.overdue,
  .crm-overdue-date,
  .activity-step-tab.activity-date-overdue time,
  .activities-page[data-view-mode="compact"] .activity-company-compact-step.activity-date-overdue time,
  .bpm-overdue-label
) { color: var(--brand-accent-strong) !important; }
html[data-theme="dark"] .activity-summary-row.activity-date-overdue time {
  border-left-color: var(--brand-accent);
  background: var(--brand-accent-soft);
  color: var(--brand-accent-strong);
}
html[data-theme="dark"] .activities-page[data-view-mode="compact"] .activity-company-compact-step.activity-date-overdue {
  border-left-color: var(--brand-accent);
}

html[data-theme="dark"] .crm-action-icon,
html[data-theme="dark"] :is(.crm-action-icon.email, .crm-action-icon.messenger, .crm-action-icon.in_person, .crm-action-icon.video_meeting, .crm-action-icon.meeting, .crm-next-step-missing) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
html[data-theme="dark"] .crm-action-icon img { filter: brightness(0) invert(1); opacity: .72; }
html[data-theme="dark"] .crm-next-step-missing img {
  filter: invert(65%) sepia(18%) saturate(660%) hue-rotate(304deg) brightness(101%) contrast(98%);
}

html[data-theme="dark"] :is(
  .panel,
  .company-header,
  .dashboard-hero,
  .metric-grid article,
  .test-subnav,
  .employee-filter,
  .inn-search,
  .auth-panel,
  .access-card,
  .activity-card,
  .planner-card,
  .planner-cell,
  .planner-no-step,
  .kanban-column,
  .kanban-card,
  .kanban-hover-card,
  .statistics-summary,
  .statistics-filter-menu,
  .statistics-help,
  .work-funnel-panel,
  .work-funnel-detail-dialog,
  .crm-filter-panel,
  .crm-table-wrap,
  .crm-reference-table-wrap,
  .crm-compact-section,
  .crm-reference-context,
  .crm-reference-client-card,
  .crm-reference-events,
  .crm-commercial-records,
  .crm-reference-communication,
  .crm-company-create-section,
  .crm-reference-add-contact > form,
  .crm-side-panel,
  .crm-deal-head,
  .crm-deal-context,
  .crm-deal-activity-column,
  .deal-task-card,
  .deal-task-dialog,
  .activity-history-event,
  .company-subsection,
  .company-edit-panel,
  .company-inline-form,
  .girbo-control,
  .source-monitor,
  .project-clone-control > form,
  .project-settings-tabs,
  .project-dictionary-row,
  .analytics-kpis,
  .analytics-panel,
  .bpm-dialog,
  .bpm-work-block,
  .communication-report,
  .communication-report-preview
) {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text);
  box-shadow: none;
}

html[data-theme="dark"] :is(
  .secondary,
  .button,
  .kebab-button,
  .crm-icon-button,
  .panel-inline-action,
  .contact-inline-icon,
  .task-icon,
  .task-history-edit-toggle,
  .task-history-inline-button,
  .task-history-delete,
  .statistics-info,
  .statistics-help-close,
  .statistics-breakdown-toggle,
  .statistics-records-progress button,
  .work-funnel-detail-dialog footer button,
  .work-funnel-detail-dialog footer a,
  .girbo-icon,
  .crm-bulk-toolbar button
) {
  border-color: var(--dark-border);
  background: var(--dark-elevated);
  color: var(--dark-text);
}
html[data-theme="dark"] :is(
  .secondary,
  .button,
  .kebab-button,
  .crm-icon-button,
  .panel-inline-action,
  .contact-inline-icon,
  .task-icon,
  .task-history-edit-toggle,
  .task-history-inline-button,
  .statistics-info,
  .statistics-help-close,
  .statistics-breakdown-toggle
):hover { background: #29343f; }
html[data-theme="dark"] :is(.crm-icon-button, .panel-inline-action, .contact-inline-icon, .task-icon, .statistics-info, .statistics-help-close, .statistics-breakdown-toggle) img {
  filter: brightness(0) invert(1);
  opacity: .82;
}
html[data-theme="dark"] .contact-delete-icon {
  border-color: var(--dark-border);
  background: transparent;
}
html[data-theme="dark"] .contact-delete-icon:hover { background: var(--dark-hover); }
html[data-theme="dark"] .contact-delete-icon.confirm {
  border-color: #76505a;
  background: #35262d;
}
html[data-theme="dark"] .contact-delete-icon img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .contact-delete-confirm small { color: var(--dark-muted); }
html[data-theme="dark"] .extra-contact-grid > span,
html[data-theme="dark"] .extra-contact-row > * { border-bottom-color: var(--dark-border); }

html[data-theme="dark"] :is(
  .filter-panel,
  .statistics-filterbar,
  .analytics-filterbar,
  .activities-filterbar,
  .work-funnel-filterbar,
  .crm-filterbar,
  .crm-bulk-toolbar,
  .planner-toolbar,
  .kanban-toolbar,
  .company-edit-grid,
  .deal-task-card > summary,
  .crm-deal-reference .crm-pipeline-step,
  .crm-reference-tabs,
  .crm-section-head,
  .crm-table thead,
  .crm-mode .crm-table th,
  .table-header,
  .statistics-work-table thead th
) {
  border-color: var(--dark-border);
  background: var(--dark-soft);
  color: var(--dark-text);
}
html[data-theme="dark"] :is(.statistics-work-table tbody tr:nth-child(even), .table-row:nth-child(even)) { background: #141b22; }
html[data-theme="dark"] .statistics-work-table tfoot { background: #17312d; }
html[data-theme="dark"] .statistics-page .statistics-work-table .statistics-breakdown > td { background: #1b242d; }
html[data-theme="dark"] :is(table, th, td, .table-row, .crm-table-row, .crm-data-list > div, .crm-reference-person-section, .crm-reference-collapsible) {
  border-color: var(--dark-border);
}
html[data-theme="dark"] :is(th, dt, .table-header, .statistics-work-table thead th, .statistics-breakdown-items dt) { color: var(--dark-muted); }
html[data-theme="dark"] :is(td, dd, .statistics-work-table tbody th, .statistics-work-table a) { color: var(--dark-text); }

html[data-theme="dark"] :is(.statistics-multi-filter summary, .statistics-period input, .work-funnel-segmented span) {
  border-color: var(--dark-border);
  background: #111820;
  color: #c4ced8;
}
html[data-theme="dark"] .work-funnel-segmented input:checked + span {
  border-color: #3ebbad;
  background: #173934;
  color: #8ae6dc;
  box-shadow: inset 0 0 0 1px #3ebbad;
}
html[data-theme="dark"] .statistics-filter-menu label:hover { background: #29343f; }

html[data-theme="dark"] :is(
  .activities-filterbar summary,
  .activities-filter-reset,
  .activities-company-search-control button,
  .activities-multiselect > div,
  .kanban-filter summary,
  .kanban-period-nav,
  .analytics-employee-filter summary,
  .analytics-employee-filter > div,
  .analytics-tabs,
  .activities-view-switcher,
  .activities-sort-control,
  .activities-view-control
) {
  border-color: var(--dark-border);
  background: var(--dark-elevated);
  color: var(--dark-text);
}
html[data-theme="dark"] .activities-extra-filter > summary { background: transparent; }
html[data-theme="dark"] .activities-extra-filter > summary i {
  border-color: var(--dark-muted);
  background: var(--dark-soft);
  box-shadow: 0 0 0 8px var(--dark-soft);
}
html[data-theme="dark"] :is(.activities-filter-reset, .kanban-period-nav) img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .kanban-filter .is-active summary { border-color: #4abfb4; background: var(--brand-accent-soft); }

html[data-theme="dark"] .work-funnel-stage { border-color: #40505e; color: #e8eef5; }
html[data-theme="dark"] .work-funnel-stage.stage-processed { background: #29333d; }
html[data-theme="dark"] .work-funnel-stage.stage-calls { background: #20384a; }
html[data-theme="dark"] .work-funnel-stage.stage-interest { background: #1e3c51; }
html[data-theme="dark"] .work-funnel-stage.stage-agreement { background: #4a3b20; }
html[data-theme="dark"] .work-funnel-stage.stage-pilot { background: #392e49; }
html[data-theme="dark"] .work-funnel-stage.stage-partner,
html[data-theme="dark"] .work-funnel-stage.stage-won { background: #1f4435; }
html[data-theme="dark"] .work-funnel-stage.stage-closed { background: #2a333c; }
html[data-theme="dark"] .work-funnel-stage.stage-lost { background: #4a292f; }
html[data-theme="dark"] .work-funnel-activity-overview button { border-color: var(--dark-border); background: #1c2630; color: var(--dark-text); }
html[data-theme="dark"] .work-funnel-activity-overview button:hover { background: #25323e; }
html[data-theme="dark"] .work-funnel-action-grid button:nth-child(1) { background: #20384a; }
html[data-theme="dark"] .work-funnel-action-grid button:nth-child(2) { background: #293c27; }
html[data-theme="dark"] .work-funnel-action-grid button:nth-child(3) { background: #4a3b20; }
html[data-theme="dark"] .work-funnel-action-grid button:nth-child(4) { background: #392e49; }

html[data-theme="dark"] :is(.crm-reference-client-card header, .crm-reference-company-summary, .crm-reference-person-grid, .crm-reference-additional-data dl) { border-color: var(--dark-border); }
html[data-theme="dark"] :is(.crm-reference-company-summary dt, .crm-reference-person-grid dt) { color: var(--dark-muted); }
html[data-theme="dark"] :is(.crm-reference-company-summary dd, .crm-reference-person-grid dd) { color: var(--dark-text); }
html[data-theme="dark"] .contact-primary-badge { background: #293946; color: #c5d5e4; }
html[data-theme="dark"] .crm-reference-company-tags > span:not(.muted) { background: #28333e; color: #c1ccd7; }
html[data-theme="dark"] :is(.crm-product-picker label span, .crm-product-picker.readonly > span, .crm-sales-channel) {
  border-color: var(--dark-border);
  background: var(--dark-elevated);
  color: #bec9d4;
}
html[data-theme="dark"] .crm-product-picker input:checked + span { border-color: #3ebbad; background: #173934; color: #8ae6dc; }

html[data-theme="dark"] :is(.company-inline-form, .deal-task-dialog, .task-history-edit-form) :is(input, select, textarea),
html[data-theme="dark"] :is(.task-title-input, .task-history-inline-select) {
  border-color: var(--dark-border);
  background: #111820;
  color: var(--dark-text);
}
html[data-theme="dark"] :is(.company-narrative-text, .communication-report, .communication-report-preview) { color: #c8d3dd; }
html[data-theme="dark"] :is(.task-tooltip, .crm-company-bigdata-results) {
  border-color: var(--dark-border);
  background: #222c36;
  color: var(--dark-text);
  box-shadow: 0 8px 24px rgb(0 0 0 / 30%);
}

html[data-theme="dark"] :is(.access-card.access-date-overdue, .activity-card.activity-date-overdue, .table-row.activity-date-overdue) { border-color: #66404a; background: #382329; }
html[data-theme="dark"] :is(.access-card.access-date-today, .access-draft-card, .activity-card.activity-date-today, .table-row.activity-date-today) { border-color: #635535; background: #352f21; }
html[data-theme="dark"] :is(.access-card.access-date-future, .activity-card.activity-date-future, .table-row.activity-date-future) { border-color: var(--dark-border); background: var(--dark-surface); }
html[data-theme="dark"] :is(.message, .crm-warning, .crm-company-bigdata-existing) { border-color: #66552f; background: #342d1e; color: #f2d68f; }
html[data-theme="dark"] :is(.message.error, .field-error, .crm-error) { border-color: #6c3e49; background: #3b2228; color: #ffadb8; }
html[data-theme="dark"] :is(.message.success, .crm-success) { border-color: #35664f; background: #1c392d; color: #98e5ba; }

html[data-theme="dark"] .auth-panel { box-shadow: 0 22px 70px rgb(0 0 0 / 28%); }
html[data-theme="dark"] .auth-panel .primary { color: #071715; }
html[data-theme="dark"] :is(.project-admin-list > a, .project-dictionary-row) { border-color: var(--dark-border); background: var(--dark-surface); color: var(--dark-text); }
html[data-theme="dark"] .project-admin-list > a:hover { background: #222c36; }
html[data-theme="dark"] .project-dictionary-row.is-disabled { background: #1b222a; }

html[data-theme="dark"] :is(.planner-row-heading, .planner-column-heading, .kanban-column > header) {
  border-color: var(--dark-border);
  background: var(--dark-elevated);
  color: var(--dark-text);
}
html[data-theme="dark"] :is(.planner-cell.overdue, .planner-column-heading.overdue) { border-color: rgb(239 199 204 / 24%); background: rgb(169 20 39 / 18%); color: rgb(239 199 204 / 82%); }
html[data-theme="dark"] :is(.planner-cell.today, .planner-column-heading.today) { border-color: rgb(234 215 165 / 25%); background: rgb(118 83 0 / 22%); color: rgb(234 215 165 / 86%); }
html[data-theme="dark"] :is(.planner-cell.future, .planner-column-heading.future) { border-color: rgb(199 223 209 / 22%); background: rgb(39 98 68 / 25%); color: rgb(199 223 209 / 84%); }
html[data-theme="dark"] .planner-cell.overdue .planner-card { border-left-color: rgb(169 20 39 / 66%); }
html[data-theme="dark"] .planner-cell.today .planner-card { border-left-color: rgb(118 83 0 / 72%); }
html[data-theme="dark"] .planner-cell.future .planner-card { border-left-color: rgb(39 98 68 / 72%); }
html[data-theme="dark"] :is(.planner-card p, .planner-card header span, .planner-card footer, .kanban-hover-card p, .kanban-hover-card time) { color: var(--dark-muted); }
html[data-theme="dark"] :is(.kanban-column > header h2, .kanban-hover-card h3, .kanban-hover-card dd) { color: var(--dark-text); }
html[data-theme="dark"] .kanban-column > header span { background: #303b47; color: #c4ced8; }
html[data-theme="dark"] :is(.kanban-card:hover, .kanban-card:focus-visible) { border-color: #617285; background: #232d37; }
html[data-theme="dark"] .kanban-column > header { border-bottom-color: var(--dark-border); box-shadow: 0 2px 6px rgb(0 0 0 / 24%); }
html[data-theme="dark"] .kanban-hover-card dl > div { border-color: var(--dark-border); }

html[data-theme="dark"] :is(.analytics-kpis article, .analytics-panel > header, .analytics-table-scroll th, .analytics-table-scroll td) { border-color: var(--dark-border); }
html[data-theme="dark"] :is(.analytics-kpis span, .analytics-kpis small, .analytics-panel > header small, .analytics-trend-panel footer) { color: var(--dark-muted); }
html[data-theme="dark"] :is(.analytics-kpis strong, .analytics-panel > header > strong) { color: var(--dark-text); }
html[data-theme="dark"] :is(.analytics-export-button, .analytics-presets a) { border-color: var(--dark-border); background: var(--dark-elevated); color: var(--dark-text); }

html[data-theme="dark"] :is(.crm-mode .crm-activity-form, .crm-mode .crm-timeline-item, .crm-mode .crm-next-step, .crm-reference-communication > section) {
  border-color: var(--dark-border);
  background: #1b242d;
  color: var(--dark-text);
}
html[data-theme="dark"] :is(.crm-mode .crm-tabs, .crm-mode .crm-timeline-item, .crm-deal-products-panel, .crm-reference-contact-list) { border-color: var(--dark-border); }
html[data-theme="dark"] .crm-deal-reference { color: var(--dark-text); }
html[data-theme="dark"] .crm-mode .crm-tabs { background: var(--dark-surface); }
html[data-theme="dark"] .crm-reference-context { background: transparent; }
html[data-theme="dark"] .crm-mode .crm-tabs.crm-reference-tabs {
  border-bottom: 1px solid var(--dark-border);
  background: transparent;
  box-shadow: none;
}
html[data-theme="dark"] :is(.crm-mode .crm-tabs button, .crm-reference-communication > section > span, .crm-reference-communication dd span) {
  background: transparent;
  color: var(--dark-muted);
}
html[data-theme="dark"] :is(.crm-mode .crm-tabs button.active, .crm-reference-communication > section p) { color: var(--dark-text); }
html[data-theme="dark"] .activity-status-model {
  border-color: var(--dark-border);
  background: var(--dark-soft);
}
html[data-theme="dark"] .activity-status-button {
  border-color: var(--dark-border);
  background: transparent;
  color: var(--dark-muted);
}
html[data-theme="dark"] .activity-status-button.is-active {
  background: var(--dark-elevated);
  color: var(--dark-text);
}
html[data-theme="dark"] .activity-status-button.is-complete { background: #1b232b; color: #bdc8d3; }
html[data-theme="dark"] .crm-deal-status-model .activity-status-button:hover { background: #29343f; color: #fff; }
html[data-theme="dark"] :is(.crm-owner-tag, .crm-data-tag, .crm-product-tag) { border-color: var(--dark-border); background: #28333e; color: #c7d2dc; }
html[data-theme="dark"] .bpm-table-row.access-date-overdue > td { background: #382329; }

html[data-theme="dark"] :is(.company-tag-badge, .crm-product-tag, .crm-sales-channel, .crm-owner-tag, .crm-data-tag, .contact-primary-badge, .access-owner-tag, .crm-reference-company-tags > span, .assigned-base-tags > span, .crm-status) {
  border-color: #46525e;
  background: #252e37;
  color: #b9c4ce;
  font-weight: 500;
}
html[data-theme="dark"] .crm-mode .crm-table.crm-company-table .crm-company-name-link,
html[data-theme="dark"] .crm-mode .crm-table.crm-holdings-table td:nth-child(2) .crm-entity-link { color: var(--brand-accent-strong); }
html[data-theme="dark"] .crm-mode .crm-table.crm-company-table .crm-holding-link,
html[data-theme="dark"] .crm-mode .crm-table.crm-holdings-table td:first-child .crm-entity-link { color: var(--dark-text); }
html[data-theme="dark"] :is(.crm-reference-person-form input, .crm-reference-person-form select) {
  border-color: var(--dark-border);
  background: #111820;
  color: var(--dark-text);
}
html[data-theme="dark"] .enrichment-control[data-state="failed"] .enrichment-fill,
html[data-theme="dark"] .girbo-control[data-result-tone="error"] .enrichment-fill { background: #222b35; }
html[data-theme="dark"] .crm-state-filter,
html[data-theme="dark"] .crm-bulk-toolbar :is(select, input) {
  border-color: var(--dark-border);
  background: #111820;
  color: var(--dark-text);
}
html[data-theme="dark"] .crm-state-filter span { border-color: var(--dark-border); color: var(--dark-muted); }
html[data-theme="dark"] .crm-state-filter input:checked + span { background: #19332f; color: #8ad9cf; box-shadow: inset 0 -2px #36b8aa; }

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] *,
  html[data-theme="dark"] *::before,
  html[data-theme="dark"] *::after { transition-duration: .01ms !important; }
}
