/* ========================================================

   BI RECLAMOS - NETCALL PER?

   Layout 100vh Real / Ultra-Compact Power BI Executive Grid

   ======================================================== */



:root {
  /* ========================================================
     TEMA NETCALL PERÚ - ATON BI
     ======================================================== */
  --bg-app: #F7F9F8;
  --bg-card: #FFFFFF;

  /* Paleta Corporativa Oficial */
  --netcall-navy: #0E2E67;
  --netcall-navy-sub: #1A3B78;
  --netcall-orange: #E64A00;
  --netcall-blue-mid: #0D6ABF;
  --netcall-blue-light: #41A4FF;
  --netcall-navy-muted: #3B5E96;
  --netcall-slate: #627EAB;
  --netcall-ice: #A3B5D1;

  --entel-blue: #0E2E67;
  --entel-navy: #0E2E67;
  --entel-orange: #E64A00;
  --accent-blue: #0D6ABF;
  --accent-cyan: #41A4FF;

  --border-color: #E2E8F0;
  --border-subtle: #CBD5E1;

  --text-dark: #0E2E67;
  --text-muted: #627EAB;
  --text-light: #A3B5D1;

  --th-bg: #0E2E67;
  --th-sub-bg: #1A3B78;

  --fundado-color: #0D6ABF;
  --infundado-color: #E64A00;

  --total-col-bg: #F7F9F8;

  --header-height: 56px;
  --filter-height: 48px;
}



* {

  margin: 0;

  padding: 0;

  box-sizing: border-box;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;

  user-select: none;

}



html, body {

  width: 100vw;

  height: 100vh;

  overflow: hidden;

  background-color: var(--bg-app);

  color: var(--text-dark);

}



/* App Container - 100vh Real Lock */

.app-container {

  width: 100vw;

  height: 100vh;

  overflow: hidden;

  position: relative;

  display: flex;

  flex-direction: column;

}



/* Vistas */

.view-section {

  display: none;

  width: 100%;

  height: 100%;

  overflow: hidden;

}



.view-section.active {

  display: flex;

  flex-direction: column;

  height: 100%;

}



/* ========================================================

   VISTA 1: LANDING / SELECTOR DE CAMPA?AS

   ======================================================== */

.landing-container {

  display: grid;

  grid-template-columns: 460px 1fr;

  width: 100%;

  height: 100%;

  background-color: var(--bg-app);

}



.landing-left {

  background: linear-gradient(160deg, #0E2E67 0%, #081F47 100%);

  color: #FFFFFF;

  padding: 44px;

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  position: relative;

  box-shadow: 4px 0 24px rgba(0,0,0,0.15);

  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);

}



.brand-badge {

  display: flex;

  align-items: center;

  gap: 12px;

}



.brand-icon {

  background: var(--entel-orange);

  width: 38px;

  height: 38px;

  border-radius: 8px;

  display: flex;

  align-items: center;

  justify-content: center;

  color: #fff;

}



.brand-name {

  font-weight: 700;

  letter-spacing: 1.5px;

  font-size: 1.05rem;

}



.landing-hero {

  margin: auto 0;

}



.hero-tag {

  color: var(--entel-orange);

  font-size: 0.78rem;

  font-weight: 700;

  letter-spacing: 1.5px;

  margin-bottom: 10px;

  text-transform: uppercase;

}



.hero-title {

  font-size: 2.6rem;

  line-height: 1.15;

  font-weight: 800;

  letter-spacing: -0.5px;

  margin-bottom: 14px;

}



.hero-bar {

  width: 48px;

  height: 4px;

  background-color: var(--entel-orange);

  border-radius: 3px;

  margin-bottom: 18px;

}



.hero-desc {

  color: #CBD5E1;

  font-size: 0.92rem;

  line-height: 1.55;

  max-width: 360px;

}



.landing-footer {

  display: flex;

  flex-direction: column;

  gap: 4px;

}



.footer-label {

  color: var(--entel-orange);

  font-size: 0.68rem;

  font-weight: 700;

  letter-spacing: 1px;

}



.footer-val {

  color: #E2E8F0;

  font-size: 0.82rem;

  font-family: monospace;

}



/* Landing Right */

.landing-right {

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 50px;

}



.cards-wrapper {

  display: flex;

  flex-direction: column;

  gap: 20px;

  width: 100%;

  max-width: 540px;

}



.campaign-card {

  background: #FFFFFF;

  border-radius: 14px;

  padding: 24px;

  display: flex;

  align-items: center;

  gap: 20px;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  border: 1px solid var(--border-color);

  position: relative;

  overflow: hidden;

  cursor: pointer;

  transition: all 0.2s ease;

}



.campaign-card:not(.disabled):hover {

  transform: translateY(-3px);

  box-shadow: 0 10px 24px rgba(250, 100, 0, 0.12);

  border-color: #FED7AA;

}



.card-entel {

  border-left: 5px solid var(--entel-orange);

}



