/* wf.css – Workflow-System (ergänzt app.css) */
.wf-logo { background: linear-gradient(135deg, var(--accent-2), #ec4899); }
.save-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.save-state i { color: var(--ok); font-size: 16px; } .save-state.bad i { color: var(--danger); }
.wf .tabs button .n { width: 18px; height: 18px; border-radius: 50%; font: 700 10.5px/18px var(--mono); text-align: center; background: var(--border); color: var(--text-2); transition: background .2s, color .2s; }
.wf .tabs button.active .n { background: var(--accent); color: #fff; }
.wf .tabs button.done .n { background: var(--ok); color: #fff; }
.wf .tabs button .stale { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-left: -2px; }

.wf-body { display: grid; grid-template-columns: minmax(0, 1fr) 384px; min-height: 0; }
.wf-body[data-stage="task"] { grid-template-columns: minmax(0, 1fr) 420px; }
#wfMain { position: relative; min-width: 0; min-height: 0; background: var(--canvas); }
#wfSide { overflow-y: auto; }
.wf-pad { padding: 2px 0 12px; }
.wf-canvas { position: absolute; inset: 0; }
.wf .dg-add { visibility: hidden; pointer-events: none; }
.wf .dg-hdl { display: none; }

/* schwebende Leisten */
.wf-float { position: absolute; left: 14px; top: 14px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.wf-legendbox { position: absolute; left: 14px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 14px; padding: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; font-size: 12px; color: var(--text-2); box-shadow: var(--shadow); }
.wf-legendbox span { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.wf-legendbox .dg-glyph { width: 54px; } .wf-legendbox .dg-glyph .edge, .wf-legendbox .dg-glyph .ln, .wf-legendbox .dg-glyph path { fill: none; stroke: var(--line); stroke-width: 1.8; stroke-linecap: round; }
.wf-legendbox .dg-glyph .dg-circ { fill: var(--canvas); }
.wf-banner { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 14px; background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); border-radius: 12px; font-size: 13px; }
.wf-banner i { color: var(--warn); font-size: 18px; }

/* Leere Zustände */
.wf-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 24px; }
.wf-empty i { font-size: 44px; color: var(--accent); opacity: .85; }
.wf-empty h3 { margin: 4px 0 0; color: var(--text); font-size: 18px; }
.wf-empty p { margin: 0 0 10px; max-width: 360px; }
.wf-empty .row { display: flex; gap: 8px; }
.wf-empty.small { position: static; padding: 28px 0; } .wf-empty.small i { font-size: 30px; }

/* Aufgabe */
.wf-task { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 16px 22px 14px; gap: 12px; }
.wf-task-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 11px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; color: var(--muted); transition: all .15s; }
.seg button i { font-size: 17px; } .seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px -2px rgba(30, 35, 80, .25); }
.wf-legend { display: flex; gap: 8px; }
.wf-task-body { flex: 1; min-height: 0; display: flex; }
.wf-task-body textarea { flex: 1; resize: none; padding: 20px 24px; font-size: 16px; line-height: 1.8; border-radius: 16px; background: var(--surface); }
.wf-text { flex: 1; overflow-y: auto; padding: 20px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-size: 16.5px; line-height: 2; white-space: pre-wrap; cursor: text; position: relative; }
.wf-task-body .wf-empty { position: relative; flex: 1; background: var(--surface); border: 1px dashed var(--border); border-radius: 16px; }
.wf-hint { margin: 0; display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); } .wf-hint i { font-size: 17px; flex: none; margin-top: 1px; }
.mk { padding: 2px 7px; border-radius: 7px; font-weight: 600; font-size: .96em; color: inherit; background: transparent; }
mark.mk { cursor: pointer; transition: filter .15s; } mark.mk:hover { filter: brightness(.93); }
.mk.e { background: color-mix(in srgb, #5b5bf0 20%, transparent); box-shadow: inset 0 -2px 0 #5b5bf0; }
.mk.a { background: color-mix(in srgb, #10b981 20%, transparent); box-shadow: inset 0 -2px 0 #10b981; }
.mk.r { background: color-mix(in srgb, #f59e0b 24%, transparent); box-shadow: inset 0 -2px 0 #f59e0b; }
.wf-legend .mk { font-size: 12.5px; }
.wf-float-menu { position: fixed; z-index: 200; display: flex; flex-direction: column; min-width: 190px; padding: 5px; background: var(--ink); color: #fff; border-radius: 13px; box-shadow: var(--shadow); }
.wf-float-menu:not(.col) { flex-direction: row; }
.wf-float-menu button { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border: 0; background: transparent; color: #fff; border-radius: 9px; white-space: nowrap; font-weight: 600; font-size: 13px; }
.wf-float-menu button:hover { background: rgba(255, 255, 255, .14); }
.wf-float-menu i { font-size: 17px; }
.wf-float-menu .fm-title { padding: 6px 11px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.wf-float-menu:has(.fm-title) { flex-direction: column; }

/* Kandidaten rechts */
.cand { padding: 9px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cand:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.cand-head { display: flex; align-items: center; gap: 6px; } .cand-head > i { color: var(--accent); font-size: 18px; }
.cand-head input { padding: 4px 8px; font-weight: 650; border-color: transparent; background: transparent; } .cand-head input:focus { background: var(--surface); }
.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 2px; } .rel-grid select { padding: 5px 24px 5px 8px; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.pill { display: inline-flex; align-items: center; gap: 3px; padding: 3px 4px 3px 10px; font-size: 12.5px; font-weight: 600; border-radius: 999px; border: 1px solid color-mix(in srgb, #10b981 45%, var(--border)); background: color-mix(in srgb, #10b981 12%, transparent); color: var(--text); }
.pill button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); } .pill button:hover { background: rgba(0, 0, 0, .1); color: var(--danger); }
.pill-in { width: 92px; padding: 3px 9px; font-size: 12.5px; border-radius: 999px; border-style: dashed; }
button.pill.sug { padding: 3px 10px 3px 6px; border-style: dashed; background: transparent; border-color: var(--border); color: var(--text-2); } button.pill.sug:hover { border-color: var(--accent); color: var(--accent); }
button.pill.pick { padding: 3px 10px; background: transparent; border-color: var(--border); color: var(--text-2); } button.pill.pick.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Konzeptionelle Karten */
.cg-in.weak { box-shadow: 0 0 0 1px var(--border), 0 0 0 5px var(--surface), 0 0 0 6px color-mix(in srgb, var(--c) 70%, var(--border)), 0 6px 20px -10px rgba(30, 35, 80, .3); }
.cg-rows { padding: 4px 0 8px; }
.cg-row { height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 10px; font-size: 13px; }
.cg-row.is-key { background: color-mix(in srgb, var(--warn) 8%, transparent); } .cg-row.is-key .dg-ico { color: var(--warn); } .cg-row .dg-ico i.bx-layer { color: var(--accent-2); }
.cg-an { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cg-an.req { font-weight: 650; }
.cg-tag { font-size: 10.5px; color: var(--muted); } .cg-none { color: var(--muted); font-style: italic; }
.cg-handle { position: absolute; right: -13px; top: 50%; width: 26px; height: 26px; margin-top: -13px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--surface), 0 4px 10px rgba(0, 0, 0, .25); cursor: crosshair; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.cg-handle i { font-size: 15px; } .dg-card:hover .cg-handle, .dg-card.selected .cg-handle { opacity: 1; transform: scale(1); }
.cg-lbl rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.4; } .cg-lbl text { fill: var(--text); font: 600 12.5px var(--sans); }
.dg-rel.selected .cg-lbl rect, .dg-rel:hover .cg-lbl rect { stroke: var(--accent); } .dg-rel .cg-lbl { cursor: pointer; }
.cg-isa .ln, .cg-weak .ln { fill: none; stroke: var(--line); stroke-width: 1.8; } .cg-isa .tri { fill: var(--canvas); stroke: var(--line); stroke-width: 1.8; stroke-linejoin: round; }
.cg-weak .ln { stroke-dasharray: 6 5; } .cg-weak rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; } .cg-weak text { fill: var(--text-2); font: 600 11px var(--sans); }

/* Inspektor */
.attr-list { display: grid; gap: 6px; }
.attr, .colrow { display: flex; align-items: center; gap: 4px; }
.attr input { padding: 5px 8px; font-size: 13px; }
.colrow { flex-wrap: wrap; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.colrow .c-name { flex: 1 1 110px; padding: 5px 8px; font-size: 13px; } .colrow .c-type { flex: 0 0 112px; padding: 5px 24px 5px 8px; font-size: 12px; }
.rel-sum { padding: 10px 12px; margin-bottom: 12px; background: var(--surface-2); border-radius: 12px; font-size: 13px; } .rel-sum p { margin: 4px 0 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11.5px var(--mono); }
.checks { display: grid; gap: 6px; } .chk { display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 13px; background: var(--surface-2); }
.chk i { font-size: 18px; flex: none; } .chk.error { background: color-mix(in srgb, var(--danger) 12%, transparent); } .chk.error i { color: var(--danger); }
.chk.warn i { color: var(--warn); } .chk.info i { color: var(--accent); } .chk.ok i { color: var(--ok); }
.subtabs { display: flex; gap: 2px; padding: 3px; margin-bottom: 14px; background: var(--surface-2); border-radius: 11px; }
.subtabs button { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 5px; padding: 6px 4px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.subtabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px -2px rgba(30, 35, 80, .25); } .subtabs i { font-size: 16px; }

/* Regeln */
.rules { display: grid; gap: 6px; } .rule { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.4; }
.rule.link { cursor: pointer; } .rule.link:hover { background: var(--accent-soft); }
.rtag { flex: none; min-width: 30px; text-align: center; padding: 1px 7px; border-radius: 6px; font: 700 11px var(--mono); color: #fff; background: var(--muted); }
.r-R1 { background: #5b5bf0; } .r-R2 { background: #0ea5e9; } .r-R3 { background: #ec4899; } .r-R4 { background: #8b5cf6; } .r-R5 { background: #14b8a6; } .r-R6 { background: #f59e0b; } .r-R7 { background: #ef4444; } .r-HI { background: var(--muted); }
.legend { margin-top: 14px; } .legend summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 6px 0; } .legend .rule { margin-top: 6px; }

/* Normalisierung */
.ncard { padding: 9px 11px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; } .ncard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.ncard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .ncard-head > span { display: inline-flex; gap: 4px; }
.nf { padding: 1px 7px; border-radius: 6px; font: 700 10.5px var(--mono); } .nf.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); } .nf.bad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.issue { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); } .issue > span:nth-child(2) { flex: 1; } .issue.ok { color: var(--ok); } .issue.ok i { font-size: 16px; }
.fd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; margin-bottom: 5px; border-radius: 9px; background: var(--surface-2); font-size: 13px; } .fd i { vertical-align: middle; color: var(--accent); }
.fd-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); } .fd-pick { margin-bottom: 10px; }

/* Physisch */
.exp { display: grid; gap: 7px; }
.exp-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; transition: all .15s; }
.exp-btn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(40, 40, 120, .5); } .exp-btn:disabled { opacity: .45; pointer-events: none; }
.exp-btn > i { font-size: 24px; color: var(--accent); flex: none; } .exp-btn span { display: grid; min-width: 0; } .exp-btn b { font-size: 13.5px; } .exp-btn small { color: var(--muted); font-size: 12px; }
.exp-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; } .exp-btn.primary > i, .exp-btn.primary small { color: rgba(255, 255, 255, .88); }
.typemap { width: 100%; border-collapse: collapse; font-size: 12.5px; } .typemap td { padding: 3px 4px; } .typemap i { color: var(--muted); vertical-align: middle; }
.ddl { margin: 0; padding: 12px 14px; max-height: 340px; overflow: auto; border-radius: 12px; background: var(--surface-2); font: 12px/1.55 var(--mono); white-space: pre; }

/* Projekte */
.pj-list { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.pj { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; } .pj:hover { background: var(--accent-soft); } .pj.cur { border-color: var(--accent); }
.pj > i { font-size: 22px; color: var(--accent); } .pj span { display: grid; flex: 1; min-width: 0; } .pj small { color: var(--muted); }
@media (max-width: 1100px) { .wf-body, .wf-body[data-stage="task"] { grid-template-columns: minmax(0, 1fr) 320px; } }
.wf-pad > p, .wf-pad > .fld { margin-bottom: 12px; }

.wf-float, .wf-legendbox { max-width: calc(100% - 28px); }
.wf-legendbox { flex-wrap: wrap; row-gap: 4px; }
