/*
 * GE Comercial - camada final de compatibilidade do tema escuro.
 *
 * Este arquivo precisa ser carregado depois dos estilos dos modulos. Varios
 * componentes recentes possuem cores claras locais ou estilos embutidos na
 * view; as regras abaixo centralizam as superficies sem alterar o tema claro.
 */
html[data-ui-theme="dark"] {
  color-scheme: dark;
  --ge-dark-bg: #07111e;
  --ge-dark-surface: #101d2c;
  --ge-dark-surface-2: #142235;
  --ge-dark-surface-3: #0b1725;
  --ge-dark-surface-hover: #192a40;
  --ge-dark-text: #f1f5f9;
  --ge-dark-text-soft: #cbd5e1;
  --ge-dark-muted: #94a3b8;
  --ge-dark-border: #29394d;
  --ge-dark-border-strong: #3a4d65;
  /* aliases historicos usados pelos modulos mais antigos e pelos mais novos */
  --surface: var(--ge-dark-surface);
  --surface-soft: var(--ge-dark-surface-2);
  --panel: var(--ge-dark-surface);
  --panel-soft: var(--ge-dark-surface-2);
  --paper: var(--ge-dark-bg);
  --white: var(--ge-dark-surface);
  --text: var(--ge-dark-text);
  --text-muted: var(--ge-dark-muted);
  --border: var(--ge-dark-border);
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body),
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .app-shell,
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .app-main {
  background-color: var(--ge-dark-bg) !important;
  color: var(--ge-dark-text) !important;
}