.card-movistar {

  border-left: 5px solid #00A9E0;

}



.card-icon-box {

  width: 48px;

  height: 48px;

  border-radius: 10px;

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

}



.entel-icon {

  background: #FFF7ED;

  color: var(--entel-orange);

}



.movistar-icon {

  background: #E0F2FE;

  color: #0284C7;

}



.card-body {

  flex: 1;

}



.card-header-row {

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 4px;

}



.card-tag {

  font-size: 0.7rem;

  font-weight: 700;

  letter-spacing: 1px;

  color: var(--text-muted);

}



.status-badge {

  font-size: 0.65rem;

  font-weight: 700;

  padding: 2px 7px;

  border-radius: 5px;

}



.status-badge.live {

  background: #DCFCE7;

  color: #15803D;

}



.status-badge.soon {

  background: #F7F9F8;

  color: #64748B;

}



.card-title {

  font-size: 1.3rem;

  font-weight: 800;

  color: var(--entel-blue);

  margin-bottom: 4px;

}



.card-text {

  font-size: 0.78rem;

  color: var(--text-muted);

  line-height: 1.45;

}



.card-arrow {

  color: #CBD5E1;

  transition: transform 0.2s;

}



.campaign-card:hover .card-arrow {

  color: var(--entel-orange);

  transform: translateX(4px);

}



.campaign-card.disabled {

  opacity: 0.65;

  cursor: not-allowed;

  filter: grayscale(0.5);

}



/* ========================================================

   VISTA 2: HEADER CORPORATIVO (bg-slate-900 / #0E2E67 FIJO)

   ======================================================== */

header.app-header, .dashboard-header {

  height: var(--header-height);

  width: 100%;

  background-color: #0E2E67 !important; border-bottom: 2px solid #E64A00 !important;

  color: #FFFFFF !important;

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 0 24px;

  flex-shrink: 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

  box-sizing: border-box;

}



.header-left {

  display: flex;

  align-items: center;

  gap: 14px;

}



.header-logo {

  display: flex;

  align-items: center;

  gap: 10px;

  cursor: pointer;

  transition: opacity 0.15s;

}



.header-logo:hover {

  opacity: 0.85;

}



.logo-box {

  background: var(--entel-orange);

  width: 28px;

  height: 28px;

  border-radius: 6px;

  display: flex;

  align-items: center;

  justify-content: center;

  color: #FFFFFF;

}



.logo-box svg {

  width: 16px;

  height: 16px;

}



.logo-text {

  display: flex;

  flex-direction: column;

}



.logo-title {

  font-size: 0.98rem;

  font-weight: 800;

  letter-spacing: -0.2px;

  color: #FFFFFF !important;

  line-height: 1;

}



.logo-sub {

  font-size: 0.6rem;

  font-weight: 700;

  color: #94A3B8 !important;

  letter-spacing: 0.8px;

}



.header-divider {

  width: 1px;

  height: 22px;

  background-color: rgba(255, 255, 255, 0.2);

}



.header-breadcrumb {

  font-size: 0.86rem;

  font-weight: 700;

  letter-spacing: 0.5px;

  color: #FFFFFF !important;

}



/* Pesta?as Superiores Dentro del Header Oscuro */

.nav-tabs {

  display: flex;

  gap: 4px;

  background: rgba(255, 255, 255, 0.08);

  padding: 3px;

  border-radius: 7px;

  border: 1px solid rgba(255, 255, 255, 0.1);

}



.nav-tab {

  background: transparent;

  border: none;

  color: #CBD5E1;

  font-size: 0.82rem;

  font-weight: 600;

  padding: 5px 18px;

  border-radius: 5px;

  cursor: pointer;

  transition: all 0.15s ease;

}



.nav-tab:hover {

  color: #FFFFFF;

  background: rgba(255, 255, 255, 0.1);

}



.nav-tab.active {

  background: #FFFFFF;

  color: #0E2E67 !important;

  font-weight: 700;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);

}



/* Header Right: Selector de A?o y Refresh */

.header-right {

  display: flex;

  align-items: center;

  gap: 12px;

}



.year-pills {

  display: flex;

  background: rgba(255, 255, 255, 0.1);

  padding: 2px;

  border-radius: 6px;

  gap: 2px;

}



.year-btn {

  background: transparent;

  border: none;

  color: #CBD5E1;

  font-size: 0.76rem;

  font-weight: 600;

  padding: 4px 10px;

  border-radius: 4px;

  cursor: pointer;

  transition: all 0.15s;

}



.year-btn:hover {

  color: #FFFFFF;

}



.year-btn.active {

  background: var(--entel-orange);

  color: #FFFFFF !important;

  font-weight: 700;

}



.btn-icon {

  background: rgba(255, 255, 255, 0.1);

  border: 1px solid rgba(255, 255, 255, 0.15);

  color: #FFFFFF;

  width: 30px;

  height: 30px;

  border-radius: 6px;

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  transition: all 0.2s;

}



