:root[data-theme="dark"] .workspace-main,
:root[data-theme="dark"] .main-content { background-color: var(--color-canvas); }

:root[data-theme="dark"] :where(
  .sidebar, .contextbar, .user-menu, .task-center, .button-secondary,
  .search-field, .view-switch, .view-switch button, .summary-card, .table-panel,
  .action-dialog, .dialog-footer, .route-state, .info-card, .choice-card, .stepper,
  .entity-preview, .collection-pager button,
  .notice, .admin-link, .health-row, .event-row, .event-panel, .console-gateway-panel,
  .catalog-card, .catalog-card footer button, .infrastructure-card,
  .infrastructure-card footer button, .admin-kpis article, .admin-panel,
  .admin-quick button, .customer-card, .customer-card footer,
  .settings-layout > aside, .reference-panel, .health-summary > article, .dep-node,
  .resource-card, .storage-card, .resource-settings, .resource-pagination,
  .pagination-controls button, .storage-add, .resource-add, .detail-drawer,
  .drawer-header, .drawer-tabs, .drawer-structured-list, .drawer-footer,
  .period-chip, .copy-detail, .drawer-quick-actions button, .structured-action,
  .order-process, .order-options article, .asset-tile, .compact-tile, .panel
) { color: var(--color-ink); background-color: var(--color-surface); }

:root[data-theme="dark"] :where(
  .data-table th, .data-table tbody tr:hover, .dialog-footer, .customer-card footer
) { background-color: #222b36; }

:root[data-theme="dark"] :where(
  .search-field input, .dialog-field input, .dialog-field select, .dialog-field textarea,
  .settings-form input, .settings-form select, .settings-form-grid input,
  .settings-form-grid select, .environment-selector-panel select, .network-limit-field input
) { color: var(--color-ink); background: #151b23; border-color: var(--color-line-strong); }

:root[data-theme="dark"] :where(
  .button-secondary, .button-ghost, .workflow-list li, .data-table th,
  .catalog-card footer button, .infrastructure-card footer button,
  .drawer-quick-actions button, .structured-action, .period-chip, .copy-detail
) { color: #c1cad6; }

:root[data-theme="dark"] :where(
  .resource-visual, .storage-visual
) { background: linear-gradient(135deg, #242d39, #35242b); }

:root[data-theme="dark"] :where(.resource-facts > div, .service-meta > span) {
  background-color: #222b36;
}

:root[data-theme="dark"] .appearance-control {
  color: #edf2f7;
  border-color: #566273;
  background: #303a47;
}

:root[data-theme="dark"] .dialog-result { color: #c1cad6; background: #222b36; }
:root[data-theme="dark"] .dialog-result.is-readonly { color: #f2cf7a; background: #3b311b; border-color: #6b5728; }
:root[data-theme="dark"] .dialog-result.is-error { color: #ff9bb0; background: #3e1d27; border-color: #713447; }
:root[data-theme="dark"] .error-state { color: #ff9bb0; background: #3e1d27; border-color: #713447; }
:root[data-theme="dark"] .empty-inline { color: var(--color-muted); background: var(--color-surface); }

:root[data-theme="dark"] .service-health-grid em { color: var(--color-muted); }
