
:root{
  --wfm-madison:#0E2E67;
  --wfm-san-marino:#3B5E96;
  --wfm-trinidad:#E64A00;
  --wfm-ink:#162A46;
  --wfm-muted:#718096;
  --wfm-line:#DCE5F0;
  --wfm-bg:#F4F7FB;
  --wfm-card:#FFFFFF;
  --wfm-soft:#EEF3F9;
  --wfm-shadow:0 10px 30px rgba(14,46,103,.08);
  --wfm-radius:16px;
}

/* Base */
body{background:var(--wfm-bg)!important;color:var(--wfm-ink)}
h1,h2,h3,h4,h5,h6,.page-title,.section-title,.card-title{color:var(--wfm-madison)}
a{transition:color .18s ease,background .18s ease,border-color .18s ease,transform .18s ease}
small,.muted,.text-muted,.subtitle,.page-subtitle{color:var(--wfm-muted)!important}

/* Sidebar / NAV */
.app-sidebar{
  background:linear-gradient(180deg,var(--wfm-madison) 0%,#123A78 58%,#173F7A 100%)!important;
  border-right:0!important;
  box-shadow:10px 0 35px rgba(14,46,103,.12)!important
}
.app-sidebar .brand-block{border-bottom:1px solid rgba(255,255,255,.10)!important}
.app-sidebar .brand-mark{
  background:linear-gradient(135deg,#fff,#DDE8F6)!important;
  color:var(--wfm-madison)!important;
  box-shadow:0 8px 20px rgba(0,0,0,.12)
}
.app-sidebar .brand-copy strong,.app-sidebar .brand-copy small{color:#fff!important}
.app-nav a{color:rgba(255,255,255,.80)!important;border:1px solid transparent!important}
.app-nav a b{color:inherit!important}
.app-nav a small{color:rgba(255,255,255,.52)!important}
.app-nav a:hover{
  background:rgba(255,255,255,.09)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.08)!important;
  transform:translateX(2px)
}
.app-nav a.active{
  background:linear-gradient(90deg,rgba(255,255,255,.18),rgba(255,255,255,.08))!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.16)!important;
  box-shadow:inset 3px 0 0 var(--wfm-trinidad)!important
}
.app-nav a.active small{color:rgba(255,255,255,.70)!important}
.sidebar-collapse,.sidebar-toggle{
  background:var(--wfm-san-marino)!important;color:#fff!important;
  border-color:rgba(255,255,255,.18)!important
}
.campaign-switch>a{
  background:linear-gradient(135deg,rgba(255,255,255,.13),rgba(230,74,0,.16))!important;
  border-color:rgba(255,255,255,.16)!important;color:#fff!important
}
.campaign-switch-icon{background:var(--wfm-trinidad)!important}
.campaign-switch .sidebar-foot-copy small,
.campaign-switch .sidebar-foot-copy b,
.campaign-switch-arrow{color:#fff!important}

/* Panels, cards and KPIs */
.card,.panel,.box,.kpi-card,.metric-card,.stat-card,.filter-card,.filters,.table-card,.chart-card{
  border-color:var(--wfm-line)!important;
  box-shadow:var(--wfm-shadow);
}
.card,.panel,.box,.kpi-card,.metric-card,.stat-card,.table-card,.chart-card{
  background:var(--wfm-card)!important
}
.kpi-card h3,.metric-card h3,.stat-card h3,
.kpi-title,.metric-title,.stat-title{color:var(--wfm-muted)!important}
.kpi-value,.metric-value,.stat-value,.big-number{color:var(--wfm-madison)!important}

/* Headers and section accents */
.page-header,.section-header,.card-header,.panel-heading{
  border-color:var(--wfm-line)!important
}
.page-header h1,.page-header h2,.section-header h2,.section-header h3,
.card-header h2,.card-header h3,.panel-heading{color:var(--wfm-madison)!important}

/* Forms / filters */
input,select,textarea,.form-control,.form-select{
  border-color:#CBD8E8!important;
  background-color:#fff!important;
  color:var(--wfm-ink)!important;
  outline:none
}
input:focus,select:focus,textarea:focus,.form-control:focus,.form-select:focus{
  border-color:var(--wfm-san-marino)!important;
  box-shadow:0 0 0 3px rgba(59,94,150,.12)!important
}
label,.filter-label{color:#49617F!important}

/* Buttons */
button,.btn{transition:.18s ease}
.btn-primary,button.btn-primary,.btn-search,.btn-filter,.btn-apply{
  background:var(--wfm-madison)!important;border-color:var(--wfm-madison)!important;color:#fff!important
}
.btn-primary:hover,.btn-search:hover,.btn-filter:hover,.btn-apply:hover{
  background:var(--wfm-san-marino)!important;border-color:var(--wfm-san-marino)!important
}
.btn-secondary,.btn-outline-primary{
  color:var(--wfm-san-marino)!important;border-color:var(--wfm-san-marino)!important;background:#fff!important
}
.btn-danger,.btn-warning,.btn-accent{background:var(--wfm-trinidad)!important;border-color:var(--wfm-trinidad)!important;color:#fff!important}

/* Tables */
table{background:#fff}
thead th{
  background:#EDF3FA!important;
  color:var(--wfm-madison)!important;
  border-color:#D8E3F0!important;
  font-weight:750!important
}
tbody td{border-color:#E7EDF5!important}
tbody tr:hover td{background:#F7FAFD!important}

/* Badges / states */
.badge,.chip,.tag{border-radius:999px}
.badge-primary,.chip-primary,.tag-primary{background:#E8EFF8!important;color:var(--wfm-madison)!important}
.badge-info,.chip-info,.tag-info{background:#EAF0F8!important;color:var(--wfm-san-marino)!important}
.badge-warning,.badge-danger,.chip-warning,.tag-warning{background:#FFF0E8!important;color:var(--wfm-trinidad)!important}

/* Charts */
.highcharts-title,.highcharts-subtitle{fill:var(--wfm-madison)!important}
.highcharts-axis-title,.highcharts-axis-labels text{fill:#60738F!important}
.highcharts-grid-line{stroke:#E5ECF4!important}

/* Modal */
.campaign-head{
  background:linear-gradient(125deg,var(--wfm-madison) 0%,var(--wfm-san-marino) 72%,var(--wfm-trinidad) 160%)!important
}
.campaign-card h3,.working-panel h2{color:var(--wfm-madison)!important}
.campaign-card.active{border-color:var(--wfm-san-marino)!important}
.campaign-card.active:before{color:var(--wfm-san-marino)!important;background:#E9F0F9!important}
.campaign-card.soon .cm-icon,.working-badge{color:var(--wfm-trinidad)!important}
.working-close{background:var(--wfm-madison)!important}

/* Scrollbar, subtle corporate finish */
*{scrollbar-color:var(--wfm-san-marino) #E9EFF6}
::selection{background:rgba(59,94,150,.22)}


/* V4.1 - Corrección de legibilidad en encabezados de tablas.
   Algunas tablas de Avance de ventas usan fondos oscuros definidos por la vista;
   se fuerza una combinación legible para todos sus TH. */
body table thead th,
body .table thead th,
body .table-card table thead th,
body .table-responsive table thead th {
  background:#EDF3FA !important;
  color:#0E2E67 !important;
  border-color:#D8E3F0 !important;
  font-weight:750 !important;
  text-shadow:none !important;
}

body table thead th *,
body .table thead th *,
body .table-card table thead th *,
body .table-responsive table thead th * {
  color:#0E2E67 !important;
  text-shadow:none !important;
}

/* Mantiene visibles iconos/enlaces/ordenamiento dentro del encabezado */
body table thead th a,
body table thead th button,
body table thead th i,
body table thead th span {
  color:#0E2E67 !important;
}


/* V4.2 - Avance de Ventas: override final real.
   Este archivo ahora se carga DESPUÉS de Bootstrap y app.css. */
body .sales-matrix-table thead th,
body .sales-matrix-table thead th.sticky-col,
body .sales-matrix-table thead th.matrix-key-head,
body .sales-matrix-table thead th.matrix-total-head,
body .sales-matrix-table thead th.tramo-head,
body .table-wrap table thead th {
    background:#EDF3FA !important;
    background-color:#EDF3FA !important;
    color:#0E2E67 !important;
    -webkit-text-fill-color:#0E2E67 !important;
    text-shadow:none !important;
    opacity:1 !important;
}
body .sales-matrix-table thead th *,
body .table-wrap table thead th * {
    color:#0E2E67 !important;
    -webkit-text-fill-color:#0E2E67 !important;
}
