/**
 * Overrides finais — cores legadas em styles.css não podem vencer o tema.
 * Este arquivo deve ser o último CSS carregado.
 */

html[data-theme] body,
html[data-theme] .page {
  background: var(--portal-bg) !important;
  color: var(--portal-text) !important;
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] .module-headline h2,
html[data-theme] .kpi-value {
  color: var(--portal-text) !important;
}

html[data-theme] .subtitle,
html[data-theme] .module-headline p,
html[data-theme] .kpi-title,
html[data-theme] .kpi-meta,
html[data-theme] .filter-info,
html[data-theme] .card-helper,
html[data-theme] .card-subtitle,
html[data-theme] .badge,
html[data-theme] .auth-message {
  color: var(--portal-text-muted) !important;
}

html[data-theme] .user-pill {
  background: var(--portal-surface-2) !important;
  border: 1px solid var(--portal-border-muted) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .pill.ghost {
  color: var(--portal-text) !important;
  border-color: var(--portal-border-muted) !important;
}

html[data-theme] .pill.ghost:hover {
  border-color: var(--portal-hover) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .status {
  background: var(--portal-status-bg) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .card,
html[data-theme] .kpi-card,
html[data-theme] .module-option,
html[data-theme] .modal-card,
html[data-theme] .perfil-card {
  background: var(--portal-surface) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .data-table {
  background: var(--portal-table-bg) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .data-table thead th {
  background: var(--portal-table-head) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .data-table tbody td {
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .data-table tbody tr:nth-child(odd) {
  background: var(--portal-table-stripe) !important;
}

html[data-theme] .table-input,
html[data-theme] .table-select,
html[data-theme] .filter-group input,
html[data-theme] .filter-group select,
html[data-theme] input[type="search"] {
  background: var(--portal-surface-input) !important;
  border-color: var(--portal-border-input) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .btn-icon,
html[data-theme] .status-chip,
html[data-theme] .pill:not(.active) {
  background: var(--portal-surface-2) !important;
  border-color: var(--portal-border-muted) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .empty-state {
  background: var(--portal-surface-elevated) !important;
  border-color: var(--portal-border-muted) !important;
  color: var(--portal-text-muted) !important;
}

html[data-theme] .module-embed iframe,
html[data-theme] .module-iframe {
  background: var(--portal-bg) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .descarga-status-menu {
  background: var(--portal-surface) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .descarga-status-option {
  color: var(--portal-text) !important;
}

html[data-theme] .descarga-status-option:hover {
  background: var(--portal-surface-elevated) !important;
}

html[data-theme] .progress-track,
html[data-theme] .chart-card,
html[data-theme] .tab-panel {
  background: var(--portal-surface) !important;
  border-color: var(--portal-border) !important;
}

html[data-theme] .data-table a,
html[data-theme] .arrow {
  color: var(--portal-link) !important;
}

html[data-theme] .theme-select,
html[data-theme] .theme-toggle-group {
  background: var(--portal-surface-2) !important;
  border-color: var(--portal-border-muted) !important;
  color: var(--portal-text) !important;
}

html[data-theme] .theme-toggle-btn {
  color: var(--portal-text-muted) !important;
}

html[data-theme] .theme-toggle-btn.is-active {
  color: var(--portal-accent) !important;
  background: var(--portal-accent-soft) !important;
}
