/* ==========================================================================
   Power BI Live — Authentic Fluent Design System
   Paleta oficial de Power BI Desktop & Service:
   Ribbon: #252423 | Accent: #F2C811 (Power BI Gold) | Canvas: #f0f2f5
   ========================================================================== */

:root {
  --pbi-yellow: #F2C811;
  --pbi-yellow-hover: #e0b70d;
  --pbi-dark: #252423;
  --pbi-darker: #1b1a19;
  --pbi-bg-canvas: #f0f2f5;
  --pbi-card-bg: #ffffff;
  --pbi-border: #e1dfdd;
  --pbi-border-hover: #c8c6c4;
  --pbi-text: #201f1e;
  --pbi-text-muted: #605e5c;
  --pbi-text-dim: #a19f9d;
  --pbi-pane-bg: #f8f9fa;
  
  --pbi-blue: #118dff;
  --pbi-blue-dark: #12239e;
  --pbi-green: #107c41;
  --pbi-red: #d13438;
  --pbi-orange: #e66c37;
  --pbi-purple: #6b007b;
  
  --font-ui: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
  --shadow-card: 0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108);
  --shadow-hover: 0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--pbi-bg-canvas);
  color: var(--pbi-text);
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

#powerbi-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* --------------------------------------------------------------------------
   Barra Superior de Power BI (Header Ribbon)
   -------------------------------------------------------------------------- */
.pbi-header {
  height: 48px;
  background-color: var(--pbi-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid #323130;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.waffle-icon {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5px;
  cursor: pointer;
}

.waffle-icon span {
  background-color: #fff;
  border-radius: 1px;
}

.pbi-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.pbi-logo-svg {
  width: 22px;
  height: 22px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.pulse-circle {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-pill {
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
}

.company-pill strong {
  color: var(--pbi-yellow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--pbi-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-role-tag {
  font-size: 10px;
  background: rgba(242, 200, 17, 0.2);
  color: var(--pbi-yellow);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-header {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   Cinta de Pestañas Superior (Ribbon estilo Power BI Desktop)
   -------------------------------------------------------------------------- */
.pbi-desktop-ribbon {
  background: #f3f2f1;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  flex-direction: column;
}

.ribbon-tabs {
  display: flex;
  height: 28px;
  background: #edebe9;
  border-bottom: 1px solid var(--pbi-border);
  padding: 0 8px;
}

.ribbon-tab {
  padding: 4px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--pbi-text-muted);
  border-top: 2px solid transparent;
}

.ribbon-tab.active {
  background: #f3f2f1;
  color: #000;
  font-weight: 600;
  border-top-color: var(--pbi-yellow);
}

.ribbon-tools-row {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 10px;
  background: #f3f2f1;
}

.ribbon-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px solid var(--pbi-border);
}

.ribbon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--pbi-border);
  color: var(--pbi-text);
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ribbon-btn:hover {
  background: #edebe9;
  border-color: var(--pbi-border-hover);
}

.ribbon-btn.primary {
  background: #f3f9f8;
  border-color: #008272;
  color: #004b38;
  font-weight: 600;
}

.ribbon-btn.primary:hover {
  background: #e1f0ec;
  border-color: #005a4e;
}

.ribbon-btn.live-sync {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Barra de Fórmulas DAX (fx)
   -------------------------------------------------------------------------- */
.dax-formula-bar {
  height: 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.fx-label {
  color: #0078d4;
  font-weight: 700;
  font-style: italic;
  font-size: 13px;
}

.dax-input {
  flex: 1;
  border: 1px solid transparent;
  padding: 3px 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  border-radius: 2px;
  background: #faf9f8;
}

.dax-input:focus {
  background: #fff;
  border-color: var(--pbi-blue);
  box-shadow: 0 0 0 1px var(--pbi-blue);
}

.btn-dax-commit {
  background: #107c41;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   Layout Principal: Rail Izquierdo + Centro + Paneles Derechos
   -------------------------------------------------------------------------- */
.pbi-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 114px);
  overflow: hidden;
}

/* Rail de Navegación Izquierdo (3 botones icónicos) */
.pbi-left-rail {
  width: 52px;
  background: #edebe9;
  border-right: 1px solid var(--pbi-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
  flex-shrink: 0;
}

.rail-btn {
  width: 46px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--pbi-text-muted);
  font-size: 15px;
  transition: all 0.15s ease;
  position: relative;
  line-height: 1;
}

.rail-btn:hover {
  background: #e1dfdd;
  color: #000;
}

.rail-btn.active {
  background: #ffffff;
  color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.rail-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--pbi-yellow);
  border-radius: 0 2px 2px 0;
}

/* Área Central de Vistas */
.pbi-center-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--pbi-bg-canvas);
  overflow: hidden;
  position: relative;
}

/* Vista 1: Informe (Lienzo 16:9 con Cuadrícula) */
.report-view-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.canvas-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Vista 2: Datos (Table Grid View) */
.table-view-container {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-view-toolbar {
  padding: 8px 16px;
  background: #faf9f8;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Vista 3: Modelo Relacional (Diagram & Star Schema View)
   ========================================================================== */
.model-view-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #f0f2f5;
  padding: 0;
}

.model-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Barra de Herramientas de la Vista de Modelo */
.model-view-toolbar {
  padding: 6px 14px;
  background: #faf9f8;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 25;
}

.model-toolbar-left, .model-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-badge-stat {
  font-size: 11.5px;
  color: #605e5c;
  background: #f3f2f1;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
  border: 1px solid #e1dfdd;
}

/* Lienzo y Cuadrícula */
.model-canvas-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: #f0f2f5;
  background-image: radial-gradient(#c8c6c4 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  cursor: default;
}

.model-diagram-canvas {
  min-width: 1700px;
  min-height: 1100px;
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.15s ease;
}

/* Capa SVG de Conexiones Relacionales */
.model-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 10;
}

.rel-line-hitbox {
  stroke: transparent;
  stroke-width: 14px;
  fill: none;
  cursor: pointer;
}

.rel-line {
  stroke: #605e5c;
  stroke-width: 2px;
  fill: none;
  cursor: pointer;
  transition: stroke 0.15s, stroke-width 0.15s, filter 0.15s;
}

.rel-group:hover .rel-line,
.rel-group.hovered .rel-line {
  stroke: #0078d4;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 5px rgba(0, 120, 212, 0.45));
}

.rel-group.selected .rel-line {
  stroke: #f2c811;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 6px rgba(242, 200, 17, 0.6));
}

.rel-cardinality-badge {
  font-size: 10.5px;
  font-weight: 700;
  fill: #323130;
  text-anchor: middle;
  dominant-baseline: central;
  user-select: none;
}

.rel-badge-bg {
  fill: #ffffff;
  stroke: #8a8886;
  stroke-width: 1px;
  rx: 3px;
  ry: 3px;
}

.rel-arrow-marker {
  fill: #605e5c;
}
.rel-group:hover .rel-arrow-marker {
  fill: #0078d4;
}
.rel-group.selected .rel-arrow-marker {
  fill: #f2c811;
}

/* Tarjetas de Tablas (Table Cards) */
.model-table-card {
  width: 288px;
  background: #ffffff;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(22, 43, 67, 0.09);
  position: absolute;
  overflow: visible;
  z-index: 20;
  user-select: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.model-table-card.fact-table {
  border-top: 4px solid #f2c811;
}

.model-table-card.dimension-table {
  border-top: 4px solid #0078d4;
}

.model-table-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border-color: #a19f9d;
}

.model-table-card.selected {
  border: 2px solid #0078d4 !important;
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 30;
}

.model-table-header {
  background: #f8fafc;
  padding: 11px 13px;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
}

.model-table-header:active {
  cursor: grabbing;
}

.model-table-card.is-dragging {
  opacity: 0.92;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  z-index: 100;
}

.card-title-box {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.card-title-box > div {
  min-width: 0;
}

.card-title-box strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  line-height: 1.3;
}

.model-table-subtitle {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 400;
}

.model-table-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e8f1fb;
  color: #1769aa;
  flex: none;
  font-size: 17px;
}

.card-actions-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  color: #605e5c;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
}
.card-actions-btn:hover {
  background: #edebe9;
  color: #000;
}

/* Buscador de campos dentro de la tarjeta */
.card-search-box {
  padding: 8px 11px;
  background: #fff;
  border-bottom: 1px solid #f3f2f1;
}

.card-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbe2ea;
  border-radius: 5px;
  padding: 6px 9px;
  font-size: 11px;
  outline: none;
}
.card-search-input:focus {
  border-color: #0078d4;
}

/* Lista de columnas */
.model-columns-list {
  padding: 4px 0 7px;
  max-height: 340px;
  overflow-y: auto;
  position: relative;
}

.model-column-item {
  position: relative;
  min-height: 31px;
  box-sizing: border-box;
  padding: 5px 13px;
  gap: 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.1s;
}

.model-column-item:hover {
  background: #f3f2f1;
}

.model-column-item.highlighted {
  background: #deecf9 !important;
  color: #0078d4;
  font-weight: 600;
}

.col-name-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.col-name-left .model-field-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-field-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #61758a;
  font-size: 10px;
  font-weight: 700;
  flex: none;
}

.model-column-item.is-key-col .model-field-icon {
  background: #e9f2fd;
  color: #1769aa;
}

.model-column-meta {
  display: flex;
  align-items: center;
  flex: none;
  gap: 6px;
}

.col-type-tag {
  font-size: 10px;
  color: #64748b;
  flex-shrink: 0;
}

.col-eye-btn {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  opacity: 0;
}

.model-column-item:hover .col-eye-btn,
.model-column-item:focus-within .col-eye-btn,
.col-eye-btn.is-hidden {
  opacity: 1;
}

.col-eye-btn:hover {
  background: #e6edf5;
}

/* Puertos de conexión para arrastrar relaciones (Drag to connect) */
.col-port {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a19f9d;
  border: 1.5px solid #ffffff;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: crosshair;
  z-index: 35;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
  opacity: 0;
}

.model-column-item:hover .col-port,
.model-column-item:focus-within .col-port,
.col-port.connecting {
  opacity: 1;
}

.col-port.left {
  left: -4px;
}

.col-port.right {
  right: -4px;
}

.col-port:hover, .col-port.connecting {
  background: #0078d4;
  transform: translateY(-50%) scale(1.5);
  box-shadow: 0 0 4px #0078d4;
}

/* Panel Lateral de Propiedades del Modelo */
.model-properties-pane {
  width: 300px;
  background: #ffffff;
  border-left: 1px solid var(--pbi-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  z-index: 30;
}

.prop-pane-header {
  height: 38px;
  background: #edebe9;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-weight: 600;
  font-size: 12px;
}

.prop-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prop-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prop-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f3f2f1;
}

.prop-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prop-group label {
  font-size: 11px;
  color: #323130;
  font-weight: 600;
}

.prop-input, .prop-select {
  padding: 4px 8px;
  font-size: 11.5px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  background: #fff;
  outline: none;
}
.prop-input:focus, .prop-select:focus {
  border-color: #0078d4;
}

/* Modales de Gestión de Relaciones y DAX */
.pbi-modal-table-preview {
  max-height: 160px;
  overflow: auto;
  border: 1px solid #e1dfdd;
  margin-top: 6px;
  border-radius: 2px;
  background: #fff;
}

.pbi-rel-selector-col {
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
}
.pbi-rel-selector-col.selected {
  background: #c7e0f4;
  font-weight: 700;
  color: #004578;
}

/* Ribbon de Modelado (Cinta Superior) */
.ribbon-modeling-container {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}


