/**
 * ARCA — Overrides de marca para classes Bootstrap.
 * Mantém badges/botões/backgrounds do Bootstrap na paleta da marca (dourado/navy)
 * e preserva o esquema de cor próprio do .idp-page.
 * (Antes: color-override-force.css. As regras que caçavam cores em style="" inline
 *  foram removidas após a migração dos inline para tokens — não há mais alvos.)
 * Carregado por último no base.html para vencer os estilos do Bootstrap.
 */

/* ============================================
   GRADIENTES VERDES INLINE (indicadores)
   ============================================ */

*[style*="linear-gradient(135deg, #28a745"],
*[style*="linear-gradient(90deg, #28a745"],
*[style*="linear-gradient(135deg, #20c997"],
*[style*="linear-gradient(90deg, #20c997"],
*[style*="linear-gradient(135deg, #10b981"],
*[style*="linear-gradient(90deg, #10b981"],
*[style*="background: #28a745"],
*[style*="background:#28a745"],
*[style*="background: #20c997"],
*[style*="background:#20c997"],
*[style*="background: #10b981"],
*[style*="background:#10b981"],
div[style*="#28a745"],
div[style*="#20c997"],
div[style*="#10b981"],
span[style*="#28a745"],
span[style*="#20c997"],
span[style*="#10b981"] {
  background: linear-gradient(90deg, var(--antique-gold, #C59D5F) 0%, #b08c52 100%) !important;
}

/* ============================================
   BADGES COLORIDOS
   Todos devem ser Antique Gold ou Deep Navy
   ============================================ */

.badge[style*="#667eea"],
.badge[style*="#764ba2"],
.badge[style*="#28a745"],
.badge[style*="#0d6efd"],
.badge[style*="#ffc107"],
span.badge[style*="linear-gradient"],
.badge:not(.badge-arca-gold):not(.badge-arca-navy) {
  background: linear-gradient(135deg, var(--antique-gold) 0%, #b08c52 100%) !important;
  color: white !important;
}

/* ============================================
   MODAL HEADERS
   ============================================ */

.modal-header[style*="#667eea"],
.modal-header[style*="#764ba2"],
.modal-header[style*="linear-gradient"] {
  background: linear-gradient(135deg, var(--deep-navy) 0%, #15202f 100%) !important;
  color: white !important;
}

/* ============================================
   CARDS HEADERS
   ============================================ */

.card-header[style*="#667eea"],
.card-header[style*="#764ba2"],
.card-header[style*="#28a745"],
.card-header[style*="linear-gradient"] {
  background: linear-gradient(135deg, var(--antique-gold) 0%, var(--terracotta) 100%) !important;
  color: white !important;
}

/* ============================================
   ÍCONES CIRCULARES COLORIDOS
   ============================================ */

div[style*="width: 80px"][style*="height: 80px"][style*="linear-gradient"],
span[style*="width: 80px"][style*="height: 80px"][style*="linear-gradient"] {
  background: linear-gradient(135deg, var(--antique-gold) 0%, var(--terracotta) 100%) !important;
}

/* ============================================
   BACKGROUND COLORS SÓLIDOS NÃO OFICIAIS
   ============================================ */

/* Verde */
.bg-success:not(.alert):not(.toast),
*[style*="background-color: #28a745"],
*[style*="background-color:#28a745"],
*[style*="background-color: #20c997"],
*[style*="background-color:#20c997"] {
  background-color: var(--antique-gold) !important;
}

/* Azul */
.bg-info:not(.alert):not(.toast),
.bg-primary:not(.navbar):not(.alert),
*[style*="background-color: #0d6efd"],
*[style*="background-color:#0d6efd"],
*[style*="background-color: #0a58ca"],
*[style*="background-color:#0a58ca"] {
  background-color: var(--antique-gold) !important;
}

/* Roxo */
*[style*="background-color: #667eea"],
*[style*="background-color:#667eea"],
*[style*="background-color: #764ba2"],
*[style*="background-color:#764ba2"] {
  background-color: var(--antique-gold) !important;
}

/* ============================================
   TEXT COLORS NÃO OFICIAIS
   ============================================ */

/* Texto roxo vira Deep Navy */
.text-purple,
*[style*="color: #667eea"],
*[style*="color:#667eea"],
*[style*="color: #764ba2"],
*[style*="color:#764ba2"] {
  color: var(--deep-navy) !important;
}

/* ============================================
   CLASSES BOOTSTRAP COLORIDAS
   ============================================ */

/* Progress bars Bootstrap */
.progress .bg-success,
.progress .bg-info,
.progress .bg-warning:not(.alert),
.progress .bg-primary {
  background: linear-gradient(90deg, var(--antique-gold) 0%, #b08c52 100%) !important;
}

/* Buttons Bootstrap */
.btn-success:not(:hover),
.btn-info:not(:hover),
.btn-warning:not(:hover) {
  background: linear-gradient(135deg, var(--antique-gold) 0%, var(--terracotta) 100%) !important;
  border-color: var(--antique-gold) !important;
  color: white !important;
}

.btn-success:hover,
.btn-info:hover,
.btn-warning:hover {
  background: linear-gradient(135deg, #b08c52 0%, var(--antique-gold) 100%) !important;
  border-color: #b08c52 !important;
  color: white !important;
}

/* ============================================
   TABELAS E LISTAS
   ============================================ */

.table-success,
.table-info,
.table-warning {
  background-color: rgba(197, 157, 95, 0.1) !important;
}

.list-group-item-success,
.list-group-item-info,
.list-group-item-warning {
  background-color: rgba(197, 157, 95, 0.1) !important;
  border-color: rgba(197, 157, 95, 0.3) !important;
}

/* ============================================
   EXCEÇÕES (Mantém cores originais)
   ============================================ */

/* Alertas mantém cores semânticas */
.alert.alert-success,
.alert.alert-danger,
.alert.alert-warning,
.alert.alert-info,
.toast-success,
.toast-danger,
.toast-warning,
.toast-info {
  background: initial !important;
  color: initial !important;
}

/* Status indicators mantém verde/vermelho */
.status-success,
.status-error,
.status-active,
.status-inactive {
  background: initial !important;
}

/* Charts e gráficos (se houver) */
.chart,
.graph,
[class*="chart-"],
[class*="graph-"] {
  background: initial !important;
}

/* ============================================
   IMPORTANTE: RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
  /* Mesmo comportamento em mobile */
  *[style*="linear-gradient"][style*="#667eea"],
  *[style*="linear-gradient"][style*="#764ba2"],
  *[style*="linear-gradient"][style*="#28a745"] {
    background: linear-gradient(90deg, var(--antique-gold) 0%, #b08c52 100%) !important;
  }
}

/* ============================================
   DEBUG MODE (Comentado em produção)
   ============================================ */

/* Descomente para identificar elementos com cores erradas */
/*
*[style*="#667eea"],
*[style*="#764ba2"],
*[style*="#28a745"],
*[style*="#0d6efd"] {
  outline: 3px solid red !important;
}
*/

/* ============================================
   IDP DASHBOARD — PRESERVAR ESQUEMA DE CORES
   O Dashboard IDP usa paleta própria (azul/verde/
   roxo). As regras acima são muito agressivas e
   capturam border/color além de background.
   Estas regras têm especificidade maior e desfazem
   os overrides para o contexto .idp-page.
   ============================================ */

/* Cards/seções: fundo sempre branco, exceto blocos premium do IDP */
.idp-page .idp-section:not(.idp-section--premium-plan),
.idp-page .idp-section[style]:not(.idp-section--premium-plan) {
  background: #fff !important;
  background-image: none !important;
}

.idp-page .idp-section--premium-plan,
.idp-page .idp-section--premium-plan[style] {
  background: linear-gradient(135deg, #0f172a 0%, #162235 52%, #1e293b 100%) !important;
  background-image: linear-gradient(135deg, #0f172a 0%, #162235 52%, #1e293b 100%) !important;
  color: #fff !important;
}

/* RDI highlight — gradiente creme suave */
.idp-page .rdi-highlight,
.idp-page .rdi-highlight[style] {
  background: linear-gradient(180deg, #fffdf8, #fff) !important;
}

/* Hero — gradiente navy */
.idp-page .idp-hero,
.idp-page .idp-hero[style] {
  background: linear-gradient(135deg, #1B2A41 0%, #2d4156 100%) !important;
}

/* Modal headers verdes no IDP */
.idp-page .modal-header[style*="#10b981"],
.idp-page .modal-header[style*="background:#10b981"],
.idp-page .modal-header[style*="background: #10b981"] {
  background: #10b981 !important;
  background-image: none !important;
  color: #fff !important;
}

/* Botão de filtro "Todos" verde */
.idp-page button[style*="background:#10b981"],
.idp-page button[style*="background: #10b981"] {
  background: #10b981 !important;
  background-image: none !important;
  color: #fff !important;
}

/* Divs com fundo branco explícito que têm borda verde */
.idp-page div[style*="background: #fff"][style*="#10b981"],
.idp-page div[style*="background:#fff"][style*="#10b981"] {
  background: #fff !important;
  background-image: none !important;
}
