/* assets/ab-dashboard.css - Tableros de Procesos Estilo Analítico (Sin marcas registradas) */

.ab-dashboard-container {
  background: #09131f;
  border: 1px solid var(--border, #183552);
  border-radius: 14px;
  padding: 24px;
  margin: 36px 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(94, 234, 212, 0.05);
  color: #f8fafc;
  font-family: inherit;
}

/* Encabezado del Tablero */
.ab-dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.ab-dash-title-group h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ab-dash-tag {
  background: rgba(94, 234, 212, 0.15);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ab-dash-sample-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ab-dash-export-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ab-dash-export-btn:hover,
.ab-dash-export-btn:focus-visible {
  background: rgba(94, 234, 212, 0.2);
  border-color: #5eead4;
  color: #fff;
  outline: none;
}

/* Barra de Filtros Analíticos */
.ab-dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #0d2238;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  align-items: center;
}

.ab-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
}

.ab-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ab-filter-select {
  background: #061527;
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
  cursor: pointer;
  outline: none;
}

.ab-filter-select:focus {
  border-color: #5eead4;
}

/* Fila de Tarjetas KPI */
.ab-dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ab-dash-kpi-card {
  background: #0d2238;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ab-dash-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.4);
}

.ab-dash-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--teal, #5eead4);
}

.ab-dash-kpi-card.kpi-warn::before { background: #fbbf24; }
.ab-dash-kpi-card.kpi-danger::before { background: #f87171; }
.ab-dash-kpi-card.kpi-purple::before { background: #c084fc; }

.ab-kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
  display: block;
}

.ab-kpi-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
  margin-bottom: 4px;
  display: block;
}

.ab-kpi-delta {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5eead4;
}

.ab-kpi-delta.is-bad { color: #f87171; }

/* Grid Principal de Gráficas */
.ab-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .ab-dash-grid { grid-template-columns: 1fr; }
}

.ab-dash-panel {
  background: #0d2238;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.ab-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.ab-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.ab-panel-legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.ab-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}

/* Flujo de Proceso Interactivo (Pipeline) */
.ab-pipeline-flow {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}

.ab-pipe-step {
  flex: 1 1 120px;
  min-width: 130px;
  background: #061527;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.ab-pipe-step:hover,
.ab-pipe-step:focus-visible,
.ab-pipe-step.is-selected {
  border-color: #5eead4;
  background: rgba(94, 234, 212, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.ab-pipe-step.is-bottleneck {
  border-color: rgba(248, 113, 113, 0.6);
}

.ab-step-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
  display: block;
}

.ab-step-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.25;
  margin-bottom: 6px;
  display: block;
}

.ab-step-badge {
  font-size: 0.68rem;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 700;
  display: inline-block;
}

.ab-badge-auto { background: rgba(94, 234, 212, 0.2); color: #5eead4; }
.ab-badge-warn { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.ab-badge-human { background: rgba(192, 132, 252, 0.2); color: #c084fc; }

/* Panel de Drill-down (Detalle por nivel) */
.ab-drilldown-box {
  background: #061527;
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ab-drilldown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Gráficas SVG enlazadas */
.ab-svg-chart {
  width: 100%;
  height: 220px;
  overflow: visible;
}

.ab-chart-bar {
  cursor: pointer;
  transition: opacity 0.2s ease, fill 0.2s ease;
}

.ab-chart-bar:hover,
.ab-chart-bar:focus-visible {
  opacity: 0.85;
  filter: drop-shadow(0 0 6px #5eead4);
  outline: none;
}

/* Tabla de Datos con Búsqueda */
.ab-dash-table-wrap {
  margin-top: 20px;
}

.ab-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ab-table-search {
  background: #061527;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  width: 240px;
  outline: none;
}

.ab-table-search:focus {
  border-color: #5eead4;
}