.btn-icon:hover {

  background: var(--entel-orange);

  border-color: var(--entel-orange);

}



/* ========================================================

   GLOBAL FILTER BAR (Blanco con Borde Slate-200)

   ======================================================== */

.filter-bar {

  height: var(--filter-height);

  width: 100%;

  background-color: #FFFFFF;

  border-bottom: 1px solid var(--border-color);

  display: flex;

  align-items: center;

  padding: 0 20px;

  gap: 16px;

  flex-shrink: 0;

  box-shadow: 0 1px 3px rgba(0,0,0,0.02);

  box-sizing: border-box;

}



.filter-item {

  display: flex;

  align-items: center;

  gap: 6px;

}



.filter-item label {

  font-size: 0.72rem;

  font-weight: 700;

  color: var(--text-muted);

  text-transform: uppercase;

  letter-spacing: 0.3px;

}



.form-select {

  border: 1px solid #CBD5E1;

  border-radius: 5px;

  padding: 3px 8px;

  font-size: 0.76rem;

  color: var(--text-dark);

  background-color: #F8FAFC;

  outline: none;

  cursor: pointer;

  height: 30px;

}



.form-select:focus {

  border-color: var(--accent-blue);

  background-color: #FFFFFF;

}



.filter-actions {

  margin-left: auto;

  display: flex;

  align-items: center;

  gap: 10px;

}



.btn-reset {

  display: flex;

  align-items: center;

  gap: 5px;

  background: #F7F9F8;

  border: 1px solid #E2E8F0;

  color: #475569;

  font-size: 0.72rem;

  font-weight: 600;

  padding: 3px 10px;

  border-radius: 5px;

  cursor: pointer;

  height: 30px;

  transition: all 0.15s;

}



.btn-reset:hover {

  background: #FEE2E2;

  border-color: #FCA5A5;

  color: #B91C1C;

}



.active-records-badge {

  font-size: 0.74rem;

  font-weight: 700;

  color: var(--entel-blue);

  background: #E0E7FF;

  padding: 3px 10px;

  border-radius: 5px;

  height: 30px;

  display: flex;

  align-items: center;

}



/* ========================================================

   DASHBOARD VIEWPORT (100vh Real / overflow hidden)

   ======================================================== */

.dashboard-viewport {

  height: calc(100vh - var(--header-height) - var(--filter-height));

  width: 100%;

  overflow: hidden;

  padding: 10px 14px;

  position: relative;

  box-sizing: border-box;

}



.tab-pane {

  display: none;

  width: 100%;

  height: 100%;

  overflow: hidden;

  box-sizing: border-box;

}



.tab-pane.active {

  display: flex;

  flex-direction: column;

}



/* ========================================================

   TARJETAS Y JERARQU?A CORPORATIVA

   ======================================================== */

.card-chart, .card-matrix {

  background: var(--bg-card);

  border-radius: 8px;

  border: 1px solid var(--border-color);

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);

  display: flex;

  flex-direction: column;

  overflow: hidden;

  min-height: 0;

  min-width: 0;

  max-height: 100%;

}



.card-header, .matrix-header {

  padding: 6px 12px;

  background: #FFFFFF;

  border-bottom: 1px solid #F7F9F8;

  display: flex;

  align-items: center;

  justify-content: space-between;

  flex-shrink: 0;

  height: 32px;

}



.card-header .title, .matrix-header span {

  font-size: 0.76rem;

  font-weight: 700;

  color: var(--entel-blue);

  letter-spacing: -0.2px;

}



.chart-legend-custom {

  font-size: 0.68rem;

  color: var(--text-muted);

  display: flex;

  align-items: center;

  gap: 8px;

}



.dot {

  width: 7px;

  height: 7px;

  border-radius: 2px;

  display: inline-block;

}



