/* Light theme adapted from the approved Skymetrics reference. */
:root[data-rotier-product='hub']:not([data-theme='dark']) {
  --ds-canvas: #f2f2f2;
  --ds-surface: #fff;
  --ds-text: #050504;
  --ds-muted: #595958;
  --ds-border: #e5e5e5;
  --ds-border-soft: #ededed;
  --ds-field-border: #8a8a88;
  --ds-section-heading: #fff;
  --ds-filter-surface: #fafafa;
  --ds-navigation: #fff;
  --ds-hover-surface: #f4f4f4;
  --ds-selected-surface: #f4f4f4;
  --ds-workbench: #e5e5e5;
  --ds-brand: #2f5a60;
  --ds-brand-rgb: 47, 90, 96;
  --ds-brand-hover: #274b50;
  --ds-brand-pressed: #1f3f44;
  --ds-brand-dark: #050504;
  --ds-brand-soft: #f4f4f4;
  --ds-focus: #274b50;
  --ds-shadow: none;
  --ds-success: #16712e; --ds-success-text: #16712e; --ds-success-soft: #cff5de;
  /* Aliases das telas legadas: fundos de marca não tingem grandes áreas. */
  --rotier-charcoal: #595958;
  --rotier-charcoal-dark: #050504;
  --rotier-charcoal-light: #595958;
  --rotier-white: #fff;
  --rotier-cream: #f2f2f2;
  --rotier-cream-mid: #ededed;
  --rotier-cream-dark: #e5e5e5;
  --rotier-stone: #8a8a88;
  --rotier-stone-dark: #595958;
  --rotier-sage-pale: #f4f4f4;
  --rotier-sage-light: #e5e5e5;
  --sage-light: #e5e5e5;
  --sage-pale: #f4f4f4;
  --primary-pale: #f4f4f4;
  --p-primary-pale: #f4f4f4;
  --p-surface-cnt: #ededed;
  --bs-light-rgb: 250, 250, 250;
  --bs-secondary-color: var(--ds-muted);
  --bs-secondary-bg: var(--ds-border-soft);
  --bs-tertiary-bg: var(--ds-filter-surface);
}

/* Navegação branca e áreas de leitura sobre a mesa cinza. */
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(body, .main-wrapper, .page-content) {
  background: var(--ds-canvas);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .page-content {
  border: 0; border-radius: 0;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.sidebar, #mobileSidebar) {
  background: var(--ds-navigation); border-right: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .app-header {
  background: #f2f2f2; border-bottom: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.page-title, .sidebar-link, .filter-label) {
  color: var(--ds-text);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .sidebar-link:hover {
  background: #f4f4f4; color: var(--ds-text);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .sidebar-link.active {
  background: var(--ds-selected-surface); color: #050504; box-shadow: none;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.hdr-profile .av, .nav-badge:not(.nav-badge-danger)) {
  background: #f4f4f4; color: #595958;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.sidebar-link.active .nav-badge:not(.nav-badge-danger), .sidebar-toggle-btn:hover) {
  background: #e5e5e5; color: var(--ds-text);
}

/* Painéis brancos com cabeçalhos integrados ao conteúdo. */
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.card, .stat-card, .sg-pane, .contracts-register,
  .contracts-resource-section, .contracts-document-tools, .dashboard-panel, .creation-surface, .creation-section,
  .dash-kpi-card, .modal-content, .dropdown-menu) {
  background-color: var(--ds-surface); border-color: var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.card, .stat-card, .sg-pane, .contracts-register,
  .contracts-resource-section, .contracts-document-tools, .dashboard-panel) { border: 1px solid var(--ds-border-soft); }
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.card-header, .contracts-section-heading,
  .contracts-resource-heading, .creation-section-head, .contract-editor-head, .modal-header) {
  background: var(--ds-section-heading); color: var(--ds-text); border-bottom: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .contracts-section-heading { border-radius: 20px 20px 0 0; }
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.dashboard-panel-heading, .sg-head) {
  border-bottom: 1px solid var(--ds-border-soft); padding-bottom: 16px;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.dashboard-metrics, .rh-overview, .rs-metrics) {
  background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: 20px;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.stat-label, .dash-kpi-label, .kanban-task-desc, .kanban-task-meta) {
  color: var(--ds-muted);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.dash-kpi-icon, .creation-section-number, .contracts-gallery-icon, .sg-step-n) {
  background: #f4f4f4; color: #595958; border-color: var(--ds-border);
}
/* As cores semânticas inline dos pequenos ícones de conclusão/receita permanecem. */
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.contracts-gallery-section, .dashboard-attention, .sg-preserve,
  .contract-data-heading, .creation-actions, .modal-footer) { background: var(--ds-filter-surface); }
