/* Final light-mode surface layer. Never applies to Escuro or Conforto.
   Status colors, chart series, logos and modal backdrops remain independent. */
:root[data-theme="light"][data-theme-accent="neutral"] {
    --light-tone-eaf0ed:#eef1f5; --light-tone-f3f7f5:#f3f5f8;
    --light-tone-203532:#253244; --light-tone-526b65:#536276;
    --light-tone-cddcd5:#d0d8e2; --light-tone-17765c:#435b77;
    --light-tone-125b48:#344860; --light-tone-e9f1ed:#e9edf2;
    --light-tone-deeee6:#dfe7f0; --light-tone-e1ebe5:#e5eaf0;
    --light-tone-39574e:#435369; --light-tone-627e73:#617189;
    --light-tone-e9f2ec:#edf1f6; --light-tone-243f36:#253244;
    --light-tone-e9f3ee:#edf1f6; --light-tone-c4d9ce:#ccd7e4;
    --light-tone-e7f2ec:#e9eff6; --light-tone-92bbaa:#91a5bf;
    --light-tone-acbfb4:#aebccb; --light-tone-e7eee9:#e9edf2;
    --light-tone-f5f8f5:#f6f8fa; --light-tone-cbdcd1:#d0d8e2;
    --light-tone-358969:#506d90; --light-tone-f1f6f2:#f2f5f8;
    --light-tone-edf5f4:#f0f3f7; --light-tone-e0eee5:#e5ebf3;
    --light-tone-cadbd1:#d0d8e2; --light-tone-86adb0:#91a5bf;
    --light-tone-f0f5f1:#f0f3f7; --light-tone-76aa94:#8299b3;
    --light-tone-f7faf7:#f8fafc; --light-tone-bacfc2:#bdcbdc;
    --light-tone-246a76:#435b77; --light-tone-dce6e0:#e1e7ef;
    --light-tone-466354:#536276; --light-tone-2e5041:#344860;
    --light-tone-e5eee9:#e9edf2; --light-tone-bed4c6:#ccd7e4;
    --light-tone-355544:#344860; --light-tone-e5eee8:#e9edf2; --light-tone-f5f8f6:#f5f7fa;
}

/* Structural panels that predate the shared palette. */
html:root[data-theme="light"] body :is(
    .gma-api-test-result,.gma-api-type-list div,
    .gio-manobra-empty-steps,.gio-manobra-list-row,.gio-manobra-etapa-row,.gio-manobra-apoio-editor,
    .mo-public-summary div,.adm-system-dependencies article,.adm-system-integrations article,
    .sge-health-list,.sge-health-score-block p,.sge-pie-legend button,.dashboard-radar-card,
    .sgd-folder-pane,.sgd-content-pane,.sgd-history-item,.sgd-file-list-item,
    .sga-risk-card,.sga-insight,.sga-automation,.sga-history-panel,.sga-history-item,
    .sga-embedded-panel,.sga-attachment-panel,.sga-attachment-upload,.sga-attachment-item,
    .sga-activity-tree,.sga-kpi-detail-row,.sga-kpi-empty,.sga-project-bar-row,
    .sga-kanban-column,.sga-empty-state,.sga-member-panel,.sga-workflow-step,
    .sgm-performance-panel,.sgm-comparison-frequency,.sgm-comparison-preview,
    .sgm-pre-service-section,.sgm-support-card,.sgm-view-info,.sgm-view-description,
    .sgm-execution-os-list,.sgm-pmo-region-summary-row,.sgm-pmo-region-row,.sgm-pmo-region-bars,
    .sgm-risk-matrix-scroll,.sgm-risk-matrix-legend,.sgm-risk-alert-card,
    .ons-sam-panel,.ons-sam-status-card,.ons-sam-kpi,.ons-sam-detail-summary > div,.ons-sam-resource,
    .gio-pv-kpis button,.gio-pv-panel .mo-form-grid,.gio-pv-panel .mo-option-group,
    .gio-chart-legend div,.gio-company-bar-row,
    .adm-health-row,.adm-alert-item,.adm-activity-item,.adm-users-health-row,.adm-users-steps button,
    .adm-users-metric,.adm-users-health,.adm-users-flow,.adm-user-register-summary > div,
    .adm-upload-field-block,.adm-upload-summary,.adm-upload-extension-panel,
    .executive-alert,.executive-module-list a,.help-ask-form,.help-chat-links button,
    .notification-table-wrap,.notification-filter-field,.chat-header,.chat-panel,.sgm-dashboard-alert
) {
    background:var(--ginoma-surface) !important;
    color:var(--ginoma-text) !important;
    border-color:var(--ginoma-border) !important;
    box-shadow:none;
}

