/* ── Workflow Validator Panel ─────────────────────────────────────────────── */

/* Botón en toolbar */
.wf-validate-btn {
  position: relative;
}
.wf-validate-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: none;
  pointer-events: none;
}
.wf-validate-badge.has-errors   { display: block; background: #ef4444; color: #fff; }
.wf-validate-badge.has-warnings { display: block; background: #f59e0b; color: #fff; }
.wf-validate-badge.all-clear    { display: block; background: #22c55e; color: #fff; }

/* Panel inferior */
.wf-validator-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #e2e8f0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  max-height: 280px;
  transition: max-height .2s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.wf-validator-panel.collapsed { max-height: 36px; overflow: hidden; }

.wf-validator-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.wf-validator-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wf-validator-counts {
  display: flex;
  gap: 6px;
  margin-left: 4px;
}
.wf-val-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.wf-val-count.error   { background: #fee2e2; color: #dc2626; }
.wf-val-count.warning { background: #fef3c7; color: #d97706; }
.wf-val-count.info    { background: #dbeafe; color: #1d4ed8; }
.wf-val-count.ok      { background: #dcfce7; color: #15803d; }

.wf-validator-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wf-validator-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
}
.wf-validator-close:hover { color: #475569; background: #f1f5f9; }

/* Lista de issues */
.wf-validator-body {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.wf-issue {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background .1s;
}
.wf-issue:hover { background: #f8fafc; }
.wf-issue:last-child { border-bottom: none; }

.wf-issue-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}
.wf-issue-icon.error   { background: #fee2e2; color: #dc2626; }
.wf-issue-icon.warning { background: #fef3c7; color: #d97706; }
.wf-issue-icon.info    { background: #dbeafe; color: #1d4ed8; }

.wf-issue-content { flex: 1; min-width: 0; }
.wf-issue-message {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-issue-detail {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-issue-suggestion {
  font-size: 10px;
  color: #0ea5e9;
  margin-top: 2px;
  display: none;
}
.wf-issue:hover .wf-issue-suggestion { display: block; }

.wf-issue-loc {
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
  align-self: center;
  padding: 1px 6px;
  background: #f1f5f9;
  border-radius: 3px;
  white-space: nowrap;
}

/* Estado de carga */
.wf-validator-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  color: #94a3b8;
  font-size: 12px;
}

/* Estado OK */
.wf-validator-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  color: #15803d;
  font-size: 13px;
}

/* Nodo/edge resaltado por validador */
.wf-node-highlighted {
  outline: 3px solid #f59e0b !important;
  outline-offset: 3px;
}
.wf-edge-highlighted {
  stroke: #f59e0b !important;
  stroke-width: 3px !important;
}
