/* Workflow editor page */
.wf-editor-body {
  --bg: #0b0f1a;
  --panel: #111827;
  --surface: #1a2236;
  --border: #334155;
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --text3: #94a3b8;
  --accent: #818cf8;

  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wf-topbar {
  height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--panel, #111827); border-bottom: 1px solid var(--border, #2a3a52);
  flex-shrink: 0;
}
.wf-back { color: var(--text2, #94a3b8); text-decoration: none; font-size: 13px; }
.wf-back:hover { color: var(--text, #e8edf5); }
.wf-title-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.wf-name-input {
  background: transparent; border: 1px solid transparent; color: var(--text);
  font-size: 15px; font-weight: 600; padding: 4px 8px; border-radius: 6px; min-width: 200px;
}
.wf-name-input:focus { border-color: var(--accent, #6366f1); outline: none; background: var(--surface, #1a2236); }
.wf-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.wf-badge-active { background: rgba(16,185,129,.2); color: #10b981; }
.wf-badge-inactive { background: rgba(100,116,139,.2); color: #94a3b8; }
.wf-toolbar { display: flex; gap: 8px; }

.wf-layout { flex: 1; display: grid; grid-template-columns: 200px 1fr 320px; min-height: 0; }
.wf-palette {
  background: var(--panel, #111827); border-right: 1px solid var(--border);
  padding: 12px; overflow-y: auto;
}
.wf-palette h3, .wf-props h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3, #64748b); margin: 0 0 12px; }
.wf-palette-group { margin-bottom: 16px; }
.wf-palette-label { display: block; font-size: 10px; color: var(--text3); margin-bottom: 6px; text-transform: uppercase; }
.wf-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 5px;
  border-radius: 8px;
  cursor: grab;
  background: var(--surface, #1a2236);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text, #e2e8f0);
  transition: border-color .15s, background .15s, transform .1s;
}
.wf-palette-item:hover {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,.08);
  transform: translateX(2px);
}
.wf-palette-item:active { cursor: grabbing; }
.wf-webhook-code { display: block; font-size: 10px; word-break: break-all; margin-top: 4px; color: var(--accent2, #818cf8); }

.wf-canvas-wrap { position: relative; overflow: hidden; background: #0a0e17; }

/* Minimap — top right of canvas */
.wf-minimap {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  width: 180px;
  height: 120px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  backdrop-filter: blur(8px);
  cursor: crosshair;
  user-select: none;
}
.wf-minimap__label {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  pointer-events: none;
}
.wf-minimap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.wf-minimap__viewport {
  position: absolute;
  border: 1.5px solid rgba(129, 140, 248, 0.9);
  background: rgba(99, 102, 241, 0.12);
  border-radius: 3px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
#drawflow {
  width: 100%; height: 100%;
  background-color: #0a0e17;
  background-size: 24px 24px;
  background-image: radial-gradient(circle, #1e293b 1px, transparent 1px);
}

/* ── Drawflow: reset node shell ── */
#drawflow .drawflow-node {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-width: unset !important;
  width: auto !important;
  padding: 0 !important;
}
#drawflow .drawflow-node.selected {
  box-shadow: none !important;
}
#drawflow .drawflow-node.selected .wf-node-card {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,.25), 0 8px 24px rgba(0,0,0,.45);
}

/* ── Connection ports ── */
#drawflow .drawflow-node .inputs,
#drawflow .drawflow-node .outputs {
  width: 0 !important;
}
#drawflow .drawflow-node .input,
#drawflow .drawflow-node .output {
  width: 11px !important;
  height: 11px !important;
  border: 2px solid #6366f1 !important;
  background: #0f172a !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
  transition: transform .15s, background .15s, box-shadow .15s;
}
#drawflow .drawflow-node .input:hover,
#drawflow .drawflow-node .output:hover {
  background: #6366f1 !important;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(99,102,241,.35) !important;
}

/* ── Connection lines ── */
#drawflow .connection .main-path {
  stroke: #475569 !important;
  stroke-width: 2.5px !important;
}
#drawflow .connection .main-path:hover {
  stroke: #818cf8 !important;
}
#drawflow .connection .point {
  stroke: #6366f1 !important;
  fill: #6366f1 !important;
}

/* ── Node card (n8n-style) ── */
.wf-node-card {
  position: relative;
  display: flex;
  min-width: 188px;
  max-width: 220px;
  background: linear-gradient(145deg, #1a2236 0%, #141c2e 100%);
  border: 1px solid #2a3a52;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  font-family: Inter, sans-serif;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.wf-node-card:hover {
  border-color: #3d4f6a;
  transform: translateY(-1px);
}
.wf-node-card__accent {
  width: 4px;
  flex-shrink: 0;
  background: #64748b;
}
.wf-node-card--emerald .wf-node-card__accent { background: linear-gradient(180deg, #34d399, #059669); }
.wf-node-card--teal .wf-node-card__accent    { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.wf-node-card--violet .wf-node-card__accent  { background: linear-gradient(180deg, #a78bfa, #6366f1); }
.wf-node-card--amber .wf-node-card__accent   { background: linear-gradient(180deg, #fbbf24, #d97706); }
.wf-node-card--orange .wf-node-card__accent  { background: linear-gradient(180deg, #fb923c, #ea580c); }
.wf-node-card--cyan .wf-node-card__accent    { background: linear-gradient(180deg, #22d3ee, #0891b2); }
.wf-node-card--yellow .wf-node-card__accent  { background: linear-gradient(180deg, #facc15, #ca8a04); }
.wf-node-card--blue .wf-node-card__accent    { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.wf-node-card--slate .wf-node-card__accent   { background: linear-gradient(180deg, #94a3b8, #64748b); }

.wf-node-card__content {
  flex: 1;
  padding: 10px 12px 11px;
  min-width: 0;
}
.wf-node-card__header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.wf-node-card__icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.wf-node-card__type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}
.wf-node-card__label {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Legacy drawflow inner nodes (workflows guardados antes del rediseño) */
#drawflow .drawflow-node .title-box {
  display: none !important;
}
#drawflow .drawflow-node .box {
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #e2e8f0 !important;
  background: linear-gradient(145deg, #1a2236, #141c2e) !important;
  border: 1px solid #2a3a52 !important;
  border-radius: 10px !important;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

.wf-props {
  background: var(--panel, #111827); border-left: 1px solid var(--border);
  padding: 12px; overflow-y: auto;
  transition: box-shadow .2s, border-color .2s;
}
.wf-props--active {
  border-left-color: #6366f1;
  box-shadow: inset 4px 0 0 #6366f1;
}
.wf-props-hint {
  font-size: 12px; color: var(--text3, #64748b); line-height: 1.5;
  padding: 8px 10px; background: rgba(99,102,241,.08); border-radius: 8px;
  border: 1px dashed rgba(99,102,241,.3);
}
.wf-props-node-title {
  font-size: 13px; font-weight: 600; color: var(--text, #e2e8f0);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.wf-props-node-title span { font-weight: 400; color: var(--text3); font-size: 11px; }
.wf-props-callout {
  font-size: 11px; color: #a5b4fc; background: rgba(99,102,241,.1);
  padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; line-height: 1.4;
}
.wf-props-desc {
  font-size: 11px; color: var(--text2); margin: -6px 0 12px;
  padding-left: 2px; line-height: 1.4;
}
.wf-node-card--unset .wf-node-card__label {
  color: #94a3b8; font-style: italic;
}
.wf-props-empty { font-size: 12px; color: var(--text3); }
.wf-props .field { margin-bottom: 12px; }
.wf-props label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.wf-props input, .wf-props select, .wf-props textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border, #2a3a52);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
}
.wf-props select {
  cursor: pointer;
  appearance: auto;
}
.wf-props select option,
.wf-props select optgroup {
  background-color: #0f172a;
  color: #e2e8f0;
}
.wf-props select option:checked,
.wf-props select option:hover {
  background-color: #3730a3;
  color: #ffffff;
}
.wf-props input:focus,
.wf-props select:focus,
.wf-props textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.wf-props textarea {
  min-height: 80px;
  resize: vertical;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.wf-hint { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* Same fix for modal inputs */
.wf-modal-box textarea,
.wf-modal-box input,
.wf-modal-box select {
  color-scheme: dark;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--border, #2a3a52);
}
.wf-modal-box select option {
  background-color: #0f172a;
  color: #e2e8f0;
}

.wf-runs-panel {
  height: 160px;
  min-height: 48px;
  max-height: 70vh;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: height .15s ease;
}
.wf-runs-panel.is-expanded {
  height: 55vh !important;
}
.wf-runs-resize {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  z-index: 5;
}
.wf-runs-resize:hover,
.wf-runs-resize.is-dragging {
  background: rgba(99, 102, 241, 0.35);
}
.wf-runs-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wf-runs-header h3 { margin: 0; font-size: 13px; }
.wf-runs-hint { font-size: 11px; color: var(--text3); flex: 1; }
.wf-runs-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}
.wf-runs-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  align-content: start;
}
.wf-run-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.wf-run-item:hover { border-color: #6366f1; }
.wf-run-item.selected { border-color: var(--accent, #6366f1); box-shadow: 0 0 0 1px rgba(99,102,241,.35); }
.wf-run-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wf-run-status.completed { background: #10b981; }
.wf-run-status.failed { background: #ef4444; }
.wf-run-status.running { background: #f59e0b; }
.wf-run-status.skipped { background: #64748b; }
.wf-run-status.succeeded { background: #10b981; }
.wf-run-status.pending { background: #64748b; }

/* Full run detail drawer */
.wf-run-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.wf-run-drawer.is-open {
  pointer-events: auto;
  opacity: 1;
}
.wf-run-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
}
.wf-run-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(920px, 92vw);
  background: var(--panel, #111827);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 48px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  transform: translateX(24px);
  transition: transform .2s ease;
}
.wf-run-drawer.is-open .wf-run-drawer__panel {
  transform: translateX(0);
}
.wf-run-drawer__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wf-run-drawer__head h3 {
  margin: 0;
  font-size: 15px;
  flex: 1;
}
.wf-run-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text, #f1f5f9);
}
.wf-run-drawer__body .wf-step-body pre {
  max-height: 360px;
  font-size: 11px;
}

.wf-run-error {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  font-size: 12px;
}
.wf-run-error strong { display: block; margin-bottom: 4px; color: #fca5a5; }
.wf-run-error p { margin: 0; color: #fecaca; line-height: 1.45; word-break: break-word; }

.wf-run-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.wf-run-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.wf-run-tab:hover { color: var(--text); background: var(--surface); }
.wf-run-tab.is-active {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}
.wf-run-tabpanels { min-height: 200px; }
.wf-run-tabpanel { display: none; }
.wf-run-tabpanel.is-active { display: block; }

.wf-json-block {
  margin: 4px 0 10px;
  padding: 10px 12px;
  background: #0d1117;
  border-radius: 8px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--border);
  color: var(--text, #e2e8f0);
}
.wf-copy-block { margin: 0 0 12px; }
.wf-copy-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wf-copy-block__head strong {
  font-size: 13px;
  color: var(--text2, #cbd5e1);
}
.wf-copy-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #475569);
  background: var(--surface, #1e293b);
  color: var(--text2, #cbd5e1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.wf-copy-btn:hover {
  color: var(--text, #f8fafc);
  border-color: var(--accent, #818cf8);
}
.wf-copy-btn.is-copied {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
.wf-copy-block .wf-json-block { margin: 0; }
.wf-step-err { color: #ef4444; margin: 0 0 8px; }

.wf-badge--completed { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.wf-badge--failed { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.wf-badge--running { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

.wf-step-timeline { display: flex; flex-direction: column; gap: 6px; }
.wf-step { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.wf-step-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer;
  background: var(--surface); font-size: 12px;
}
.wf-step-body { display: none; padding: 10px 12px; font-size: 11px; background: #0d1117; }
.wf-step.open .wf-step-body { display: block; }
.wf-step-body pre {
  margin: 4px 0; padding: 8px; background: #000; border-radius: 4px;
  overflow-x: auto; font-size: 10px; max-height: 200px;
}

.wf-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.wf-modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; width: 480px; max-width: 90vw;
}
.wf-modal-box h3 { margin: 0 0 12px; font-size: 15px; }
.wf-modal-box textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px; font-family: monospace; font-size: 12px; }
.wf-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.wf-run-progress { margin-top: 12px; font-size: 12px; max-height: 260px; overflow-y: auto; }

.wf-live-progress {
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12px;
}
.wf-live-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  color: var(--text2); position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.wf-live-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #f59e0b;
  animation: wf-pulse 1.2s ease-out infinite; flex-shrink: 0;
}
@keyframes wf-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.wf-live-list { padding: 4px 0; }
.wf-live-empty { padding: 10px; color: var(--text3); }
.wf-live-step {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 7px 10px; border-left: 3px solid transparent;
}
.wf-live-step--running { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.wf-live-step--succeeded { border-left-color: #10b981; }
.wf-live-step--failed { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.wf-live-icon { width: 14px; text-align: center; font-weight: 700; flex-shrink: 0; }
.wf-live-step--running .wf-live-icon { color: #f59e0b; }
.wf-live-step--succeeded .wf-live-icon { color: #10b981; }
.wf-live-step--failed .wf-live-icon { color: #ef4444; }
.wf-live-title { color: var(--text); }
.wf-live-meta { color: var(--text3); font-size: 11px; }
.wf-live-err { color: #fca5a5; font-size: 11px; margin-top: 3px; }

#drawflow .drawflow-node.wf-exec-running .wf-node-card {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 8px 24px rgba(0,0,0,.45) !important;
}
#drawflow .drawflow-node.wf-exec-ok .wf-node-card {
  border-color: #10b981 !important;
}
#drawflow .drawflow-node.wf-exec-fail .wf-node-card {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
}

.wf-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 16px 0; }
.wf-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.wf-card-title { font-weight: 600; margin-bottom: 4px; }
.wf-card-desc { font-size: 12px; color: var(--text2); margin-bottom: 12px; min-height: 36px; }
.wf-card-meta { font-size: 11px; color: var(--text3); margin-bottom: 12px; }
.wf-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Trigger field builder — stacked cards (props panel is narrow) */
.wf-field-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 12px;
}
.wf-field-card {
  background: var(--surface, #111827);
  border: 1px solid var(--border, #1f2937);
  border-radius: 10px;
  padding: 10px 12px;
}
.wf-field-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.wf-field-card__num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.wf-fb-del {
  appearance: none;
  background: transparent;
  border: 0;
  color: #f87171;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
}
.wf-fb-del:hover {
  background: rgba(248, 113, 113, .12);
}
.wf-field-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.wf-field-card__cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.wf-field-card__cell label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3, #64748b);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.wf-field-card__cell input,
.wf-field-card__cell select {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel, #0b1220);
  border: 1px solid var(--border, #1f2937);
  color: var(--text, #e2e8f0);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 12px;
  min-height: 34px;
}
.wf-field-card__cell--req {
  justify-content: flex-end;
  padding-bottom: 2px;
}
.wf-fb-req {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2, #cbd5e1);
  cursor: pointer;
  margin: 0;
  padding: 6px 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.wf-fb-req input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #10b981;
  flex-shrink: 0;
}
.wf-fb-add {
  width: 100%;
  justify-content: center;
  border: 1px dashed var(--border, #334155) !important;
  border-radius: 8px;
  padding: 8px 12px !important;
  color: var(--text2) !important;
}
.wf-fb-add:hover {
  border-color: #64748b !important;
  color: var(--text) !important;
}

.wf-input-with-picker { display: flex; gap: 6px; align-items: flex-start; }
.wf-input-with-picker textarea, .wf-input-with-picker input { flex: 1; min-width: 0; }
.wf-picker-btn { flex-shrink: 0; white-space: nowrap; }

.wf-dyn-picker {
  position: fixed; z-index: 200; width: 340px; max-height: 360px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); display: none; overflow: hidden;
}
.wf-dyn-picker__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.wf-dyn-search {
  width: calc(100% - 16px); margin: 8px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 12px;
}
.wf-dyn-picker__body { overflow-y: auto; max-height: 280px; padding: 0 0 8px; }
.wf-dyn-group__title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text3);
  padding: 8px 12px 4px;
}
.wf-dyn-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--text);
  padding: 6px 12px; cursor: pointer; font-size: 12px;
}
.wf-dyn-item:hover { background: var(--surface); }
.wf-dyn-item code { font-size: 10px; color: var(--text3); }

.wf-args-map { display: flex; flex-direction: column; gap: 8px; }
.wf-advanced { margin-top: 8px; font-size: 12px; color: var(--text2); }
.wf-advanced textarea { width: 100%; margin-top: 6px; min-height: 80px; }

.wf-node-card--pink .wf-node-card__accent { background: #ec4899; }
.wf-node-card--indigo .wf-node-card__accent { background: #6366f1; }

.wf-findings { margin-bottom: 12px; }
.wf-findings h4 { margin: 0 0 8px; font-size: 13px; }
.wf-finding {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 6px;
  background: var(--surface); font-size: 12px;
}
.wf-finding p { margin: 8px 0 0; color: var(--text2, #cbd5e1); line-height: 1.55; font-size: 14px; }
.wf-finding--critical { border-color: #ef4444; }
.wf-finding--high { border-color: #f97316; }
.wf-finding--medium { border-color: #eab308; }
.wf-finding--info { border-color: #38bdf8; }

.wf-report-dash {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0;
}
.wf-report-header {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(63, 81, 181, 0.12), rgba(6, 182, 212, 0.08));
}
.wf-report-header__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}
.wf-report-header__empresa {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent, #6366f1);
}
.wf-report-header__meta {
  margin: 0;
  font-size: 12px;
  color: var(--text3);
}
.wf-report-narrative {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.55;
  max-height: 420px;
  overflow: auto;
}
.wf-report-narrative h2, .wf-report-narrative h3, .wf-report-narrative h4 {
  margin: 12px 0 6px;
  font-size: 14px;
}
.wf-report-narrative ul { margin: 8px 0; padding-left: 20px; }

.wf-kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.wf-kpi-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.wf-kpi-card__label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.wf-kpi-card__value { font-size: 20px; font-weight: 700; margin-top: 4px; color: var(--text); }
.wf-kpi-card__meta { font-size: 11px; color: var(--text3); margin-top: 4px; }
.wf-report-section { margin: 14px 0; }
.wf-report-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--text2); }
.wf-report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wf-report-table th, .wf-report-table td {
  border: 1px solid var(--border); padding: 6px 8px; text-align: left;
}
.wf-report-table th { background: var(--surface); color: var(--text2); }
.wf-kpi-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px;
}
.wf-kpi-tile .v { font-size: 18px; font-weight: 600; }
.wf-kpi-tile .l { font-size: 11px; color: var(--text3); }
