/* Workflows (025 Stijlboek, 6.6 Workflowbalk; 9.5 Zijpaneel). */

/* Process bar on a record */
.flow { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r); display: flex; align-items: stretch; overflow-x: auto; margin-bottom: 10px; }
.flow .tag { background: var(--grad-d); color: #fff; padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; min-width: 180px; text-decoration: none; }
.flow .tag b { font-size: 12px; }
.flow .tag span { font-size: 11px; opacity: .85; }
.flow .steps { display: flex; flex: 1; align-items: flex-start; padding: 0 16px; margin: 0; list-style: none; min-width: max-content; }
.flow .step { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; font-size: 11px; color: var(--fg-2); padding: 8px 4px; text-align: center; }
.flow .step::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.flow .step:first-child::before { display: none; }
.flow .step.done::before, .flow .step.cur::before { background: var(--accent); }
.flow .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); position: relative; z-index: 1; display: grid; place-items: center; }
.flow .step.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.flow .step.cur .dot { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 10px var(--accent); }
.flow .step.cur { color: var(--fg); font-weight: 600; }
.flow .step svg { width: 11px; height: 11px; stroke-width: 3; }

/* Editor */
.wf-view { display: flex; flex-direction: column; gap: 10px; }
.wf-meta .body { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.wf-meta .fr { margin: 0; min-width: 220px; }
.wf-meta .fr.grow { flex: 1; }
.wf-state { margin: 0; display: flex; gap: 8px; align-items: center; }
.wf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 10px; min-height: 560px; }
.wf-canvas { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-height: 560px;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.wf-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wf-panel { position: sticky; top: 10px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; }
.wf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.wf-tabs button { background: none; border: 0; padding: 10px 8px 8px; border-bottom: 2px solid transparent; color: var(--fg-2); font: inherit; cursor: pointer; }
.wf-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--fg); font-weight: 600; }
.wf-due span { display: flex; gap: 6px; }
.wf-due input { width: 80px; }
.wf-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.wf-conds { display: flex; flex-direction: column; gap: 6px; }
.wf-group { border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.wf-cond { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.wf-cond .in { min-width: 0; padding: 4px 6px; }
.wf-or { font-size: 11px; font-weight: 700; color: var(--fg-2); text-align: center; }
.wf-vars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.wf-var { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; }
.wf-var .wf-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--fg-2); }
.wf-var .wf-field[hidden] { display: none; }
.wf-var .btn { justify-self: start; }

/* Blocks on the canvas (overrides of drawflow.css) */
.wf-canvas .drawflow .drawflow-node.wf-node { background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--r); box-shadow: var(--shadow); width: 190px; min-height: 0; padding: 8px 10px; }
.wf-canvas .drawflow .drawflow-node.wf-node.selected { background: var(--accent-soft); border-color: var(--accent); }
.wf-canvas .drawflow .drawflow-node.wf-node.wf-bad { border-color: var(--bad); border-left-color: var(--bad); }
.wf-canvas .drawflow-node .drawflow_content_node { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.wf-canvas .wf-n-title { font-size: 13px; overflow-wrap: anywhere; }
.wf-canvas .wf-n-sub, .wf-canvas .wf-n-cond { font-size: 11px; color: var(--fg-2); }
.wf-canvas .wf-n-cond { color: var(--warn); }
.wf-canvas .drawflow .drawflow-node .input, .wf-canvas .drawflow .drawflow-node .output { width: 14px; height: 14px; border: 2px solid var(--accent); background: var(--surface); }
.wf-canvas .drawflow .drawflow-node .input { left: -19px; }
.wf-canvas .drawflow .drawflow-node .output { right: -9px; }
.wf-canvas .drawflow .connection .main-path { stroke: var(--accent); stroke-width: 2.5px; }
.wf-canvas .drawflow .connection .main-path:hover, .wf-canvas .drawflow .connection .main-path.selected { stroke: var(--bad); }
.wf-canvas .drawflow-delete { background: var(--bad); color: #fff; border: 2px solid var(--surface); }
.wf-canvas.parent-drawflow { min-height: 560px; }

@media (max-width: 900px) {
  .wf-layout { grid-template-columns: 1fr; }
  .wf-panel { position: static; max-height: none; }
}
