/* ============================================================
   JIRO y Asociados — Fundamentos de marca para Central de Producción
   Fuente: sistema de diseño "Jiro Asociados" (colors_and_type.css).
   Se carga después de custom.css: redefine sus variables y los
   componentes base de Bootstrap / Tabulator / TomSelect.

   Reglas de legibilidad (WCAG AA):
   · Los 4 acentos (amarillo, verde, naranja, menta) son solo RELLENO
     con texto navy encima; nunca texto sobre blanco.
   · Texto chico: --fg (#121A2D) o --fg-muted (#4A546A, 8.0:1).
     --fg-soft (#7A8298, 3.9:1) solo para ≥ 18 px o decoración.
   · Tipografía: Montserrat (sustituto libre de Gotham que indica la guía).
   ============================================================ */

:root {
  /* Paleta de marca */
  --jiro-blue:      #164281;
  --jiro-blue-700:  #0F305E;
  --jiro-blue-300:  #6E8EBE;
  --jiro-blue-100:  #DCE6F3;
  --jiro-navy:      #121A2D;
  --jiro-cream:     #E2E1CC;
  --jiro-cream-200: #F2F1E2;
  --jiro-cream-100: #F8F7EE;
  --jiro-yellow:    #FFD62B;   /* Autos */
  --jiro-green:     #93C01F;   /* Vida / Salud */
  --jiro-orange:    #F4AD0F;   /* Hogar / Empresarial */
  --jiro-mint:      #59D1AF;   /* Fianzas / Ahorro */

  /* Texto y bordes */
  --fg:            #121A2D;
  --fg-muted:      #4A546A;
  --fg-soft:       #7A8298;
  --border:        #E4E6EE;
  --border-strong: #C9CDDB;

  /* Estados: relleno suave + texto oscuro (del componente Badge de la guía) */
  --ok-bg:     #E8F3D3;  --ok-fg:     #4F6A12;
  --warn-bg:   #FDEBC4;  --warn-fg:   #6E4500;
  --danger-bg: #FBE0E0;  --danger-fg: #8E1E1E;
  --info-bg:   #DCE6F3;  --info-fg:   #0F305E;
  --neutral-bg:#ECEEF5;
  --status-danger: #C23434;   /* rojo de la guía (#D64545) oscurecido para texto 4.5:1 */

  /* Forma y elevación */
  --radius-xs: 6px;  --radius-sm: 10px; --radius-md: 14px;
  --radius-lg: 20px; --radius-pill: 999px; --radius-block: 18px;
  --shadow-xs:    0 1px 2px rgba(18, 26, 45, .06);
  --shadow-sm:    0 2px 6px rgba(18, 26, 45, .07);
  --shadow-md:    0 8px 24px -8px rgba(18, 26, 45, .16);
  --shadow-lg:    0 20px 48px -16px rgba(18, 26, 45, .22);
  --shadow-block: 0 6px 0 0 rgba(18, 26, 45, .08);
  --ease-jiro: cubic-bezier(.2, .8, .2, 1);

  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Variables propias de CP → marca */
  --color-primary:       var(--jiro-blue);
  --color-primary-light: var(--jiro-blue-700);   /* hover: un paso más oscuro */
  --color-accent:        var(--jiro-orange);
  --color-accent-dark:   #D9960A;
  --color-bg:            var(--jiro-cream-100);
  --color-card:          #fff;
  --color-bg-card:       #fff;
  --color-text:          var(--fg);
  --color-text-muted:    var(--fg-muted);
  --color-border:        var(--border);
  --color-danger:        var(--status-danger);
  --radius-card:         var(--radius-md);
  --radius-btn:          var(--radius-sm);
  --shadow-card:         var(--shadow-sm);
  --shadow-card-hover:   var(--shadow-md);
  --transition:          .2s var(--ease-jiro);
  --font-family:         var(--font-sans);

  /* Bootstrap 5.3 */
  --bs-body-font-family: var(--font-sans);
  --bs-body-color:       var(--fg);
  --bs-body-color-rgb:   18, 26, 45;
  --bs-body-bg:          #fff;          /* superficies (campos, tarjetas, modales) blancas; el crema va solo en <body> */
  --bs-tertiary-bg:      var(--jiro-cream-100);
  --bs-emphasis-color:   var(--fg);
  --bs-secondary-color:  var(--fg-muted);
  --bs-primary:          #164281;
  --bs-primary-rgb:      22, 66, 129;
  --bs-primary-text-emphasis: #0F305E;
  --bs-primary-bg-subtle: #DCE6F3;
  --bs-primary-border-subtle: #B9CCE6;
  --bs-link-color:       #164281;
  --bs-link-color-rgb:   22, 66, 129;
  --bs-link-hover-color: #0F305E;
  --bs-link-hover-color-rgb: 15, 48, 94;
  --bs-border-color:     var(--border);
  --bs-border-radius:    var(--radius-sm);
  --bs-border-radius-sm: var(--radius-xs);
  --bs-border-radius-lg: var(--radius-md);
  --bs-border-radius-xl: var(--radius-lg);
  --bs-focus-ring-color: rgba(22, 66, 129, .18);
  --bs-heading-color:    var(--fg);
}