/* Secondary surfaces distinguish tools from records without dark strips. */
html:root[data-theme="light"] body :is(
    .grid-filter-panel,.grid-sticky-top,.grid-loading-message,.grid-group-dropzone,.grid-group-chip,
    .grid-column-filters,.grid-columns-menu-body,.report-group-row td,
    .mud-tabs-tabbar,.mud-tabs-panels,.mud-tab-panel,.int-tabs,.int-subtabs,.gio-rap-nav,
    .gio-manobra-support-tabs,.gio-manobra-step-counter,
    .sgm-performance-header,.sgm-performance-action-group,.sgm-loading-panel,
    .sgm-pmo-follow-toggle,.sgm-pmo-follow-year,.sgm-pmo-follow-row.is-local-row,
    .sgm-pmo-follow-row.is-pmo-row,.sgm-pmo-follow-row.is-plan,.sgm-torre-selector,
    .ons-sam-connection-bar,.ons-sam-ready,.ons-sam-resource-tabs,
    .sga-workflow-actions,.sga-kpi-detail-summary,.sga-action-stat,.sga-project-row-metrics span,
    .sge-period-summary span,.adm-course-card-stats span,.adm-system-score,
    .adm-user-register-header,.adm-user-modal-footer,.adm-profile-header,.adm-association-header,
    .adm-user-profile-selector,.adm-audit-period,.adm-upload-add-extension,
    .notification-quick-days,.notification-count-pill,.notification-grid-filter,
    .manager-focus-score,.sgm-ss-upload-grid .sgm-upload-box
) {
    background:var(--ginoma-surface-soft) !important;
    color:var(--ginoma-text) !important;
    border-color:var(--ginoma-border) !important;
}
html:root[data-theme="light"] body :is(.gio-pv-page,.gio-pv-page .gio-dashboard-loading) {
    background:var(--ginoma-bg) !important; color:var(--ginoma-text) !important;
}
html:root[data-theme="light"] body :is(
    .sgm-os-position-table,.sgm-risk-matrix-table,.sgm-risk-detail-table,
    .ons-sam-detail-table,.ons-sam-query-table,.audit-detail-table
) th {
    background:var(--ginoma-surface-soft) !important;
    color:var(--ginoma-text) !important; border-color:var(--ginoma-border) !important;
}
html:root[data-theme="light"] body .sgm-os-position-table td {
    background:var(--ginoma-surface) !important; color:var(--ginoma-text) !important;
}