/* Superficies compartilhadas. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .page-head,
  .page-hero,
  .panel,
  .filter-card,
  .responsive-table,
  .table-wrap,
  .operation-action-card,
  .counter-toolbar,
  .counter-filter,
  .counter-filter-total,
  .counter-items-detail,
  .counter-items-grid,
  .tables-live-summary,
  .dashboard-period-card,
  .dashboard-metric-card,
  .dashboard-panel,
  .dashboard-chart-filter,
  .dashboard-summary-strip,
  .service-order-list-panel,
  .os-dashboard-card,
  .os-list-filter,
  .quote-list-panel,
  .quote-filter,
  .quote-settings-dialog,
  .quote-settings-section,
  .quote-settings-card,
  .quote-detail-panel,
  .quote-section-card,
  .quote-section-card-title,
  .quote-client-grid,
  .quote-item-card,
  .nfe55-list-panel,
  .nfe-detail,
  .nfe-form-tabs,
  .nfe-tab-panel,
  .nfe-item-modal-card,
  .nfe-fiscal-item-card,
  .delivery-filter,
  .delivery-card,
  .settings-card,
  .settings-form,
  .settings-section-head
) {
  background-color: var(--ge-dark-surface) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .operation-action-card:hover,
  .operation-action-card:focus-visible,
  .os-dashboard-card:hover,
  .os-dashboard-card:focus-visible,
  .list-row:hover,
  .modern-table tbody tr:hover,
  .responsive-table tbody tr:hover
) {
  background-color: var(--ge-dark-surface-hover) !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
}

/* Tipografia: evita texto escuro ou quase invisivel sobre superficies escuras. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  h1, h2, h3, h4, h5, h6,
  .page-head h1,
  .page-head h2,
  .panel h2,
  .panel h3,
  .operation-action-card strong,
  .counter-status-copy,
  .counter-status-copy strong,
  .tables-live-summary strong,
  .service-order-list-panel h2,
  .os-dashboard-card strong,
  .quote-section-title h2,
  .quote-section-title h3
) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .muted,
  .page-head p,
  .operation-action-card small,
  .tables-live-summary small,
  .os-dashboard-card span,
  .os-dashboard-card small,
  .quote-kpi-header p,
  .quote-kpi-detail,
  .quote-analytics-head p,
  .quote-chart-title span
) {
  color: var(--ge-dark-muted) !important;
}

/* Controles e filtros declarados novamente em estilos locais dos modulos. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .select2-selection,
  .choices__inner,
  .date-input,
  .search-input
) {
  background-color: var(--ge-dark-surface-3) !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: none !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  input, textarea
)::placeholder {
  color: #7f90a7 !important;
  opacity: 1;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  label,
  .counter-filter-title,
  .dashboard-period-title,
  .dashboard-chart-filter label
) {
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .btn:not(.primary):not(.success):not(.danger):not(.fiscal-action),
  button.btn:not(.primary):not(.success):not(.danger):not(.fiscal-action),
  a.btn:not(.primary):not(.success):not(.danger):not(.fiscal-action)
) {
  background-color: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
}

/* Tabelas e listas. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  table,
  .modern-table,
  .responsive-table table,
  .counter-items-grid,
  .nfe-items-grid
) {
  background-color: var(--ge-dark-surface) !important;
  color: var(--ge-dark-text) !important;
  border-color: var(--ge-dark-border) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  thead,
  th,
  .modern-table thead,
  .modern-table th,
  .counter-items-grid-head,
  .nfe-items-grid-head
) {
  background-color: var(--ge-dark-surface-3) !important;
  color: var(--ge-dark-text-soft) !important;
  border-color: var(--ge-dark-border) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  tbody tr,
  td,
  .modern-table tbody tr,
  .modern-table td,
  .counter-items-grid-row,
  .nfe-items-grid-row
) {
  background-color: var(--ge-dark-surface) !important;
  color: var(--ge-dark-text) !important;
  border-color: var(--ge-dark-border) !important;
}

/* Cards de atalhos usados por Balcao, Mesas, OS, Compras e outros modulos. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .operation-action-card {
  background: var(--ge-dark-surface-2) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .operation-action-card kbd {
  background: var(--ge-dark-surface-3) !important;
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .operation-action-card:disabled {
  background: #172336 !important;
  color: #718096 !important;
  opacity: .7;
}

/* Dashboard. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dashboard-chart-filter,
  .dashboard-summary-strip
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dashboard-summary-strip strong,
  .dashboard-product-copy strong,
  .dashboard-product-total,
  .dashboard-activity strong,
  .dashboard-goal-card strong
) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dashboard-summary-strip small,
  .dashboard-product-copy small,
  .dashboard-activity small,
  .dashboard-goal-card small
) {
  color: var(--ge-dark-muted) !important;
}

/* Orcamentos: KPIs e modal de indicadores possuem CSS embutido na view. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .quote-kpi-card,
  .quote-kpi-open
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .quote-kpi-number,
  .quote-kpi-label
) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .quote-kpi-card::after {
  opacity: .14 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .quote-analytics-dialog {
  background: var(--ge-dark-bg) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .quote-analytics-head {
  background: rgba(16, 29, 44, .97) !important;
  border-color: var(--ge-dark-border) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .quote-analytics-summary article,
  .quote-chart-card
) {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .quote-analytics-head h2,
  .quote-analytics-summary strong,
  .quote-chart-title h3,
  .quote-funnel-row strong,
  .quote-ranking-row strong
) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .quote-analytics-summary span,
  .quote-analytics-summary small,
  .quote-funnel-row span,
  .quote-ranking-row span
) {
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .quote-analytics-close {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
}

/* Balcao e historico de vendas. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .counter-status-card,
  .counter-filter-total,
  .counter-filter,
  .counter-order-card,
  .counter-items-detail
) {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .counter-status-card.active {
  background: var(--ge-dark-surface-2) !important;
}

/* Balcao: preserva a semantica dos filtros de situacao no tema escuro.
   Estas regras precisam vir depois da normalizacao estrutural acima. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.pending {
  background: #0d2340 !important;
  border-color: #245ca8 !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.completed {
  background: #102a22 !important;
  border-color: #26734a !important;
  color: #bbf7d0 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.cancelled {
  background: #321923 !important;
  border-color: #8b3146 !important;
  color: #fecdd3 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.discarded {
  background: #17202d !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.pending.active {
  background: #12345f !important;
  border-color: #60a5fa !important;
  box-shadow: inset 0 -3px 0 #60a5fa, 0 0 0 1px rgba(96, 165, 250, .32) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.completed.active {
  background: #123b2d !important;
  border-color: #4ade80 !important;
  box-shadow: inset 0 -3px 0 #4ade80, 0 0 0 1px rgba(74, 222, 128, .28) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.cancelled.active {
  background: #491d2c !important;
  border-color: #fb7185 !important;
  box-shadow: inset 0 -3px 0 #fb7185, 0 0 0 1px rgba(251, 113, 133, .28) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card.discarded.active {
  background: #263446 !important;
  border-color: #94a3b8 !important;
  box-shadow: inset 0 -3px 0 #94a3b8, 0 0 0 1px rgba(148, 163, 184, .26) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-toolbar .counter-tabs .counter-status-card :is(strong, span) {
  color: inherit !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-status-card.pending .counter-status-icon {
  background: #173b68 !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-status-card.completed .counter-status-icon {
  background: #174b35 !important;
  color: #bbf7d0 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-status-card.cancelled .counter-status-icon {
  background: #54202f !important;
  color: #fecdd3 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body)
  .counter-status-card.discarded .counter-status-icon {
  background: #29384b !important;
  color: #e2e8f0 !important;
}

/* Sistema visual compartilhado para acoes, menus e etiquetas.
   Evita que componentes pequenos mantenham o fundo branco de views antigas. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .icon-action,
  .mini-action,
  .counter-icon-action,
  .financial-method-badge,
  .payable-note-details-trigger,
  .fiscal-details-action,
  .role-chip,
  .counter-more-actions > summary
) {
  background: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text-soft) !important;
  box-shadow: none !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .icon-action,
  .mini-action,
  .counter-icon-action,
  .counter-more-actions > summary
):is(:hover, :focus-visible) {
  background: var(--ge-dark-surface-hover) !important;
  border-color: #527096 !important;
  color: #ffffff !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .icon-action.edit,
  .mini-action.print,
  .counter-icon-action.edit,
  .counter-icon-action.print,
  .counter-icon-action.timeline
) {
  background: #10294a !important;
  border-color: #285f9e !important;
  color: #93c5fd !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .icon-action.success,
  .mini-action.cash,
  .counter-icon-action.finance,
  .counter-icon-action.success
) {
  background: #102f27 !important;
  border-color: #26734a !important;
  color: #86efac !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .mini-action.timeline,
  .counter-icon-action.warning
) {
  background: #332615 !important;
  border-color: #815b2d !important;
  color: #fed7aa !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .icon-action.delete,
  .mini-action.delete,
  .counter-icon-action.delete,
  .counter-icon-action.danger
) {
  background: #351a23 !important;
  border-color: #8b3146 !important;
  color: #fda4af !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .counter-more-actions[open] > summary {
  background: #10294a !important;
  border-color: #3b82f6 !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .counter-more-menu,
  .receivable-actions-menu,
  .rental-actions > div
) {
  background: var(--ge-dark-surface-3) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .42) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .counter-more-menu,
  .receivable-actions-menu,
  .rental-actions > div
) :is(a, button):not(.danger):not(.delete):hover {
  background: var(--ge-dark-surface-hover) !important;
  color: #ffffff !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .status-badge {
  background: #10294a !important;
  border: 1px solid #285f9e !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .status-badge.success,
  .user-status-pill.active,
  .status.issued
) {
  background: #102f27 !important;
  border-color: #26734a !important;
  color: #86efac !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .status-badge.warning,
  .status.draft
) {
  background: #332615 !important;
  border-color: #815b2d !important;
  color: #fed7aa !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .status-badge.danger,
  .user-status-pill.inactive,
  .status.cancelled
) {
  background: #351a23 !important;
  border-color: #8b3146 !important;
  color: #fecdd3 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .status-badge.neutral,
  .role-chip,
  .financial-method-badge
) {
  background: #1b2737 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .payable-note-details-trigger,
  .receivable-note-details .payable-note-details-trigger
) {
  background: #25204a !important;
  border-color: #5145a5 !important;
  color: #c4b5fd !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .operation-action-icon,
  .page-head-action-icon,
  .nfe-head-action-icon,
  .product-title-icon
) {
  background: var(--ge-dark-surface-3) !important;
  border-color: var(--ge-dark-border-strong) !important;
}

/* Mesas. Mantem a sinalizacao operacional pela borda, sem cards brancos. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .tables-live-summary {
  background: linear-gradient(135deg, #102a25, #142235) !important;
  border-color: #276749 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .table-card {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .table-card.open {
  background: #2a2117 !important;
  border-color: #b86a13 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .table-card strong,
  .table-card small,
  .table-number,
  .table-status
) {
  color: var(--ge-dark-text) !important;
}

/* Ordens de servico. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .os-list-filter {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .os-dashboard-card.overdue {
  background: #311921 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .os-dashboard-card.due-soon {
  background: #2b2415 !important;
}

/* Modais e caixas de dialogo de todos os modulos administrativos. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .modal-backdrop > section,
  .additional-modal,
  .fiscal-file-modal,
  .dashboard-config-dialog,
  .quote-settings-dialog,
  .product-modal-card,
  .customer-modal-card,
  .supplier-modal-card,
  .carrier-modal-card,
  .confirmation-dialog,
  .system-confirm-dialog
) {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dashboard-config-list,
  .dashboard-config-list label,
  .modal-section,
  .modal-card,
  .dialog-card
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

/* Menus flutuantes, resultados de busca e seletores. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dropdown-menu,
  .popover,
  .search-results,
  .floating-results,
  .os-floating-results,
  .select2-dropdown,
  .choices__list--dropdown
) {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .dropdown-menu a:hover,
  .popover a:hover,
  .search-results button:hover,
  .floating-results button:hover,
  .os-floating-results button:hover,
  .select2-results__option--highlighted,
  .choices__item--choice.is-highlighted
) {
  background: var(--ge-dark-surface-hover) !important;
  color: var(--ge-dark-text) !important;
}

/* Barras de rolagem discretas no tema escuro. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) * {
  scrollbar-color: #52647c var(--ge-dark-surface-3);
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) *::-webkit-scrollbar-track {
  background: var(--ge-dark-surface-3);
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) *::-webkit-scrollbar-thumb {
  background: #52647c;
  border: 2px solid var(--ge-dark-surface-3);
}

/*
 * Cobertura dos modulos especializados. Estes componentes foram encontrados
 * na auditoria declarando superficies claras depois do bloco escuro original.
 */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .composition-card,
  .production-history-row,
  .products-search,
  .composition-search-results,
  .raw-summary-grid article,
  .raw-filter,
  .raw-count-form,
  .raw-history,
  .agenda-patient-results,
  .agenda-patient-results button,
  .agenda-confirm-modal,
  .agenda-compact-event details > div,
  .carrier-modal-head,
  .carrier-tabs,
  .carrier-form-main fieldset,
  .carrier-modal-footer,
  .carrier-logistics-form,
  .carrier-logistics-list,
  .carrier-modal .carrier-section,
  .cte-screen-tabs a,
  .cte-import-panel,
  .cte-file-picker span,
  .cte-city-results,
  .cte-city-results button,
  .cte-nfe-modal,
  .cte-readiness article,
  .rental-kpis article,
  .rental-section,
  .rental-customer-results,
  .rental-customer-results button,
  .rental-actions > div,
  .contract-health > div,
  .contract-kpis article,
  .contract-card,
  .shipping-hero,
  .shipping-nfe-list > label,
  .shipping-summary article,
  .shipping-recipient,
  .shipping-money-field,
  .receivable-payment-modal,
  .receivable-payment-modal-head,
  .receivable-payment-grid,
  .receivable-payment-meta,
  .receivable-payment-meta div,
  .quote-view-toggle,
  .quote-kanban-navigation button,
  .quote-kanban-empty,
  .sicoob-layout-option,
  .sicoob-layout-preview,
  .labels-v2-text-style label,
  .sync-overview-card,
  .exchange-kpis article,
  .sicoob-sync-dialog,
  .seller-modal-card,
  .seller-modal-card > header,
  .customer-contact-row,
  .customer-contacts-footer,
  [data-customer-modal] .customer-cnpj-strip,
  [data-customer-modal] .customer-person-type,
  [data-customer-modal] .customer-disclosure-content
) {
  background-color: var(--ge-dark-surface) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .raw-material-row,
  .carrier-logistics-list article,
  .cte-screen-tabs a.active,
  .contract-tabs button.active,
  .os-settings-group,
  .os-settings-featured,
  .os-tool-unavailable-card,
  .os-tool-allocation-card,
  .os-attachment-grid article,
  .os-conference-item,
  .os-global-history-list > article,
  .os-help-steps li,
  .os-help-checklist label,
  .os-help-example > div,
  .os-help-status-grid article,
  .os-quote-import-result,
  .financial-alert-kpis article,
  .financial-alert-card,
  .financial-alert-tabs,
  .customer-contact-row
) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