/* ── Base ─────────────────────────────────────────────────────────── */
html, body {
  font-family: var(--font-sans);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { background: var(--jiro-cream-100); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.01em;
}
strong, b { font-weight: 700; }
a { color: var(--jiro-blue); }
a:hover { color: var(--jiro-blue-700); }
::selection { background: var(--jiro-blue-100); color: var(--fg); }
.text-muted, .text-secondary, .text-body-secondary { color: var(--fg-muted) !important; }
.text-primary { color: var(--jiro-blue) !important; }
.text-danger  { color: var(--status-danger) !important; }
.text-success { color: #2E7D32 !important; }   /* 5.1:1 en blanco y crema */
.bg-primary   { background-color: var(--jiro-blue) !important; }
.border       { border-color: var(--border) !important; }

/* Etiqueta de sección (eyebrow) de la guía */
.eyebrow, .label-section {
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--jiro-blue);
}

/* ── Menú lateral: navy de marca ──────────────────────────────────── */
#sidebar { background: var(--jiro-navy); }
.sidebar-header { background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-logo { font-weight: 700; letter-spacing: -.015em; font-size: 1rem; }
.sidebar-logo-icon { background: transparent; border-radius: 0; width: 30px; height: 30px; }
.sidebar-logo-icon img { width: 26px !important; height: 26px !important; }
.sidebar-nav a { color: rgba(255, 255, 255, .86); border-radius: var(--radius-sm); margin: 1px 8px;
  padding: 9px 12px; font-weight: 500; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: var(--jiro-blue); color: #fff; font-weight: 700; }
.sidebar-section-header { color: rgba(255, 255, 255, .78) !important; font-weight: 700; letter-spacing: .12em;
  padding: 16px 20px 4px; }
.sidebar-divider { border-color: rgba(255, 255, 255, .14); }

/* ── Barra superior ───────────────────────────────────────────────── */
#topbar {
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}
.topbar-avatar { background: var(--jiro-blue); }

/* ── Título de página ─────────────────────────────────────────────── */
.page-title { color: var(--fg); font-weight: 700; letter-spacing: -.015em; }
.page-title .breadcrumb { color: var(--fg-muted); }
.breadcrumb-item a { color: var(--jiro-blue); }

/* ── Tarjetas ─────────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
  transition: box-shadow .18s var(--ease-jiro), transform .18s var(--ease-jiro);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { font-weight: 700; color: var(--fg); border-bottom-color: var(--border); }
.card-header:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.card-footer:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.filters-bar { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.filters-bar .form-label, .form-label-xs { color: var(--fg-muted); font-weight: 600; }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--border); }
.dropdown-menu { border-color: var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.dropdown-item.active, .dropdown-item:active { background: var(--jiro-blue); }
.list-group-item.active { background: var(--jiro-blue); border-color: var(--jiro-blue); }

/* ── Botones (primario azul → secundario contorno → fantasma → acento amarillo) ── */
.btn { font-weight: 700; letter-spacing: .005em; border-radius: var(--radius-sm) !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease; }
.btn:active { transform: scale(.98); }
.btn-primary {
  --bs-btn-bg: #164281; --bs-btn-border-color: #164281;
  --bs-btn-hover-bg: #0F305E; --bs-btn-hover-border-color: #0F305E;
  --bs-btn-active-bg: #0F305E; --bs-btn-active-border-color: #0F305E;
  --bs-btn-disabled-bg: #164281; --bs-btn-disabled-border-color: #164281;
  background: var(--bs-btn-bg); border-color: var(--bs-btn-border-color);
}
.btn-primary:hover, .btn-primary:focus-visible { background: #0F305E; border-color: #0F305E; }
.btn-outline-primary {
  --bs-btn-color: #164281; --bs-btn-border-color: #164281;
  --bs-btn-hover-bg: #DCE6F3; --bs-btn-hover-color: #0F305E; --bs-btn-hover-border-color: #164281;
  --bs-btn-active-bg: #DCE6F3; --bs-btn-active-color: #0F305E; --bs-btn-active-border-color: #164281;
}
.btn-secondary {
  --bs-btn-bg: #4A546A; --bs-btn-border-color: #4A546A;
  --bs-btn-hover-bg: #363E50; --bs-btn-hover-border-color: #363E50;
}
.btn-outline-secondary {
  --bs-btn-color: #4A546A; --bs-btn-border-color: #C9CDDB;
  --bs-btn-hover-bg: #ECEEF5; --bs-btn-hover-color: #121A2D; --bs-btn-hover-border-color: #C9CDDB;
  --bs-btn-active-bg: #ECEEF5; --bs-btn-active-color: #121A2D; --bs-btn-active-border-color: #C9CDDB;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-color: var(--fg);
  --bs-btn-hover-bg: var(--jiro-cream-100); --bs-btn-hover-border-color: var(--border-strong); }
.btn-accent, .btn-warning {
  --bs-btn-bg: #FFD62B; --bs-btn-border-color: #FFD62B; --bs-btn-color: #121A2D;
  --bs-btn-hover-bg: #F2C200; --bs-btn-hover-border-color: #F2C200; --bs-btn-hover-color: #121A2D;
  --bs-btn-active-bg: #F2C200; --bs-btn-active-color: #121A2D;
  background: var(--bs-btn-bg); border-color: var(--bs-btn-border-color); color: #121A2D;
}
.btn-accent:hover { background: #F2C200; color: #121A2D; }
.btn-success {
  --bs-btn-bg: #2E7D32; --bs-btn-border-color: #2E7D32;
  --bs-btn-hover-bg: #23622A; --bs-btn-hover-border-color: #23622A;
}
.btn-danger, .btn-outline-danger:hover {
  --bs-btn-bg: #C23434; --bs-btn-border-color: #C23434;
  --bs-btn-hover-bg: #A12A2A; --bs-btn-hover-border-color: #A12A2A;
}
.btn-outline-danger { --bs-btn-color: #C23434; --bs-btn-border-color: #C23434;
  --bs-btn-hover-bg: #C23434; --bs-btn-hover-border-color: #C23434; }
.btn-link { --bs-btn-color: #164281; --bs-btn-hover-color: #0F305E; font-weight: 600; }
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(22, 66, 129, .22) !important; }

/* ── Badges: píldora Gotham/Montserrat bold ───────────────────────── */
.badge { font-weight: 700; letter-spacing: .01em; border-radius: var(--radius-pill); }
.badge.bg-primary   { background: var(--jiro-blue) !important; color: #fff !important; }
.badge.bg-secondary { background: var(--neutral-bg) !important; color: var(--fg) !important; }
.badge.bg-success   { background: var(--ok-bg) !important; color: var(--ok-fg) !important; }
.badge.bg-danger    { background: var(--danger-bg) !important; color: var(--danger-fg) !important; }
.badge.bg-warning   { background: var(--jiro-yellow) !important; color: var(--fg) !important; }
.badge.bg-info      { background: var(--info-bg) !important; color: var(--info-fg) !important; }
.badge.bg-light     { background: var(--neutral-bg) !important; color: var(--fg) !important; }
.badge.bg-dark      { background: var(--jiro-navy) !important; color: #fff !important; }
.badge-convenio     { background: var(--ok-bg); color: var(--ok-fg); }
.badge-no-convenio  { background: var(--danger-bg); color: var(--danger-fg); }

/* ── Alertas ──────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius-md); border-width: 1px; }
.alert-info    { background: var(--info-bg);   border-color: #B9CCE6; color: var(--info-fg); }
.alert-success { background: var(--ok-bg);     border-color: #CFE3A8; color: var(--ok-fg); }
.alert-warning { background: var(--warn-bg);   border-color: #F6D58C; color: var(--warn-fg); }
.alert-danger  { background: var(--danger-bg); border-color: #F2B8B8; color: var(--danger-fg); }
.alert-light   { background: #fff; border-color: var(--border); color: var(--fg); }

/* ── Formularios: borde fuerte + anillo azul de marca ─────────────── */
.form-control, .form-select {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
}
.form-control::placeholder { color: #6B7385; }   /* 4.6:1 */
.form-control:focus, .form-select:focus {
  border-color: var(--jiro-blue);
  box-shadow: 0 0 0 4px rgba(22, 66, 129, .14);
}
.form-check-input:checked { background-color: var(--jiro-blue); border-color: var(--jiro-blue); }
.form-check-input:focus { border-color: var(--jiro-blue); box-shadow: 0 0 0 4px rgba(22, 66, 129, .14); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23164281'/%3e%3c/svg%3e"); }
.form-label { font-weight: 600; color: var(--fg); }
.input-group-text { background: var(--jiro-cream-100); border-color: var(--border-strong); color: var(--fg-muted); }
.ts-wrap .ts-control { border-color: var(--border-strong) !important; border-radius: var(--radius-sm) !important; }
.ts-wrap.focus .ts-control, .ts-control.focus { border-color: var(--jiro-blue) !important;
  box-shadow: 0 0 0 4px rgba(22, 66, 129, .14) !important; }
.ts-wrap .ts-control .item { background: var(--jiro-blue); border-radius: var(--radius-xs); }
.ts-dropdown { border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.ts-dropdown .option.active { background: var(--jiro-blue-100); color: var(--jiro-blue-700); }

/* ── Tablas ───────────────────────────────────────────────────────── */
.table { --bs-table-color: var(--fg); --bs-table-border-color: var(--border); }
.table thead th, .table-header, .table-header-sm { background: var(--jiro-blue); color: #fff; font-weight: 700; }
.table-hover > tbody > tr:hover > *, .table tbody tr:hover { --bs-table-hover-bg: rgba(22, 66, 129, .05); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-striped-bg: rgba(226, 225, 204, .28); }
.table-light, .table > thead.table-light th { --bs-table-bg: #ECEEF5; --bs-table-color: var(--fg); color: var(--fg); background: #ECEEF5; }
.tabulator { font-family: var(--font-sans); border-color: var(--border); font-size: 13px; }  /* Montserrat es ~8 % más ancha que Inter */
.tabulator .tabulator-footer .tabulator-page { border-radius: var(--radius-xs); color: var(--jiro-blue); }
.tabulator .tabulator-footer .tabulator-page.active { background: var(--jiro-blue) !important; border-color: var(--jiro-blue) !important; color: #fff !important; }
.tabulator .tabulator-footer .tabulator-page:not(.active):not(:disabled):hover { background: var(--jiro-blue-100); color: var(--jiro-blue-700); }
.tabulator .tabulator-footer .tabulator-page:disabled { color: #6B7385; }
.tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col { background: var(--jiro-blue) !important; }
.tabulator .tabulator-header .tabulator-col { font-weight: 700; font-size: 12.5px; letter-spacing: 0; }
.tabulator .tabulator-row.tabulator-row-even { background: #FBFBF6; }
.tabulator .tabulator-row:hover { background: rgba(22, 66, 129, .05) !important; }
.tabulator .tabulator-footer { background: #fff; border-color: var(--border); color: var(--fg-muted); }

/* ── Paginación / pestañas / barras de progreso ──────────────────── */
.pagination { --bs-pagination-color: #164281; --bs-pagination-active-bg: #164281; --bs-pagination-active-border-color: #164281;
  --bs-pagination-hover-color: #0F305E; --bs-pagination-focus-box-shadow: 0 0 0 4px rgba(22,66,129,.14); }
.nav-tabs .nav-link { color: var(--fg-muted); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--jiro-blue); font-weight: 700; }
.nav-pills .nav-link { color: var(--fg-muted); font-weight: 600; border-radius: var(--radius-pill); }
.nav-pills .nav-link.active { background: var(--jiro-blue); color: #fff; }
.progress { background: #ECEEF5; border-radius: var(--radius-pill); }
.progress-bar { background-color: var(--jiro-blue); }
.progress-bar-custom { background: var(--jiro-blue); }   /* sin degradado */

/* ── Estados vacíos y ayudas ─────────────────────────────────────── */
.empty-state { color: var(--fg-muted); }
.lc-strip .lc-card-label { color: var(--fg-muted); }

/* ── Pantalla de acceso ──────────────────────────────────────────── */
.login-page { background: var(--jiro-navy); }
.login-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.login-logo { background: transparent; width: auto; height: auto; }

/* ══ Fase 2 · Inicio y Dashboard (prefijo html body: gana a dashboard-cards.css, que carga después) ══ */

/* Tarjetas de indicadores: blancas, cifra navy, bloque de color con ícono
   (estilo "block icon" de la guía; glifo navy sobre acentos claros para 3:1+) */
html body .kpi-card {
  background: #fff !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  height: 100%;
}

html body .kpi-card:hover { box-shadow: var(--shadow-md) !important; }

html body .kpi-card .kpi-icon {
  position: absolute; right: 14px; top: 14px; transform: none;
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; opacity: 1; z-index: 1;
  background: var(--kpi-block, var(--jiro-blue)); color: var(--kpi-glyph, #fff);
  box-shadow: var(--shadow-block);
}

html body .kpi-card .kpi-label {
  color: var(--fg-muted) !important; font-weight: 700; font-size: .7rem;
  letter-spacing: .1em; padding-right: 44px; margin-bottom: 4px;
  min-height: 34px; display: flex; align-items: center; line-height: 1.25;
}

html body .kpi-card .kpi-value { color: var(--fg) !important; font-weight: 700; letter-spacing: -.015em; }

html body .kpi-card .kpi-yoy { color: var(--fg-muted); }

html body .kpi-card .kpi-yoy-up { color: #2E7D32 !important; }

html body .kpi-card .kpi-yoy-down { color: var(--status-danger) !important; }

html body .kpi-card .kpi-yoy-label { color: var(--fg-muted) !important; font-weight: 500; }

html body .kpi-blue { --kpi-block: var(--jiro-blue); }

html body .kpi-orange { --kpi-block: var(--jiro-orange); --kpi-glyph: var(--jiro-navy); }

html body .kpi-secondary { --kpi-block: var(--jiro-navy); }

html body .kpi-green { --kpi-block: var(--jiro-green);  --kpi-glyph: var(--jiro-navy); }

html body .kpi-teal { --kpi-block: var(--jiro-mint);   --kpi-glyph: var(--jiro-navy); }

html body .kpi-danger { --kpi-block: #C23434; }

html body .kpi-gold { --kpi-block: var(--jiro-yellow); --kpi-glyph: var(--jiro-navy); }

html body .kpi-danger:hover,
html body .kpi-gold:hover { box-shadow: var(--shadow-md) !important; }

html body .kpi-danger-link:hover { opacity: 1; }

html body .kpi-danger-link:hover .kpi-card { border-color: #E9B4B4 !important; }


/* Encabezado de bienvenida: bloque azul plano (sin degradados por rol) */
html body .home-banner,
html body .home-banner.ger,
html body .home-banner.desp,
html body .home-banner.dirreg {
  background: var(--jiro-blue); border-radius: var(--radius-md);
}

html body .home-banner::after { background: rgba(255, 255, 255, .07); }

html body .hb-entity { font-weight: 700; letter-spacing: -.015em; }

html body .hb-sub { opacity: 1; color: rgba(255, 255, 255, .88); }

html body .hb-right { opacity: 1; color: rgba(255, 255, 255, .88); }


/* Etiquetas, pestañas y chips */
html body .section-label { color: var(--fg-muted); letter-spacing: .12em; }

html body .dim-tab { background: #ECEEF5; color: var(--fg-muted); }

html body .dim-tab:hover { background: var(--border-strong); color: var(--fg); }

html body .dim-tab.active { background: var(--jiro-blue); color: #fff; }

html body #active-filters-strip { background: var(--jiro-cream-100); border-color: var(--border); border-radius: var(--radius-sm); }

html body .af-chip { background: var(--info-bg); color: var(--info-fg); }

html body .renov-chip { border-color: var(--border); border-radius: var(--radius-sm); }

html body .renov-chip:hover,
html body .renov-chip.active { border-color: var(--jiro-blue); }

html body .renov-chip.active { background: var(--jiro-blue-100); }

html body .pct-green { background: var(--ok-bg);     color: var(--ok-fg); }

html body .pct-yellow { background: var(--warn-bg);   color: var(--warn-fg); }

html body .pct-red { background: var(--danger-bg); color: var(--danger-fg); }

html body .conc-bar-wrap { background: #ECEEF5; }

html body .chart-empty { color: var(--fg-muted); }


/* Barra de indicadores del Dashboard */
html body .kpi-bar-fixed { border-color: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }

html body .kpi-bar-hd { background: var(--jiro-cream-100); border-color: var(--border); }

html body .kpi-bar-ttl,
html body .kpi-i-lbl { color: var(--fg-muted); }

html body .kpi-i { border-color: #F0F1F5; }

html body .kpi-i-blue { --kpi-color: #164281; }

html body .kpi-i-orange { --kpi-color: #8A5300; }
   /* naranja de marca oscurecido para texto (6.2:1) */
html body .kpi-i-gray { --kpi-color: #4A546A; }

html body .kpi-i-green { --kpi-color: #2E7D32; }

html body .kpi-i-teal { --kpi-color: #0E6B55; }
   /* menta oscurecida para texto (6.4:1) */
html body .kpi-i .kpi-yoy-up { color: #2E7D32; }

html body .kpi-i .kpi-yoy-down { color: var(--status-danger); }

html body .kpi-i .kpi-yoy,
html body .kpi-i .kpi-yoy-label { color: var(--fg-muted); }


/* Tarjetas de resumen (Gerencias / Vendedores / Despachos): encabezados planos */
html body .resumen-hd-navy { background: var(--jiro-blue); }

html body .resumen-hd-teal { background: var(--jiro-navy); }

html body .resumen-hd-coral { background: var(--jiro-blue-700); }

html body .resumen-card-navy  .resumen-tbl thead th { background: #EEF2F8; color: var(--jiro-blue-700); }

html body .resumen-card-teal  .resumen-tbl thead th { background: #ECEEF5; color: var(--fg); }

html body .resumen-card-coral .resumen-tbl thead th { background: var(--jiro-cream-200); color: var(--fg); }

html body .resumen-card-navy  .resumen-tbl tbody tr:nth-child(even) td,
html body .resumen-card-teal  .resumen-tbl tbody tr:nth-child(even) td,
html body .resumen-card-coral .resumen-tbl tbody tr:nth-child(even) td { background: #FBFBF6; }

html body .resumen-card-navy  .resumen-tbl tbody tr:hover td,
html body .resumen-card-teal  .resumen-tbl tbody tr:hover td,
html body .resumen-card-coral .resumen-tbl tbody tr:hover td { background: var(--jiro-blue-100); }


/* Medallas (sustituyen a los emojis 🥇🥈🥉) y puntos de color */
html body .jiro-medal {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px;
  font-size: .7rem; font-weight: 800; line-height: 1; color: var(--jiro-navy);
  box-shadow: 0 2px 0 0 rgba(18, 26, 45, .10); vertical-align: middle;
}

html body .jiro-medal.m1 { background: var(--jiro-yellow); }

html body .jiro-medal.m2 { background: #D5D9E3; }

html body .jiro-medal.m3 { background: var(--jiro-orange); }

html body .jiro-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin: 0 2px; }


/* Botón verde de contorno (Bootstrap #198754 da 4.2:1 sobre crema) */
html body .btn-outline-success { --bs-btn-color: #2E7D32; --bs-btn-border-color: #2E7D32;
  --bs-btn-hover-bg: #2E7D32; --bs-btn-hover-border-color: #2E7D32; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #23622A; --bs-btn-active-border-color: #23622A; }

html body .btn-outline-warning { --bs-btn-color: #6E4500; --bs-btn-border-color: #D9960A;
  --bs-btn-hover-bg: var(--jiro-yellow); --bs-btn-hover-color: #121A2D; --bs-btn-hover-border-color: #D9960A; }

html body .btn-outline-info { --bs-btn-color: #0F305E; --bs-btn-border-color: #6E8EBE;
  --bs-btn-hover-bg: var(--jiro-blue-100); --bs-btn-hover-color: #0F305E; --bs-btn-hover-border-color: #164281; }

html body .lc-min-kpi-btn,
html body .lc-min-kpi-btn > span { color: var(--fg-muted); }
/* Encabezados de tabla: siempre blanco sobre azul (muchos traían un gris en línea que
   sobre el azul quedaba ilegible); los encabezados claros (.table-light) van en navy */
html body .table thead th:not([style*="background"]):not(.renov-thead th) { color: #fff !important; }
/* Encabezados claros a propósito (fondo en línea u ordenables de Renovaciones): navy */
html body .table thead th[style*="background:#f"] { color: var(--fg) !important; }
html body .table thead.table-light th, html body .table thead tr.table-light th,
html body .table .table-light th { color: var(--fg) !important; background: #ECEEF5 !important; }
html body .table thead th a { color: #fff; }

/* ── Fase 3 · ajustes de textos que no cabían ─────────────────────── */
html body .ef-btn-value { max-width: 200px; }

/* ── Fase 4 · utilidades y restos de degradados ─────────────────── */
.text-warning { color: #8A5300 !important; }   /* ámbar legible (6.2:1) */
.text-info    { color: #0E6B55 !important; }   /* menta oscurecida (6.4:1) */
html body .ranking-pos-1, html body .ranking-pos-2, html body .ranking-pos-3 { border-left: 0; }
html body .ranking-pos-1 { background: #FFF6CF !important; }
html body .ranking-pos-2 { background: #F1F2F6 !important; }
html body .ranking-pos-3 { background: #FDEBC4 !important; }
html body .ranking-pos-1:hover, html body .ranking-pos-2:hover, html body .ranking-pos-3:hover {
  background: var(--jiro-blue-100) !important; }
html body .conv-barra-relleno { background: var(--jiro-blue); }
html body .conv-barra-pista { background: var(--jiro-blue-100); }
html body .kpi-gold { color: var(--fg); }
code { color: #A12A2A; }   /* rosa de Bootstrap (3.6:1) → rojo oscuro legible */
/* Texto secundario dentro de encabezados azules de tabla */
html body .table thead:not(.table-light) tr:not(.table-light) th:not([style*="background"]) .text-muted,
html body .table thead:not(.table-light) tr:not(.table-light) th:not([style*="background"]) small {
  color: rgba(255, 255, 255, .85) !important; }
/* Filas desactivadas legibles (en lugar de opacity .5, que deja el texto a ~2.5:1) */
html body .nivel-inactivo { background: #F6F6F2; border-style: dashed !important; }
html body .nivel-inactivo, html body .nivel-inactivo * { color: #4A546A !important; }
html body .nivel-inactivo .input-group-text, html body .nivel-inactivo .form-control { background: #ECEEF5; }
html body .nivel-inactivo .badge { background: #ECEEF5 !important; }