/* Paneles independientes de Filtros, Visualizaciones y Datos */
.pbi-right-panes {
  --filters-pane-width: 180px;
  --visuals-pane-width: 300px;
  --data-pane-width: 280px;
  width: calc(var(--filters-pane-width) + var(--visuals-pane-width) + var(--data-pane-width));
  background: var(--pbi-pane-bg);
  border-left: 1px solid var(--pbi-border);
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  overflow: hidden;
}
.pbi-right-panes > .pane-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--pbi-border);
}
.pbi-right-panes > .pane-section:last-child { border-right: 0; }
.report-filters-pane { flex: 0 0 var(--filters-pane-width); }
.report-visuals-pane { flex: 0 0 var(--visuals-pane-width); }
.report-data-pane { flex: 0 0 var(--data-pane-width); }
.pbi-right-panes:has(.report-filters-pane.is-collapsed) { --filters-pane-width: 34px; }
.pbi-right-panes:has(.report-visuals-pane.is-collapsed) { --visuals-pane-width: 34px; }
.pbi-right-panes:has(.report-data-pane.is-collapsed) { --data-pane-width: 34px; }
.pane-section.is-collapsed .pane-content { display: none !important; }
.pane-section.is-collapsed .pane-header { writing-mode: vertical-rl; justify-content: flex-start; gap: 12px; height: 100%; padding: 10px 5px; }
.pane-section.is-collapsed .pane-collapse-btn { transform: rotate(180deg); }
.pane-collapse-btn { border: 0; background: transparent; color: #605e5c; cursor: pointer; font-size: 20px; line-height: 1; width: 22px; height: 25px; padding: 0; }
.pane-collapse-btn:hover { background: #dedbd8; color: #201f1e; }
.pane-collapse-btn:focus-visible { outline: 2px solid #0078d4; }
.report-filters-content { flex: 1; overflow-y: auto; background: #fff; padding: 12px 10px; font-size: 12px; }
.report-filters-heading { margin: 0 0 8px; font-weight: 700; color: #323130; }
.report-filters-hint { margin: 0 0 12px; color: #605e5c; line-height: 1.4; }
.report-filter-card { border: 1px solid #edebe9; border-radius: 3px; padding: 8px; margin-bottom: 8px; background: #faf9f8; }
.report-filter-card label { display: block; margin-bottom: 5px; font-weight: 600; overflow-wrap: anywhere; }
.report-filter-card select { display: block; width: 100%; min-height: 28px; border: 1px solid #a19f9d; border-radius: 2px; background: #fff; color: #201f1e; }
.report-filter-exact { display: flex; gap: 4px; }
.report-filter-exact input { min-width: 0; flex: 1; border: 1px solid #a19f9d; border-radius: 2px; padding: 4px; font: inherit; }
.report-filter-exact button { border: 1px solid #c8c6c4; background: #fff; cursor: pointer; padding: 3px 5px; font: inherit; }
.report-filter-active { display: block; width: 100%; border: 1px solid #f2c811; background: #fff8d6; text-align: left; padding: 5px; margin-bottom: 7px; cursor: pointer; overflow-wrap: anywhere; }
.report-filters-clear { border: 1px solid #c8c6c4; background: #fff; padding: 6px 9px; cursor: pointer; }
.report-filters-clear:hover { background: #f3f2f1; }
.report-filter-section { border-bottom: 1px solid #edebe9; padding: 2px 0 14px; margin-bottom: 13px; }
.report-filter-section h3 { font-size: 12px; margin: 3px 0 10px; color: #323130; }
.report-filter-add { width: 100%; min-height: 31px; border: 1px dashed #a19f9d; background: #fff; color: #605e5c; font: inherit; padding: 4px; }
.report-filter-card { position: relative; }
.report-filter-card:has(.report-filter-remove) label { padding-right: 14px; }
.report-filter-remove { position: absolute; right: 5px; top: 4px; border: 0; background: transparent; color: #605e5c; cursor: pointer; font-size: 16px; }
@media (max-width: 1350px) {
  .pbi-right-panes { --filters-pane-width: 155px; --data-pane-width: 235px; }
}
@media (max-width: 900px) {
  .pbi-right-panes { --visuals-pane-width: 250px; }
}

.pane-header {
  height: 32px;
  background: #edebe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--pbi-text-muted);
}

/* Galería de Iconos de Visualizaciones */
.visual-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visuals-gallery-label { padding: 11px 10px 0; background: #fff; font-size: 11px; font-weight: 700; color: #323130; }
.visuals-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 9px;
  max-height: 300px;
  overflow-y: auto;
  background: #ffffff;
}

.visual-icon-btn {
  width: 100%;
  min-height: 61px;
  background: #fff;
  border: 1px solid var(--pbi-border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 2px;
  color: #476ba7;
  transition: all 0.12s ease;
}

.visual-icon-btn:hover {
  background: #eef5ff;
  border-color: #118dff;
}

.visual-icon-btn.active {
  background: #fff5cc;
  border-color: var(--pbi-yellow);
  color: #2b579a;
}
.visual-icon-btn svg { width: 24px; height: 24px; flex: none; }
.visual-icon-btn span { display: block; max-width: 100%; color: #314866; font-size: 10.5px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }

.visual-pane-tabs { display: flex; gap: 2px; padding: 7px 9px 0; background: #fff; border-bottom: 1px solid #e1dfdd; }
.visual-pane-tab { flex: 1; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 4px; color: #605e5c; font: inherit; font-size: 12px; cursor: pointer; }
.visual-pane-tab.active { border-bottom-color: #f2c811; color: #201f1e; font-weight: 700; }
.visual-pane-tab:focus-visible, .visual-icon-btn:focus-visible { outline: 2px solid #0078d4; outline-offset: -2px; }
.visual-editor-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; background: #fff; color: #201f1e; font-size: 12px; }
.visual-editor-heading { font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.visual-editor-hint { color: #605e5c; line-height: 1.45; margin: 0 0 10px; }
.visual-editor-group { border-top: 1px solid #edebe9; padding: 10px 0 2px; }
.visual-editor-group h3 { font-size: 12px; margin: 0 0 10px; }
.visual-editor-field { display: grid; gap: 5px; margin-bottom: 11px; }
.visual-editor-field span { font-weight: 600; }
.visual-editor-field input, .visual-editor-field select { width: 100%; box-sizing: border-box; min-height: 30px; border: 1px solid #c8c6c4; border-radius: 3px; padding: 4px 7px; background: #fff; color: #201f1e; font: inherit; }
.visual-editor-field input[type="color"] { padding: 2px; height: 32px; }
.visual-assigned-field { display: grid; gap: 4px; padding: 8px; border: 1px solid #c9d9eb; border-radius: 6px; background: #f7fbff; }
.visual-assigned-field span { color: #54708c; font-size: 10px; }
.visual-assigned-field strong { color: #17456f; font-size: 11px; overflow-wrap: anywhere; }
.visual-assigned-field.is-empty { border-style: dashed; border-color: #a9bed4; background: #fbfdff; }
.visual-assigned-field.is-empty strong { color: #8193a6; font-weight: 500; }
.visual-editor-group > .visual-assigned-field { min-height: 58px; margin-bottom: 14px; box-sizing: border-box; }
.visual-selected-columns .visual-assigned-field.is-empty { min-height: 58px; box-sizing: border-box; }
.visual-field-warning { color: #a4262c; line-height: 1.3; }
.visual-selected-columns { display: grid; gap: 6px; margin-bottom: 12px; }
.visual-selected-column { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 31px; padding: 4px 7px 4px 10px; border: 1px solid #bfd7f1; border-radius: 7px; background: #eef6ff; color: #174b7f; font-size: 11px; font-weight: 700; }
.visual-selected-column span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visual-selected-column button { flex: 0 0 auto; width: 23px; height: 23px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #436889; font-size: 17px; cursor: pointer; }
.visual-selected-column button:hover { background: #d8eaff; color: #123c64; }
.field-format-ribbon { min-width: 330px; }
.field-format-ribbon-content { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; padding: 4px 10px; }
.field-format-ribbon-count { width: 100%; color: #174b7f; font-size: 11px; font-weight: 700; }
.field-format-ribbon-content label { display: grid; gap: 3px; color: #36516f; font-size: 10px; font-weight: 600; }
.field-format-ribbon-content select, .field-format-ribbon-content input { min-width: 84px; max-width: 180px; height: 28px; padding: 3px 6px; border: 1px solid #c9d8e8; border-radius: 4px; background: #fff; color: #173454; font-size: 11px; }
.field-format-ribbon-hint { max-width: 290px; color: #5c7087; font-size: 11px; line-height: 1.35; }
.report-slicer-visual { padding: 12px; display: grid; gap: 9px; font-size: 12px; }
.report-slicer-visual label { font-weight: 600; overflow-wrap: anywhere; }
.report-slicer-visual select, .report-slicer-visual input { width: 100%; min-width: 0; min-height: 32px; border: 1px solid #a19f9d; border-radius: 2px; padding: 5px; background: #fff; font: inherit; }
.report-slicer-visual form { display: flex; gap: 5px; }
.report-slicer-visual button { border: 1px solid #c8c6c4; background: #fff; cursor: pointer; }
.visual-editor-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0; cursor: pointer; }
.visual-editor-toggle input { accent-color: #f2c811; }
.visual-editor-panel .hidden { display: none; }

/* Árbol de Campos (Data Fields Tree) */
.fields-tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  background: #ffffff;
}

.table-node {
  margin-bottom: 6px;
}

.table-node-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}

.table-node-header:hover {
  background: #f3f2f1;
}

.table-fields-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  font-size: 11.5px;
  cursor: grab;
  border-radius: 3px;
  color: var(--pbi-text);
}

.field-item:hover {
  background: #f3f2f1;
}

.field-icon {
  font-size: 11px;
  width: 14px;
  text-align: center;
}

.field-icon.sigma { color: #118dff; font-weight: bold; }
.field-icon.calc { color: #107c41; font-weight: bold; }
.field-icon.text { color: #605e5c; }

/* --------------------------------------------------------------------------
   Modal de Power Query (ETL) — Réplica Oficial Power BI Desktop
   -------------------------------------------------------------------------- */
.power-query-modal {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
}

.pq-titlebar {
  height: 32px;
  background: #f3f2f1;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 12px;
  color: #323130;
  user-select: none;
}

.pq-menubar {
  height: 28px;
  background: #ffffff;
  border-bottom: 1px solid #edebe9;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.pq-menu-file-btn {
  background: #0078d4;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  margin-right: 4px;
}

.pq-menu-file-btn:hover {
  background: #106ebe;
}

.pq-menu-item {
  padding: 4px 12px;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.pq-menu-item:hover {
  background: #f3f2f1;
}

.pq-menu-item.active {
  font-weight: 600;
  color: #000;
  border-bottom-color: #0078d4;
}

/* Cinta de Opciones (Ribbon) de Power Query */
.pq-ribbon-container {
  height: 84px;
  background: #ffffff;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  align-items: stretch;
  padding: 2px 6px;
  overflow-x: auto;
}

.pq-ribbon-grp {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  border-right: 1px solid #e1dfdd;
  padding: 2px 6px;
  flex-shrink: 0;
}

.pq-grp-content {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.pq-grp-label {
  font-size: 9.5px;
  color: #605e5c;
  text-align: center;
  padding-bottom: 1px;
  user-select: none;
}

.pq-btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 6px;
  height: 58px;
  min-width: 52px;
  cursor: pointer;
  font-size: 11px;
  text-align: center;
  line-height: 1.15;
  transition: all 0.1s ease;
}

.pq-btn-large:hover {
  background: #f3f2f1;
  border-color: #c8c6c4;
}

.pq-btn-large.highlight {
  background: #fff8e5;
  border-color: #f2c811;
  font-weight: 600;
}

.pq-btn-stacked {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 6px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}

.pq-btn-stacked:hover {
  background: #f3f2f1;
  border-color: #c8c6c4;
}

/* Banner de Aviso de Actualización (Amarillo) */
.pq-warning-banner {
  background: #fff8e5;
  border-bottom: 1px solid #fed979;
  padding: 4px 14px;
  font-size: 11.5px;
  color: #594300;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pq-banner-btn {
  background: #ffffff;
  border: 1px solid #c8c6c4;
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 2px;
  cursor: pointer;
  margin-left: 12px;
}

.pq-banner-btn:hover {
  background: #f3f2f1;
}

/* Barra de Fórmulas M (fx) */
.pq-formula-row {
  height: 28px;
  background: #ffffff;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.pq-formula-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pq-fx-icon {
  color: #0078d4;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  padding: 0 4px;
}

.pq-formula-input {
  flex: 1;
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
  font-size: 11.5px;
  color: #12239e;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pq-formula-input:focus {
  background: #f9fbfd;
  border-color: #0078d4;
}

/* Estructura Principal: Izquierda (Consultas) + Centro (Tabla) + Derecha (Pasos) */
.pq-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Panel Izquierdo: Árbol de Consultas [23] */
.pq-left-queries {
  width: 220px;
  background: #ffffff;
  border-right: 1px solid #d2d0ce;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.pq-queries-header {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #323130;
  border-bottom: 1px solid #edebe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pq-folder-group {
  margin-bottom: 1px;
}

.pq-folder-title {
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #323130;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.pq-folder-title:hover {
  background: #f3f2f1;
}

.pq-query-item {
  padding: 3px 8px 3px 22px;
  font-size: 11.5px;
  color: #201f1e;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.pq-query-item:hover {
  background: #f3f2f1;
}

.pq-query-item.active {
  background: #fff8e5;
  border-color: #f2c811;
  font-weight: 600;
}

/* Panel Central: Cuadrícula de Datos de Power Query */
.pq-center-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

.pq-grid-scroll {
  flex: 1;
  overflow: auto;
}

.pq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: auto;
}

.pq-table th {
  background: #f8f9fa;
  border-right: 1px solid #edebe9;
  border-bottom: 1px solid #c8c6c4;
  padding: 2px 6px 4px;
  text-align: left;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pq-table th.index-col {
  width: 38px;
  text-align: center;
  color: #605e5c;
  background: #f3f2f1;
}

.pq-col-quality-line {
  height: 3px;
  background: #107c41;
  margin-bottom: 3px;
  border-radius: 1px;
}

.pq-col-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.pq-type-tag {
  font-size: 11px;
  color: #118dff;
  font-weight: 700;
  cursor: pointer;
}

.pq-col-name {
  font-weight: 600;
  color: #252423;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pq-filter-arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 8px;
  color: #605e5c;
}

.pq-table td {
  padding: 4px 8px;
  border-right: 1px solid #f3f2f1;
  border-bottom: 1px solid #f3f2f1;
  white-space: nowrap;
  color: #201f1e;
}

.pq-table td.null-val {
  color: #a19f9d;
  font-style: italic;
}

.pq-table td.index-cell {
  background: #faf9f8;
  color: #605e5c;
  text-align: center;
  font-size: 10.5px;
  border-right: 1px solid #e1dfdd;
}

.pq-table tr:hover td {
  background-color: #f0f7ff;
}

/* Panel Derecho: Configuración de la Consulta y Pasos Aplicados */
.pq-right-steps {
  width: 260px;
  background: #ffffff;
  border-left: 1px solid #d2d0ce;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pq-settings-header {
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid #edebe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pq-panel-toggle, .pq-formula-copy, .pq-link-button {
  border: 0;
  background: transparent;
  color: #0078d4;
  cursor: pointer;
  font: inherit;
}
.pq-link-button { padding: 4px 0; text-align: left; font-size: 10.5px; }
.pq-left-queries.is-collapsed, .pq-right-steps.is-collapsed { width: 38px; }
.pq-left-queries.is-collapsed #pq-queries-tree,
.pq-right-steps.is-collapsed .pq-prop-section,
.pq-right-steps.is-collapsed .pq-steps-section,
.pq-left-queries.is-collapsed #pq-query-count,
.pq-right-steps.is-collapsed .pq-settings-header span { display: none; }
.pq-left-queries.is-collapsed .pq-queries-header,
.pq-right-steps.is-collapsed .pq-settings-header { justify-content: center; padding: 0; }
.pq-distribution { display: block; padding: 2px 4px; color: #605e5c; font-size: 9px; font-weight: 400; white-space: normal; }
.pq-dep-dialog { box-sizing: border-box; width: min(1080px, 100%); max-height: min(86vh, 820px); display: flex; flex-direction: column; background: #fff; color: #201f1e; border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.22); padding: 20px; }
.pq-dep-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pq-dep-header h2 { margin: 0; font-size: 20px; }
.pq-dep-close { border: 0; background: transparent; color: #605e5c; font-size: 26px; cursor: pointer; }
.pq-dep-summary { margin: 8px 0 12px; color: #605e5c; font-size: 13px; }
.pq-dep-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 12px; }
.pq-dep-legend-item::before { content: ''; display: inline-block; width: 18px; height: 3px; margin: 0 6px 3px 0; background: currentColor; }
.pq-dep-reference { color: #3867a0; stroke: #3867a0; }
.pq-dep-merge { color: #7d49a7; stroke: #7d49a7; }
.pq-dep-append { color: #0e786c; stroke: #0e786c; }
.pq-dep-viewport { min-height: 220px; overflow: auto; border: 1px solid #d7dce2; border-radius: 6px; background: #f6f8fb; }
.pq-dep-map { position: relative; display: grid; gap: 110px; width: max-content; min-width: 100%; min-height: 220px; padding: 28px; box-sizing: border-box; }
.pq-dep-lines { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; z-index: 0; }
.pq-dep-edge { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pq-dep-lane { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; }
.pq-dep-node { box-sizing: border-box; width: 220px; min-height: 72px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 12px; border: 1px solid #9db4ca; border-left: 4px solid #3867a0; border-radius: 6px; background: #fff; color: #201f1e; text-align: left; box-shadow: 0 2px 6px rgba(30,60,90,.1); cursor: pointer; }
.pq-dep-node:hover:not(:disabled), .pq-dep-node:focus-visible { border-color: #096fc2; box-shadow: 0 0 0 2px rgba(0,120,212,.2); }
.pq-dep-node.is-active { background: #eaf4ff; border-color: #0078d4; border-left-color: #0078d4; }
.pq-dep-node.is-missing { border-style: dashed; border-color: #bd6b36; color: #704319; background: #fff7ee; cursor: default; }
.pq-dep-node strong { width: 100%; overflow-wrap: anywhere; font-size: 13px; }
.pq-dep-node small { color: #605e5c; font-size: 11px; }
.pq-action-dialog-backdrop { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.38); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pq-action-dialog { width: min(460px, 100%); max-height: min(80vh, 680px); overflow: auto; background: #fff; color: #201f1e; border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.22); padding: 20px; }
.pq-action-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.pq-action-dialog p { margin: 0 0 14px; font-size: 13px; color: #605e5c; }
.pq-action-dialog label { display: block; margin: 10px 0; font-size: 12px; font-weight: 600; }
.pq-action-dialog label > input, .pq-action-dialog label > textarea, .pq-action-dialog label > select { display: block; box-sizing: border-box; width: 100%; margin-top: 5px; padding: 8px; border: 1px solid #c8c6c4; border-radius: 4px; font: inherit; font-weight: 400; }
.pq-action-dialog label > textarea { min-height: 160px; resize: vertical; font-family: Consolas, monospace; white-space: pre; }
.pq-source-item button { margin: 5px 0 0; padding: 5px 8px; border: 1px solid #c8c6c4; border-radius: 4px; background: #fff; cursor: pointer; }
.pq-action-column-list { display: grid; gap: 4px; max-height: 45vh; overflow: auto; }
.pq-action-column-list label { display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid #e1dfdd; border-radius: 5px; font-size: 13px; cursor: pointer; }
.pq-source-item { display: flex; flex-direction: column; gap: 3px; padding: 9px; border: 1px solid #e1dfdd; border-radius: 5px; font-size: 13px; }
.pq-source-item small { color: #605e5c; }
.pq-source-item .pq-source-status { margin: 5px 0 0; padding: 8px 10px; border-radius: 5px; background: #e8f5eb; color: #185c2f; font-size: 12px; }
.pq-source-item .pq-source-status:empty { display: none; }
.pq-source-item .pq-source-status.is-error { background: #fff0ee; color: #9d241d; }
.pq-source-pending-banner { padding: 9px 16px; background: #fff4ce; color: #694500; border-bottom: 1px solid #e8cb75; font-size: 13px; font-weight: 600; }
.pq-source-pending-banner.is-error { background: #fff0ee; color: #9d241d; border-bottom-color: #e5aaa6; }
.pq-action-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pq-action-dialog-actions button { border: 1px solid #c8c6c4; border-radius: 5px; padding: 8px 12px; background: #fff; cursor: pointer; }
.pq-action-dialog-actions button:last-child { background: #f2c811; border-color: #f2c811; font-weight: 700; }
.pq-action-dialog:has(.pq-action-comparison) { width: min(760px, 100%); }
.pq-action-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.pq-action-comparison section { min-width: 0; overflow: auto; border: 1px solid #d7e3ef; border-radius: 6px; }
.pq-action-comparison h3 { margin: 0; padding: 8px 10px; background: #e9f3ff; color: #17446a; font-size: 12px; }
.pq-action-comparison table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pq-action-comparison th, .pq-action-comparison td { padding: 6px 8px; border-top: 1px solid #edf1f5; text-align: left; white-space: nowrap; }
.pq-action-comparison th { background: #f8fbff; font-weight: 700; }
@media (max-width: 620px) { .pq-action-comparison { grid-template-columns: 1fr; } }
.pq-manual-dialog { width: min(880px, 100%); }
.pq-manual-tools { display: flex; gap: 8px; margin: 12px 0; }
.pq-manual-tools button, .pq-manual-grid button { border: 1px solid #c8c6c4; border-radius: 4px; background: #fff; cursor: pointer; }
.pq-manual-tools button { padding: 6px 10px; }
.pq-manual-grid { overflow: auto; max-height: 380px; border: 1px solid #d2d0ce; border-radius: 5px; }
.pq-manual-grid table { width: 100%; min-width: 360px; border-collapse: collapse; table-layout: fixed; }
.pq-manual-grid th, .pq-manual-grid td { border: 1px solid #e5e5e5; padding: 3px; white-space: nowrap; }
.pq-manual-grid th:first-child { width: 48px; background: #f3f2f1; font-weight: 600; }
.pq-manual-grid thead th { background: #f3f2f1; }
.pq-manual-grid input { box-sizing: border-box; width: calc(100% - 25px); min-width: 80px; border: 0; padding: 6px; background: transparent; font: inherit; }
.pq-manual-grid td input { width: 100%; }
.pq-manual-grid input:focus { outline: 2px solid #0078d4; outline-offset: -2px; background: #fff; }
.pq-manual-grid button { width: 21px; height: 21px; padding: 0; }
.pq-parameters-dialog { width: min(650px, 100%); }
.pq-parameters-body { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr); gap: 16px; }
.pq-parameters-body select[size] { min-height: 180px; }
.pq-parameters-body > div > button { margin-top: 4px; border: 1px solid #c8c6c4; border-radius: 5px; background: #fff; padding: 8px 10px; cursor: pointer; }
@media (max-width: 560px) { .pq-parameters-body { grid-template-columns: 1fr; } }
.pq-sources-dialog { width: min(720px, 100%); }
.pq-sources-dialog h3 { margin: 18px 0 8px; font-size: 14px; }
.pq-source-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pq-source-options button { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 70px; padding: 10px; text-align: left; border: 1px solid #c8c6c4; border-radius: 6px; background: #fff; cursor: pointer; }
.pq-source-options button:hover, .pq-source-options button:focus-visible { border-color: #0078d4; background: #f3f9fd; }
.pq-source-options small { color: #605e5c; }
@media (max-width: 560px) { .pq-source-options { grid-template-columns: 1fr; } }

.pq-prop-section {
  padding: 8px 12px;
  border-bottom: 1px solid #edebe9;
}

.pq-steps-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 12px;
}

.pq-steps-scroll {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
}

.pq-step-row {
  padding: 5px 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid transparent;
}

.pq-step-row:hover {
  background: #f3f2f1;
}

.pq-step-row.active {
  background: #e1dfdd;
  border-color: #c8c6c4;
  font-weight: 600;
}

.pq-step-gear {
  color: #605e5c;
  font-size: 12px;
  cursor: pointer;
}

.pq-step-delete {
  color: #d13438;
  font-size: 12px;
  font-weight: bold;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 4px;
}

/* Modal del Editor Avanzado (M Script) */
.m-editor-dialog {
  width: 820px;
  height: 600px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.m-code-area {
  flex: 1;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #000;
  background: #faf9f8;
  border: 1px solid #e1dfdd;
  border-radius: 2px;
  outline: none;
  resize: none;
  line-height: 1.5;
}

/* Barra de Fórmulas M (fx) */
.pq-formula-bar {
  height: 32px;
  background: #fff;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.pq-formula-input {
  flex: 1;
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: #12239e;
  background: transparent;
}

.pq-cleaning-panel {
  flex-shrink: 0;
  max-height: 285px;
  overflow: auto;
  padding: 10px 14px;
  background: #f8fbff;
  border-bottom: 1px solid #c7d9ee;
  color: #25344a;
  font-size: 11px;
}
.pq-cleaning-head, .pq-cleaning-actions, .pq-cleaning-sample-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pq-cleaning-head strong { display: block; font-size: 13px; }
.pq-cleaning-head span { display: block; color: #53657b; margin-top: 2px; }
.pq-cleaning-panel button {
  border: 1px solid #b7cce3;
  background: #fff;
  color: #174a79;
  border-radius: 5px;
  padding: 5px 9px;
  cursor: pointer;
}
.pq-cleaning-panel button:disabled { opacity: .5; cursor: default; }
.pq-cleaning-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.pq-cleaning-choices button { text-align: left; }
.pq-cleaning-choices button.active { background: #e2f0ff; border-color: #0078d4; }
.pq-cleaning-choices small { display: block; color: #52657a; margin-top: 2px; }
.pq-cleaning-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pq-cleaning-sample { min-width: 0; background: #fff; border: 1px solid #d7e2ee; border-radius: 5px; }
.pq-cleaning-sample-title { padding: 5px 8px; border-bottom: 1px solid #e6edf5; }
.pq-cleaning-table-wrap { max-height: 94px; overflow: auto; }
.pq-cleaning-sample table { border-collapse: collapse; width: max-content; min-width: 100%; }
.pq-cleaning-sample th, .pq-cleaning-sample td { text-align: left; white-space: nowrap; padding: 3px 7px; border: 1px solid #edf1f5; }
.pq-cleaning-sample th { background: #f5f8fb; }
.pq-cleaning-sample th small { color: #62758a; font-weight: normal; }
.pq-cleaning-actions { margin-top: 8px; }
.pq-cleaning-actions button { background: #0078d4; color: #fff; border-color: #0078d4; font-weight: 600; }
.pq-cleaning-empty { margin: 9px 0 0; color: #53657b; }
@media (max-width: 900px) { .pq-cleaning-compare { grid-template-columns: 1fr; } }

.pq-formula-input:focus {
  background: #fdfdfd;
}

.pq-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.pq-left-queries {
  width: 200px;
  background: #faf9f8;
  border-right: 1px solid var(--pbi-border);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.pq-query-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}

.pq-query-item:hover {
  background: #edebe9;
}

.pq-query-item.active {
  background: #fff;
  border-color: var(--pbi-yellow);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pq-center-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.pq-grid-scroll {
  flex: 1;
  overflow: auto;
}

/* Calidad de Columnas (Verde, Gris, Rojo) */
.pq-quality-bar {
  display: flex;
  height: 4px;
  width: 100%;
  margin-bottom: 4px;
  border-radius: 2px;
  overflow: hidden;
  background: #e1dfdd;
}

.pq-quality-valid {
  background: #107c41;
  height: 100%;
}

.pq-quality-empty {
  background: #a19f9d;
  height: 100%;
}

.pq-quality-error {
  background: #d13438;
  height: 100%;
}

.pq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.pq-table th {
  background: #f8f9fa;
  border-right: 1px solid #edebe9;
  border-bottom: 1px solid #d2d0ce;
  padding: 4px 8px;
  text-align: left;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pq-table th.index-col {
  width: 44px;
  text-align: center;
  color: #605e5c;
  background: #f3f2f1;
}

.pq-col-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pq-type-icon {
  font-size: 10.5px;
  font-weight: 700;
  color: #118dff;
  cursor: pointer;
  background: #e1f0ff;
  padding: 1px 4px;
  border-radius: 2px;
}

.pq-col-title {
  flex: 1;
  font-weight: 600;
  color: #252423;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pq-col-filter-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 9px;
  color: #605e5c;
  padding: 2px 4px;
}

.pq-col-filter-btn:hover {
  background: #e1dfdd;
  border-radius: 2px;
}

.pq-table td {
  padding: 5px 8px;
  border-right: 1px solid #f3f2f1;
  border-bottom: 1px solid #f3f2f1;
  white-space: nowrap;
}

.pq-table td.index-cell {
  background: #faf9f8;
  color: #605e5c;
  text-align: center;
  font-size: 10.5px;
  border-right: 1px solid #e1dfdd;
}

.pq-table tr:hover td {
  background-color: #f0f7ff;
}

.pq-status-bar {
  height: 24px;
  background: #f3f2f1;
  border-top: 1px solid var(--pbi-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: #605e5c;
}

.pq-right-steps {
  width: 260px;
  background: #faf9f8;
  border-left: 1px solid var(--pbi-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.pq-steps-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.pq-step-item {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--pbi-border);
  border-radius: 3px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pq-step-item:hover {
  background: #f8f9fa;
  border-color: #c8c6c4;
}

.pq-step-item.active {
  border-color: var(--pbi-yellow);
  background: #fffef7;
  font-weight: 600;
}

.pq-step-icon {
  color: #0078d4;
  margin-right: 6px;
}

/* Modales y utilidades */
.hidden { display: none !important; }

/* ==========================================================================
   Tarjetas de Visualizaciones y Objetos Visuales (Power BI Executive Widgets)
   ========================================================================== */
.pbi-widget {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e1dfdd;
  box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.11), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.18s ease;
  min-height: 140px;
  position: relative;
}

.pbi-widget:hover {
  box-shadow: 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.14), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.10);
  border-color: #c8c6c4;
}

.pbi-widget.selected {
  outline: 2px solid #0078d4;
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.25), 0 6px 18px rgba(0, 0, 0, 0.15);
}

.widget-header {
  padding: 8px 12px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f3f2f1;
  background: #faf9f8;
  user-select: none;
}

.widget-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.widget-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #252423;
  letter-spacing: -0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-subtitle {
  font-size: 10px;
  color: #605e5c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.pbi-widget:hover .widget-actions,
.pbi-widget.selected .widget-actions {
  opacity: 1;
}

.widget-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  color: #605e5c;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.widget-btn:hover {
  background: #edebe9;
  color: #000;
}

.widget-btn.btn-delete:hover {
  background: #fde7e9;
  color: #d13438;
}

.widget-content {
  flex: 1;
  padding: 8px 12px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

/* Tarjeta KPI Ejecutiva Pro */
.kpi-container-pro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 4px 0;
}

.kpi-value-pro {
  font-size: 32px;
  font-weight: 700;
  color: var(--visual-color, #201f1e);
  letter-spacing: -0.8px;
  line-height: 1.1;
  font-family: var(--font-main);
}

.kpi-target-row {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.kpi-target-label {
  color: #605e5c;
  font-size: 11px;
}

.kpi-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kpi-badge.positive {
  background: #dff6dd;
  color: #107c41;
}

.kpi-badge.negative {
  background: #fde7e9;
  color: #d13438;
}

.kpi-progress-bar-bg {
  width: 100%;
  height: 5px;
  background: #edebe9;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.kpi-progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.kpi-progress-bar-fill.fill-green {
  background: linear-gradient(90deg, #107c41, #1aab40);
}

.kpi-progress-bar-fill.fill-amber {
  background: linear-gradient(90deg, #e66c37, #d9b300);
}

.kpi-footer-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #8a8886;
  border-top: 1px solid #f3f2f1;
  padding-top: 4px;
}

.pulse-circle-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #107c41;
  display: inline-block;
  animation: pulse-ring 2s infinite ease-in-out;
}

/* Tabla Matriz Detallada con Data Bars */
.matrix-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid #edebe9;
  border-radius: 4px;
  background: #fff;
}
.data-view-resizable { table-layout:fixed; width:max-content; }
.data-view-resizable th { position:relative; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.data-view-resizable th:has(.data-column-filter[open]) { overflow:visible; z-index:10; }
.data-view-resizable td { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.data-column-filter { font-weight:400; font-size:10px; color:#1269bc; }
.data-column-filter summary { cursor:pointer; width:max-content; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.data-column-filter-popover { position:absolute; top:100%; left:0; z-index:30; width:260px; box-sizing:border-box; display:grid; gap:8px; padding:12px; white-space:normal; background:#fff; color:#24374c; border:1px solid #b8cce0; border-radius:8px; box-shadow:0 10px 24px #10294333; }
.data-column-filter-popover label { display:grid; gap:4px; font-size:11px; }
.data-column-filter-popover input,.data-column-filter-popover select { box-sizing:border-box; width:100%; padding:5px; }
.data-column-filter-popover small { font-size:10px; color:#66788e; }
.data-column-filter-popover button { padding:5px 8px; cursor:pointer; }
.data-view-footer { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:6px 14px; border-top:1px solid #dce5ef; font-size:11px; }
.data-view-footer button { margin-left:6px; padding:4px 9px; border:1px solid #c8d8ed; border-radius:4px; background:#fff; cursor:pointer; }
.table-column-resizer { position:absolute; top:0; right:0; width:9px; height:100%; cursor:col-resize; touch-action:none; border-right:2px solid transparent; }
.table-column-resizer:hover,.table-column-resizer:focus-visible { border-right-color:#118dff; outline:0; }

.pbi-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.pbi-matrix-table.fixed-columns { table-layout: fixed; }
.pbi-matrix-table.fixed-columns th,
.pbi-matrix-table.fixed-columns td {
  width: var(--matrix-column-width, 150px);
  min-width: var(--matrix-column-width, 150px);
  max-width: var(--matrix-column-width, 150px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.pbi-matrix-table.resizable-columns { width:max-content; }
.pbi-matrix-table.resizable-columns th,
.pbi-matrix-table.resizable-columns td { width:auto; min-width:0; max-width:none; }
.pbi-matrix-table.resizable-columns th { position:relative; }
.pbi-matrix-table tbody tr.matrix-highlight > th,
.pbi-matrix-table tbody tr.matrix-highlight > td { background: var(--matrix-highlight-color, #fff2bb); }
.pbi-matrix-table button,
.matrix-table-footer button { border: 1px solid #c8d8ed; border-radius: 4px; background: #fff; color: #164981; cursor: pointer; }
.pbi-matrix-table button { padding: 1px 5px; }
.matrix-table-footer button { padding: 4px 8px; }
.matrix-table-footer button:disabled { opacity: .45; cursor: default; }
.pbi-matrix-table small { display: block; color: #65758d; }
.matrix-row-child { padding-left: 10px; }
.matrix-mini-bar { position: relative; min-height: 22px; display: flex; align-items: center; padding: 2px 5px; isolation: isolate; }
.matrix-mini-bar::before { content: ''; position: absolute; z-index: -1; inset: 2px auto 2px 0; width: var(--mini-bar-width); background: var(--mini-bar-color); opacity: .22; border-radius: 3px; }
.matrix-mini-bar span { position: relative; font-variant-numeric: tabular-nums; }

.pbi-matrix-table thead th {
  background: #f3f2f1;
  color: #323130;
  font-weight: 600;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 2px solid #e1dfdd;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
.pbi-matrix-table thead .table-sort-button { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.pbi-matrix-table thead .table-sort-button span { flex: 0 0 auto; color: #4775a3; }
.pbi-matrix-table thead .table-sort-button:focus-visible { outline: 2px solid #118dff; outline-offset: 2px; }

.pbi-matrix-table tbody tr.matrix-row {
  border-bottom: 1px solid #f3f2f1;
  cursor: pointer;
  transition: background 0.12s;
}

.pbi-matrix-table tbody tr.matrix-row:hover {
  background: #f0f7fd !important;
}

.pbi-matrix-table tbody td {
  padding: 5px 10px;
  vertical-align: middle;
  white-space: nowrap;
}
.pbi-matrix-table tfoot tr.matrix-grand-total > th,
.pbi-matrix-table tfoot tr.matrix-grand-total > td {
  padding: 8px 10px;
  border-top: 2px solid #82afd9;
  background: #eaf3ff;
  color: #143f69;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pbi-matrix-table tfoot tr.matrix-grand-total > :first-child { text-align: left; }
.pivot-matrix tbody td.matrix-total-cell { background: #f0f7ff; font-weight: 700; }

/* La matriz separa claramente encabezados, totales de fila y subniveles. */
.pivot-matrix { border-collapse: separate; border-spacing: 0; color: #19334f; font-size: 12px; }
.pivot-matrix.fixed-columns th:first-child,
.pivot-matrix.fixed-columns td:first-child { width: var(--matrix-label-width); min-width: var(--matrix-label-width); max-width: var(--matrix-label-width); }
.pivot-matrix thead th { height: 42px; box-sizing: border-box; padding: 8px 12px; background: #eaf2fb; color: #163b61; border-right: 1px solid #d5e3f1; border-bottom: 2px solid #96bce3; text-align: right; font-size: 11px; }
.pivot-matrix thead .matrix-corner { left: 0; z-index: 4; background: #184b7b; color: #fff; text-align: left; }
.pivot-matrix .matrix-corner span { display: block; font-size: 12px; font-weight: 700; }
.pivot-matrix .matrix-corner small { color: #d2e8ff; font-weight: 500; margin-top: 2px; }
.pivot-matrix .matrix-column-label { display: inline-block; overflow: hidden; max-width: 100%; text-overflow: ellipsis; vertical-align: middle; }
.pivot-matrix tbody tr > th,
.pivot-matrix tbody tr > td { height: 34px; box-sizing: border-box; border-right: 1px solid #edf2f7; border-bottom: 1px solid #e8eef5; }
.pivot-matrix tbody tr.matrix-row { cursor: default; }
.pivot-matrix tbody tr:nth-child(even) > td { background: #f8fbff; }
.pivot-matrix tbody tr > th { position: sticky; left: 0; z-index: 1; padding: 7px 12px; background: #f3f8ff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pivot-matrix tbody tr.matrix-row-parent > th,
.pivot-matrix tbody tr.matrix-row-parent > td.matrix-value { font-weight: 700; }
.pivot-matrix tbody tr.matrix-row-detail > th { background: #fbfdff; color: #55718d; font-weight: 500; }
.pivot-matrix .matrix-row-child { padding-left: 25px; }
.pivot-matrix .matrix-total-tag { display: inline; margin-left: 6px; color: #728ca5; font-size: 9px; font-weight: 600; }
.pivot-matrix tbody td.matrix-value { padding: 7px 12px; text-align: right; color: #173d65; font-variant-numeric: tabular-nums; }
.pivot-matrix tbody td.matrix-empty { color: transparent; }
.pivot-matrix tbody tr:hover > th,
.pivot-matrix tbody tr:hover > td { background: #eaf5ff; }
.pivot-matrix .matrix-expand { width: 20px; height: 20px; margin-right: 6px; padding: 0; border-radius: 5px; text-align: center; font-size: 11px; }

.table-data-bar-track {
  width: 70px;
  height: 9px;
  background: #edebe9;
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}

.table-data-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #118dff, #005a9e);
  border-radius: 3px;
}

.margin-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.margin-badge.high {
  background: #dff6dd;
  color: #107c41;
}

.margin-badge.mid {
  background: #deecf9;
  color: #0078d4;
}

.margin-badge.low {
  background: #fde7e9;
  color: #d13438;
}

.region-pill {
  font-size: 10.5px;
  background: #f3f2f1;
  color: #605e5c;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.status-indicator-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
}

.status-indicator-tag.tag-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-indicator-tag.tag-pending {
  background: #fff8e1;
  color: #f57f17;
}

.matrix-table-footer {
  padding: 6px 10px;
  font-size: 11px;
  color: #605e5c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #faf9f8;
  border-top: 1px solid #edebe9;
}

/* Barra de Segmentadores y Filtros Interactivos (Slicers Bar) */
.pbi-slicers-bar {
  background: #ffffff;
  border-bottom: 1px solid #edebe9;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.slicer-chips-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slicer-chip-label {
  font-size: 11px;
  font-weight: 700;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.slicer-chip-btn {
  background: #f3f2f1;
  border: 1px solid #d2d0ce;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11px;
  color: #323130;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.slicer-chip-btn:hover {
  background: #e1dfdd;
  border-color: #a19f9d;
}

.slicer-chip-btn.active {
  background: #0078d4;
  color: #ffffff;
  border-color: #004578;
  font-weight: 600;
}

.active-filter-badge {
  background: #deecf9;
  border: 1px solid #0078d4;
  color: #004578;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.btn-remove-filter {
  cursor: pointer;
  font-weight: 700;
  color: #a80000;
}

/* Pestañas de Páginas de Informe Inferiores (Report Page Tabs) */
.pbi-pages-bar {
  height: 32px;
  background: #edebe9;
  border-top: 1px solid #d2d0ce;
  display: flex;
  align-items: flex-end;
  padding: 0 12px;
  gap: 4px;
  flex-shrink: 0;
  z-index: 15;
}

.pbi-page-tab {
  background: #f3f2f1;
  border: 1px solid #d2d0ce;
  border-bottom: none;
  padding: 4px 14px;
  font-size: 11px;
  color: #605e5c;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  height: 28px;
}

.pbi-page-tab:hover {
  background: #ffffff;
  color: #000;
}

.pbi-page-tab.active {
  background: #ffffff;
  color: #201f1e;
  font-weight: 600;
  border-top: 2.5px solid #f2c811;
  height: 29px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.06);
}

.btn-add-page {
  background: transparent;
  border: none;
  font-size: 15px;
  color: #605e5c;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
}

.btn-add-page:hover {
  background: #d2d0ce;
  color: #000;
}

/* ==========================================================================
   Seguridad a Nivel de Fila (RLS) & Objetos Visuales HTML Embed
   ========================================================================== */
.rls-simulation-banner {
  background: #fff4ce;
  border-bottom: 1.5px solid #fed9cc;
  color: #794500;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  flex-shrink: 0;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.btn-stop-rls {
  background: #ffffff;
  border: 1px solid #d2d0ce;
  color: #a80000;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}

.btn-stop-rls:hover {
  background: #fde7e9;
  border-color: #a80000;
}

/* Objeto Visual de Incrustación HTML y Embed */
.custom-html-visual-wrapper {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-radius: 4px;
}

.html-editor-textarea {
  width: 100%;
  height: 220px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #1e1e1e;
  color: #4ec9b0;
  resize: vertical;
  outline: none;
  line-height: 1.45;
  box-sizing: border-box;
}

.embed-code-textarea {
  width: 100%;
  height: 100px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 11.5px;
  padding: 8px 10px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #faf9f8;
  color: #201f1e;
  resize: none;
  outline: none;
  box-sizing: border-box;
}

.preset-badge-btn {
  background: #f3f2f1;
  border: 1px solid #d2d0ce;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  color: #252423;
  transition: all 0.15s;
}

.preset-badge-btn:hover {
  background: #e1dfdd;
  border-color: #0078d4;
  color: #0078d4;
}

.rls-role-row {
  padding: 8px 12px;
  border: 1px solid #edebe9;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rls-role-row:hover {
  background: #f3f2f1;
}

.rls-role-row.active {
  background: #deecf9;
  border-color: #0078d4;
  font-weight: 600;
}

/* Modales */
.pbi-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  isolation: isolate;
}

.pbi-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.58);
}

.pbi-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.pbi-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.pbi-modal-header > div { min-width: 0; }

.pbi-modal-header .btn-close-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 18px;
}

.pbi-modal-header .btn-close-modal:hover,
.pbi-modal-header .btn-close-modal:focus-visible {
  background: #e2e8f0;
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

.pbi-modal-dialog > :not(.pbi-modal-header) { min-height: 0; }

@media (max-width: 640px) {
  .pbi-modal { padding: 8px; }
  .pbi-modal-dialog { max-height: calc(100dvh - 16px); }
  .pbi-modal-header { align-items: flex-start; }
  .pbi-modal-header > div > div { flex-wrap: wrap; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-dialog {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 580px;
  max-width: 92vw;
  overflow: hidden;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--pbi-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #faf9f8;
}

.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--pbi-text-dim);
  cursor: pointer;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer {
  padding: 12px 18px;
  background: #faf9f8;
  border-top: 1px solid var(--pbi-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pbi-text);
}

.form-control {
  border: 1px solid var(--pbi-border);
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--pbi-blue);
}

.helper-text {
  font-size: 11.5px;
  color: var(--pbi-text-muted);
}

.pbi-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--pbi-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  font-size: 13px;
  z-index: 11000;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--pbi-yellow);
}

/* ==========================================================================
   Power Query Editor Oficial — Fluent Office Design
   Réplica exacta del Editor de Power Query de Power BI Desktop
   ========================================================================== */
.power-query-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.power-query-modal.hidden {
  display: none !important;
}

/* 1. Barra de Título */
.pq-titlebar {
  height: 32px;
  background: #ffffff;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  flex-shrink: 0;
}

/* 2. Menú de Pestañas */
.pq-menubar {
  height: 28px;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid #edebe9;
  flex-shrink: 0;
}

.pq-menu-file-btn {
  background: #0078d4;
  color: #fff;
  border: none;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px 2px 0 0;
  margin-right: 6px;
}

.pq-menu-file-btn:hover {
  background: #106ebe;
}

.pq-menu-item {
  padding: 4px 10px;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}

.pq-menu-item:hover {
  background: #f3f2f1;
}

.pq-menu-item.active {
  color: #0078d4;
  font-weight: 600;
  border-bottom: 2px solid #0078d4;
}

/* 3. Cinta de Opciones (Ribbon) */
.pq-ribbon-container {
  height: 92px;
  background: #f3f2f1;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
}

.pq-ribbon-container::-webkit-scrollbar {
  height: 4px;
}
.pq-ribbon-container::-webkit-scrollbar-thumb {
  background: #c8c6c4;
}

.pq-ribbon-grp {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 6px 2px;
  border-right: 1px solid #e1dfdd;
  flex-shrink: 0;
  min-height: 84px;
  max-width: 100%;
}

.pq-ribbon-grp.is-collapsed {
  width: 36px;
  min-height: 84px;
  justify-content: center;
  padding: 0;
  border: 1px solid #8db6df;
  border-top: 2px solid #337ab7;
  background: #dcecff;
}

.pq-ribbon-grp.is-collapsed:hover { background: #c9e2fb; }
.pq-ribbon-grp.is-collapsed .pq-grp-toggle { color: #17446a; }

.pq-toggle-all-groups {
  border: 1px solid #8db6df;
  border-radius: 4px;
  background: #e9f3ff;
  color: #17446a;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
  white-space: nowrap;
}

.pq-toggle-all-groups:hover, .pq-toggle-all-groups:focus-visible { background: #c9e2fb; }
.pq-toggle-all-groups:disabled { opacity: .55; cursor: default; }

.pq-ribbon-grp.is-collapsed .pq-grp-content { display: none; }

.pq-grp-toggle {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  padding: 2px 4px;
  font: inherit;
  color: #40566f;
  font-size: 10px;
  text-align: center;
}

.pq-grp-toggle:hover, .pq-grp-toggle:focus-visible { background: #deecf9; border-color: #99c9f0; }
.pq-ribbon-grp.is-collapsed .pq-grp-toggle {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 100%;
  padding: 3px 0;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.pq-grp-content {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.pq-grp-label {
  font-size: 10px;
  color: #605e5c;
  text-align: center;
  margin-top: 1px;
  user-select: none;
}

.pq-btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 5px;
  font-size: 11px;
  color: #201f1e;
  cursor: pointer;
  min-width: 48px;
  gap: 2px;
  height: 58px;
  text-align: center;
  line-height: 1.15;
}

.pq-btn-large:hover {
  background: #edebe9;
  border-color: #c8c6c4;
}

.pq-btn-large.highlight {
  background: #eff6fc;
  border-color: #c7e0f4;
}

.pq-btn-large.highlight:hover {
  background: #deecf9;
  border-color: #2b88d8;
}

.pq-btn-stacked {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 11px;
  color: #201f1e;
  cursor: pointer;
  white-space: nowrap;
  height: 20px;
}

.pq-btn-stacked:hover {
  background: #edebe9;
  border-color: #c8c6c4;
}

/* 4. Banner Amarillo de Advertencia */
.pq-warning-banner {
  background: #fff4ce;
  border-bottom: 1px solid #edebe9;
  color: #323130;
  padding: 3px 12px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.pq-banner-btn {
  background: #ffffff;
  border: 1px solid #8a8886;
  border-radius: 2px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 8px;
}

.pq-banner-btn:hover {
  background: #f3f2f1;
}

/* 5. Barra de Fórmulas fx */
.pq-formula-row {
  height: 28px;
  background: #ffffff;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  flex-shrink: 0;
}

.pq-formula-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pq-fx-icon {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-weight: 700;
  color: #0078d4;
  font-size: 14px;
}

.pq-formula-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  color: #201f1e;
  background: transparent;
}

/* 6. Cuerpo Principal */
.pq-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: #ffffff;
}

/* Panel Izquierdo: Consultas [23] */
.pq-left-queries {
  width: 240px;
  background: #fcfcfc;
  border-right: 1px solid #d2d0ce;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pq-queries-header {
  height: 26px;
  background: #f3f2f1;
  border-bottom: 1px solid #edebe9;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #323130;
}

.pq-folder-group {
  margin-bottom: 1px;
}

.pq-folder-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #323130;
  cursor: pointer;
  user-select: none;
}

.pq-folder-row:hover {
  background: #f3f2f1;
}

.pq-folder-chevron {
  font-size: 8px;
  color: #605e5c;
  width: 10px;
  display: inline-block;
  transition: transform 0.1s;
}

.pq-folder-chevron.collapsed {
  transform: rotate(-90deg);
}

.pq-folder-items {
  padding-left: 16px;
}

.pq-folder-items.hidden {
  display: none;
}

.pq-tree-query {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #201f1e;
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pq-tree-query:hover {
  background: #f3f2f1;
}

.pq-tree-query.active {
  background: #e5f1fb;
  color: #000;
  font-weight: 600;
  outline: 1px solid #99c9ef;
}

/* Panel Central: Cuadrícula */
.pq-center-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

.pq-grid-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}

.pq-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 11.5px;
}

.pq-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f3f2f1;
  border-right: 1px solid #d2d0ce;
  border-bottom: 1px solid #d2d0ce;
  padding: 0;
  vertical-align: top;
  user-select: none;
}

.pq-table th.index-col {
  width: 32px;
  min-width: 32px;
  text-align: center;
  color: #605e5c;
  font-weight: normal;
  background: #f3f2f1;
  vertical-align: middle;
  padding: 4px;
}

.pq-quality-bar {
  height: 3px;
  width: 100%;
  display: flex;
  background: #e1dfdd;
}

.pq-quality-valid {
  background: #107c41;
  height: 100%;
}

.pq-quality-empty {
  background: #8a8886;
  height: 100%;
}

.pq-quality-error {
  background: #a80000;
  height: 100%;
}

.pq-col-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  gap: 6px;
}

.pq-type-icon {
  font-size: 10px;
  color: #0078d4;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.pq-col-title {
  font-weight: 600;
  font-size: 11px;
  color: #201f1e;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.pq-col-filter-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
  color: #605e5c;
  padding: 0 2px;
  flex-shrink: 0;
}

.pq-table td {
  border-right: 1px solid #edebe9;
  border-bottom: 1px solid #edebe9;
  padding: 2px 6px;
  white-space: nowrap;
  color: #201f1e;
  height: 22px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11.5px;
}

.pq-table td.index-cell {
  background: #f8f9fa;
  color: #605e5c;
  text-align: center;
  border-right: 1px solid #d2d0ce;
  width: 32px;
  min-width: 32px;
  user-select: none;
  font-size: 11px;
}

.pq-table tr:hover td {
  background: #f3f9fd;
}

.pq-table tr:hover td.index-cell {
  background: #edebe9;
}

.pq-null {
  font-style: italic;
  color: #8a8886;
}

.pq-status-bar {
  height: 24px;
  background: #f3f2f1;
  border-top: 1px solid #d2d0ce;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: #605e5c;
  flex-shrink: 0;
}

/* Panel Derecho: Configuración de la Consulta y Pasos */
.pq-right-steps {
  width: 240px;
  background: #fcfcfc;
  border-left: 1px solid #d2d0ce;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pq-settings-header {
  height: 26px;
  background: #f3f2f1;
  border-bottom: 1px solid #edebe9;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #323130;
}

.pq-prop-section {
  padding: 10px;
  border-bottom: 1px solid #edebe9;
}

.pq-steps-section {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pq-steps-scroll {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin-top: 8px;
  padding-right: 4px;
}

.pq-step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  font-size: 11.5px;
  color: #323130;
  cursor: pointer;
  border-radius: 2px;
  margin-bottom: 1px;
  user-select: none;
}

.pq-step-item:hover {
  background: #f3f2f1;
}

.pq-step-item.active {
  background: #e1dfdd;
  font-weight: 600;
  color: #000;
  outline: 1px solid #c8c6c4;
}

.pq-step-icon {
  font-size: 11px;
  margin-right: 6px;
  color: #605e5c;
}

/* Modal: Editor Avanzado M */
.m-editor-dialog {
  width: 820px;
  max-width: 95vw;
  height: 560px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.m-code-area {
  flex: 1;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  padding: 10px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #201f1e;
  resize: none;
  outline: none;
  background: #faf9f8;
}

/* ==========================================================================
   Menús Contextuales (Clic Derecho) y Desplegables de Power Query (Clic Izquierdo)
   ========================================================================== */
.pq-context-menu {
  position: fixed;
  z-index: 10050;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.2);
  min-width: 220px;
  padding: 4px 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  color: #201f1e;
  user-select: none;
  animation: pqFadeIn 0.1s ease;
}

@keyframes pqFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.pq-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.08s;
  position: relative;
}

.pq-ctx-item:hover {
  background: #f3f2f1;
}

.pq-ctx-item.has-submenu:hover > .pq-ctx-submenu {
  display: block;
}

.pq-ctx-icon {
  width: 16px;
  text-align: center;
  font-size: 12px;
  color: #605e5c;
  flex-shrink: 0;
}

.pq-ctx-label {
  flex: 1;
  white-space: nowrap;
}

.pq-ctx-shortcut {
  font-size: 10.5px;
  color: #a19f9d;
  margin-left: 12px;
}

.pq-ctx-arrow {
  font-size: 9px;
  color: #605e5c;
}

.pq-ctx-separator {
  height: 1px;
  background: #edebe9;
  margin: 4px 0;
}

.pq-ctx-submenu {
  display: none;
  position: absolute;
  top: -4px;
  left: 100%;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.2);
  min-width: 190px;
  padding: 4px 0;
}

/* Selector de Tipos de Datos (Clic Izquierdo en Icono 📅 / 123 / ABC) */
.pq-type-picker {
  position: fixed;
  z-index: 10050;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  min-width: 190px;
  padding: 4px 0;
  font-size: 11.5px;
  font-family: 'Segoe UI', sans-serif;
  user-select: none;
  animation: pqFadeIn 0.1s ease;
}

.pq-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
}

.pq-type-option:hover {
  background: #e5f1fb;
}

.pq-type-opt-icon {
  width: 20px;
  font-weight: 600;
  color: #0078d4;
  font-size: 11px;
}

/* Tarjeta Desplegable de Filtrado y Ordenación (Clic Izquierdo en ▼) */
.pq-filter-dropdown {
  position: fixed;
  z-index: 10050;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.22);
  width: 260px;
  padding: 8px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11.5px;
  color: #201f1e;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pqFadeIn 0.1s ease;
}

.pq-filter-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 2px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 11.5px;
}

.pq-filter-action-btn:hover {
  background: #f3f2f1;
}

.pq-filter-search-box {
  display: flex;
  align-items: center;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  padding: 3px 6px;
  background: #ffffff;
}

.pq-filter-search-input {
  border: none;
  outline: none;
  font-size: 11px;
  flex: 1;
  background: transparent;
}

.pq-filter-list {
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid #edebe9;
  border-radius: 2px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #faf9f8;
}

.pq-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
}

.pq-filter-item:hover {
  background: #edebe9;
}

.pq-filter-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #edebe9;
}

/* Resaltado de Columna Seleccionada */
.pq-table th.selected-col {
  background-color: #deecf9 !important;
  outline: 1px solid #2b88d8;
}

.pq-table td.selected-col {
  background-color: #eff6fc !important;
}

/* Renombrado en Línea de Columnas */
.pq-inline-rename {
  border: 1px solid #0078d4;
  outline: none;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
  width: 90%;
  font-family: inherit;
}

/* ==========================================================================
   MODAL: CATÁLOGO Y ASISTENTE DE FUNCIONES DAX
   ========================================================================== */
.dax-assistant-layout {
  display: flex;
  min-height: 440px;
  max-height: 520px;
}

.dax-cat-sidebar {
  width: 200px;
  border-right: 1px solid #edebe9;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.dax-cat-btn {
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #323130;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background 0.15s ease;
}

.dax-cat-btn:hover {
  background: #f3f2f1;
}

.dax-cat-btn.active {
  background: #deecf9;
  color: #0078d4;
  font-weight: 700;
}

.dax-func-list-col {
  width: 210px;
  border-right: 1px solid #edebe9;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.dax-func-item {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #0078d4;
  cursor: pointer;
  background: #faf9f8;
  border: 1px solid #edebe9;
  transition: all 0.15s ease;
}

.dax-func-item:hover {
  background: #eff6fc;
  border-color: #c7e0f4;
}

.dax-func-item.active {
  background: #0078d4;
  color: #ffffff;
  border-color: #0078d4;
}

.dax-assistant-sidebar {
  width: 280px;
  border-right: 1px solid #edebe9;
  padding: 12px;
  display: flex;
  flex-direction: column;
  background: #faf9f8;
  overflow: hidden;
}

.dax-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  font-size: 11.5px;
  outline: none;
}
.dax-search-input:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.dax-functions-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.dax-assistant-content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #ffffff;
}

.dax-syntax-box {
  background: #1e1e1e;
  color: #4ec9b0;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 10px 0;
  line-height: 1.5;
  border: 1px solid #333;
}

.dax-example-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0078d4;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  margin-top: 6px;
}

/* ==========================================================================
   INTERFAZ OFICIAL POWER BI DESKTOP: HEADER & RIBBON MEJORADO
   ========================================================================== */

.pbi-header {
  height: 38px !important;
  background-color: #1f1f1f !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 10px 0 12px !important;
  border-bottom: 1px solid #333333 !important;
}

.quick-access-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 8px;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,.2);
}

.qa-icon-btn {
  background: transparent;
  border: none;
  color: #cccccc;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 3px;
  transition: all 0.12s ease;
}

.qa-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.report-file-title {
  font-size: 12px;
  font-weight: 500;
  color: #e1dfdd;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.12s ease;
  white-space: nowrap;
}

.report-file-title:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Ribbon Tabs */
.ribbon-tabs {
  height: 32px !important;
  background: #f3f2f1 !important;
  border-bottom: 1px solid #d2d0ce !important;
  padding: 0 8px !important;
  display: flex !important;
  align-items: center !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  scrollbar-width: thin;
}

.ribbon-tab {
  padding: 6px 12px !important;
  font-size: 12px !important;
  color: #201f1e !important;
  border-top: none !important;
  border-bottom: 2px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
  user-select: none !important;
  flex-shrink: 0 !important;
}

.ribbon-tab:focus-visible, .qa-icon-btn:focus-visible {
  outline: 2px solid #0078d4 !important;
  outline-offset: -2px;
}

.ribbon-tab:hover {
  background: #edebe9 !important;
}

.ribbon-tab.active {
  background: #ffffff !important;
  color: #008272 !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #008272 !important;
}

.ribbon-tab.file-tab {
  background: #008272 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 2px !important;
  padding: 4px 14px !important;
  margin-right: 4px !important;
}

.ribbon-tab.file-tab:hover {
  background: #005a4e !important;
}

.ribbon-tab.contextual-tab {
  color: #008272 !important;
  font-weight: 600 !important;
}

.ribbon-share-btn {
  background: #005e46;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ribbon-share-btn:hover {
  background: #004b38;
}

/* Ribbon Groups (Bloques de la Cinta al estilo oficial) */
.ribbon-tools-row {
  display: flex !important;
  align-items: stretch !important;
  padding: 4px 8px 3px 8px !important;
  gap: 0 !important;
  background: #faf9f8 !important;
  border-bottom: 1px solid #d2d0ce !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.ribbon-group-block {
  display: flex;
  flex-direction: column;
  padding: 2px 8px 3px 8px;
  border-right: 1px solid #e1dfdd;
  flex-shrink: 0;
}

.ribbon-group-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.ribbon-group-footer {
  text-align: center;
  font-size: 10px;
  color: #605e5c;
  padding-top: 2px;
  user-select: none;
  letter-spacing: 0.2px;
}

.ribbon-btn-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 58px;
  padding: 3px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.ribbon-btn-large:hover {
  background: #edebe9;
  border-color: #c8c6c4;
}

.ribbon-btn-large.primary {
  background: #f3f9f8;
}

.ribbon-btn-large.primary:hover {
  background: #e1f0ec;
  border-color: #008272;
}

.ribbon-large-icon {
  font-size: 20px;
  line-height: 1;
}

.ribbon-large-label {
  font-size: 10.5px;
  color: #201f1e;
  text-align: center;
  line-height: 1.15;
  margin-top: 3px;
  white-space: nowrap;
}

.ribbon-col-small {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ribbon-2col-small {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 8px;
}

.ribbon-btn-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 2px 6px;
  font-size: 11px;
  color: #201f1e;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s ease;
}

.ribbon-btn-mini:hover {
  background: #edebe9;
  border-color: #c8c6c4;
}

/* Galería de Iconos de Visualizaciones en Cuadrícula en el Ribbon */
.ribbon-visuals-matrix {
  display: grid;
  grid-template-columns: repeat(6, 26px);
  grid-template-rows: repeat(2, 26px);
  gap: 2px;
  background: #ffffff;
  padding: 3px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  margin: 0 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.vis-matrix-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.12s ease;
}

.vis-matrix-btn:hover {
  background: #deecf9;
  border-color: #0078d4;
  transform: scale(1.08);
}

/* ==========================================================================
   LIENZO DE INFORME MEJORADO (CANVAS 16:9 CON MANEJADORES ACTIVOS)
   ========================================================================== */

.report-view-container {
  background: #eef2f6 !important;
}

.canvas-scroll-area {
  padding: 16px 20px !important;
  display: flex;
  justify-content: flex-start;
  overflow: auto;
}

.dashboard-grid {
  width: 100%;
  flex: none;
  box-sizing: border-box;
  max-width: 1600px;
  background: #ffffff;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  min-height: 820px;
  align-content: start;
  align-items: start;
  grid-auto-rows: min-content;
}
.dashboard-grid[data-page-size="4:3"] { max-width: 1080px; }
.dashboard-grid[data-page-size="16:9"] { max-width: 1440px; }
.dashboard-grid.has-visuals { display: block; position: relative; }
.dashboard-grid.has-visuals .pbi-widget { position: absolute !important; box-sizing: border-box; }
.pbi-widget .widget-header { cursor: move; touch-action: none; }
.pbi-widget .widget-actions { cursor: default; }
.pbi-widget.is-moving { z-index: 8; box-shadow: 0 12px 28px rgba(0, 120, 212, .24) !important; }
.visual-empty-state { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; text-align: center; color: #605e5c; border: 1px dashed #c8c6c4; background: #faf9f8; padding: 12px; }
.visual-empty-state > span { font-size: 30px; color: #a19f9d; line-height: 1; }
.visual-empty-state strong { font-size: 12px; font-weight: 600; color: #323130; }
.visual-empty-state small { font-size: 11px; line-height: 1.3; }
.visual-empty-guide { flex: 1; min-height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; text-align: center; color: #7b8a9b; background: transparent; padding: 12px; box-sizing: border-box; }
.visual-empty-guide > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #c3d0de; border-radius: 50%; color: #8ca0b4; font-size: 22px; line-height: 1; }
.visual-empty-guide strong { font-size: 11px; font-weight: 600; color: #667b90; }
.visual-empty-guide small { font-size: 10px; color: #8394a5; }

/* Widget con Selección Activa y 8 Manejadores Resize */
.pbi-widget {
  position: relative !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
}

.pbi-widget.selected {
  outline: 1.5px solid #0078d4 !important;
  box-shadow: 0 0 0 1px #0078d4, 0 8px 24px rgba(0, 120, 212, 0.18) !important;
  border-color: #0078d4 !important;
  overflow: visible;
}
.pbi-widget.selected .widget-content { overflow: hidden; }

@media print {
  @page { size: landscape; margin: 8mm; }
  html, body, #powerbi-app-layout, .pbi-body, .pbi-center-workspace,
  #report-view-container, .canvas-scroll-area {
    display: block !important; width: 100% !important; height: auto !important;
    max-width: none !important; overflow: visible !important; padding: 0 !important;
    margin: 0 !important; background: #fff !important;
  }
  .pbi-header, .pbi-desktop-ribbon, .pbi-left-rail, .pbi-right-panes,
  .pbi-pages-bar, .pbi-slicers-bar, .modal-backdrop, .resize-handle,
  .widget-actions, .widget-collab-active, .pbi-toast { display: none !important; }
  #dashboard-grid { width: 100% !important; max-width: none !important; box-shadow: none !important; border: 0 !important; }
  .pbi-widget { box-shadow: none !important; border: 1px solid #d8dde6 !important; break-inside: avoid; }
}


.resize-handle {
  display: none;
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 1.5px solid #0078d4;
  border-radius: 1px;
  z-index: 10;
  touch-action: none;
}

.pbi-widget.selected .resize-handle {
  display: block;
}

.resize-handle.top-left     { top: -4px; left: -4px; cursor: nwse-resize; }
.resize-handle.top-center   { top: -4px; left: calc(50% - 3.5px); cursor: ns-resize; }
.resize-handle.top-right    { top: -4px; right: -4px; cursor: nesw-resize; }
.resize-handle.middle-left  { top: calc(50% - 3.5px); left: -4px; cursor: ew-resize; }
.resize-handle.middle-right { top: calc(50% - 3.5px); right: -4px; cursor: ew-resize; }
.resize-handle.bottom-left  { bottom: -4px; left: -4px; cursor: nesw-resize; }
.resize-handle.bottom-center{ bottom: -4px; left: calc(50% - 3.5px); cursor: ns-resize; }
.resize-handle.bottom-right { bottom: -4px; right: -4px; cursor: nwse-resize; }

/* Barra de Pestañas Inferiores de Páginas */
.pbi-pages-bar {
  background: #f3f2f1;
  border-top: 1px solid #d2d0ce;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 2px;
}

.pbi-page-tab {
  padding: 4px 14px;
  font-size: 11.5px;
  color: #323130;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 3px 3px 0 0;
  transition: all 0.12s ease;
  user-select: none;
  white-space: nowrap;
}

.pbi-page-tab:hover {
  background: #e1dfdd;
}

.pbi-page-tab.active {
  background: #ffffff;
  color: #0078d4;
  font-weight: 600;
  border-bottom: 2px solid #0078d4;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.06);
}

/* ==========================================================================
   MENÚS CONTEXTUALES DE CLIC DERECHO (FLUENT UI CONTEXT MENU)
   ========================================================================== */

.pbi-context-menu {
  position: fixed;
  z-index: 10020;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  min-width: 230px;
  padding: 4px 0;
  font-family: var(--font-ui);
  user-select: none;
  animation: pbi-ctx-fade 0.1s ease-out;
}

@keyframes pbi-ctx-fade {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  padding: 6px 14px;
  font-size: 12px;
  color: #201f1e;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: background 0.08s ease;
}

.context-item:hover {
  background: #f3f2f1;
}

.context-item.danger {
  color: #a80000;
}

.context-item.danger:hover {
  background: #fde7e9;
  color: #a80000;
}

.context-icon {
  width: 18px;
  font-size: 13px;
  text-align: center;
  flex-shrink: 0;
}

.context-shortcut {
  margin-left: auto;
  font-size: 10.5px;
  color: #8a8886;
  font-family: var(--font-mono);
}

.context-arrow {
  margin-left: auto;
  font-size: 11px;
  color: #605e5c;
}

.context-separator {
  height: 1px;
  background: #edebe9;
  margin: 4px 0;
}

/* Submenús */
.context-item.has-submenu:hover > .pbi-submenu {
  display: flex;
}

.pbi-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -4px;
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  min-width: 210px;
  padding: 4px 0;
  flex-direction: column;
}

/* ==========================================================================
   MODO DE ENFOQUE (FOCUS MODE OVERLAY)
   ========================================================================== */

.focus-mode-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 10008;
  display: flex;
  flex-direction: column;
  animation: pbi-focus-in 0.2s ease-out;
}

@keyframes pbi-focus-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.focus-mode-header {
  height: 48px;
  background: #faf9f8;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.btn-focus-back {
  background: transparent;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0078d4;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.btn-focus-back:hover {
  background: #eff6fc;
  border-color: #0078d4;
}

.focus-mode-separator {
  color: #c8c6c4;
  font-size: 16px;
}

.focus-mode-body {
  flex: 1;
  padding: 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

/* Historial de informes: lista y comparación legibles en pantallas pequeñas. */
.report-history-dialog { width:min(940px, 94vw); max-width:940px; max-height:88vh; display:flex; flex-direction:column; }
.report-history-body { overflow:auto; padding:16px; }
.report-history-grid { display:grid; grid-template-columns:minmax(250px, 1fr) minmax(280px, 1fr); gap:18px; }
.report-history-grid section { min-width:0; }
.report-history-grid h3 { font-size:13px; margin:12px 0 8px; }
.report-history-entry { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; padding:10px; margin:6px 0; border:1px solid #dce4ed; border-radius:7px; background:#fff; }
.report-history-entry strong { display:block; font-size:12px; }
.report-history-entry small { display:block; color:#64748b; margin-top:3px; }
.report-history-entry-actions { display:flex; flex-wrap:wrap; gap:5px; justify-content:flex-end; }
.report-history-entry-actions button { border:1px solid #cbd5e1; border-radius:4px; background:#f8fafc; padding:4px 7px; cursor:pointer; font-size:11px; }
.report-history-diff, .report-history-note { border:1px solid #dce4ed; border-radius:7px; padding:10px; background:#f8fafc; font-size:12px; margin-bottom:9px; }
.report-history-diff ul { margin:7px 0 0; padding-left:18px; }
.report-history-note small { display:block; color:#64748b; margin-bottom:4px; }
#report-history-status { min-height:20px; font-size:12px; color:#9b3c00; }
#report-history-note-input { display:block; box-sizing:border-box; width:100%; margin:5px 0 8px; border:1px solid #cbd5e1; border-radius:5px; padding:8px; font:inherit; resize:vertical; }
@media (max-width:720px) { .report-history-grid { grid-template-columns:1fr; } }

.report-flow-dialog { width:min(1180px, 96vw); max-width:1180px; max-height:92vh; display:flex; flex-direction:column; }
.report-flow-body { overflow:auto; padding:16px 22px 20px; background:#f7f9fc; }
.report-flow-toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.report-flow-toolbar p { margin:0 0 10px; color:#64748b; font-size:12px; }
#report-flow-status { color:#526579; font-size:12px; margin-bottom:12px; }
.report-flow-map-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.report-flow-map-header h3, .report-flow-detail h3 { margin:3px 0 0; color:#17324d; font-size:19px; }
.report-flow-eyebrow { color:#66829c; font-size:10px; font-weight:800; letter-spacing:.09em; }
.report-flow-search-label .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.report-flow-version { flex:none; border-radius:20px; padding:6px 11px; color:#135a87; background:#e5f3fb; font-size:11px; font-weight:700; }
.report-flow-map { padding:17px; border:1px solid #d9e4ed; border-radius:14px; background:linear-gradient(160deg,#fff,#f0f7fd); }
.report-flow-main-stages { display:flex; align-items:stretch; gap:7px; overflow-x:auto; padding:3px 2px 10px; }
.report-flow-node { min-width:0; display:flex; align-items:center; gap:10px; border:1px solid #d5e2ec; border-radius:12px; background:#fff; padding:14px 11px; text-align:left; color:#23435c; cursor:pointer; box-shadow:0 2px 7px #1d527512; transition:transform .15s, border-color .15s, box-shadow .15s; }
.report-flow-main-stages .report-flow-node { flex:1 0 190px; }
.report-flow-node:hover, .report-flow-node:focus-visible { transform:translateY(-2px); border-color:#4f9acb; }
.report-flow-node.is-active { border-color:#087fba; box-shadow:0 0 0 2px #d3ecfa, 0 4px 13px #165b8424; }
.report-flow-node-icon { width:35px; height:35px; flex:none; display:grid; place-items:center; border-radius:9px; color:#096b9a; background:#e5f4fb; font-size:20px; font-weight:700; }
.report-flow-node-measures .report-flow-node-icon { color:#875a09; background:#fff4d7; }
.report-flow-node-pages .report-flow-node-icon { color:#6949a2; background:#f0eafb; }
.report-flow-node-activity .report-flow-node-icon, .report-flow-node-notes .report-flow-node-icon { color:#456779; background:#eaf0f3; }
.report-flow-node-copy { flex:1; min-width:0; }
.report-flow-node-copy strong { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.report-flow-node-copy small { display:block; margin-top:3px; color:#718397; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.report-flow-count { flex:none; border-radius:11px; background:#edf4f8; padding:3px 7px; color:#28516a; font-size:11px; font-weight:800; }
.report-flow-arrow { flex:none; align-self:center; color:#7faac3; font-size:22px; }
.report-flow-support-stages { display:flex; gap:9px; margin-top:7px; padding-top:12px; border-top:1px dashed #cbdce8; }
.report-flow-support-stages .report-flow-node { flex:1; max-width:260px; padding:10px; }
.report-flow-detail { margin-top:15px; border:1px solid #d9e4ed; border-radius:14px; background:#fff; padding:15px; }
.report-flow-detail-heading { display:flex; justify-content:space-between; align-items:end; gap:15px; margin-bottom:12px; }
.report-flow-detail-heading p { margin:3px 0 0; font-size:11px; color:#718397; }
.report-flow-search-label input { box-sizing:border-box; width:min(280px,35vw); padding:9px 11px; border:1px solid #c8d7e3; border-radius:8px; font:inherit; font-size:12px; }
.report-flow-items { min-height:160px; max-height:310px; overflow-y:auto; border:1px solid #e4ebf1; border-radius:9px; }
.report-flow-item { display:flex; align-items:flex-start; gap:12px; padding:8px 11px; border-bottom:1px solid #edf1f5; font-size:12px; }
.report-flow-item:last-child { border-bottom:0; }
.report-flow-item:nth-child(even) { background:#fafcfe; }
.report-flow-item-action { width:100%; border-top:0; border-left:0; border-right:0; background:#fff; text-align:left; cursor:pointer; font:inherit; }
.report-flow-item-action:hover, .report-flow-item-action:focus-visible { background:#f0f8fc; }
.report-flow-item-action.is-selected { background:#e8f4fb; box-shadow:inset 3px 0 #087fba; }
.report-flow-item-type { flex:none; min-width:60px; text-align:center; border-radius:10px; background:#eaf3f9; color:#245d82; padding:3px 6px; font-size:10px; font-weight:700; }
.report-flow-item strong { display:block; overflow-wrap:anywhere; color:#263e53; font-weight:600; }
.report-flow-item small { display:block; margin-top:2px; color:#708295; overflow-wrap:anywhere; }
.report-flow-empty { padding:25px; text-align:center; color:#8899a9; font-size:12px; }
.report-flow-pagination { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; color:#6f8192; font-size:11px; }
.report-flow-pagination > div { display:flex; align-items:center; gap:7px; }
.report-flow-pagination button { border:1px solid #cbdbe8; border-radius:7px; background:#f6fafc; color:#24526d; padding:6px 9px; font-size:11px; cursor:pointer; }
.report-flow-pagination button:disabled { opacity:.45; cursor:default; }
.report-flow-hint { margin:15px 0 0; padding:13px; border-radius:8px; background:#f3f8fb; color:#647f94; font-size:12px; }
.report-flow-connections { margin-top:14px; padding:15px; border:1px solid #cbdde9; border-radius:11px; background:#f7fbfe; }
.report-flow-connections-header h4 { margin:4px 0; color:#1a425e; font-size:15px; }
.report-flow-connections-header p { margin:0 0 12px; color:#70899d; font-size:11px; }
.report-flow-routes, .report-flow-connection-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.report-flow-routes > div, .report-flow-connection-column { min-width:0; padding:11px; border:1px solid #dbe7ee; border-radius:9px; background:#fff; }
.report-flow-routes strong { display:block; margin-bottom:7px; color:#355c75; font-size:11px; }
.report-flow-route { display:flex; align-items:center; flex-wrap:wrap; gap:5px; font-size:11px; }
.report-flow-route button, .report-flow-connection-row button { border:0; border-radius:6px; background:#eaf4fa; color:#12648f; padding:4px 7px; cursor:pointer; font:inherit; font-size:11px; text-align:left; overflow-wrap:anywhere; }
.report-flow-route button:hover, .report-flow-connection-row button:hover { background:#d8ecf8; }
.report-flow-unresolved { color:#8b6a2f; font-size:11px; }
.report-flow-connection-grid { margin-top:10px; }
.report-flow-connection-column h5 { margin:0 0 7px; color:#315a73; font-size:12px; }
.report-flow-connection-column h5 span { color:#738c9d; font-weight:400; }
.report-flow-connection-column p { color:#8a9ba7; font-size:11px; }
.report-flow-connection-row { display:flex; align-items:baseline; flex-wrap:wrap; gap:5px; padding:4px 0; border-bottom:1px solid #edf2f5; }
.report-flow-connection-row small { color:#8195a3; font-size:10px; }
.report-flow-show-more { margin-top:7px; border:1px solid #c3d9e7; border-radius:6px; background:#f1f8fc; color:#1d638d; padding:5px 8px; cursor:pointer; font-size:11px; }
.report-flow-warnings { margin-top:10px; padding:9px 11px; border-left:3px solid #e2a840; background:#fff9ec; color:#755925; font-size:11px; }
.report-flow-warnings ul { margin:5px 0 0; padding-left:18px; }
.report-flow-scope-toggle { display:inline-flex; border:1px solid #c9dae6; border-radius:8px; overflow:hidden; background:#eaf2f7; padding:2px; gap:2px; }
.report-flow-scope-btn { border:0; background:transparent; padding:5px 11px; border-radius:6px; font-size:11px; font-weight:600; color:#41637c; cursor:pointer; transition:all .15s ease; }
.report-flow-scope-btn:hover { color:#184260; background:#dcecf6; }
.report-flow-scope-btn.is-active { background:#fff; color:#0b618e; box-shadow:0 1px 4px #0c3d5a1a; font-weight:700; }
.report-flow-contrast-badge { display:flex; align-items:flex-start; gap:8px; margin-top:10px; padding:9px 12px; border-radius:8px; font-size:11px; }
.report-flow-contrast-badge.contrast-ok { background:#f0f9f3; border:1px solid #b7e4c7; color:#1b6338; }
.report-flow-contrast-badge.contrast-warn { background:#fff9ec; border:1px solid #f9d89c; color:#7d5918; }
.report-flow-contrast-badge span { font-weight:800; font-size:13px; line-height:1; }
.report-flow-contrast-badge strong { display:block; margin-bottom:2px; font-weight:700; }
.report-flow-contrast-badge small { display:block; font-size:10.5px; opacity:.9; }
.report-flow-impact-box { margin-top:10px; padding:11px; border-radius:8px; background:#f4f7fa; border:1px dashed #cad9e4; font-size:11px; }
.report-flow-impact-box strong { color:#224663; display:block; margin-bottom:4px; font-size:12px; }
.report-flow-impact-box p { margin:0 0 7px; color:#587185; }
.report-flow-impact-tags { display:flex; flex-wrap:wrap; gap:5px; }
.impact-tag { display:inline-flex; align-items:center; padding:3px 7px; border-radius:6px; font-size:10.5px; font-weight:600; }
.impact-tag.report-tag { background:#e5f1fb; color:#115582; border:1px solid #c2def4; }
.impact-tag.visual-tag { background:#f5eefb; color:#5b2f8e; border:1px solid #decbf4; }
/* Catálogo Semántico de Negocio y Mapa de Impacto */
.semantic-catalog-dialog { width:min(1240px, 97vw); max-width:1240px; max-height:94vh; display:flex; flex-direction:column; }
.semantic-catalog-body { overflow:auto; padding:16px 20px 20px; background:#f6f8fb; flex:1; display:flex; flex-direction:column; gap:14px; }
.semantic-catalog-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 16px; background:#fff; border:1px solid #d8e3ed; border-radius:12px; box-shadow:0 1px 4px #10324d0a; }
.semantic-toolbar-inputs { display:flex; align-items:center; gap:10px; flex:1; min-width:280px; }
.semantic-search-input { flex:1; min-width:220px; padding:8px 12px; border:1px solid #cbd8e5; border-radius:8px; font:inherit; font-size:12px; }
.semantic-filter-select { padding:8px 10px; border:1px solid #cbd8e5; border-radius:8px; font:inherit; font-size:12px; background:#fff; color:#23445d; }
.semantic-catalog-layout { display:grid; grid-template-columns:1.15fr 0.85fr; gap:14px; min-height:480px; flex:1; }
.semantic-catalog-left { display:flex; flex-direction:column; gap:10px; min-width:0; }
.semantic-catalog-right { display:flex; flex-direction:column; min-width:0; }
.semantic-terms-list { display:flex; flex-direction:column; gap:9px; overflow-y:auto; max-height:560px; padding-right:4px; }
.semantic-term-card { background:#fff; border:1px solid #dbe6ef; border-radius:11px; padding:12px 15px; display:flex; flex-direction:column; gap:7px; cursor:pointer; transition:all .15s ease; position:relative; box-shadow:0 1px 3px #1843640d; }
.semantic-term-card:hover { border-color:#0b7bb4; transform:translateY(-1px); box-shadow:0 3px 8px #0b7bb41a; }
.semantic-term-card.is-active { border-color:#087fba; background:#f4faff; box-shadow:0 0 0 2px #d3ecfa, 0 3px 9px #0c4d721f; }
.semantic-card-header { display:flex; align-items:baseline; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.semantic-card-title { font-size:13.5px; font-weight:700; color:#183750; margin:0; }
.semantic-tech-pill { font-size:10px; font-weight:700; color:#0e5884; background:#e8f4fc; border:1px solid #c7e3f6; border-radius:6px; padding:2px 7px; font-family:Consolas, monospace; }
.semantic-card-desc { font-size:11.5px; color:#5c7082; margin:0; line-height:1.4; }
.semantic-card-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:2px; font-size:10.5px; }
.semantic-synonym-tag { background:#f0f4f8; color:#36536b; padding:2px 6px; border-radius:5px; font-size:10px; border:1px solid #e1e9f0; }
.semantic-owner-badge { color:#687b8c; font-size:10.5px; display:flex; align-items:center; gap:4px; }
.semantic-area-badge { color:#6b46a0; background:#f2eefb; padding:2px 6px; border-radius:5px; font-weight:600; font-size:10px; }
.semantic-card-actions { display:flex; gap:6px; margin-top:4px; }
.semantic-mini-btn { border:1px solid #c5d7e5; background:#f7fafc; color:#1d5a7e; padding:4px 8px; border-radius:6px; font-size:10.5px; font-weight:600; cursor:pointer; }
.semantic-mini-btn:hover { background:#e8f4fc; border-color:#0b7bb4; }
.semantic-impact-panel { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; max-height:600px; box-shadow:0 1px 4px #10324d0a; }
.impact-hero-badge { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-radius:10px; font-size:11.5px; }
.impact-hero-badge.risk-alto { background:#fdf2f2; border:1px solid #f8b4b4; color:#9b1c1c; }
.impact-hero-badge.risk-medio { background:#fff8eb; border:1px solid #fbd38d; color:#975a16; }
.impact-hero-badge.risk-bajo { background:#ebf8ff; border:1px solid #bee3f8; color:#2b6cb0; }
.impact-hero-badge.risk-ninguno { background:#f0fdf4; border:1px solid #bbf7d0; color:#166534; }
.impact-hero-badge strong { font-size:13px; font-weight:800; }
.impact-section { border-top:1px dashed #dce7f0; padding-top:10px; }
.impact-section-title { font-size:11px; font-weight:700; color:#2c4c64; margin-bottom:6px; display:flex; align-items:center; justify-content:space-between; }
.impact-items-list { display:flex; flex-direction:column; gap:4px; font-size:11px; }
.impact-item-row { display:flex; align-items:center; gap:6px; padding:3px 0; color:#375267; }
.impact-item-icon { font-size:12px; }
.impact-empty-note { color:#8296a6; font-size:11px; font-style:italic; }
.impact-neighborhood-box { background:#f7fafc; border:1px solid #d5e4ef; border-radius:9px; padding:10px 12px; font-size:11px; }
.impact-neighborhood-box h6 { margin:0 0 6px; font-size:11.5px; color:#1a3d58; }
.neighborhood-badges { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.neighborhood-badge { padding:3px 7px; border-radius:6px; font-size:10px; font-weight:600; }
.neighborhood-badge.hop-center { background:#087fba; color:#fff; }
.neighborhood-badge.hop-1 { background:#e2f2fb; color:#0e5884; border:1px solid #bce1f7; }
.neighborhood-badge.hop-2 { background:#edf3f7; color:#4a6477; border:1px solid #dce6ed; }
.impact-path-box { background:#fafcfe; border:1px solid #dae7f1; border-radius:9px; padding:10px 12px; font-size:11px; margin-top:4px; }
.impact-path-route { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:6px; font-size:11px; font-weight:600; color:#0c5b89; }
@media (max-width:850px) { .semantic-catalog-layout { grid-template-columns:1fr; } }
@media (max-width:700px) { .report-flow-dialog { width:98vw; max-height:95vh; } .report-flow-body { padding:12px; } .report-flow-main-stages .report-flow-node { flex-basis:175px; } .report-flow-support-stages .report-flow-node { max-width:none; } .report-flow-detail-heading { align-items:stretch; flex-direction:column; } .report-flow-search-label input { width:100%; } .report-flow-pagination { align-items:flex-start; flex-direction:column; } .report-flow-pagination > div { flex-wrap:wrap; } }
@media (max-width:700px) { .report-flow-routes, .report-flow-connection-grid { grid-template-columns:1fr; } }

/* ==========================================================================
   Etapa 4: Creador de Medidas sin Código
   ========================================================================== */
.no-code-measure-dialog { width:min(1160px, 97vw); max-width:1160px; max-height:94vh; display:flex; flex-direction:column; }
.no-code-measure-body { overflow:auto; padding:16px 20px 20px; background:#f6f8fb; flex:1; display:flex; flex-direction:column; gap:14px; }
.no-code-nl-box { background:#fff; border:1px solid #cfe0ed; border-radius:12px; padding:12px 16px; box-shadow:0 1px 4px #10324d0a; display:flex; flex-direction:column; gap:8px; }
.no-code-nl-input { flex:1; padding:8px 12px; border:1px solid #cbd8e5; border-radius:8px; font:inherit; font-size:12.5px; }
.no-code-nl-input:focus { outline:none; border-color:#0284c7; box-shadow:0 0 0 3px #0284c71a; }
.no-code-nl-feedback { font-size:11px; padding:6px 10px; border-radius:6px; background:#e8f4fc; color:#0c5b89; border:1px solid #bce1f7; }
.no-code-main-layout { display:grid; grid-template-columns:1.25fr 0.75fr; gap:16px; flex:1; min-height:460px; }
.no-code-left-col { display:flex; flex-direction:column; gap:12px; min-width:0; }
.no-code-right-col { display:flex; flex-direction:column; gap:12px; min-width:0; }
.no-code-templates-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); gap:8px; max-height:200px; overflow-y:auto; padding:2px; }
.no-code-template-card { background:#fff; border:1px solid #d5e2ed; border-radius:10px; padding:10px 12px; cursor:pointer; transition:all .15s ease; display:flex; flex-direction:column; gap:4px; text-align:left; box-shadow:0 1px 2px #0c385808; }
.no-code-template-card:hover { border-color:#0b7bb4; transform:translateY(-1px); box-shadow:0 3px 8px #0b7bb41a; }
.no-code-template-card.is-active { border-color:#0284c7; background:#f0f9ff; box-shadow:0 0 0 2px #bae6fd; }
.no-code-template-icon { font-size:18px; margin-bottom:2px; }
.no-code-template-title { font-size:12px; font-weight:700; color:#183247; line-height:1.2; }
.no-code-template-desc { font-size:10px; color:#607385; line-height:1.3; }
.no-code-badge { font-size:10.5px; font-weight:700; color:#0284c7; background:#e0f2fe; padding:2px 8px; border-radius:6px; border:1px solid #bae6fd; }
.no-code-params-box { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:14px 16px; box-shadow:0 1px 3px #0c385808; display:flex; flex-direction:column; }
.no-code-preview-card { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:16px; box-shadow:0 1px 4px #10324d0a; display:flex; flex-direction:column; gap:4px; text-align:center; }
.no-code-kpi-value { font-size:32px; font-weight:800; color:#0f2e4c; font-variant-numeric:tabular-nums; margin:6px 0; }
.no-code-explanation-box { background:#fbfcfe; border:1px solid #d7e4ed; border-radius:10px; padding:12px 14px; }
.no-code-dax-drawer { background:#1e293b; color:#e2e8f0; border-radius:9px; padding:10px 12px; font-family:Consolas, monospace; font-size:11px; }
.no-code-dax-code { display:block; color:#38bdf8; word-break:break-all; white-space:pre-wrap; }
@media (max-width:850px) { .no-code-main-layout { grid-template-columns:1fr; } }

/* ==========================================================================
   Etapa 5: Asistente y Creador de Visuales Guiados
   ========================================================================== */
.guided-visual-dialog { width:min(1200px, 98vw); max-width:1200px; max-height:94vh; display:flex; flex-direction:column; }
.guided-visual-body { overflow:auto; padding:16px 20px 20px; background:#f6f8fb; flex:1; display:flex; flex-direction:column; gap:14px; }
.guided-visual-nl-box { background:#fff; border:1px solid #cfe0ed; border-radius:12px; padding:12px 16px; box-shadow:0 1px 4px #10324d0a; display:flex; flex-direction:column; gap:8px; }
.guided-visual-nl-feedback { font-size:11px; padding:7px 11px; border-radius:6px; background:#e8f4fc; color:#0c5b89; border:1px solid #bce1f7; line-height:1.4; }
.guided-visual-main-layout { display:grid; grid-template-columns:1.2fr 0.8fr; gap:16px; flex:1; min-height:480px; }
.guided-visual-left-col { display:flex; flex-direction:column; gap:12px; min-width:0; }
.guided-visual-right-col { display:flex; flex-direction:column; gap:12px; min-width:0; }
.guided-visual-fields-box { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:12px 16px; box-shadow:0 1px 3px #0c385808; }
.guided-visual-cards-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:9px; max-height:220px; overflow-y:auto; padding:2px; }
.guided-visual-card { background:#fff; border:1px solid #d6e3ee; border-radius:10px; padding:10px 12px; cursor:pointer; transition:all .15s ease; display:flex; flex-direction:column; gap:4px; text-align:left; box-shadow:0 1px 2px #0c385808; position:relative; }
.guided-visual-card:hover { border-color:#0284c7; transform:translateY(-1px); box-shadow:0 3px 8px #0284c71a; }
.guided-visual-card.is-active { border-color:#0284c7; background:#f0f9ff; box-shadow:0 0 0 2px #bae6fd; }
.guided-visual-card-header { display:flex; justify-content:space-between; align-items:center; }
.guided-visual-card-title { font-size:12px; font-weight:700; color:#183247; line-height:1.2; }
.guided-visual-card-badge { font-size:9.5px; font-weight:700; padding:1px 6px; border-radius:5px; }
.guided-visual-card-badge.badge-top { background:#e0f2fe; color:#0369a1; border:1px solid #bae6fd; }
.guided-visual-card-badge.badge-alt { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }
.guided-visual-card-desc { font-size:10px; color:#5b7184; line-height:1.3; }
.guided-visual-params-box { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:12px 16px; box-shadow:0 1px 3px #0c385808; }
.guided-visual-preview-card { background:#fff; border:1px solid #d8e4ee; border-radius:12px; padding:14px; box-shadow:0 1px 4px #10324d0a; display:flex; flex-direction:column; gap:8px; min-height:180px; }
.guided-visual-chart-box { height:150px; width:100%; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.guided-visual-reason-card { background:#fbfcfe; border:1px solid #d7e4ed; border-radius:10px; padding:12px 14px; }
.guided-visual-why-box { background:#fefce8; border:1px solid #fef08a; border-radius:10px; padding:10px 12px; }
.guided-visual-provenance-box { background:#f4f8fb; border:1px solid #dbe6ef; border-radius:10px; padding:10px 12px; }
@media (max-width:850px) { .guided-visual-main-layout { grid-template-columns:1fr; } }

/* ==========================================================================
   Etapa 6: Colaboración Completa (Presencia, Comentarios y Resolución de Conflictos)
   ========================================================================== */

/* Barra de Presencia en Cabecera */
.collab-presence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #d0d7de;
  border-radius: 20px;
  padding: 3px 10px 3px 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.collab-avatar-stack {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
}

.collab-avatar-stack .collab-avatar {
  margin-left: -8px;
  transition: transform 0.15s ease, z-index 0.15s ease;
}

.collab-avatar-stack .collab-avatar:hover {
  transform: scale(1.15) translateY(-2px);
  z-index: 10;
}

.collab-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  position: relative;
}

.collab-avatar.status-editing {
  outline: 2px solid #f59e0b;
}

.collab-summary-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  padding: 0;
}

.collab-summary-pill:hover {
  color: #111827;
}

.collab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  display: inline-block;
}

.collab-dot.live {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-collab-dot 2s infinite;
}

@keyframes pulse-collab-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Indicador de colaborador activo en el widget */
.widget-collab-active {
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: fadeIn 0.2s ease;
}

/* Botón de comentarios en el widget */
.widget-comment-btn {
  position: relative;
}

.widget-comment-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  border-radius: 7px;
  text-align: center;
  display: none;
}

.widget-comment-badge.has-comments {
  display: inline-block;
}

/* Modal de Comentarios y Decisiones */
.comments-modal-dialog {
  width: min(720px, 95vw);
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.comments-modal-body {
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  background: #f8fafc;
  overflow: hidden;
  gap: 12px;
  flex: 1;
}

.collab-badge {
  font-size: 11px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #bae6fd;
}

.comments-filter-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.comments-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.comments-filter-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.comments-filter-btn.is-active {
  background: #fff;
  color: #0284c7;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comments-thread-list {
  flex: 1;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.comment-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease;
}

.comment-card.is-decision {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
}

.comment-card.is-resolved {
  opacity: 0.75;
  background: #f8fafc;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-author-name {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.comment-role-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
}

.comment-date {
  font-size: 11px;
  color: #94a3b8;
}

.comment-target-tag {
  font-size: 10.5px;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.comment-decision-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #fde68a;
}

.comment-body {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.comment-action-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-action-btn:hover {
  color: #0284c7;
}

.comments-composer {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comments-composer-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 54px;
  box-sizing: border-box;
}

.comments-textarea:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.comments-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-decision-checkbox {
  font-size: 11.5px;
  font-weight: 600;
  color: #854d0e;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Modal de Resolución de Conflictos */
.conflict-modal-dialog {
  width: min(840px, 96vw);
  max-width: 840px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.conflict-modal-body {
  padding: 16px 20px 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.conflict-banner {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 10px 14px;
}

.conflict-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.conflict-col {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conflict-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.col-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.col-tag.server {
  background: #fee2e2;
  color: #b91c1c;
}

.col-tag.local {
  background: #e0f2fe;
  color: #0369a1;
}

.conflict-changes-box {
  min-height: 80px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 11.5px;
  color: #334155;
  line-height: 1.4;
}

.conflict-changes-box ul {
  margin: 0;
  padding-left: 18px;
}

.conflict-changes-box li {
  margin-bottom: 4px;
}

.conflict-decisions-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.conflict-decisions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conflict-item-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.conflict-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.conflict-item-options {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
}

.conflict-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
@media (max-width:850px) { .guided-visual-main-layout { grid-template-columns:1fr; } }

/* ============================================================================
 * Agente Piloto de Cálculos y Métricas (Etapa 7)
 * ============================================================================ */
.calc-agent-dialog {
  width: min(880px, 96vw);
  max-width: 880px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.calc-agent-role-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 2px 8px;
}

.calc-agent-body {
  overflow-y: auto;
  padding: 16px 20px 20px;
  background: #f8fafc;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-agent-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}

.calc-agent-perms-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #475569;
  font-weight: 500;
}

.calc-agent-mode-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-agent-input-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.calc-agent-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 640px) {
  .calc-agent-body { padding: 12px; }
  .calc-agent-input-row { flex-direction: column; align-items: stretch; }
  .calc-agent-input-row > * { width: 100%; min-width: 0; }
  .calc-agent-toolbar > * { max-width: 100%; }
}

.calc-agent-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.calc-agent-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font-size: 11px;
  color: #334155;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calc-agent-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.calc-agent-output-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.2s ease;
}

.calc-agent-verif-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 8px;
  border-radius: 6px;
}

.calc-agent-dax-box {
  background: #0f172a;
  color: #38bdf8;
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 7px;
  overflow-x: auto;
  border: 1px solid #1e293b;
  position: relative;
}

.calc-agent-dax-box .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 4px;
  font-size: 10.5px;
  padding: 2px 6px;
  cursor: pointer;
}

.calc-agent-dax-box .copy-btn:hover {
  background: #334155;
  color: #f8fafc;
}

.calc-agent-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.calc-agent-stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
}

.calc-agent-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.calc-agent-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.calc-agent-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.calc-agent-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.calc-agent-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  transition: border-color 0.15s ease;
}

.calc-agent-task-row:hover {
  border-color: #cbd5e1;
}

.calc-agent-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.calc-agent-status-badge.proposed { background: #e0f2fe; color: #0284c7; }
.calc-agent-status-badge.applied { background: #dcfce7; color: #16a34a; }
.calc-agent-status-badge.rolled_back { background: #f1f5f9; color: #64748b; }
.calc-agent-status-badge.rejected { background: #fee2e2; color: #dc2626; }
.calc-agent-status-badge.failed { background: #fee2e2; color: #dc2626; }

/* --------------------------------------------------------------------------
   Coordinador General de Proyecto y Tareas Encadenadas (Etapa 8)
   -------------------------------------------------------------------------- */
.coord-dialog {
  max-width: 880px;
  width: 92%;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.coord-role-pill {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #c4b5fd;
}

.coord-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 82vh;
  overflow-y: auto;
}

.coord-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}

.coord-perms-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
}

.coord-lock {
  font-size: 14px;
}

.coord-mode-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coord-input-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.coord-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.coord-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.coord-chip {
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  color: #6b21a8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.coord-chip:hover {
  background: #e9d5ff;
  border-color: #c084fc;
}

.coord-graph-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

.coord-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.coord-status-badge.pending { background: #f1f5f9; color: #64748b; }
.coord-status-badge.running { background: #e0f2fe; color: #0284c7; }
.coord-status-badge.paused { background: #fef3c7; color: #b45309; }
.coord-status-badge.completed { background: #dcfce7; color: #16a34a; }
.coord-status-badge.failed { background: #fee2e2; color: #dc2626; }
.coord-status-badge.rolled_back { background: #f1f5f9; color: #64748b; }

.coord-dag-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.coord-dag-card {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.2s ease;
}

.coord-dag-card.running {
  border-color: #a855f7;
  background: #f5f3ff;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.coord-dag-card.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.coord-dag-card.requires_decision {
  background: #fffbeb;
  border-color: #fcd34d;
}

.coord-dag-card.rejected {
  background: #fef2f2;
  border-color: #fca5a5;
}

.coord-dag-card.rolled_back {
  background: #f8fafc;
  border-color: #cbd5e1;
  opacity: 0.8;
}

.coord-dag-step-badge {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #7c3aed;
}

.coord-dag-card.completed .coord-dag-step-badge {
  color: #16a34a;
}

.coord-dag-card.requires_decision .coord-dag-step-badge {
  color: #d97706;
}

.coord-dag-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.3;
}

.coord-dag-desc {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.3;
}

.coord-dag-agent {
  font-size: 10px;
  color: #9333ea;
  font-weight: 600;
  margin-top: auto;
}

.coord-decision-section {
  margin-top: 2px;
}

.coord-decision-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
}

.coord-decision-actions {
  display: flex;
  gap: 8px;
}

.coord-resumption-section {
  margin-top: 2px;
}

.coord-resumption-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 14px;
}

.coord-resumption-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.coord-delta-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.coord-delta-stat-pill {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.coord-lineage-deltas-list {
  font-size: 11px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 4px;
}

.coord-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

/* --------------------------------------------------------------------------
   Servicio y Automatización (Etapa 9)
   -------------------------------------------------------------------------- */
.service-auto-dialog {
  max-width: 880px;
  width: 92%;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.service-auto-role-pill {
  background: #dcfce7;
  color: #15803d;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #86efac;
}

.service-auto-tabs-nav {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 12px;
  gap: 4px;
}

.service-auto-tab-btn {
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.service-auto-tab-btn:hover {
  color: #0f172a;
}

.service-auto-tab-btn.active {
  color: #15803d;
  border-bottom-color: #16a34a;
  font-weight: 700;
}

.service-auto-body {
  padding: 16px 20px;
  max-height: 76vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-auto-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-auto-pane.hidden {
  display: none !important;
}

.service-auto-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.service-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.service-status-badge.published { background: #dcfce7; color: #15803d; }
.service-status-badge.not-published { background: #f1f5f9; color: #64748b; }
.service-status-badge.has-changes { background: #fef3c7; color: #b45309; }
.service-status-badge.revoked { background: #fee2e2; color: #dc2626; }

.service-auto-version-compare {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: #334155;
}

.service-schedule-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.service-surveillance-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.service-anomaly-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
}

.service-anomaly-card.critical {
  border-left-color: #ef4444;
  background: #fff5f5;
}

.service-anomaly-card.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.service-fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.service-fabric-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-auto-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* --------------------------------------------------------------------------
   Pasarela Multi-IA y Conectores de Agentes por API (Etapa 10)
   -------------------------------------------------------------------------- */
.ai-modal-dialog {
  max-width: 960px;
  width: 94%;
  border-radius: 10px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.ai-role-pill {
  background: #f3e8ff;
  color: #7e22ce;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #d8b4fe;
}

.ai-body-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  padding: 16px 20px;
  max-height: 75vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .ai-body-grid {
    grid-template-columns: 1fr;
  }
}

.ai-providers-panel, .ai-form-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-providers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

.ai-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.ai-card.active-default {
  border-color: #a855f7;
  background: #faf5ff;
}

.ai-type-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ai-type-pill.ollama { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; }
.ai-type-pill.openai { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.ai-type-pill.anthropic { background: #fed7aa; color: #c2410c; border: 1px solid #fdba74; }
.ai-type-pill.gemini { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.ai-type-pill.deepseek { background: #e0e7ff; color: #4338ca; border: 1px solid #a5b4fc; }
.ai-type-pill.custom { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.ai-template-selector-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.ai-local-help { margin:7px 0 0; padding:8px 10px; border:1px solid #c9e8d5; border-radius:7px; background:#f0faf4; color:#205b3b; font-size:11px; line-height:1.45; }
.ai-local-help code { white-space:normal; overflow-wrap:anywhere; font-size:11px; }
.dashboard-ai-preview-dialog { position:fixed; inset:0; margin:auto; box-sizing:border-box; width:min(1000px,94vw); max-height:90vh; overflow:auto; padding:22px; border:1px solid #cbd8e8; border-radius:14px; color:#172b4d; box-shadow:0 24px 70px #091c3b66; }
.dashboard-ai-preview-dialog::backdrop { background:#0a1b35aa; }
.dashboard-ai-preview-dialog h2 { margin:0 0 5px; font-size:18px; }
.dashboard-ai-preview-dialog p { color:#526983; font-size:12px; }
.dashboard-ai-preview-data-note { padding:8px 10px; border:1px solid #c9ddeb; border-radius:7px; background:#eef7ff; color:#244e6c !important; }
.dashboard-ai-preview-body { display:grid; gap:13px; max-height:60vh; overflow:auto; }
.dashboard-ai-page-preview { padding:12px; border:1px solid #dae5f2; border-radius:10px; background:#f7faff; }
.dashboard-ai-page-preview h3 { margin:0 0 10px; font-size:13px; }
.dashboard-ai-preview-grid { position:relative; width:100%; border:1px dashed #adc2da; border-radius:7px; background:repeating-linear-gradient(90deg,#f8fbff,#f8fbff calc(100% / 12 - 1px),#e5edf7 calc(100% / 12 - 1px),#e5edf7 calc(100% / 12)); }
.dashboard-ai-preview-card { position:absolute; box-sizing:border-box; display:flex; flex-direction:column; gap:4px; padding:9px; border:1px solid #bfcee0; border-radius:7px; background:#fff; overflow:hidden; overflow-wrap:anywhere; }
.dashboard-ai-preview-visual { flex:1; min-height:0; width:100%; overflow:hidden; pointer-events:none; font-size:10px; }
.dashboard-ai-preview-card strong { font-size:11px; }
.dashboard-ai-preview-card small { color:#60758c; font-size:10px; }
.dashboard-ai-preview-warning { padding:10px 12px; border:1px solid #e6c778; border-radius:8px; background:#fff9e8; color:#6f4c08; font-size:12px; }
.dashboard-ai-preview-warning ul { margin:6px 0 0; padding-left:18px; }
.dashboard-ai-preview-error { padding:12px; border:1px solid #df9c9c; border-radius:8px; background:#fff1f1; color:#8b1c1c !important; font-size:13px !important; }
.dashboard-ai-visual-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:6px 12px; margin:12px 0 0; padding:0; list-style:none; }
.dashboard-ai-visual-list li { display:flex; flex-direction:column; gap:2px; padding:7px 9px; border:1px solid #e0e9f4; border-radius:6px; background:#fff; font-size:11px; }
.dashboard-ai-visual-list span { color:#5e7188; overflow-wrap:anywhere; }
.dashboard-ai-preview-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:18px; }
.dashboard-ai-preview-actions button { padding:8px 13px; border:1px solid #a9c7e8; border-radius:7px; background:#fff; color:#164b80; cursor:pointer; }
.dashboard-ai-preview-actions #dashboard-ai-apply { border-color:#1269bc; background:#1269bc; color:#fff; }
.dashboard-ai-preview-actions button:disabled { opacity:.5; cursor:default; }
.ai-process-dialog { width:min(560px,94vw); }
.ai-process-options { display:grid; gap:9px; margin:20px 0 12px; }
.ai-process-options label { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid #cbd8e8; border-radius:9px; cursor:pointer; }
.ai-process-options label:has(input:checked) { border-color:#1269bc; background:#eef7ff; }
.ai-process-options label span { display:grid; gap:3px; }
.ai-process-options small { color:#526983; }

.ai-template-chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s ease;
}

.ai-template-chip:hover {
  border-color: #9333ea;
  color: #9333ea;
  background: #faf5ff;
}

.ai-test-result {
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-test-result.success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

.ai-test-result.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}









.pbi-page-tab.delegation-readonly { opacity: .66; }
.pbi-page-tab.delegation-readonly::after { content: ' 🔒'; font-size: 10px; }

/* Informe y Power Query: jerarquía visual del espacio de trabajo. */
.report-view-container { background: #e9eff7 !important; }
.canvas-scroll-area { padding: 24px !important; }
.dashboard-grid {
  border-color: #cbd8e8;
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(24, 49, 83, .1), 0 2px 8px rgba(24, 49, 83, .06);
}
.pbi-widget {
  border-color: #dce6f2;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(29, 54, 88, .07);
}
.pbi-widget:hover {
  border-color: #8bb8eb;
  box-shadow: 0 10px 26px rgba(29, 54, 88, .14);
}
.pbi-widget .widget-header {
  min-height: 50px;
  padding: 11px 14px 8px;
  background: #fff;
  border-bottom-color: #edf2f8;
}
.pbi-widget .widget-title { font-size: 13px; font-weight: 700; color: #172b4d; }
.pbi-widget .widget-subtitle { font-size: 11px; color: #64748b; }
.pbi-widget .widget-content { padding: 10px 14px 14px; }
.pbi-widget .widget-btn { min-width: 26px; min-height: 26px; border-radius: 6px; }
.pbi-widget .widget-btn:hover { background: #eaf3ff; color: #0755ae; }
.pbi-pages-bar { min-height: 42px; height: 42px; padding: 0 14px; gap: 5px; background: #fff; border-top-color: #dce6f2; }
.pbi-page-tab { padding: 9px 14px; border-radius: 7px 7px 0 0; }
.pbi-page-tab.active { color: #075bd6; border-bottom-color: #075bd6; box-shadow: none; }
.pbi-right-panes { background: #f5f8fc; border-left-color: #dce6f2; }
.pbi-right-panes > .pane-section { border-right-color: #dce6f2; }
.pane-header { background: #f5f8fc; color: #172b4d; font-weight: 700; border-bottom: 1px solid #dce6f2; }
.report-filters-content { background: #fff; }
.report-filter-card { border-color: #dce6f2; border-radius: 8px; background: #f8fbff; }
.report-filter-add { border-color: #a8bfdc; border-radius: 7px; color: #315577; }

.power-query-modal { background: #edf3fa; }
.power-query-modal .pq-titlebar {
  height: 44px;
  padding: 0 18px;
  background: #f8fbff;
  border-bottom-color: #d7e3f0;
}
.power-query-modal .pq-menubar { height: 38px; padding: 0 14px; border-bottom-color: #d7e3f0; }
.power-query-modal .pq-menu-item.active { color: #075bd6; border-bottom-color: #075bd6; }
.power-query-modal .pq-formula-row {
  margin: 8px 14px;
  border: 1px solid #c9d9ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 49, 83, .04);
}
.power-query-modal .pq-cleaning-panel { margin: 0 14px 8px; border: 1px solid #bdd7f4; border-radius: 9px; }
.power-query-modal .pq-body { gap: 10px; padding: 0 14px 12px; background: #edf3fa; }
.power-query-modal .pq-left-queries,
.power-query-modal .pq-center-grid,
.power-query-modal .pq-right-steps {
  min-height: 0;
  border: 1px solid #d6e3f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(24, 49, 83, .05);
  overflow: hidden;
}
.power-query-modal .pq-left-queries { width: 250px; }
.power-query-modal .pq-right-steps { width: 270px; }
.power-query-modal .pq-left-queries.is-collapsed,
.power-query-modal .pq-right-steps.is-collapsed { width: 38px; }
.power-query-modal .pq-queries-header,
.power-query-modal .pq-settings-header { min-height: 38px; height: 38px; padding: 0 12px; background: #f5f9ff; border-bottom-color: #dce6f2; color: #172b4d; font-weight: 700; }
.power-query-modal .pq-query-item,
.power-query-modal .pq-tree-query { border-radius: 7px; }
.power-query-modal .pq-query-item.active,
.power-query-modal .pq-tree-query.active { background: #e8f2ff; border-color: #a9cdf8; color: #064da0; box-shadow: inset 3px 0 #0874ef; outline: none; }
.power-query-modal .pq-prop-section { padding: 14px; border-bottom-color: #e5edf6; }
.power-query-modal .pq-steps-section { padding: 14px; }
.power-query-modal .pq-step-row,
.power-query-modal .pq-step-item { min-height: 32px; border-radius: 7px; }
.power-query-modal .pq-step-row.active,
.power-query-modal .pq-step-item.active { background: #e8f2ff; border-color: #a9cdf8; color: #064da0; box-shadow: inset 3px 0 #0874ef; }
.power-query-modal .pq-table th { background: #f2f7fe; border-bottom-color: #c8d9eb; }
.power-query-modal .pq-table td { height: 28px; border-bottom-color: #e8eef5; }
.power-query-modal .pq-table tbody tr:nth-child(even) td { background: #f9fbfe; }
.power-query-modal .pq-table tbody tr:hover td { background: #eaf3ff; }
.power-query-modal .pq-table td.selected-col { background: #e8f2ff; }

@media (max-width: 1100px) {
  .canvas-scroll-area { padding: 12px !important; }
  .power-query-modal .pq-body { gap: 6px; padding: 0 8px 8px; }
  .power-query-modal .pq-left-queries { width: 205px; }
  .power-query-modal .pq-right-steps { width: 220px; }
}
@media print {
  .dashboard-grid, .pbi-widget { box-shadow: none !important; }
}

/* Centro de colaboración abierto desde el indicador de presencia. */
.collab-summary-pill:focus-visible { outline: 2px solid #4d9aff; outline-offset: 4px; border-radius: 5px; }
.collaboration-dialog { width: min(900px, 100%); border-radius: 16px; }
.collaboration-layout { display: grid; grid-template-columns: 132px minmax(0,1fr); min-height: 450px; max-height: min(78vh,760px); }
.collaboration-nav { display: flex; flex-direction: column; gap: 7px; padding: 18px 10px; background: #e7effa; border-right: 1px solid #d2e0f0; }
.collaboration-nav button { border: 0; border-radius: 9px; padding: 11px 13px; text-align: left; color: #284b73; background: transparent; font: 700 12px var(--font-ui); cursor: pointer; }
.collaboration-nav button.active { background: #fff; color: #075bd6; box-shadow: 0 2px 9px #b9cee873; }
.collaboration-header { padding: 20px 24px; background: linear-gradient(110deg, #152d51, #23508a); color: #fff; }
.collaboration-header h2 { margin: 0; font-size: 19px; }
.collaboration-header p { margin: 5px 0 0; font-size: 12px; color: #d9e8fa; }
.collaboration-header .btn-close-modal { color: #fff; }
.collaboration-body { min-width: 0; overflow-y: auto; padding: 20px 24px 24px; background: #f3f7fc; display: grid; align-content: start; gap: 14px; }
.collaboration-search { width: 100%; margin-top: 12px; min-height: 38px; }
.collaboration-table-wrap { overflow: auto; max-height: 260px; margin-top: 9px; border: 1px solid #dce6f2; border-radius: 9px; }
.collaboration-table { width: 100%; min-width: 570px; border-collapse: collapse; font-size: 11px; }
.collaboration-table th { position: sticky; top: 0; z-index: 1; background: #eef5ff; color: #284b73; text-align: left; padding: 9px; }
.collaboration-table td { padding: 9px; border-top: 1px solid #e5edf6; color: #173c68; }
.collaboration-table td small { display: block; color: #687c97; margin-top: 2px; }
.collaboration-table tbody tr { cursor: pointer; }
.collaboration-table tbody tr:hover, .collaboration-table tbody tr.selected { background: #e7f1ff; }
.collaboration-table tbody tr.pending td:first-child::before { content: '• '; color: #ed8b16; }
.collaboration-person-preview { margin-top: 12px; padding: 12px 14px; border: 1px solid #bbd7f2; border-radius: 9px; background: #f4f9ff; color: #173c68; }
.collaboration-person-preview:empty { display: none; }
.collaboration-person-preview > strong { display: block; margin-bottom: 9px; font-size: 12px; }
.collaboration-preview-grid { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 6px 12px; margin: 0; font-size: 11px; }
.collaboration-preview-grid dt { font-weight: 700; color: #496782; }
.collaboration-preview-grid dd { margin: 0; overflow-wrap: anywhere; }
.collaboration-person-preview p { margin: 10px 0 0; font-size: 10px; color: #5f7490; }
.pbi-right-panes.theme-panel-hidden { display: none; }
.report-view-drawer.theme-mode { flex: 0 0 360px; width: 360px; position: relative; right: auto; top: auto; bottom: auto; box-shadow: none; }
.report-view-drawer.theme-mode .report-view-drawer-body { padding: 14px; }
.theme-panel-intro { margin: 0 0 14px; color: #56708b; font-size: 11px; line-height: 1.45; }
.theme-panel-section { margin: 0 0 10px; border: 1px solid #d5e3f1; border-radius: 9px; background: #fff; overflow: hidden; }
.theme-panel-section summary { padding: 11px 12px; cursor: pointer; color: #173c68; font-size: 12px; font-weight: 700; background: #f5f9fe; }
.theme-panel-section-body { padding: 10px 12px 12px; }
.theme-panel-section-target { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 7px; color: #365473; font-size: 10px; }
.theme-panel-section-target code { display: inline-block; margin-top: 3px; padding: 2px 4px; border-radius: 4px; background: #eaf2fc; color: #0753ad; overflow-wrap: anywhere; }
.theme-panel-section-target button { flex: none; padding: 5px 6px; border: 1px solid #a9c7e8; border-radius: 5px; background: #fff; color: #0753ad; font-size: 10px; cursor: pointer; }
.theme-panel-section-target button:disabled { opacity: .5; cursor: default; }
.theme-panel-section-body p { margin: 0 0 8px; color: #657b93; font-size: 10px; line-height: 1.4; }
.theme-panel-section textarea { box-sizing: border-box; width: 100%; min-height: 116px; padding: 9px; border: 1px solid #b9cde4; border-radius: 6px; font: 11px/1.5 Consolas, monospace; resize: vertical; background: #fbfdff; color: #193a5e; }
.theme-panel-section textarea:focus { outline: 2px solid #7eb7eb; border-color: #1870c6; }
.theme-panel-section textarea:disabled { opacity: .6; }
.report-canvas-chat { display: flex; flex: 1; flex-direction: column; box-sizing: border-box; min-height: 0; padding: 4px; gap: 9px; font-size: 12px; line-height: 1.4; }
.report-canvas-chat-feed { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; }
.report-canvas-chat-welcome { margin: 0; color: #315477; }
.report-canvas-chat-bubble { max-width: 90%; margin: 0; padding: 8px 10px; border-radius: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-canvas-chat-bubble.user { align-self: flex-end; background: #e2f0ff; color: #174267; }
.report-canvas-chat-bubble.assistant { align-self: flex-start; background: #f1f5fa; color: #243e58; }
.report-canvas-chat-form { display: flex; gap: 6px; }
.report-canvas-chat-form input { flex: 1; min-width: 0; padding: 8px; border: 1px solid #b8cadc; border-radius: 7px; font: inherit; }
.report-canvas-chat-form button, .report-canvas-chat-choices button { border: 1px solid #9dbbda; border-radius: 7px; background: #fff; color: #124f8a; cursor: pointer; font: inherit; padding: 7px 9px; }
.report-canvas-chat-form button { background: #0b63b6; border-color: #0b63b6; color: #fff; }
.report-canvas-chat-choices { display: flex; flex-wrap: wrap; gap: 6px; max-height: 44%; overflow-y: auto; }
.report-canvas-chat-choices > select { flex: 1 1 100%; min-width: 0; padding: 7px; border: 1px solid #b8cadc; border-radius: 7px; background: #fff; color: #243e58; font: inherit; }
.report-canvas-chat-choices > div:not(.report-canvas-chat-question) { flex: 1 1 100%; }
.report-canvas-chat-question { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.report-canvas-chat-filter { display: flex; flex-direction: column; gap: 3px; color: #315477; }
.report-canvas-chat-filter select, .report-canvas-chat-filter input { min-width: 0; width: 100%; box-sizing: border-box; padding: 7px; border: 1px solid #b8cadc; border-radius: 7px; background: #fff; color: #243e58; font: inherit; }
.report-canvas-chat-note { margin: 0; color: #677d92; }
.visual-editor-field textarea { width: 100%; box-sizing: border-box; border: 1px solid #b9cde4; border-radius: 6px; padding: 7px; font: 11px/1.4 Consolas,monospace; resize: vertical; }
.chat-question-editor { border: 1px solid #d5e3f1; border-radius: 7px; padding: 8px; margin: 8px 0; background: #fbfdff; }
.chat-measure-suggestions:not([hidden]) { display: grid; gap: 2px; max-height: 180px; overflow-y: auto; padding: 4px; margin-top: 4px; border: 1px solid #adc9e3; border-radius: 6px; background: #fff; box-shadow: 0 5px 14px #183b5c24; }
.chat-measure-suggestions button { width: 100%; padding: 7px; border: 0; border-radius: 4px; background: transparent; color: #173c66; text-align: left; cursor: pointer; }
.chat-measure-suggestions button:hover, .chat-measure-suggestions button:focus-visible { background: #e7f2ff; }
.chat-measure-suggestions span { padding: 7px; color: #66788c; font-size: 11px; }
.chat-question-editor > button, .chat-question-add { border: 1px solid #adc9e3; border-radius: 5px; background: #fff; color: #155b98; cursor: pointer; padding: 6px 9px; font-size: 11px; }
.chat-question-editor > button { margin-top: 6px; }
.theme-panel-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 0; }
.theme-panel-actions button { padding: 8px 10px; border: 1px solid #a9c7e8; border-radius: 7px; background: #fff; color: #164b80; font-size: 11px; font-weight: 700; cursor: pointer; }
.theme-panel-actions button.primary { background: #0b66d9; border-color: #0b66d9; color: #fff; }
.theme-panel-actions button:disabled { opacity: .5; cursor: default; }
.theme-panel-status { min-height: 18px; color: #a4262c; font-size: 11px; }
@media (max-width: 700px) { .report-view-drawer.theme-mode { position: absolute; z-index: 50; right: 0; top: 0; bottom: 0; width: min(360px, 92vw); box-shadow: -8px 0 25px #173a5a26; } }
.image-visual { display: grid; grid-template-rows: minmax(0,1fr) auto; height: 100%; min-height: 0; gap: 8px; }
.image-visual-grid { min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); gap: 10px; align-content: start; }
.image-visual-grid.single { grid-template-columns: minmax(0,1fr); height: 100%; }
.image-visual figure { margin: 0; min-width: 0; border: 1px solid #dce6f2; border-radius: 8px; overflow: hidden; background: #f8fbff; }
.image-visual-grid.single figure { height: 100%; display: grid; grid-template-rows: minmax(0,1fr) auto; }
.image-visual img { display: block; width: 100%; height: 120px; object-fit: contain; }
.image-visual-grid.single img { height: 100%; min-height: 0; }
.image-visual figcaption { padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #365473; font-size: 11px; }
.image-visual-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #526781; font-size: 11px; }
.image-visual-pager button { padding: 5px 9px; border: 1px solid #b9cee8; border-radius: 6px; background: #fff; color: #0b5ab2; cursor: pointer; }
.image-visual-pager button:disabled { opacity: .45; cursor: default; }
.collaboration-agent-person { padding: 12px 0; border-top: 1px solid #e5edf6; }
.collaboration-agent-person strong { display: block; margin-bottom: 10px; font-size: 12px; color: #172b4d; }
.collaboration-agent-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.collaboration-agent-grid label { display: grid; gap: 5px; font-size: 11px; color: #365473; }
.collaboration-agent-grid select { min-width: 0; }
.collaboration-chat-messages { min-height: 90px; max-height: 240px; overflow: auto; margin: 10px 0; padding: 10px; border: 1px solid #dce6f2; border-radius: 8px; background: #f9fbff; font-size: 12px; white-space: pre-wrap; }
.collaboration-chat-compose { display: flex; gap: 8px; }
.collaboration-chat-compose input { min-width: 0; flex: 1; }
.collaboration-section { padding: 18px; border: 1px solid #dce6f2; border-radius: 12px; background: #fff; box-shadow: 0 3px 14px rgba(29, 54, 88, .05); }
.collaboration-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.collaboration-section-heading h3 { margin: 0; font-size: 14px; color: #172b4d; }
.collaboration-section-heading span { color: #18724c; background: #e6f7ef; border-radius: 20px; padding: 5px 10px; font-size: 11px; font-weight: 700; }
.collaboration-online-list { display: flex; flex-wrap: wrap; gap: 8px; }
.collaboration-person { display: flex; align-items: center; gap: 9px; min-width: 220px; padding: 8px 10px; border: 1px solid #e1e9f3; border-radius: 9px; background: #fbfdff; }
.collaboration-person strong, .collaboration-person small { display: block; }
.collaboration-person strong { font-size: 11px; color: #172b4d; }
.collaboration-person small { margin-top: 2px; font-size: 10px; color: #64748b; }
.collaboration-online-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-left: auto; border-radius: 50%; background: #16a36b; }
.collaboration-help { margin: 0 0 12px; font-size: 11px; line-height: 1.5; color: #61738b; }
.collaboration-link { border: 0; background: transparent; color: #075bd6; font: 700 11px var(--font-ui); cursor: pointer; }
.collaboration-link:hover { text-decoration: underline; }
.collaboration-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #eaf3ff; color: #174777; font-size: 12px; font-weight: 700; }
.collaboration-permission-list { margin: 12px 0; max-height: 290px; overflow-y: auto; }
.collaboration-editor-row { padding: 12px 0; border-top: 1px solid #e5edf6; }
.collaboration-editor-row:first-child { border-top: 0; }
.collaboration-editor-row strong { display: block; margin-bottom: 6px; color: #172b4d; font-size: 12px; }
.collaboration-editor-row label { font-size: 11px; color: #3e5571; }
.collaboration-editor-row input[type="checkbox"] { accent-color: #096ce2; }
.collaboration-agent-label { display: block; margin: 0 0 7px; color: #172b4d; font-size: 12px; font-weight: 700; }
.collaboration-agent-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.collaboration-agent-controls select { flex: 1; min-width: 210px; }
@media (max-width: 600px) {
  .collaboration-layout { grid-template-columns: 1fr; }
  .collaboration-nav { flex-direction: row; padding: 8px; }
  .collaboration-agent-grid { grid-template-columns: 1fr; }
  .collaboration-body { padding: 12px; }
  .collaboration-header { padding: 16px; }
  .collaboration-section { padding: 13px; }
  .collaboration-person { width: 100%; }
}
.collaboration-company { margin: 0 0 14px; padding: 9px 12px; background: #edf6ff; border-radius: 8px; color: #46617f; font-size: 11px; }
.collaboration-company strong { color: #123b6b; }
.collaboration-user-picker { display: grid; gap: 7px; margin-bottom: 14px; color: #172b4d; font-size: 12px; font-weight: 700; }
.collaboration-user-picker select { width: 100%; min-height: 40px; border: 1px solid #a8c5e6; border-radius: 8px; padding: 0 10px; background: #fff; color: #172b4d; font: 600 12px var(--font-ui); }
.collaboration-pickers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.collaboration-access-label { display: grid; gap: 7px; margin: 12px 0; color: #173c68; font-size: 12px; font-weight: 700; }
.collaboration-access-select { min-height: 40px; padding: 0 10px; border: 1px solid #8fb6e4; border-radius: 8px; background: #fff; color: #123b6b; font: 700 12px var(--font-ui); }
.collaboration-permission-list { max-height: 380px; }
.collaboration-check-group { margin: 12px 0; padding: 12px; border: 1px solid #dce6f2; border-radius: 9px; }
.collaboration-check-group legend { padding: 0 6px; color: #173c68; font-size: 11px; font-weight: 700; }
.collaboration-check-options { display: flex; flex-wrap: wrap; gap: 8px; }
.collaboration-check-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 9px; border: 1px solid #dce6f2; border-radius: 7px; background: #f8fbff; cursor: pointer; }
.collaboration-check-options label:has(input:checked) { background: #e8f2ff; border-color: #8cbbf0; color: #0753ad; }
.collaboration-task-form { display: grid; grid-template-columns: 130px 130px minmax(180px,1fr) 145px auto; gap: 7px; }
.collaboration-task-form input, .collaboration-task-form select { min-width: 0; min-height: 33px; padding: 5px 8px; border: 1px solid #c6d8ed; border-radius: 7px; background: #fff; color: #172b4d; font: 11px var(--font-ui); }
.collaboration-task-form button { padding: 6px 10px; border: 1px solid #0b65c7; border-radius: 7px; background: #e8f2ff; color: #0753ad; font: 700 11px var(--font-ui); cursor: pointer; }
.collaboration-task-list { display: grid; gap: 6px; margin-top: 10px; }
.collaboration-task-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; background: #f5f9ff; color: #244567; font-size: 11px; line-height: 1.4; }
.collaboration-task-item button { border: 0; background: transparent; color: #b4232b; cursor: pointer; font-weight: 700; }
@media (max-width: 760px) { .collaboration-pickers, .collaboration-task-form { grid-template-columns: repeat(2,minmax(0,1fr)); } .collaboration-task-description { grid-column: 1 / -1; } }
@media (max-width: 560px) { .collaboration-pickers { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .pbi-body { flex-direction: column; height: calc(100dvh - 114px); }
  .pbi-left-rail { width: 100%; min-height: 50px; flex-direction: row; justify-content: center; padding: 3px 6px; }
  .pbi-center-workspace { flex: 1; min-height: 0; }
  .pbi-right-panes { width: 100%; height: min(220px, 34vh); flex-shrink: 0; overflow-x: auto; }
  .pbi-right-panes > .pane-section { flex: 0 0 240px; }
  .canvas-scroll-area { justify-content: flex-start; padding: 8px !important; }
  .dashboard-grid, .dashboard-grid.has-visuals { display: grid; grid-template-columns: 1fr; gap: 10px; min-height: 0 !important; padding: 10px; }
  .dashboard-grid.has-visuals .pbi-widget { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; min-height: 160px; height: var(--mobile-height, 280px) !important; grid-column: 1 !important; order: var(--mobile-order, 1); }
  .dashboard-grid.has-visuals .pbi-widget[data-mobile-hidden="true"] { display: none !important; }
  .pbi-widget .widget-header { cursor: default; }
}
.fields-bulk-toolbar button,.canvas-preview-head button { border:1px solid #a9c7e8; background:#fff; color:#164b80; border-radius:5px; padding:6px 9px; cursor:pointer; }
.fields-bulk-toolbar button:hover,.canvas-preview-head button.active { background:#e4f1ff; }
.fields-toolbar { padding:10px; border-bottom:1px solid #e4ebf4; background:#fff; }
.fields-intro { margin:0 0 9px; color:#516781; font-size:11px; line-height:1.45; }
.fields-agents-link { width:100%; margin-top:8px; padding:7px 9px; border:1px solid #c5d8ef; border-radius:7px; background:#f4f9ff; color:#14548d; font:600 11px var(--font-ui); text-align:left; cursor:pointer; }
.fields-agents-link:hover { background:#e7f2ff; }
.fields-search-box { display:flex; align-items:center; gap:6px; min-height:34px; box-sizing:border-box; padding:0 8px; border:1px solid #ccd9e8; border-radius:8px; background:#f8fbff; color:#66809c; }
.fields-search-box:focus-within { border-color:#418fda; box-shadow:0 0 0 2px #cfe9ff; }
.fields-search-box>span { font-size:18px; line-height:1; }
.fields-search-box input { width:100%; min-width:0; border:0; outline:0; background:transparent; font-size:12px; color:#18324d; }
.fields-filter-row { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:8px; }
.fields-filter-row label { display:grid; gap:3px; min-width:0; color:#405a76; font-size:11px; font-weight:600; }
.fields-filter-row select { width:100%; min-width:0; padding:5px; border:1px solid #c3d3e5; border-radius:6px; background:#fff; color:#173b5d; font-size:11px; }
.fields-filter-empty { padding:12px; color:#607790; font-size:12px; }
.fields-bulk-toolbar { display:flex; flex-direction:column; gap:8px; margin-top:9px; padding:9px; border:1px solid #c8dff7; border-radius:8px; background:#f2f8ff; font-size:11px; }
.fields-bulk-toolbar[hidden] { display:none!important; }
.fields-bulk-toolbar strong { color:#125a9a; }
.fields-bulk-toolbar label { display:flex; flex-direction:column; gap:4px; font-weight:600; color:#405a76; }
.fields-bulk-toolbar select { width:100%; min-width:0; padding:5px; border:1px solid #c3d3e5; border-radius:6px; background:#fff; color:#173b5d; }
.fields-bulk-actions { display:flex; gap:5px; }
.fields-bulk-actions button { flex:1; min-width:0; border:1px solid #a9c7e8; background:#fff; color:#164b80; border-radius:6px; padding:6px 5px; cursor:pointer; font-size:11px; }
.fields-bulk-actions button:last-child { color:#a62530; border-color:#efc6ca; }
.fields-bulk-actions button:disabled { opacity:.45; cursor:default; }
.field-bulk-check { flex:none; margin:0 2px 0 0; }
.field-item.used-in-visual { background:#e7f2ff; color:#114f86; }
.fields-visual-hint:not([hidden]) { display:block; margin-top:5px; color:#5d738a; font-size:10px; }
.field-used-mark { flex:none; margin-left:auto; padding-left:6px; color:#1266ae; font-size:14px; font-weight:700; }
.field-item[hidden],.table-node[hidden] { display:none !important; }
.report-data-pane { min-width:0; }
.report-data-pane .fields-tree-container { padding:10px 8px; }
.report-data-pane .table-node { margin-bottom:9px; border:1px solid #e4ebf4; border-radius:9px; overflow:hidden; background:#fff; }
.report-data-pane .table-node-head-row { display:flex; align-items:stretch; background:#f5f8fc; }
.report-data-pane .table-node-select { align-self:center; flex:none; margin:0 2px 0 8px; cursor:pointer; }
.report-data-pane .table-node-header { flex:1; min-width:0; min-height:38px; padding:7px 8px; border:0; border-radius:0; background:transparent; color:#203c59; text-align:left; font:600 12px var(--font-ui); }
.report-data-pane .table-node-header:hover { background:#eaf3ff; }
.report-data-pane .table-node-actions { width:30px; flex:none; border:0; background:transparent; color:#365a7d; cursor:pointer; font-size:19px; }
.report-data-pane .table-node-actions:hover { background:#eaf3ff; }
.fields-table-bulk-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; padding:7px; border:1px solid #bfcee0; border-radius:7px; background:#edf5ff; font-size:11px; }
.fields-table-bulk-toolbar[hidden] { display:none; }
.fields-table-bulk-toolbar strong { flex:1 1 100%; }
.fields-table-bulk-toolbar button { border:1px solid #a9c7e8; border-radius:5px; padding:4px 7px; background:#fff; color:#164b80; cursor:pointer; font-size:11px; }
.fields-table-bulk-toolbar #fields-delete-selected-tables { border-color:#a80000; color:#a80000; }
.fields-table-bulk-toolbar button:disabled { opacity:.5; cursor:default; }
.pbi-context-menu button.context-item { width:100%; border:0; background:transparent; font-family:inherit; font-size:12px; text-align:left; }
.pbi-context-menu button.context-item:hover { background:#f3f2f1; }
.pbi-context-menu button.context-item.danger:hover { background:#fde7e9; }
.table-node-header strong { min-width:0; flex:1; overflow-wrap:anywhere; line-height:1.3; }
.table-node-chevron { width:10px; flex:none; transition:transform .15s; }
.table-node-header[aria-expanded="false"] .table-node-chevron { transform:rotate(-90deg); }
.table-node-icon { width:18px; flex:none; color:#7756a6; font-size:16px; text-align:center; }
.table-node-count { flex:none; padding:2px 6px; border-radius:10px; background:#e5edf7; color:#4f6680; font-size:10px; }
.report-data-pane .table-fields-list { padding:5px 5px 7px; margin:0; gap:2px; }
.report-data-pane .field-item { justify-content:flex-start; gap:7px; min-height:32px; padding:5px 6px; font-size:11px; line-height:1.35; }
.report-data-pane .field-item[data-kind="measure"] { color:#147343; font-weight:600; }
.field-main { display:flex; align-items:flex-start; gap:7px; min-width:0; flex:1; }
.field-name { min-width:0; overflow-wrap:anywhere; }
.report-data-pane .field-icon { flex:none; width:22px; font-size:10px; line-height:17px; border-radius:4px; background:#eaf1fa; color:#266090; font-weight:700; }
.report-data-pane .field-icon.calc { background:#e4f4e9; color:#147343; }
.report-data-pane .field-icon.sigma { background:#e7f1ff; color:#1165b7; }
.report-data-pane .field-bulk-check { margin-top:2px; }
.pbi-page-tab.is-hidden { opacity:.62; border-bottom-style:dashed; }
.pbi-page-tab.is-hidden::after { content:" 👁̸"; font-size:12px; }
.canvas-preview-dialog { width:min(96vw,1280px); max-width:none; max-height:94vh; padding:0; border:1px solid #bdcde2; border-radius:16px; overflow:hidden; color:#132945; box-shadow:0 28px 80px #091c3b66; }
.canvas-preview-dialog::backdrop { background:#0a1b35ad; }
.canvas-preview-head { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 18px; background:#fff; border-bottom:1px solid #e4eaf3; }
.canvas-preview-title { display:flex; flex-direction:column; gap:3px; }
.canvas-preview-title strong { font-size:16px; letter-spacing:-.2px; }
.canvas-preview-title span { color:#63758b; font-size:12px; }
.canvas-preview-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.canvas-preview-actions select,.preview-config-bar input[type=number] { border:1px solid #ccd9e8; background:#fff; border-radius:8px; padding:7px 9px; color:#17324f; }
.canvas-preview-head button,.preview-config-bar button,.preview-widget-controls button { border:1px solid #c4d5e8; background:#fff; color:#17558b; border-radius:8px; padding:7px 10px; cursor:pointer; font-weight:600; }
.canvas-preview-head button:hover,.preview-config-bar button:hover,.preview-widget-controls button:hover { background:#eaf4ff; }
.preview-segment { display:flex; padding:3px; background:#eef4fb; border-radius:10px; }
.preview-segment button { border:0; background:transparent; }
.preview-segment button.active { background:#fff; color:#0758ae; box-shadow:0 1px 5px #12385e2b; }
.preview-config-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; min-height:44px; padding:7px 18px; border-bottom:1px solid #dce7f3; background:#f7faff; font-size:12px; }
.preview-config-bar>span { color:#365273; font-weight:700; margin-right:auto; }
.preview-config-bar>span.is-hidden { color:#9a5e15; }
#preview-mobile-settings { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
#preview-mobile-settings[hidden],.preview-config-bar button[hidden] { display:none!important; }
#preview-mobile-settings label { display:inline-flex; align-items:center; gap:5px; color:#435b75; font-weight:600; }
#preview-mobile-settings input[type=color] { width:28px; height:28px; padding:2px; border:1px solid #bdcde2; border-radius:7px; background:#fff; }
#preview-mobile-settings input[type=number] { width:68px; box-sizing:border-box; }
.canvas-preview-scroll { overflow:auto; max-height:calc(94vh - 112px); min-height:320px; padding:22px 18px 30px; background:radial-gradient(circle at 20% 0,#f7fbff,#e9eff8 58%,#dfe9f5); }
#canvas-preview-stage { position:relative; margin:0 auto; }
#canvas-preview-grid { box-sizing:border-box; position:absolute; inset:0 auto auto 0; margin:0; border:0; border-radius:10px; box-shadow:0 18px 45px #19355428; transform-origin:top left; }
#canvas-preview-grid .preview-widget { display:flex; flex-direction:column; overflow:hidden; }
#canvas-preview-grid .preview-widget .widget-header { cursor:default; flex:0 0 auto; }
#canvas-preview-grid .preview-widget .widget-content { min-height:0; overflow:hidden; }
#canvas-preview-grid:not(.mobile-preview) { display:block!important; min-height:var(--preview-min-height,810px)!important; }
#canvas-preview-grid:not(.mobile-preview) .preview-widget { position:absolute!important; left:var(--preview-left)!important; top:var(--preview-top)!important; width:var(--preview-width)!important; height:var(--preview-height)!important; }
#canvas-preview-grid.mobile-preview { display:flex!important; flex-direction:column; gap:12px; min-height:0; }
#canvas-preview-grid.mobile-preview .preview-mobile-item { display:flex; flex-direction:column; gap:5px; width:100%; align-self:stretch; }
#canvas-preview-grid.mobile-preview .preview-widget { position:relative!important; left:auto!important; top:auto!important; width:100%!important; height:var(--preview-mobile-height,280px)!important; min-height:160px; flex:none; box-sizing:border-box; }
#canvas-preview-grid.mobile-preview .preview-mobile-item.is-hidden { display:none; }
#canvas-preview-grid.mobile-preview.mobile-edit .preview-mobile-item.is-hidden { display:flex; opacity:.68; }
#canvas-preview-grid.mobile-preview.mobile-edit .preview-mobile-item.is-hidden .preview-widget { border-style:dashed; }
.preview-widget-controls { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border:1px solid #c5d7eb; border-radius:8px; background:#f5faff; color:#193c62; font-size:12px; font-weight:700; }
.preview-widget-controls>span { max-width:120px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.preview-widget-controls>div { display:flex; align-items:center; gap:4px; }
.preview-widget-controls button { padding:4px 7px; }
.preview-widget-controls label { display:flex; align-items:center; gap:3px; margin-left:4px; font-weight:600; }
.preview-widget-controls input { width:46px; padding:4px; border:1px solid #bdcde2; border-radius:6px; }
.preview-empty { margin:24px; text-align:center; color:#56708b; }
@media(max-width:760px) { .canvas-preview-head { align-items:flex-start; flex-direction:column; } .canvas-preview-scroll { max-height:calc(94vh - 160px); } .preview-config-bar { align-items:flex-start; } }
.pq-status-bar button { border: 1px solid #a9c7e8; border-radius: 4px; background: #fff; color: #12518d; cursor: pointer; padding: 2px 6px; }
.pq-status-bar button:disabled { opacity: .45; cursor: default; }
.pbi-widget.has-gradient .widget-header { background: transparent; }
.pbi-widget .widget-title { font-size: var(--widget-title-size, 13px); color: var(--widget-title-color, #172b4d); }
.pbi-report-visual-tooltip { position: fixed; z-index: 20000; width: 390px; min-height: 260px; box-sizing: border-box; pointer-events: none; padding: 12px; background: #fff; color: #17304f; border: 1px solid #9dbce1; border-radius: 10px; box-shadow: 0 16px 38px #12294e42; }
.pbi-report-visual-tooltip > strong { display: block; margin-bottom: 7px; font-size: 12px; }
.pbi-report-visual-tooltip-body { width: 100%; height: 224px; overflow: hidden; }
.pbi-drillthrough-back { position: fixed; left: 70px; bottom: 54px; z-index: 80; max-width: min(500px, 80vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 13px; border: 1px solid #6a9bd3; border-radius: 8px; background: #fff; color: #14518f; box-shadow: 0 6px 20px #112e5050; font-weight: 700; cursor: pointer; }

/* Los controles de formato se agrupan como propiedades del objeto seleccionado. */
.visual-editor-panel { background: #f5f8fc; }
.visual-editor-heading { padding: 2px 2px 5px; color: #18375e; font-size: 14px; }
.visual-editor-group { margin: 9px 0 12px; padding: 13px 12px 3px; border: 1px solid #dce6f2; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(30,59,99,.04); }
.visual-editor-group h3 { margin-bottom: 13px; color: #18375e; font-size: 12px; }
details.visual-editor-group { padding-bottom: 13px; }
details.visual-editor-group[open] { padding-bottom: 3px; }
.visual-editor-group summary { display:flex; align-items:center; justify-content:space-between; cursor:pointer; color:#18375e; font-size:12px; font-weight:700; list-style:none; }
.visual-editor-group summary::-webkit-details-marker { display:none; }
.visual-editor-group summary::after { content:'▸'; color:#59728f; font-size:14px; transition:transform .15s ease; }
.visual-editor-group[open] summary { margin-bottom:13px; }
.visual-editor-group[open] summary::after { transform:rotate(90deg); }
.visual-editor-group summary:focus-visible { outline:2px solid #118dff; outline-offset:3px; border-radius:3px; }
.visual-editor-action { width:100%; padding:8px 10px; border:1px solid #bfcfe3; border-radius:6px; background:#f7fbff; color:#164b80; font:inherit; font-size:12px; cursor:pointer; }
.visual-editor-action:hover { background:#e7f2ff; }
.visual-editor-field span { color: #385371; font-size: 11px; }
.visual-editor-field input, .visual-editor-field select { min-height: 35px; border-color: #bfcfe3; border-radius: 6px; }
.visual-editor-field input:focus-visible, .visual-editor-field select:focus-visible { outline: 2px solid #118dff; outline-offset: 1px; }
.visual-editor-field input[type="color"] { height: 38px; padding: 3px; cursor: pointer; }
.visual-editor-toggle { min-height: 30px; color: #385371; }
.visual-editor-hint { padding: 0 2px; color: #60758f; }

/* Power Global: identidad de la aplicación; los colores configurados en cada visual permanecen independientes. */
:root {
  --pbi-yellow: #ffc21a;
  --pbi-yellow-hover: #ffda61;
  --pbi-dark: #11100f;
  --pbi-darker: #090909;
  --pbi-blue: #d97706;
  --pbi-blue-dark: #9a4b05;
  --pg-gold: #ffc21a;
  --pg-orange: #e97708;
}
.power-global-mark {
  display:inline-block;
  flex:none;
  width:36px;
  height:36px;
  border-radius:10px;
  background:#080808 url('../logo.png') center / 40px auto no-repeat;
  box-shadow:0 0 0 1px #f3a30a80,0 2px 9px #e9770833;
}
.power-global-login-mark { width:48px; height:48px; background-size:52px auto; }
.power-global-login-brand { display:flex; align-items:center; gap:13px; }
.power-global-login-brand h2 { margin:0; color:#fff; font-size:19px; font-weight:800; letter-spacing:.2px; }
.power-global-login-brand span:not(.power-global-mark) { color:#ffd777; font-size:11px; }
.power-global-login-head { background:linear-gradient(115deg,#080808,#281704 72%,#713508); color:#fff; border-bottom:2px solid var(--pg-gold); }
.power-global-login-head h2 { color:#fff; }
.pbi-header { background:linear-gradient(95deg,#080808,#211305 55%,#0d0b09); border-bottom:1px solid #a75c0d; }
.pbi-brand { gap:9px; }
.pbi-brand .power-global-name { color:#ffd158; font-size:14px; white-space:nowrap; letter-spacing:.2px; }
.pbi-brand .report-file-title { border-left:1px solid #8e602a; margin-left:3px; padding-left:11px; }
.company-pill { background:#fff1c412; border:1px solid #d8832338; }
.company-pill strong,.user-role-tag { color:#ffd158; }
.user-avatar { background:#d9750c; color:#fff; }
.ribbon-tab.active { color:#8c4800 !important; border-bottom-color:var(--pg-orange) !important; }
.ribbon-tab.file-tab { background:#a95106 !important; }
.ribbon-tab.file-tab:hover { background:#813a04 !important; }
.ribbon-tab.file-tab.active { color:#fff !important; background:#813a04 !important; border-bottom-color:#ffd158 !important; }
.rail-btn.active::before { background:var(--pg-orange) !important; }
.pbi-page-tab.active { color:#a45000 !important; border-bottom-color:var(--pg-orange) !important; }
.visual-pane-tab.active { border-bottom-color:var(--pg-orange); color:#8c4800; }
.visual-pane-tab:focus-visible,.visual-icon-btn:focus-visible,.ribbon-tab:focus-visible,.qa-icon-btn:focus-visible { outline-color:var(--pg-orange) !important; }
.ribbon-btn.primary { background:var(--pg-gold) !important; border-color:#d88907 !important; color:#201507 !important; }
.ribbon-btn.primary:hover { background:#ffda61 !important; }
.portal-login-backdrop .form-control:focus { border-color:#e89111; box-shadow:0 0 0 3px #ffc21a38; }

/* Controles independientes para menú, herramientas y comparación de Power Query. */
.power-query-modal .pq-menu-item { appearance:none; border:0; border-bottom:2px solid transparent; background:transparent; font:inherit; font-size:12px; white-space:nowrap; }
.power-query-modal .pq-menu-item.active { color:#a45000; border-bottom-color:#e97708; }
.power-query-modal .pq-menubar.is-minimized,
.power-query-modal .pq-ribbon-container.is-minimized,
.power-query-modal .pq-cleaning-panel.is-minimized { display:none !important; }
.power-query-modal .pq-titlebar { min-height:44px; height:auto; gap:8px; flex-wrap:wrap; padding-top:5px; padding-bottom:5px; }
.pq-layout-controls { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.pq-layout-toggle { flex:none; border:1px solid #e8b16e; border-radius:6px; background:#fff9ed; color:#844100; padding:5px 8px; font:600 11px var(--font-ui); cursor:pointer; white-space:nowrap; }
.pq-layout-toggle:hover,.pq-layout-toggle:focus-visible { background:#ffedc5; outline-color:#d97706; }
.pq-layout-toggle[aria-expanded="false"] { background:#ffedc5; border-color:#d78b2a; }
.pq-layout-toggle span { display:inline-block; margin-left:3px; }
@media (max-width:760px) {
  .power-query-modal .pq-titlebar { align-content:center; }
  .pq-layout-toggle { padding:4px 6px; font-size:10px; }
}

.visual-gallery-launch { background:#fff5df; color:#a45000; border-color:#e8b16e; font-size:23px; font-weight:700; }
.custom-html-visual-frame { display:block; width:100%; height:100%; min-height:100px; border:0; background:#fff; }
.html-field-binding { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px; margin:10px 0; border:1px solid #d6e0ee; border-radius:8px; background:#f7faff; font-size:12px; }
.html-field-binding strong,.html-field-binding p { grid-column:1/-1; margin:0; }
.html-field-binding code { color:#9b4d00; }
.html-field-binding label { display:grid; gap:4px; font-weight:600; }
.html-field-binding select { width:100%; padding:6px; border:1px solid #b9cbe1; border-radius:5px; background:#fff; }
.gallery-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid #dbe4ee; }
.gallery-toolbar [role=tablist] { display:flex; gap:5px; }
.gallery-toolbar button { border:1px solid #cad8e8; background:#fff; border-radius:6px; padding:7px 12px; cursor:pointer; }
.gallery-toolbar button.active { background:#fff2d0; border-color:#e7a93f; color:#8d4500; font-weight:700; }
.gallery-toolbar label { display:flex; gap:6px; align-items:center; font-size:12px; }
.gallery-toolbar select,.gallery-publish-form input,.gallery-publish-form select,.gallery-publish-form textarea { border:1px solid #c7d5e6; border-radius:6px; padding:7px; background:#fff; color:#163150; font:inherit; }
.gallery-empty { padding:32px; border:1px dashed #c7d5e6; border-radius:9px; text-align:center; color:#60748d; }
.gallery-publish-button { border:1px solid #c3740b; background:#ffc928; color:#382405; border-radius:6px; padding:7px 10px; font-weight:700; cursor:pointer; }
.gallery-publish-form { display:grid; align-content:start; gap:9px; padding:16px; background:#f7faff; border-left:1px solid #dbe4ee; font-size:12px; }
.gallery-publish-form h3 { margin:0 0 4px; font-size:14px; }
.gallery-publish-form label { display:grid; gap:4px; font-weight:600; }
.gallery-publish-form textarea { width:100%; box-sizing:border-box; resize:vertical; font-family:Consolas,monospace; }
.gallery-help { color:#5f7188; margin:0; line-height:1.4; }
.gallery-use-page { border:1px solid #c7d5e6; background:#fff; border-radius:6px; padding:7px; cursor:pointer; }
@media(max-width:720px) { .html-field-binding { grid-template-columns:1fr; } }

/* Catálogo amplio con filtros y ficha de inspección antes de insertar. */
.gallery-dialog { width:min(1120px,96vw); max-width:1120px; height:min(760px,94vh); max-height:94vh; }
.gallery-toolbar { flex:none; }
.gallery-publish-toggle { border:1px solid #d98816 !important; background:#fff4d6 !important; color:#804600; font-weight:700; }
.gallery-filters { display:grid; grid-template-columns:minmax(220px,2fr) minmax(150px,1fr) minmax(160px,1fr); gap:10px; padding:12px 16px; background:#f6f9fd; border-bottom:1px solid #dbe4ee; }
.gallery-filters label { display:grid; gap:4px; color:#40536d; font-size:11px; font-weight:700; }
.gallery-filters input,.gallery-filters select { width:100%; box-sizing:border-box; border:1px solid #c7d5e6; border-radius:7px; padding:8px; background:#fff; color:#18304d; font:inherit; }
.gallery-body { display:block; min-height:0; flex:1; overflow:hidden; }
.gallery-body.is-publishing { display:grid; grid-template-columns:minmax(0,2fr) minmax(290px,1fr); }
.gallery-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; align-content:start; gap:14px; max-height:none; height:100%; box-sizing:border-box; overflow:auto; padding:16px; }
.gallery-empty { grid-column:1/-1; }
.gallery-card { display:block; padding:0; min-width:0; overflow:hidden; border-radius:12px; box-shadow:0 5px 16px rgba(28,57,96,.06); }
.gallery-card-open { display:grid; grid-template-rows:138px 1fr auto; width:100%; min-height:285px; padding:0 !important; border:0 !important; border-radius:0 !important; background:#fff !important; color:#1f3553 !important; text-align:left; cursor:pointer; }
.gallery-card-open:hover,.gallery-card-open:focus-visible { outline:2px solid #d88a14; outline-offset:-2px; }
.gallery-card-thumb { display:grid; place-items:center; overflow:hidden; background:linear-gradient(135deg,#f8ead0,#fffaf0 55%,#eaf2fc); border-bottom:1px solid #ecdfca; }
.gallery-mini-bars { display:flex; align-items:flex-end; gap:10px; width:58%; height:82px; }
.gallery-mini-bars i { flex:1; height:68%; border-radius:7px 7px 2px 2px; background:linear-gradient(#ffc928,#e58a0b); box-shadow:0 4px 9px #a55d1233; }
.gallery-mini-bars i:nth-child(2) { height:95%; } .gallery-mini-bars i:nth-child(3) { height:48%; } .gallery-mini-bars i:nth-child(4) { height:75%; }
.gallery-mini-dashboard { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; width:63%; height:83px; }
.gallery-mini-dashboard i { border:1px solid #cbd8e9; border-radius:6px; background:#fff; box-shadow:inset 0 -16px #e6effa; }
.gallery-mini-theme { display:flex; gap:6px; transform:rotate(-10deg); }
.gallery-mini-theme i { width:36px; height:68px; border-radius:6px; box-shadow:0 4px 10px #2b385933; }
.gallery-card-info { padding:12px 14px 6px; }
.gallery-card-category { display:inline-block; padding:3px 7px; margin-bottom:7px; border-radius:20px; background:#fff1d4; color:#8d5100; font-size:10px; font-weight:800; }
.gallery-card-info strong { display:block; font-size:14px; line-height:1.3; }
.gallery-card-info p { font-size:12px; line-height:1.35; min-height:30px; margin:6px 0; }
.gallery-card-info small { display:block; font-size:11px; }
.gallery-card-keywords { display:block; color:#8d631f; font-size:10px; margin-top:6px; }
.gallery-card-view { display:block; padding:9px 14px 12px; border-top:1px solid #eef1f5; color:#9b5800; font-weight:800; font-size:11px; }
.gallery-publish-form { overflow:auto; }
.gallery-body:not(.is-publishing) .gallery-publish-form { display:none !important; }
.gallery-detail-dialog { display:flex; flex-direction:column; width:min(1080px,96vw); max-width:1080px; height:min(760px,94vh); max-height:94vh; }
.gallery-detail-meta { padding:10px 18px; color:#5b6e86; font-size:12px; background:#f7faff; border-bottom:1px solid #dce5f0; }
.gallery-detail-body { display:grid; grid-template-columns:1.15fr 1fr; flex:1; min-height:0; }
.gallery-preview-panel,.gallery-source-panel { min-width:0; min-height:0; display:flex; flex-direction:column; padding:16px; }
.gallery-preview-panel { border-right:1px solid #dce5f0; background:#f5f8fc; }
.gallery-preview-panel h3 { margin:0 0 10px; font-size:13px; }
.gallery-detail-preview { flex:1; min-height:220px; border:1px solid #cfdceb; border-radius:10px; background:#fff; overflow:hidden; }
.gallery-detail-preview iframe { width:100%; height:100%; border:0; }
.gallery-preview-panel p { color:#5b6e86; font-size:11px; line-height:1.4; }
.gallery-source-tabs { display:flex; gap:5px; margin-bottom:10px; }
.gallery-source-tabs button { border:1px solid #cad8e8; border-radius:6px; background:#fff; padding:7px 12px; cursor:pointer; }
.gallery-source-tabs button.active { background:#fff0cc; border-color:#e4a044; color:#824800; font-weight:800; }
#gallery-source-code { flex:1; margin:0; padding:14px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; border:1px solid #d4dfeb; border-radius:8px; background:#182338; color:#e5edf9; font:11px/1.5 Consolas,monospace; }
.gallery-theme-preview { height:100%; padding:20px; box-sizing:border-box; }
.gallery-theme-preview > div { height:100%; padding:20px; box-sizing:border-box; border-radius:10px; box-shadow:0 8px 20px #172b4d18; }
.gallery-theme-preview-bars { display:flex; align-items:end; gap:14px; height:75%; padding-top:14px; }
.gallery-theme-preview-bars i { width:14%; min-width:20px; border-radius:6px 6px 0 0; }
.gallery-dashboard-preview { padding:20px; }
.gallery-dashboard-preview > div { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:15px; }
.gallery-dashboard-preview span { padding:18px; border:1px solid #d4dfeb; border-radius:8px; background:#f4f8fd; }
@media(max-width:820px) { .gallery-list { grid-template-columns:1fr; } .gallery-filters { grid-template-columns:1fr 1fr; } .gallery-filters label:first-child { grid-column:1/-1; } .gallery-body.is-publishing { grid-template-columns:1fr; overflow:auto; } .gallery-detail-body { grid-template-columns:1fr; overflow:auto; } .gallery-preview-panel { border-right:0; border-bottom:1px solid #dce5f0; min-height:310px; } .gallery-source-panel { min-height:290px; } }

/* La cinta desplegada ocupa su propio espacio y deja visible el lienzo debajo. */
.pbi-desktop-ribbon { position:relative; z-index:90; flex-shrink:0; }
#powerbi-app-layout .pbi-body { min-height:0; height:auto; flex:1 1 auto; }
.pbi-desktop-ribbon .ribbon-tools-row {
  position:static;
  width:100%; max-height:120px;
  box-sizing:border-box; flex-wrap:nowrap !important;
  overflow-x:auto !important; overflow-y:hidden !important;
  background:#fff !important; border:1px solid #d8c9b3 !important;
  border-radius:0; box-shadow:none;
  padding:4px 8px !important;
}
.pbi-desktop-ribbon .ribbon-tools-row.ribbon-dropdown-hidden { display:none !important; }
.pbi-desktop-ribbon .ribbon-tab[aria-controls="desktop-ribbon-menu"]::after {
  content:'⌄'; display:inline-block; margin-left:5px; font-size:11px; color:#846b4c;
  transition:transform .15s;
}
.pbi-desktop-ribbon .ribbon-tab[aria-expanded="true"]::after { transform:rotate(180deg); }

/* Navegación lateral: anclada con rótulos o compacta solo con iconos. */
.pbi-left-rail { background:#f5f7fb; box-shadow:inset -1px 0 #dce6f2; transition:width .18s ease; }
.pbi-left-rail .rail-btn { height:54px; border-radius:7px; margin:2px 0; color:#36516f; }
.pbi-left-rail .rail-btn > span:first-child { font-size:20px; }
.pbi-left-rail .rail-btn.active { color:#0f5797; background:#fff; box-shadow:0 2px 7px #163b6324; }
.rail-dock-btn { width:34px; min-height:32px; margin-top:auto; border:1px solid #cad9eb; border-radius:7px; background:#fff; color:#36516f; cursor:pointer; }
.rail-dock-btn:hover { background:#e7f1fc; }
.pbi-left-rail.is-unpinned { width:38px; }
.pbi-left-rail.is-unpinned .rail-btn { width:34px; height:38px; }
.pbi-left-rail.is-unpinned .rail-btn > span:last-child { display:none; }
@media(max-width:700px) { .pbi-left-rail.is-unpinned { width:100%; } .rail-dock-btn { margin-top:0; margin-left:auto; } }

.fields-create-folder { width:100%; margin-top:8px; padding:6px; border:1px dashed #9fbbd9; border-radius:6px; background:#f8fbff; color:#1c5a93; cursor:pointer; font-size:11px; font-weight:600; }
.fields-create-folder:hover { background:#eaf4ff; }
.field-folder { margin:4px 0 4px 10px; border-left:1px solid #d5e4f2; }
.field-folder[hidden] { display:none!important; }
.field-folder-heading { display:flex; align-items:center; background:#f2f7fc; }
.field-folder-toggle { flex:1; min-width:0; border:0; padding:5px 4px; background:transparent; color:#284d70; text-align:left; cursor:pointer; font-size:11px; font-weight:600; }
.field-folder-remove { border:0; background:transparent; color:#637e99; cursor:pointer; padding:2px 7px; }
.field-folder-items { padding-left:7px; }

.pbi-body { position:relative; }
.report-view-drawer { flex:0 0 270px; min-width:0; display:flex; flex-direction:column; overflow:hidden; border-left:1px solid #d8e3f1; background:#fff; }
.report-view-drawer[hidden] { display:none!important; }
.report-view-drawer-head { display:flex; align-items:center; justify-content:space-between; min-height:38px; padding:6px 10px; border-bottom:1px solid #dce6f2; background:#f5f8fc; color:#163a61; }
.report-view-drawer-head button { border:0; background:transparent; color:#4d6680; font-size:19px; cursor:pointer; }
.report-view-drawer-body { overflow:auto; padding:10px; font-size:11px; }
.view-drawer-hint { color:#58718a; line-height:1.45; margin:0 0 10px; }
.view-drawer-empty { padding:12px 6px; color:#637d98; }
.view-drawer-primary { width:100%; padding:7px; border:1px solid #91b9e3; border-radius:6px; background:#eaf4ff; color:#124f87; cursor:pointer; font-weight:700; margin-bottom:9px; }
.view-drawer-item { display:flex; align-items:center; gap:3px; margin-bottom:5px; border:1px solid #e0e8f2; border-radius:6px; padding:3px; }
.view-drawer-item.is-selected { background:#eaf4ff; border-color:#8ec2f2; }
.view-drawer-item button { border:0; background:transparent; color:#284f75; cursor:pointer; min-width:24px; padding:5px 3px; }
.view-drawer-item button:first-child { flex:1; min-width:0; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.view-drawer-item button[data-view-action="select"] { flex:1; min-width:0; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.view-drawer-item input[type="checkbox"] { flex:none; margin:0 4px; }
.view-drawer-item[hidden] { display:none; }
#visual-search { box-sizing:border-box; width:100%; margin:0 0 8px; }
.visual-objects-link { float:right; border:0; background:none; color:#1269bc; font:inherit; cursor:pointer; text-decoration:underline; }
.view-drawer-item button:disabled { opacity:.35; cursor:default; }
.view-drawer-details { display:grid; grid-template-columns:95px 1fr; gap:8px 7px; overflow-wrap:anywhere; }
.view-drawer-details dt { color:#5b728b; font-weight:700; }
.view-drawer-details dd { margin:0; color:#153958; }
@media(max-width:1500px) { .report-view-drawer { position:absolute; z-index:50; right:0; top:0; bottom:0; width:min(290px,70vw); box-shadow:-8px 0 25px #173a5a26; } }

/* Default report visuals read as objects on the canvas, without permanent card chrome. */
#dashboard-grid .pbi-widget.clean-default-frame:not(.selected),
#canvas-preview-grid .preview-widget.clean-default-frame {
  border-color:transparent!important;
  border-radius:0!important;
  box-shadow:none!important;
}
#dashboard-grid .pbi-widget.clean-default-frame:not(.selected):hover { border-color:#bdd7f2!important; }
#dashboard-grid .pbi-widget.clean-default-frame.selected { border-color:#0078d4!important; box-shadow:none!important; }
#dashboard-grid .pbi-widget.clean-default-frame .widget-header,
#canvas-preview-grid .preview-widget.clean-default-frame .widget-header {
  min-height:32px;
  padding:5px 9px 3px;
  border-bottom:0;
  background:transparent;
}
#dashboard-grid .pbi-widget.clean-default-frame .widget-content,
#canvas-preview-grid .preview-widget.clean-default-frame .widget-content { padding:4px 9px 9px; }
#dashboard-grid .pbi-widget.clean-default-frame .report-slicer-visual > label,
#canvas-preview-grid .preview-widget.clean-default-frame .report-slicer-visual > label { display:none; }
#dashboard-grid .pbi-widget .widget-actions { opacity:0; pointer-events:none; }
#dashboard-grid .pbi-widget:hover .widget-actions,
#dashboard-grid .pbi-widget.selected .widget-actions,
#dashboard-grid .pbi-widget:focus-within .widget-actions { opacity:1; pointer-events:auto; }
.kpi-signal{display:inline-block;margin:6px 0;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:700}
.kpi-signal.good{background:#dcfce7;color:#166534}
.kpi-signal.attention{background:#fef3c7;color:#92400e}
.kpi-signal.urgent{background:#fee2e2;color:#b91c1c}
.kpi-forecast,.kpi-scenario{margin-top:10px;padding-top:8px;border-top:1px solid #e5e7eb;font-size:12px}
.kpi-forecast small,.kpi-scenario small{display:block;margin-top:4px}
.kpi-scenario>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:5px}
.kpi-scenario label{display:flex;flex-direction:column;gap:2px;font-size:11px}
.kpi-scenario input{width:66px;padding:3px;border:1px solid #cbd5e1;border-radius:4px}