/* Modais completos de OS, transportadora, sincronizacao e contatos. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .os-tools-settings-card,
  .os-tool-unavailable-card,
  .os-final-conference-card,
  .os-return-modal-card,
  .os-global-history-card,
  .os-help-card,
  [data-os-delete-attachment-modal] .os-attachment-delete-card,
  .os-quote-import-card,
  .customer-contacts-card,
  .seller-modal-card,
  .email-sending-dialog,
  .nfce-transmission-modal,
  .offline-online-return-dialog
) {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .os-tools-settings-card .modal-header,
  .os-tool-unavailable-card .modal-header,
  .os-final-conference-card > .modal-header,
  .os-final-conference-card > .os-conference-items,
  .os-final-conference-card > label,
  .os-final-conference-card > .modal-actions,
  .os-return-modal-card > .modal-header,
  .os-global-history-card > .modal-header,
  .os-help-header,
  .os-help-content,
  .os-help-footer,
  [data-os-delete-attachment-modal] .modal-header,
  .os-quote-import-header,
  .os-quote-import-form footer,
  .customer-contacts-card .modal-header,
  .customer-contact-list,
  .customer-contacts-footer,
  .seller-modal-card > header
) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .os-quote-import-action,
  .os-quote-import-search > span,
  .os-quote-import-result,
  .financial-alert-hero,
  .financial-alert-empty,
  .financial-fiscal-toast
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .composition-card,
  .production-history-row,
  .raw-summary-grid article,
  .raw-count-form,
  .raw-history,
  .rental-section,
  .contract-card,
  .shipping-summary article,
  .financial-alert-card,
  .sync-overview-card,
  .exchange-kpis article
) :is(h2, h3, h4, strong) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .composition-card,
  .production-history-row,
  .raw-summary-grid article,
  .raw-count-form,
  .raw-history,
  .rental-section,
  .contract-card,
  .shipping-summary article,
  .financial-alert-card,
  .sync-overview-card,
  .exchange-kpis article
) :is(p, small, span) {
  color: var(--ge-dark-text-soft);
}

/*
 * Rede de seguranca estrutural.
 * O sistema possui muitos modulos independentes e alguns deles declaram suas
 * superficies depois do CSS principal. Os nomes abaixo representam os
 * componentes visuais compartilhados, independentemente do modulo que os
 * criou. Previews de documentos e areas de impressao ficam de fora.
 */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-card"], [class*="-card "],
  [class$="-panel"], [class*="-panel "],
  [class$="-modal"], [class*="-modal "],
  [class$="-dialog"], [class*="-dialog "],
  [class$="-popover"], [class*="-popover "],
  [class$="-dropdown"], [class*="-dropdown "],
  [class$="-toolbar"], [class*="-toolbar "],
  [class$="-filters"], [class*="-filters "],
  [class$="-filter-bar"], [class*="-filter-bar "],
  [class$="-summary"], [class*="-summary "],
  [class$="-overview"], [class*="-overview "],
  [class$="-options"], [class*="-options "],
  [class$="-option"], [class*="-option "],
  [class$="-choice"], [class*="-choice "],
  [class$="-tile"], [class*="-tile "],
  [class$="-result"], [class*="-result "],
  [class$="-results"], [class*="-results "],
  [class$="-row"], [class*="-row "],
  [class$="-item"], [class*="-item "],
  [class$="-event"], [class*="-event "],
  [class$="-section"], [class*="-section "],
  [class$="-head"], [class*="-head "],
  [class$="-body"], [class*="-body "],
  [class$="-box"], [class*="-box "],
  [class$="-notice"], [class*="-notice "],
  [class$="-bar"], [class*="-bar "],
  [class$="-hero"], [class*="-hero "],
  [class$="-report"], [class*="-report "],
  [class$="-fields"], [class*="-fields "],
  [class$="-form"], [class*="-form "],
  [class$="-aside"], [class*="-aside "],
  [class$="-screen"], [class*="-screen "],
  [class$="-grid"], [class*="-grid "],
  [class$="-list"], [class*="-list "],
  [class$="-check"], [class*="-check "],
  [class$="-stats"], [class*="-stats "],
  [class$="-totals"], [class*="-totals "],
  [class$="-explorer"], [class*="-explorer "],
  [class$="-search"], [class*="-search "],
  [class$="-steps"], [class*="-steps "],
  [class$="-form-card"], [class*="-form-card "],
  [class$="-header"], [class*="-header "],
  [class$="-footer"], [class*="-footer "],
  [class$="-content"], [class*="-content "],
  [class$="-container"], [class*="-container "],
  [class$="-shell"], [class*="-shell "],
  [class$="-wrapper"], [class*="-wrapper "],
  [class$="-actions"], [class*="-actions "],
  [class$="-drawer"], [class*="-drawer "],
  [class$="-menu"], [class*="-menu "],
  [class$="-empty"], [class*="-empty "],
  [class$="-placeholder"], [class*="-placeholder "],
  [class$="-table"], [class*="-table "],
  [class$="-table-wrap"], [class*="-table-wrap "],
  [class$="-wrap"], [class*="-wrap "],
  [class$="-stage"], [class*="-stage "],
  [class$="-editor"], [class*="-editor "],
  [class$="-settings"], [class*="-settings "],
  [class$="-workspace"], [class*="-workspace "],
  [class$="-details"], [class*="-details "],
  [class$="-history"], [class*="-history "],
  [class$="-timeline"], [class*="-timeline "],
  [class$="-selector"], [class*="-selector "],
  [class$="-picker"], [class*="-picker "],
  [class$="-block"], [class*="-block "],
  dialog,
  [role="dialog"],
  [role="listbox"],
  [role="option"],
  .modal-backdrop > :is(section, form, article, div),
  fieldset
):not([class*="print"]):not([class*="preview"]):not([class*="paper"]):not([class*="pdf"]):not([class*="danfe"]):not([class*="document"]) {
  background-color: var(--ge-dark-surface) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  button[class$="-button"], button[class*="-button "],
  a[class$="-button"], a[class*="-button "]
):not(.primary):not(.success):not(.danger):not([class*="switch"]):not([class*="toggle"]) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border-strong) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-tabs"], [class*="-tabs "],
  [class$="-nav"], [class*="-nav "],
  [class$="-topbar"], [class*="-topbar "]
):not(.sidebar-nav):not([class*="print"]):not([class*="preview"]) {
  background-color: var(--ge-dark-surface) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-kpis"], [class*="-kpis "],
  [class$="-metrics"], [class*="-metrics "],
  [class$="-metric-grid"], [class*="-metric-grid "],
  [class$="-summary-grid"], [class*="-summary-grid "],
  [class$="-overview"], [class*="-overview "]
) > :is(article, a, div) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 7px 22px rgb(0 0 0 / 18%) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-stats"], [class*="-stats "],
  [class$="-totals"], [class*="-totals "],
  [class$="-steps"], [class*="-steps "],
  [class$="-check-list"], [class*="-check-list "]
) > :is(article, a, div, li) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-modal"], [class*="-modal "],
  [class$="-dialog"], [class*="-dialog "],
  dialog,
  [role="dialog"]
) > :is(header, footer) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-card"], [class*="-card "],
  [class$="-panel"], [class*="-panel "],
  [class$="-modal"], [class*="-modal "],
  [class$="-dialog"], [class*="-dialog "],
  [class$="-summary"], [class*="-summary "],
  [class$="-overview"], [class*="-overview "]
):not([class*="print"]):not([class*="preview"]):not([class*="paper"]):not([class*="pdf"]):not([class*="danfe"]):not([class*="document"]) :is(h1, h2, h3, h4, h5, h6, strong, b) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  [class$="-card"], [class*="-card "],
  [class$="-panel"], [class*="-panel "],
  [class$="-modal"], [class*="-modal "],
  [class$="-dialog"], [class*="-dialog "],
  [class$="-summary"], [class*="-summary "],
  [class$="-overview"], [class*="-overview "]
):not([class*="print"]):not([class*="preview"]):not([class*="paper"]):not([class*="pdf"]):not([class*="danfe"]):not([class*="document"]) :is(p, small, dt, dd) {
  color: var(--ge-dark-text-soft) !important;
}