:root[data-rotier-product='hub']:not([data-theme='dark']) .mrr-banner {
  background: var(--ds-surface); color: var(--ds-text); border: 1px solid var(--ds-border-soft); border-radius: 20px;
}

/* Filtros neutros, campos brancos e controles com limites legíveis. */
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.task-filters, .rs-toolbar, .contracts-filters,
  .card:has(.filter-pills)) {
  background: var(--ds-filter-surface); border: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .card:has(.filter-pills) > .card-body { background: transparent; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .contracts-filters { border-inline: 0; }
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.form-control, .form-select, .svc-search-input,
  .contract-client-input, .contract-editor-toolbar select, .contract-editor-toolbar input) { border-color: var(--ds-field-border); }
:root[data-rotier-product='hub']:not([data-theme='dark']) .filter-pills {
  background: #f4f4f4; border: 1px solid #e5e5e5;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .filter-pill:not(.active) { color: #595958; }
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.filter-pill:not(.active):hover, .view-toggle-btn:hover,
  .dropdown-item:hover, .contract-client-results [role='option']:hover, .contract-client-results [aria-selected='true']) {
  background: #ededed; color: #050504;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.view-toggle-btn.active,
  .filter-pill.active:not(.priority-pill-high):not(.priority-pill-medium):not(.priority-pill-low)) {
  background: var(--ds-brand); color: #fff; border-color: var(--ds-brand);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.input-group-text, .contract-editor-toolbar) {
  background: #f2f2f2; border-color: var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.contract-editor-toolbar button:hover, .contract-editor-toolbar select:hover) {
  background: #f4f4f4;
}

/* Tabelas e quadros: limites neutros, sinais de status preservados. */
:root[data-rotier-product='hub']:not([data-theme='dark']) .table {
  --bs-table-border-color: var(--ds-border-soft); --bs-table-hover-bg: #fafafa;
  --bs-table-striped-bg: #fafafa; --bs-table-striped-color: var(--ds-text);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .table thead th {
  background: var(--ds-section-heading); border-bottom: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.table tbody tr:hover, .dash-recent-row:hover, .tx-row:hover) {
  background-color: var(--ds-hover-surface);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-column {
  background: #ededed; border: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-column-title { color: #595958; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-count { background: #fff; color: #595958; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-task {
  background: var(--ds-surface); border: 1px solid var(--ds-border);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-task[data-priority='high'] { border-left: 3px solid var(--ds-danger); }
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-task[data-priority='medium'] { border-left: 3px solid var(--ds-warning); }
:root[data-rotier-product='hub']:not([data-theme='dark']) .kanban-task[data-priority='low'] { border-left: 3px solid var(--ds-success); }

/* O entorno do editor é neutro; a folha continua mostrando as cores reais do documento. */
:root[data-rotier-product='hub']:not([data-theme='dark']) .contract-data-group > summary {
  background: #f4f4f4; color: var(--ds-text); border-bottom: 1px solid var(--ds-border-soft);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.contract-data-group[open] > summary, .contract-data-group > summary:hover) {
  background: #ededed;
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.contract-editor-desk, .contract-pdf-pages) {
  background: var(--ds-workbench);
}
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.contract-editor-paper, .contract-document > .card-body, .contract-preview-sheet) {
  background: #fff; color: #26332e; --ds-text: #26332e; --ds-muted: #586577; --ds-surface: #fff; --bs-heading-color: #26332e;
}
@media print {
  :root[data-rotier-product='hub']:not([data-theme='dark']) {
    --ds-canvas: #fff; --ds-section-heading: #fff; --ds-filter-surface: #fff;
    --ds-workbench: #fff; --ds-navigation: #fff;
  }
}

/* White integrated headings and fine separators follow the reference. */
:root[data-rotier-product='hub']:not([data-theme='dark']) :is(.card-header, .contracts-section-heading, .contracts-resource-heading) { border-bottom-color: var(--ds-border-soft); }
:root[data-rotier-product='hub']:not([data-theme='dark']) .table thead th { color: var(--ds-muted); font-size: 13px; font-weight: 500; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .table tbody td { border-bottom-style: dashed; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .dashboard-panel-heading { border: 0; padding-bottom: 0; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .dashboard-metrics { background: transparent; border: 0; gap: 16px; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .dashboard-metrics a { background: var(--ds-surface); border: 1px solid var(--ds-border-soft); border-radius: 20px; padding: 24px; }
:root[data-rotier-product='hub']:not([data-theme='dark']) .dashboard-metrics a:hover { border-color: var(--ds-field-border); }

:root[data-rotier-product='hub']:not([data-theme='dark']) .table tbody td { border-bottom-color: var(--ds-border-soft); border-bottom-width: 1px; }