.bar-dot { background: #1E40AF; }

.line-dot { background: #E64A00; border-radius: 50%; }

.fundado-dot { background: #0D6ABF; }

.infundado-dot { background: #E64A00; }



.chart-box {

  flex: 1;

  width: 100%;

  height: 100%;

  min-height: 0;

}



/* ========================================================

   TABLAS MATRICIALES POWER BI (Compactas, Thin Scroll)

   ======================================================== */

.matrix-table-wrap {

  flex: 1;

  overflow-y: auto;

  overflow-x: auto;

  background: #FFFFFF;

  scrollbar-width: thin;

  scrollbar-color: #CBD5E1 #F8FAFC;

  min-height: 0;

  max-height: 100%;

}



.matrix-table-wrap::-webkit-scrollbar {

  width: 5px;

  height: 5px;

}



.matrix-table-wrap::-webkit-scrollbar-track {

  background: #F8FAFC;

}



.matrix-table-wrap::-webkit-scrollbar-thumb {

  background: #CBD5E1;

  border-radius: 4px;

}



.matrix-table-wrap::-webkit-scrollbar-thumb:hover {

  background: #94A3B8;

}



.bi-table {

  width: 100%;

  border-collapse: collapse;

  font-size: 0.68rem;

  table-layout: auto;

}



.bi-table th, .bi-table td {

  padding: 3px 6px;

  border: 1px solid #E2E8F0;

  white-space: nowrap;

  line-height: 1.25;

}



.bi-table thead th {

  background: var(--th-bg);

  color: #FFFFFF;

  font-weight: 600;

  text-align: center;

  position: sticky;

  top: 0;

  z-index: 2;

  font-size: 0.66rem;

}



.bi-table thead .th-main {

  text-align: left;

  font-size: 0.7rem;

}



.bi-table thead .sub-cols th {

  background: var(--th-sub-bg);

  font-size: 0.63rem;

  padding: 2px 4px;

}



/* Alineaciones num?ricas estrictas */

.bi-table tbody td {

  text-align: right;

  color: #334155;

}



.bi-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: #0E2E67;
  position: static;
  padding-left: 8px;
}



.bi-table tbody tr:hover td {

  background: #F8FAFC;

}



.bi-table tbody tr:hover td:first-child {

  background: #F7F9F8;

}



.bi-table tfoot tr td, .bi-table tbody tr.row-total td {

  background: #EBF3FF !important;

  font-weight: 700;

  color: #0E2E67;

  border-top: 2px solid #94A3B8;

}



.pct-cell {

  background: #FFF7ED;

  color: #C2410C;

  font-weight: 600;

  text-align: right;

}



/* ========================================================

   GRID 3: REINCIDENCIA (Layout 100% Ancho & 100vh Real)

   ======================================================== */

.reincidencia-layout {

  display: grid;

  grid-template-columns: 210px 1fr;

  gap: 10px;

  width: 100%;

  height: 100%;

  min-height: 0;

  flex: 1;

}



.sidebar-dimension {

  background: #FFFFFF;

  border: 1px solid var(--border-color);

  border-radius: 8px;

  padding: 10px;

  display: flex;

  flex-direction: column;

  overflow-y: auto;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);

  scrollbar-width: thin;

}



.sidebar-dimension::-webkit-scrollbar {

  width: 4px;

}

.sidebar-dimension::-webkit-scrollbar-thumb {

  background: #CBD5E1;

  border-radius: 4px;

}



.reincidencia-table-container {

  height: 100%;

  width: 100%;

  min-width: 0;

  min-height: 0;

  overflow: hidden;

  display: flex;

  flex-direction: column;

}



.reincidencia-table-container .card-matrix {

  width: 100%;

  height: 100%;

  flex: 1;

}



.fill-height {

  height: 100%;

  width: 100%;

}



.evolutivo-table thead th {

  font-size: 0.65rem;

}



/* ========================================================

   HIERARCHY / PIVOT MATRIX & DIMENSION SIDEBAR

   ======================================================== */

.side-header-row {

  display: flex;

  align-items: center;

  justify-content: space-between;

  margin-bottom: 4px;

}



.side-title {

  font-size: 0.78rem;

  font-weight: 800;

  color: var(--entel-blue);

  margin-bottom: 0;

  padding-bottom: 0;

}



.side-toolbar {

  display: flex;

  gap: 3px;

}



.btn-dim-tool {

  background: #F7F9F8;

  border: 1px solid #CBD5E1;

  border-radius: 4px;

  width: 20px;

  height: 20px;

  font-size: 0.7rem;

  font-weight: 700;

  color: #1A3B78;

  cursor: pointer;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  transition: all 0.15s;

}



.btn-dim-tool:hover {

  background: #E2E8F0;

  border-color: #94A3B8;

  color: var(--entel-orange);

}



.side-hint {

  font-size: 0.65rem;

  color: #64748B;

  margin-bottom: 8px;

  line-height: 1.2;

}



.dim-item {

  display: flex;

  align-items: center;

  justify-content: space-between;

  padding: 3px 5px;

  border-radius: 4px;

  background: #F8FAFC;

  border: 1px solid #E2E8F0;

  margin-bottom: 4px;

  transition: background 0.15s, border-color 0.15s;

}



.dim-item:hover {

  background: #F7F9F8;

  border-color: #CBD5E1;

}



.check-label {

  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 0.72rem;

  font-weight: 600;

  color: var(--text-dark);

  cursor: pointer;

  flex: 1;

}



.check-label input {

  accent-color: var(--entel-orange);

  cursor: pointer;

}



.dim-arrows {

  display: flex;

  gap: 2px;

}



.dim-arrows button {

  background: #FFFFFF;

  border: 1px solid #CBD5E1;

  border-radius: 3px;

  width: 17px;

  height: 17px;

  line-height: 1;

  font-size: 0.62rem;

  color: #475569;

  cursor: pointer;

  display: inline-flex;

  align-items: center;

  justify-content: center;

}



.dim-arrows button:hover {

  background: #E2E8F0;

  color: #0E2E67;

}



/* Tree expand/collapse toggle */

.tree-toggle {

  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 13px;

  height: 13px;

  margin-right: 5px;

  font-size: 0.62rem;

  font-weight: 700;

  border: 1px solid #94A3B8;

  background: #FFFFFF;

  color: #1A3B78;

  border-radius: 2px;

  cursor: pointer;

  user-select: none;

}



.tree-toggle:hover {

  background: #E2E8F0;

  color: var(--entel-orange);

}



.tree-toggle.empty {

  visibility: hidden;

}



.tree-level-0 {

  font-weight: 700;

  background: #F8FAFC;

}



.tree-level-1 {

  font-weight: 500;

  background: #FFFFFF;

}



.tree-level-2 {

  font-weight: 400;

  color: #475569;

  background: #FAFAFA;

}



.tree-level-3 {

  font-weight: 400;

  color: #64748B;

  background: #FAFAFA;

}



/* ========================================================

   LOADING OVERLAY & TOAST

   ======================================================== */

.loading-overlay {

  position: fixed;

  inset: 0;

  background: rgba(15, 23, 42, 0.88);

  backdrop-filter: blur(4px);

  display: flex;

  align-items: center;

  justify-content: center;

  z-index: 9999;

  transition: opacity 0.3s ease, visibility 0.3s ease;

}



.loading-overlay.hidden {

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

}



.loader-content {

  text-align: center;

  color: #FFFFFF;

}



.spinner {

  width: 44px;

  height: 44px;

  border: 4px solid rgba(255,255,255,0.2);

  border-top-color: var(--entel-orange);

  border-radius: 50%;

  animation: spin 0.8s linear infinite;

  margin: 0 auto 14px;

}



@keyframes spin {

  to { transform: rotate(360deg); }

}



#loader-title {

  font-size: 1.15rem;

  font-weight: 700;

  margin-bottom: 5px;

}



#loader-sub {

  font-size: 0.82rem;

  color: #94A3B8;

}