/* Exemplos representativos encontrados pela auditoria integral. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .financial-overview article,
  .financial-account-card,
  .financial-operation-card,
  .financial-filter-results article,
  .pending-settlement-item,
  .label-version-modal,
  .label-version-option,
  .labels-v2-text-modal > section,
  .labels-v2-purchase-modal > section,
  .labels-v2-purchase-results > button
) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .label-version-option.featured {
  background: #102b35 !important;
  border-color: #288997 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .label-version-modal,
  .label-version-option,
  .financial-overview article,
  .financial-account-card,
  .financial-operation-card
) :is(h2, h3, strong, b) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .label-version-modal,
  .label-version-option,
  .financial-overview article,
  .financial-account-card,
  .financial-operation-card
) :is(p, small, span:not([class*="badge"]):not([class*="status"])) {
  color: var(--ge-dark-text-soft) !important;
}

/* Estados de selecao continuam distintos sem voltar a uma superficie branca. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .raw-material-row.selected,
  .os-quote-import-result.is-selected,
  .agenda-patient-results button.is-active,
  .agenda-patient-results button:hover
) {
  background: #1b3150 !important;
  border-color: #608ac2 !important;
  color: var(--ge-dark-text) !important;
}

/*
 * Compatibilidade para paineis de indicadores.
 * Alguns modulos possuem CSS embutido na propria view e, por isso, suas
 * superficies claras sao declaradas depois dos estilos globais do sistema.
 * A especificidade abaixo e intencional: mantem todos os cards no mesmo tema
 * sem apagar as cores semanticas dos icones e dos status.
 */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .rental-metric-grid,
  .rental-contract-summary,
  .contract-kpis,
  .exchange-kpis,
  .financial-alert-kpis,
  .dashboard-metrics,
  .summary-metrics,
  .metrics
) > :is(article, a, div) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 7px 22px rgb(0 0 0 / 18%) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .rental-metric-grid,
  .rental-contract-summary,
  .contract-kpis,
  .exchange-kpis,
  .financial-alert-kpis,
  .dashboard-metrics,
  .summary-metrics,
  .metrics
) > :is(article, a, div) :is(h2, h3, h4, strong) {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .rental-metric-grid,
  .rental-contract-summary,
  .contract-kpis,
  .exchange-kpis,
  .financial-alert-kpis,
  .dashboard-metrics,
  .summary-metrics,
  .metrics
) > :is(article, a, div) :is(p, small, span:not([class*="icon"]):not([class*="status"])) {
  color: var(--ge-dark-text-soft) !important;
}