/* Controls and detached popovers must share the palette of their page. */
html:root[data-theme="light"] body .adm-table-panel :is(.adm-row-actions,.audit-action-column) {
    background:var(--ginoma-surface) !important; color:var(--ginoma-text) !important;
    border-color:var(--ginoma-border) !important; box-shadow:-4px 0 8px #26354a0a !important;
}
html:root[data-theme="light"] body .adm-table-panel .mud-table-head :is(.adm-row-actions,.audit-action-column) {
    background:var(--ginoma-surface-soft) !important;
}
html:root[data-theme="light"] body :is(
    .sga-search,.sge-dashboard-filter select,.sge-dashboard-filter input,
    .sgd-dashboard-date-filter input,.ginoma-confirm-field textarea,
    .notification-page-size,.notification-page-size option,.notification-filter-field input,
    .notification-grid-filter input,.notification-grid-filter select,
    .mud-popover,.mud-picker,.mud-picker-content,.mud-menu-list,.mud-dialog
) {
    background:var(--ginoma-input-bg) !important;
    color:var(--ginoma-text) !important; border-color:var(--ginoma-border) !important;
}
html:root[data-theme="light"] body :is(.grid-global-search,.grid-global-search input) {
    background:var(--ginoma-input-bg) !important; color:var(--ginoma-text) !important;
}
html:root[data-theme="light"] body :is(.mud-tabs-toolbar,.mud-tabs-tabbar,.int-tabs,.int-subtabs,.ons-sam-resource-tabs) :is(.mud-tab,button) {
    background:transparent !important; color:var(--ginoma-text-muted) !important;
}
html:root[data-theme="light"] body :is(.mud-tab.mud-tab-active,.int-tabs button.active,.int-subtabs button.active,.ons-sam-resource-tabs button.active) {
    background:var(--ginoma-hover) !important; color:var(--ginoma-primary-strong) !important;
    border-color:var(--ginoma-border) !important;
}
html:root[data-theme="light"] .ginoma-topbar .ginoma-theme-toggle {
    background:var(--ginoma-control-bg) !important; color:var(--ginoma-primary-strong) !important;
    border-color:var(--ginoma-border) !important;
}
html:root[data-theme="light"] body :is(.sge-dashboard-filter-apply,.sge-oleo-actions button,.notification-export-button,.notification-pagination-actions button,.notification-hero-clear,.ginoma-confirm-close) {
    background:var(--ginoma-control-bg) !important; color:var(--ginoma-text) !important;
    border-color:var(--ginoma-border) !important;
}

/* Readable titles and metadata formerly hardcoded white/pastel. */
html:root[data-theme="light"] body :is(
    .sgd-history-item,.sgd-file-list-item,.sga-history-item,.sga-attachment-item,
    .sga-risk-card,.sga-insight,.sga-automation,.sga-workflow-step,.sga-kanban-column,
    .sgm-performance-panel,.sgm-pre-service-section,.sgm-support-card,.sgm-view-info,.sgm-view-description,.sgm-pmo-region-row,
    .ons-sam-panel,.ons-sam-kpi,.ons-sam-status-card,.ons-sam-resource,
    .adm-system-dependencies,.adm-system-integrations,.adm-user-register-header,.adm-user-register-summary,
    .adm-profile-header,.adm-association-header,.adm-users-metric,.adm-users-health,.adm-users-flow,
    .gio-pv-kpis,.gio-chart-legend,.gio-company-bar-row,.gma-api-test-result,.gma-api-type-list
) :is(h2,h3,h4,strong,b) { color:var(--ginoma-text) !important; }
html:root[data-theme="light"] body :is(
    .sgd-history-item,.sgd-file-list-item,.sgm-view-info,.sgm-view-description,.sgm-pmo-region-row,
    .adm-user-register-summary,.adm-users-metric,.ons-sam-kpi,.ons-sam-status-card,
    .sga-history-item,.sga-attachment-item,.sga-workflow-step,.sga-insight,.sga-automation,
    .adm-system-dependencies,.adm-system-integrations,.gio-chart-legend,.gma-api-type-list
) :is(p,small,span) { color:var(--ginoma-text-muted) !important; }
html:root[data-theme="light"] body :is(.sgm-pmo-region-row,.sga-project-bar-row,.sge-pie-legend button,.adm-users-steps button,.executive-module-list a):is(:hover,.is-selected) {
    background:var(--ginoma-hover) !important; border-color:var(--ginoma-primary) !important;
}
html:root[data-theme="light"] body :is(.mud-button-root,.mud-icon-button) :is(.mud-icon-root,.mud-button-label,.mud-button-icon-start,.mud-button-icon-end) { color:inherit !important; }
html:root[data-theme="light"] body :is(
    .ginoma-vertical-bar-track,.dashboard-bar-track,.dashboard-standard-bar-track,
    .dashboard-standard-stack-track,.dashboard-vertical-bar-track,.adm-health-track,.adm-course-progress
) { background:var(--ginoma-control-bg) !important; }
html:root[data-theme="light"] body :is(.dashboard-standard-pie > div,.gio-donut > div) {
    background:var(--ginoma-surface) !important; color:var(--ginoma-text) !important;
}
html:root[data-theme="light"] body :is(.sup-ticket-cell strong,.sup-sla-cell) { color:var(--ginoma-text) !important; }
html:root[data-theme="light"] body .sup-ticket-cell span { color:var(--ginoma-text-muted) !important; }