/* Toast */

.toast {

  position: fixed;

  bottom: 20px;

  right: 20px;

  background: #1A3B78;

  color: #FFFFFF;

  padding: 8px 16px;

  border-radius: 6px;

  font-size: 0.78rem;

  font-weight: 600;

  box-shadow: 0 4px 16px rgba(0,0,0,0.2);

  transform: translateY(100px);

  opacity: 0;

  transition: all 0.25s ease;

  z-index: 10000;

}



.toast.show {

  transform: translateY(0);

  opacity: 1;

}



.toast.success { background: #166534; }

.toast.error { background: #991B1B; }

/* ========================================================
   CUADRE TOTAL PORTADA: CENTRADO, SIN CORTES Y SEMAFORIZACION
   ======================================================== */
.portada-grid {
  display: grid !important;
  grid-template-columns: 1.2fr 1.4fr 2.4fr !important;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* Remover absolutamente cualquier sticky lateral en TODA la tabla */
.bi-table th,
.bi-table td,
.bi-table tbody td:first-child,
.bi-table tbody tr:hover td:first-child {
  position: static !important;
  background: transparent !important;
  z-index: auto !important;
}

/* El wrap NUNCA debe tener scroll horizontal */
.matrix-table-wrap {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #FFFFFF !important;
  scrollbar-width: thin !important;
  scrollbar-color: #CBD5E1 #F8FAFC !important;
  min-height: 0 !important;
  max-height: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Tablas con ancho fijo al 100% respetando colgroup */
.bi-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

/* Headers oscuros con altura fija controlada */
.bi-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: #0E2E67 !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 3px 2px !important;
  box-sizing: border-box !important;
  line-height: 1.2 !important;
  border: 1px solid #334155 !important;
}

/* Header principal primera columna */
.bi-table thead .th-main {
  text-align: left !important;
  padding-left: 6px !important;
  vertical-align: middle !important;
  z-index: 6 !important;
  font-size: 0.65rem !important;
}

/* Sub-columnas del header (Q, %) */
.bi-table thead .sub-cols th {
  background: #1A3B78 !important;
  top: 19px !important;
  font-size: 0.62rem !important;
  padding: 2px 1px !important;
  z-index: 5 !important;
}

/* Columna de nombres (meses, supervisores): A la izquierda con padding limpio */
.bi-table td.col-nombre {
  text-align: left !important;
  font-weight: 600 !important;
  color: #0E2E67 !important;
  padding-left: 6px !important;
  padding-right: 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Celdas metricas: CENTRADAS como pidio el usuario para eliminar sesgo a la derecha */
.bi-table td.col-num {
  text-align: center !important;
  padding-left: 1px !important;
  padding-right: 1px !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  color: #334155 !important;
  overflow: hidden !important;
}

/* Celdas con porcentaje y semaforo */
.bi-table td.pct-cell {
  text-align: center !important;
  display: table-cell !important;
  vertical-align: middle !important;
}

/* Fila de Totales */
.bi-table tbody tr.row-total td {
  background: #EBF3FF !important;
  font-weight: 700 !important;
  color: #0E2E67 !important;
  border-top: 2px solid #94A3B8 !important;
}
.bi-table tbody tr.row-total td.col-nombre {
  text-align: left !important;
}
.bi-table tbody tr.row-total td.col-num {
  text-align: center !important;
}

/* Ajustes tipograficos finos por tabla */
#table-respuesta-mes th, #table-respuesta-mes td {
  font-size: 0.65rem !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

#table-tipo-mes th, #table-tipo-mes td {
  font-size: 0.61rem !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

#table-respuesta-sup th, #table-respuesta-sup td {
  font-size: 0.65rem !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

/* Iconos de Semaforizacion */
.sem-icon {
  font-size: 0.68rem !important;
  line-height: 1 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-right: 2px !important;
}
.sem-green { color: #16A34A !important; }
.sem-yellow { color: #EAB308 !important; }
.sem-red { color: #DC2626 !important; }

/* ========================================================
   VISTA DETALLE POWER BI: LAYOUT Y GRAFICOS
   ======================================================== */
#tab-detalle {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.detalle-container {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.detalle-top-section {
  flex: 1.4 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 210px 1.25fr 1.25fr !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

.detalle-bottom-section {
  flex: 1 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

.detalle-col-left {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  height: 100% !important;
  min-height: 0 !important;
}

.detalle-filters-card {
  background: #FFFFFF !important;
  border-radius: 6px !important;
  border: 1px solid #E2E8F0 !important;
  padding: 6px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
}

.filter-group-v {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.filter-group-v label {
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  line-height: 1.1 !important;
}

.form-select-v {
  width: 100% !important;
  font-size: 0.68rem !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  border: 1px solid #CBD5E1 !important;
  background: #F8FAFC !important;
  color: #0E2E67 !important;
  outline: none !important;
  height: 24px !important;
}

.card-cuartil {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #FFFFFF !important;
  border-radius: 6px !important;
  border: 1px solid #E2E8F0 !important;
  overflow: hidden !important;
}

.detalle-col-center,
.detalle-col-right {
  display: grid !important;
  grid-template-rows: 1fr 1.6fr !important;
  gap: 6px !important;
  height: 100% !important;
  min-height: 0 !important;
}

.card-resp-table,
.card-mensual-table,
.card-resp-chart,
.card-mensual-chart {
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #FFFFFF !important;
  border-radius: 6px !important;
  border: 1px solid #E2E8F0 !important;
  overflow: hidden !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
}

.chart-legend-bottom {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  padding: 2px 4px !important;
  font-size: 0.65rem !important;
  color: #475569 !important;
  flex-shrink: 0 !important;
  background: #FFFFFF !important;
}

.legend-dot {
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  margin-right: 4px !important;
  vertical-align: middle !important;
}

.dot-fundado { background: #0D6ABF !important; }
.dot-infundado { background: #E64A00 !important; }

/* Ocultar barra superior en Detalle para que coincida con PBI */
#tab-detalle.active ~ .filter-bar,
.view-section.active:has(#tab-detalle.active) .filter-bar {
  display: none !important;
}


/* ========================================================
   FIX EVOLUTIVO TABLE: HEADER OVERLAP & COLUMN ALIGNMENT
   ======================================================== */
.evolutivo-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
  min-width: 1200px !important;
}

.evolutivo-table thead tr:first-child th {
  position: sticky !important;
  top: 0 !important;
  height: 28px !important;
  max-height: 28px !important;
  line-height: 1.2 !important;
  background: #0E2E67 !important;
  z-index: 10 !important;
  box-sizing: border-box !important;
  padding: 4px 6px !important;
  border: 1px solid #334155 !important;
}

.evolutivo-table thead tr:first-child th.th-main {
  min-width: 280px !important;
  width: 280px !important;
  z-index: 12 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.evolutivo-table thead tr.sub-cols th {
  position: sticky !important;
  top: 28px !important;
  height: 22px !important;
  max-height: 22px !important;
  line-height: 1 !important;
  background: #1A3B78 !important;
  z-index: 9 !important;
  box-sizing: border-box !important;
  padding: 3px 2px !important;
  font-size: 0.65rem !important;
  border: 1px solid #334155 !important;
}

.evolutivo-table td.col-nombre {
  min-width: 280px !important;
  width: 280px !important;
  max-width: 320px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
}

.evolutivo-table td.col-num {
  min-width: 38px !important;
  text-align: center !important;
}

/* ========================================================
   MULTI-SELECT SLICER DROPDOWN (ESTILO POWER BI)
   ======================================================== */
.ms-dropdown {
  position: relative;
  display: inline-block;
  min-width: 150px;
}

.filter-group-v .ms-dropdown {
  width: 100%;
  min-width: 100%;
}

.ms-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #1A3B78;
  font-weight: 500;
  background-color: #F8FAFC;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  height: 28px;
}

.filter-group-v .ms-trigger {
  height: 24px;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.ms-trigger:hover,
.ms-dropdown.open .ms-trigger {
  border-color: #0D6ABF;
  background-color: #FFFFFF;
}

.ms-dropdown.has-selection .ms-trigger {
  border-color: #E64A00;
  background-color: #FFF7ED;
  color: #C2410C;
  font-weight: 600;
}

.ms-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
  text-align: left;
}

.filter-group-v .ms-label {
  max-width: 120px;
}

.ms-caret {
  font-size: 0.65rem;
  color: #64748B;
  flex-shrink: 0;
}

.ms-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 300px;
  max-height: 260px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
}

.ms-dropdown.open .ms-menu {
  display: flex;
}

.ms-Search-wrap {
  padding: 6px 8px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.ms-options-list {
  overflow-y: auto;
  max-height: 210px;
  padding: 4px 0;
}

.ms-options-list::-webkit-scrollbar {
  width: 5px;
}

.ms-options-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  color: #1A3B78;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.ms-item:hover {
  background: #F7F9F8;
}

.ms-item.checked {
  background: #FFF7ED;
  font-weight: 600;
  color: #9A3412;
}

.ms-item-all {
  font-weight: 700;
  color: #0E2E67;
  padding: 2px 4px;
}

.ms-item input[type="checkbox"] {
  accent-color: #E64A00;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.ms-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================================
   INTERACCION CROSS-FILTERING / CROSS-HIGHLIGHTING (POWER BI)
   ======================================================== */
.bi-table tbody tr.cf-row {
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.bi-table tbody tr.cf-row:hover td {
  background-color: #EFF6FF !important;
}

.bi-table tbody tr.cf-selected td {
  background-color: #DBEAFE !important;
  font-weight: 700 !important;
  color: #1E3A8A !important;
}

.bi-table tbody tr.cf-dimmed {
  opacity: 0.35;
}

/* ========================================================
   MOVISTAR: LAYOUTS DE 2 VISTAS (100VH ESTRICTO SIN SCROLL)
   ======================================================== */
.mov-portada-layout {
  display: grid;
  grid-template-rows: 62px 1fr 1.05fr;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mov-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  height: 62px;
  min-height: 0;
}

.mov-chart-toggle {
  display: inline-flex;
  background: #F7F9F8;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.mov-chart-btn {
  border: none;
  background: transparent;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748B;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mov-chart-btn:hover {
  color: #0E2E67;
}

.mov-chart-btn.active {
  background: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.25);
}

.mov-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 7px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  border-left: 4px solid #0284C7;
}

.mov-kpi-card.kpi-blue { border-left-color: #0284C7; }
.mov-kpi-card.kpi-orange { border-left-color: #EA580C; }
.mov-kpi-card.kpi-green { border-left-color: #16A34A; }
.mov-kpi-card.kpi-red { border-left-color: #DC2626; }
.mov-kpi-card.kpi-indigo { border-left-color: #4F46E5; }

.mov-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mov-kpi-label {
  font-size: 0.64rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.4px;
}

.mov-kpi-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.mov-kpi-badge.blue { background: #E0F2FE; color: #0369A1; }
.mov-kpi-badge.red { background: #FEE2E2; color: #B91C1C; }
.mov-kpi-badge.green { background: #DCFCE7; color: #15803D; }
.mov-kpi-badge.amber { background: #FEF3C7; color: #B45309; }
.mov-kpi-badge.indigo { background: #E0E7FF; color: #4338CA; }

.mov-kpi-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0E2E67;
  line-height: 1.1;
}

.mov-kpi-sub {
  font-size: 0.62rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mov-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.mov-tables-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.1fr;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* VISTA 2 MOVISTAR: REVERSAS + MATRIZ JERÁRQUICA */
.mov-reversas-layout {
  display: grid;
  grid-template-rows: 38% 1fr;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.mov-rev-top {
  display: grid;
  grid-template-columns: 240px 1fr 1fr 1.25fr;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.mov-rev-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  min-height: 0;
  height: 100%;
}

.mov-mini-kpi {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.mk-label {
  font-size: 0.58rem;
  font-weight: 800;
  color: #64748B;
  letter-spacing: 0.3px;
}

.mk-val {
  font-size: 0.92rem;
  font-weight: 800;
  margin: 2px 0;
}

.mk-val.blue { color: #0284C7; }
.mk-val.green { color: #15803D; }
.mk-val.orange { color: #EA580C; }
.mk-val.slate { color: #0E2E67; }

.mk-sub {
  font-size: 0.58rem;
  color: #94A3B8;
}

.mov-rev-bottom {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 8px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.mov-sidebar {
  padding: 8px 10px !important;
  gap: 6px !important;
}

.mov-source-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #F7F9F8;
  padding: 3px;
  border-radius: 6px;
  margin-bottom: 2px;
}

.mov-src-btn {
  border: none;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  color: #475569;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.mov-src-btn.active {
  background: #0284C7;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.mov-proto-btn[data-proto="SI"].active {
  background: #0D6ABF;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(13, 106, 191, 0.25);
}
.mov-proto-btn[data-proto="NO"].active {
  background: #E64A00;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(230, 74, 0, 0.25);
}


/* ==========================================================================
   MODO SPOTLIGHT / ENFOQUE CENTRAL (AL SELECCIONAR TITULO DE CUADRO)
   ========================================================================== */

.card-chart > .card-header,
.card-matrix > .matrix-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.card-chart > .card-header:hover,
.card-matrix > .matrix-header:hover {
  background-color: rgba(13, 106, 191, 0.06) !important;
}

.card-chart > .card-header::after,
.card-matrix > .matrix-header::after {
  content: '⤢';
  font-size: 0.85rem;
  font-weight: 700;
  color: #627EAB;
  margin-left: auto;
  padding-left: 8px;
  opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.card-chart > .card-header:hover::after,
.card-matrix > .matrix-header:hover::after {
  opacity: 1;
  color: #E64A00;
  transform: scale(1.15);
}

/* Cuando tiene un control derecho (como SI/NO o leyenda), evitamos conflicto con margin-left: auto */
.card-chart > .card-header > .chart-legend-custom,
.card-matrix > .matrix-header > .mov-chart-toggle {
  margin-left: auto;
  margin-right: 6px;
}
.card-chart > .card-header:has(.chart-legend-custom)::after,
.card-matrix > .matrix-header:has(.mov-chart-toggle)::after {
  margin-left: 4px;
}

/* Fondo borroso tipo iOS / Glassmorphism */
.card-spotlight-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(14, 46, 103, 0.38);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-spotlight-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Placeholder invisible para no deformar el grid mientras la tarjeta esta en el centro */
.card-spotlight-placeholder {
  visibility: hidden;
  pointer-events: none;
}

/* Tarjeta agrandada en el centro de la pantalla */
.card-chart.is-spotlight,
.card-matrix.is-spotlight {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(1) !important;
  width: min(92vw, 1360px) !important;
  height: min(84vh, 840px) !important;
  max-width: 94vw !important;
  max-height: 86vh !important;
  z-index: 9999 !important;
  background: #FFFFFF !important;
  border-radius: 16px !important;
  box-shadow: 0 28px 70px rgba(14, 46, 103, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.6) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: spotlightPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spotlightPopIn {
  0% {
    opacity: 0.7;
    transform: translate(-50%, -48%) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Encabezado dentro del modo Spotlight */
.card-chart.is-spotlight > .card-header,
.card-matrix.is-spotlight > .matrix-header {
  padding: 14px 20px !important;
  font-size: 1.05rem !important;
  background: #F7F9F8 !important;
  border-bottom: 2px solid #0E2E67 !important;
}

.card-chart.is-spotlight > .card-header .title,
.card-matrix.is-spotlight > .matrix-header > span:first-child {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #0E2E67 !important;
}

.card-chart.is-spotlight > .card-header::after,
.card-matrix.is-spotlight > .matrix-header::after {
  content: '✕ Cerrar';
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
  background: #E64A00;
  padding: 5px 12px;
  border-radius: 6px;
  opacity: 1;
  transform: none;
  box-shadow: 0 2px 6px rgba(230, 74, 0, 0.3);
}

.card-chart.is-spotlight > .card-header:hover::after,
.card-matrix.is-spotlight > .matrix-header:hover::after {
  background: #0E2E67;
  color: #FFFFFF;
  transform: scale(1.03);
}

/* Cuerpo de gráfico o tabla dentro del modo Spotlight: nombres completos sin recortes */
.card-chart.is-spotlight .chart-box {
  flex: 1 !important;
  width: 100% !important;
  height: calc(100% - 56px) !important;
  min-height: 450px !important;
  padding: 16px !important;
}

.card-matrix.is-spotlight .matrix-table-wrap {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  padding: 8px 14px 16px 14px !important;
  max-height: none !important;
}

.card-matrix.is-spotlight .bi-table {
  table-layout: auto !important;
  width: 100% !important;
  font-size: 0.86rem !important;
}

.card-matrix.is-spotlight .bi-table colgroup col {
  width: auto !important;
}

.card-matrix.is-spotlight .bi-table th,
.card-matrix.is-spotlight .bi-table td {
  font-size: 0.85rem !important;
  padding: 8px 12px !important;
  white-space: nowrap !important;
}

.card-matrix.is-spotlight .bi-table td.col-nombre,
.card-matrix.is-spotlight .evolutivo-table td.col-nombre,
.card-matrix.is-spotlight .bi-table th.th-main {
  max-width: none !important;
  width: auto !important;
  min-width: 260px !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