/* Locacoes: navegacao e cards sao definidos em um <style> da view. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-module-nav {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  box-shadow: 0 5px 18px rgb(0 0 0 / 18%) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-module-nav-title strong,
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-module-nav-links a {
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-module-nav-links a:hover {
  background: #1b3150 !important;
  border-color: #608ac2 !important;
  color: #dbeafe !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-metric-grid > [data-rental-card] {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: 0 7px 22px rgb(0 0 0 / 18%) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page .rental-metric-grid > [data-rental-card]:is(:hover, .is-active) {
  background: #172a43 !important;
  border-color: #608ac2 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-contract-page :is(
  .rental-contract-filters,
  .rental-step-card,
  .rental-summary-card,
  .rental-info-card,
  .rental-contract-summary article
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

/* Produtos: o bloco de busca e cada fieldset de filtros tinham fundo claro. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .products-page .products-search {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .products-page .product-filter-group {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .products-page .product-filter-audit-group {
  background: #241d17 !important;
  border-color: #754c24 !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .products-page :is(
  .products-search-field,
  .product-filter-group legend
) {
  color: var(--ge-dark-text-soft) !important;
}

/* NFS-e Nacional: checklists e superficies internas usam cores fixas no CSS legado. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-page :is(
  .nfse-checklist li,
  .nfse-total-card,
  .nfse-view-card,
  .nfse-description-card,
  .nfse-settings-section .settings-card,
  .nfse-action-modal,
  .nfse-schedule-modal,
  .nfse-schedule-list article
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-page :is(
  .nfse-card p,
  .nfse-description-card p,
  .nfse-schedule-modal header p,
  .nfse-schedule-list article span,
  .nfse-schedule-list article small
) {
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-page .nfse-card-kicker {
  background: #172f52 !important;
  border-color: #35659b !important;
  color: #93c5fd !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-page .nfse-schedule-alert {
  background: #302518 !important;
  border-color: #7c552a !important;
  color: #fed7aa !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .nfse-action-modal,
  .nfse-schedule-modal,
  .nfse-schedule-list article
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .nfse-schedule-modal header p,
  .nfse-schedule-list article span,
  .nfse-schedule-list article small
) {
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-schedule-alert {
  background: #302518 !important;
  border-color: #7c552a !important;
  color: #fed7aa !important;
}

/* Balcao: formas de pagamento da grade usam uma tarja clara propria. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .counter-panel .counter-payment-line {
  background: #17283d !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .counter-panel .modern-table tbody tr.is-cancelled .counter-payment-line {
  background: #3b1d28 !important;
  border-color: #7f3344 !important;
  color: #fecdd3 !important;
}

/* Mesas: resultados do modal de abertura possuem fundo claro proprio. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .table-open-modal .open-table-list button {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .table-open-modal .open-table-list button :is(span, strong) {
  color: inherit !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .table-open-modal .open-table-list button:is(:hover, :focus) {
  background: #1b3150 !important;
  border-color: #608ac2 !important;
}

/* Tele-entrega: a view mantem um conjunto isolado de variaveis claras. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .delivery-start {
  --ds-border: var(--ge-dark-border) !important;
  --ds-muted: var(--ge-dark-text-soft) !important;
  --ds-bg: var(--ge-dark-surface-2) !important;
  --ds-text: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .delivery-start :is(
  .delivery-start-summary,
  .delivery-start-card,
  .delivery-start-tip,
  .delivery-start-actions,
  .delivery-assistant-review,
  .delivery-assistant-item
) {
  background: var(--ge-dark-surface-2) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .delivery-start .delivery-start-tip {
  background: #17283d !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .delivery-start :is(
  .delivery-start-heading p,
  .delivery-start-section-title p,
  .delivery-start-actions p,
  .delivery-assistant-review > p,
  .delivery-assistant-item span
) {
  color: var(--ge-dark-text-soft) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .delivery-start .delivery-start-search input {
  background: var(--ge-dark-surface) !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

/* Configuracoes NFS-e: segunda view com paleta local isolada. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .nfse-settings-page {
  --ns-ink: var(--ge-dark-text) !important;
  --ns-muted: var(--ge-dark-text-soft) !important;
  --ns-border: var(--ge-dark-border) !important;
  --ns-surface: var(--ge-dark-surface-2) !important;
  --ns-soft: var(--ge-dark-surface) !important;
}

/* Residuos estruturais confirmados pela auditoria integral das views. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .backup-empty-state,
  .database-check-errors div,
  .customer-secondary-emails,
  .fiscal-result-item-context,
  .fiscal-xml-table tr,
  .item-note,
  .exchange-original-items,
  .exchange-product-option,
  .exchange-product-empty,
  .product-suggestions,
  .product-suggestions button,
  .price-adjust-empty,
  .price-adjust-placeholder,
  .price-adjust-meta div,
  .price-adjust-tools,
  .product-history-table,
  .stock-history-empty,
  .table-transfer-destination,
  .table-transfer-items article,
  .user-permissions,
  .permission-group,
  .users-summary-strip article,
  .reports-title,
  .reports-filter,
  .report-selection-tools,
  .report-metric,
  .management-insight,
  .expense-comparison-insights article,
  .expense-comparison-note,
  .cash-flow-note,
  .delivery-store-custom,
  .delivery-store-period,
  .delivery-store-modal-note,
  .financial-alert-setting-master,
  .financial-alert-setting-option,
  .financial-alert-setting-number,
  .financial-alert-setting-select,
  .financial-alert-setting-message,
  .fiscal-link-document,
  .fiscal-link-receivable,
  .fiscal-link-source,
  .fiscal-link-message,
  .rental-review-breakdown article,
  .rental-review-filter-cards button,
  .rental-review-message,
  .rental-review-batch-message,
  .rental-review-money-field,
  .rental-review-replacement,
  .rental-review-replacement-values > span,
  .rental-review-status,
  .rental-review-values,
  .rental-review-form,
  .rental-review-total,
  .equipment-billing-breakdown > div,
  .equipment-billing-form-main > section,
  .equipment-billing-money,
  .equipment-billing-review,
  .equipment-billing-review dl div,
  .equipment-billing-review-note,
  .rental-complete-checks article,
  .rental-item-calculation,
  .rental-item-total,
  .employee-bank-feedback,
  .employee-bank-progress-note,
  .rh-payments-home,
  .multi-return-candidate,
  .multi-return-purchase-group > header,
  .multi-return-review,
  .multi-return-source-cards article,
  .quote-lifecycle-moment,
  .quote-lifecycle-total,
  .quote-settings-position label,
  .rental-filters-modern
) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
  box-shadow: none !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .database-check-errors div,
  .fiscal-xml-table tr,
  .product-suggestions button,
  .table-transfer-items article,
  .multi-return-candidate,
  .rental-review-filter-cards button
):is(:hover, :focus, :focus-visible),
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .multi-return-candidate:has(input:checked) {
  background-color: var(--ge-dark-surface-hover) !important;
  border-color: var(--ge-dark-border-strong) !important;
}

/* Avisos preservam semantica, usando tons escuros em vez de papel claro. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .rental-review-invalid-warning,
  .equipment-billing-replace-warning,
  .rental-complete-warning,
  .employee-bank-warning,
  .employee-payable-import-warning,
  .payable-bulk-confirm .bulk-warning,
  .table-transfer-warning,
  .fiscal-void-warning
) {
  background: #332615 !important;
  border-color: #815b2d !important;
  color: #fed7aa !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .equipment-billing-new-error,
  .employee-summary-error,
  .quote-lifecycle-error,
  .quote-lifecycle-upload-error,
  .nfe-email-load-error
) {
  background: #3a1d26 !important;
  border-color: #8b3c51 !important;
  color: #fecdd3 !important;
}

/* Superficies de fluxos antigos que nao seguem o padrao de nomes moderno. */
html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .cr-page,
  .cr-person,
  .cp-note,
  .contract-balance article,
  .counter-fiscal-product,
  .fiscal-rejection-product,
  .nfce-contingency-pending,
  .rental-forecast-kpi,
  .rental-settings-index,
  .rental-rate-group,
  .rental-action-locked,
  .financial-alert-company-state,
  .fiscal-auto-file,
  .nfse-catalog-list-panel,
  .nfse-catalog-create,
  .rtc-actions-sticky,
  .sync-run-module,
  .nuvemshop-note,
  .nfe-detail-page,
  .nfe-email-recipient,
  .nfe-running-stat,
  .nfe-running-total,
  .nfe-total-discount-open,
  .nfe-xped-help,
  .nfse-fixed-field,
  .nfse-form-tip,
  .order-left,
  .product-panel,
  .table-customer-form,
  .table-order-note-form,
  .delivery-customer-summary,
  .search-add,
  .order-items,
  .delivery-details-form,
  .os-help-bullets li,
  .os-help-types article,
  .payments-options .check,
  .permission-profile-modules span,
  .product-profit-field,
  .receivables-filters,
  .payables-filter,
  .bank-sync-card,
  .settings-tab-panels,
  .sicoob-sync-current,
  .tabs-line,
  .update-counters div,
  .user-metric,
  .users-page .permission-check,
  .users-page .permission-group,
  .quote-payment-mode label
) {
  background-color: var(--ge-dark-surface-2) !important;
  background-image: none !important;
  border-color: var(--ge-dark-border) !important;
  color: var(--ge-dark-text) !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) :is(
  .agenda-nfse-warning,
  .nfce-contingency-banner,
  .exchange-customer-link-warning,
  .rental-cancel-warning,
  .stock-negative-confirm,
  .shipping-no-nfe-note
) {
  background: #332615 !important;
  border-color: #815b2d !important;
  color: #fed7aa !important;
}

html[data-ui-theme="dark"] body:not(.counter-pdv-body):not(.public-order-body) .rental-cancel-sicoob {
  background: #102b35 !important;
  border-color: #287582 !important;
  color: #a5f3fc !important;
}

/* Previews de impressao permanecem em papel branco por intencao. */
@media print {
  html[data-ui-theme="dark"] body,
  html[data-ui-theme="dark"] body * {
    color-scheme: light;
  }
}
