/* /Components/Layout/MainLayout.razor.rz.scp.css */
.page[b-3gk0w1z6or] {
    position: relative;
    display: flex;
    flex-direction: column;
}

main[b-3gk0w1z6or] {
    flex: 1;
}

.top-row[b-3gk0w1z6or] {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.top-row[b-3gk0w1z6or]  a, .top-row[b-3gk0w1z6or]  .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row[b-3gk0w1z6or]  a:hover, .top-row[b-3gk0w1z6or]  .btn-link:hover {
    text-decoration: underline;
}

.top-row[b-3gk0w1z6or]  a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
    .top-row[b-3gk0w1z6or] {
        justify-content: space-between;
    }

    .top-row[b-3gk0w1z6or]  a, .top-row[b-3gk0w1z6or]  .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page[b-3gk0w1z6or] {
        flex-direction: row;
    }

    .sidebar[b-3gk0w1z6or] {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row[b-3gk0w1z6or] {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth[b-3gk0w1z6or]  a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row[b-3gk0w1z6or], article[b-3gk0w1z6or] {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

#blazor-error-ui[b-3gk0w1z6or] {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss[b-3gk0w1z6or] {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
/* /Components/Pages/AdminPages/Workflows/WorkflowEditorPage.razor.rz.scp.css */
/* Workflow-Editor: Vollbild-Layout mit Palette, Canvas und Inspector.
   Der Canvas ist bewusst dunkel (wie in n8n/Figma); Panels folgen dem App-Theme. */

.wf-editor[b-n1bqy7a7yf] {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 96px);
    min-height: 520px;
    background: var(--mud-palette-background);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--mud-palette-lines-default);
}

/* ── Header ─────────────────────────────────────────────────── */

.wf-header[b-n1bqy7a7yf] {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.wf-header-spacer[b-n1bqy7a7yf] { flex: 1; }

.wf-dirty-dot[b-n1bqy7a7yf] { color: var(--mud-palette-warning); margin-left: -2px; }

/* Panel-Toggles: nur auf schmalen Screens sichtbar (dort sind Panels Overlays) */
.wf-panel-toggle[b-n1bqy7a7yf] { display: none; }

/* ── Body: Palette | Canvas | Inspector ─────────────────────── */

.wf-body[b-n1bqy7a7yf] {
    display: flex;
    flex: 1;
    min-height: 0;               /* erlaubt Kindern, unterhalb zu schrumpfen */
    position: relative;          /* Anker für mobile Overlays + Backdrop */
}

/* ── Palette ────────────────────────────────────────────────── */

.wf-palette[b-n1bqy7a7yf] {
    width: 230px;
    flex: 0 0 auto;
    padding: 12px;
    overflow-y: auto;
    background: var(--mud-palette-surface);
    border-right: 1px solid var(--mud-palette-lines-default);
}

.wf-palette-title[b-n1bqy7a7yf] {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 10px;
}

.wf-palette-item[b-n1bqy7a7yf] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 4px solid var(--wf-accent, #888);
    background: var(--mud-palette-background);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.wf-palette-item:hover[b-n1bqy7a7yf] {
    box-shadow: none;
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--wf-accent, #888) 50%, var(--mud-palette-lines-default));
}

.wf-palette-mi[b-n1bqy7a7yf] { color: var(--wf-accent, var(--mud-palette-primary)); }

.wf-palette-text[b-n1bqy7a7yf] { flex: 1; min-width: 0; }

.wf-palette-name[b-n1bqy7a7yf] { font-weight: 600; font-size: 0.85rem; }

.wf-palette-desc[b-n1bqy7a7yf] {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    white-space: normal;
    line-height: 1.25;
}

.wf-palette-add[b-n1bqy7a7yf] { color: var(--mud-palette-text-secondary); }
.wf-palette-item:hover .wf-palette-add[b-n1bqy7a7yf] { color: var(--wf-accent, var(--mud-palette-primary)); }

.wf-palette-hint[b-n1bqy7a7yf] {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.45;
}

.wf-palette-hint p[b-n1bqy7a7yf] { margin: 0 0 8px; }

/* ── Canvas ─────────────────────────────────────────────────── */

.wf-canvas-wrap[b-n1bqy7a7yf] {
    /* Dunkle Canvas-Farbwelt, als Variablen gebündelt */
    --wf-canvas-bg: var(--apple-canvas-parchment);
    --wf-node-fill: var(--apple-canvas);
    --wf-node-stroke: var(--apple-hairline);
    --wf-node-stroke-hover: var(--apple-primary-focus);
    --wf-canvas-text: var(--apple-ink);
    --wf-canvas-sub: var(--apple-ink-muted-48);
    --wf-edge: var(--apple-ink-muted-48);
    --wf-edge-hover: var(--apple-primary);

    position: relative;
    flex: 1;
    min-width: 0;
    outline: none;
    background: var(--wf-canvas-bg);
    overflow: hidden;
}

.wf-canvas[b-n1bqy7a7yf] {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.wf-canvas.wf-panning[b-n1bqy7a7yf] { cursor: grabbing; }

.wf-grid-dot[b-n1bqy7a7yf] { fill: var(--apple-hairline); }

/* Nodes */

.wf-node[b-n1bqy7a7yf] { cursor: pointer; }

.wf-node-card[b-n1bqy7a7yf] {
    fill: var(--wf-node-fill);
    stroke: var(--wf-node-stroke);
    stroke-width: 1;
    transition: stroke 0.1s ease;
}

.wf-node:hover .wf-node-card[b-n1bqy7a7yf] { stroke: var(--wf-node-stroke-hover); }

.wf-node-selected .wf-node-card[b-n1bqy7a7yf] {
    stroke: var(--apple-primary);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.wf-node-iconbox[b-n1bqy7a7yf] {
    fill: color-mix(in srgb, var(--wf-accent, #888) 18%, transparent);
    stroke: color-mix(in srgb, var(--wf-accent, #888) 55%, transparent);
    stroke-width: 1;
}

.wf-node-iconpath[b-n1bqy7a7yf] { fill: var(--wf-accent, var(--apple-ink)); }

/* Node-Texte (Titel/Subtyp/Warnung) werden als MarkupString mit Inline-Attributen
   gerendert (Razor reserviert <text> ohne Attribute) und hier nicht über Klassen gestylt. */

.wf-node-warndot[b-n1bqy7a7yf] { fill: var(--mud-palette-warning); }

/* Ports: großer transparenter Treffer-Kreis + kleiner sichtbarer Punkt.
   Der Punkt selbst hat pointer-events:none, damit der Treffer-Klick sauber greift. */

.wf-port-hit[b-n1bqy7a7yf] { fill: transparent; cursor: crosshair; }

.wf-port[b-n1bqy7a7yf] {
    pointer-events: none;
    transition: r 0.12s ease, stroke-width 0.12s ease;
}

.wf-port-in[b-n1bqy7a7yf] { fill: var(--wf-canvas-bg); stroke: var(--wf-edge-hover); stroke-width: 2; }

.wf-port-out[b-n1bqy7a7yf] { fill: var(--wf-accent, #8a93a8); stroke: var(--apple-canvas); stroke-width: 1.5; }

.wf-port-hit:hover + .wf-port[b-n1bqy7a7yf] { r: 7; stroke-width: 2.5; }

/* Kanten */

/* Breiter, unsichtbarer Treffer-Pfad unter jeder Kante – der 2px-Stroke
   allein ist mit der Maus kaum treffbar */
.wf-edge-hit[b-n1bqy7a7yf] {
    stroke: transparent;
    stroke-width: 16;
    fill: none;
    cursor: pointer;
    pointer-events: stroke;
}

.wf-edge[b-n1bqy7a7yf] {
    stroke: var(--wf-edge);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.wf-edge-hit:hover + .wf-edge[b-n1bqy7a7yf] { stroke: var(--wf-edge-hover); }

.wf-edge-selected[b-n1bqy7a7yf] { stroke: var(--mud-palette-error); stroke-width: 3; }

.wf-ghost-edge[b-n1bqy7a7yf] {
    stroke: var(--mud-palette-warning);
    stroke-width: 2;
    stroke-dasharray: 6 6;
    fill: none;
    pointer-events: none;
}

.wf-edge-delete[b-n1bqy7a7yf] { display: none; pointer-events: none; }

.wf-edge-delete-visible[b-n1bqy7a7yf] { display: inline; }

.wf-edge-delete circle[b-n1bqy7a7yf] { fill: var(--mud-palette-error); }

.wf-edge-delete-icon path[b-n1bqy7a7yf] { fill: var(--apple-on-primary); }

.wf-edge-delete:hover circle[b-n1bqy7a7yf] { fill: color-mix(in srgb, var(--mud-palette-error) 80%, #000000); }

/* Zoom-Steuerung */

.wf-zoombar[b-n1bqy7a7yf] {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--apple-surface-pearl);
    border: 1px solid var(--apple-hairline);
    z-index: 10;
}

.wf-zoom-label[b-n1bqy7a7yf] {
    color: var(--apple-ink-muted-80);
    font-size: 0.75rem;
    min-width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Verbindungs-Hinweis */

.wf-connect-hint[b-n1bqy7a7yf] {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--apple-radius-lg);
    background: var(--mud-palette-warning);
    color: #1d1d1f /* fixed contrast on constant amber */;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: var(--apple-overlay-shadow);
    z-index: 10;
}

/* ── Inspector ──────────────────────────────────────────────── */

.wf-inspector[b-n1bqy7a7yf] {
    width: 340px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-surface);
    border-left: 1px solid var(--mud-palette-lines-default);
    min-height: 0;
}

.wf-inspector-head[b-n1bqy7a7yf] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    border-left: 4px solid var(--wf-accent, #888);
    flex: 0 0 auto;
}

.wf-inspector-mi[b-n1bqy7a7yf] { color: var(--wf-accent, var(--mud-palette-primary)); }

.wf-inspector-title[b-n1bqy7a7yf] { flex: 1; min-width: 0; }

.wf-inspector-type[b-n1bqy7a7yf] { font-weight: 700; font-size: 0.95rem; }

.wf-inspector-key[b-n1bqy7a7yf] {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.wf-inspector-body[b-n1bqy7a7yf] {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Statistik-Karten im Leerzustand */

.wf-stats[b-n1bqy7a7yf] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.wf-stat[b-n1bqy7a7yf] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--mud-palette-primary) 8%, var(--mud-palette-background));
    border: 1px solid var(--mud-palette-lines-default);
}

.wf-stat-value[b-n1bqy7a7yf] { font-weight: 700; font-size: 1rem; line-height: 1.1; }

.wf-stat-on[b-n1bqy7a7yf] { color: var(--mud-palette-success); }
.wf-stat-off[b-n1bqy7a7yf] { color: var(--mud-palette-text-secondary); }

.wf-stat-label[b-n1bqy7a7yf] {
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Node-Typ-Legende */

.wf-legend-title[b-n1bqy7a7yf] {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
    margin: 14px 0 8px;
}

.wf-legend[b-n1bqy7a7yf] { display: flex; flex-direction: column; gap: 6px; }

.wf-legend-row[b-n1bqy7a7yf] {
    display: grid;
    grid-template-columns: 12px 1fr;
    grid-template-areas: "dot name" "dot desc";
    column-gap: 10px;
    align-items: start;
}

.wf-legend-dot[b-n1bqy7a7yf] {
    grid-area: dot;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
}

.wf-legend-name[b-n1bqy7a7yf] { grid-area: name; font-weight: 600; font-size: 0.82rem; }

.wf-legend-desc[b-n1bqy7a7yf] {
    grid-area: desc;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
}

/* ── Statusbar ──────────────────────────────────────────────── */

.wf-statusbar[b-n1bqy7a7yf] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
    flex: 0 0 auto;
    min-height: 34px;
}

.wf-validation[b-n1bqy7a7yf] {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.wf-issue[b-n1bqy7a7yf] {
    border: none;
    border-radius: var(--apple-radius-md);
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wf-issue-error[b-n1bqy7a7yf] {
    background: color-mix(in srgb, var(--mud-palette-error) 12%, transparent);
    color: var(--mud-palette-error);
}

.wf-issue-warn[b-n1bqy7a7yf] {
    background: color-mix(in srgb, var(--mud-palette-warning) 14%, transparent);
    color: var(--mud-palette-warning);
}

.wf-ok[b-n1bqy7a7yf] {
    color: var(--mud-palette-success);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.wf-statusbar-hint[b-n1bqy7a7yf] {
    color: var(--mud-palette-text-secondary);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
}

/* ── Backdrop für mobile Overlays ───────────────────────────── */

.wf-backdrop[b-n1bqy7a7yf] { display: none; }

/* ── Responsive: Panels werden unter 960px zu Overlays ──────── */

@media (max-width: 959.95px) {
    .wf-panel-toggle[b-n1bqy7a7yf] { display: inline-flex; }

    .wf-backdrop-open[b-n1bqy7a7yf] {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 15;
    }

    .wf-palette[b-n1bqy7a7yf],
    .wf-inspector[b-n1bqy7a7yf] {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 20;
        box-shadow: var(--apple-overlay-shadow);
        transition: transform 0.2s ease;
    }

    .wf-palette[b-n1bqy7a7yf] {
        left: 0;
        width: min(300px, 85vw);
        transform: translateX(-105%);
    }

    .wf-inspector[b-n1bqy7a7yf] {
        right: 0;
        width: min(340px, 92vw);
        transform: translateX(105%);
    }

    .wf-palette.wf-open[b-n1bqy7a7yf],
    .wf-inspector.wf-open[b-n1bqy7a7yf] { transform: none; }

    .wf-statusbar-hint[b-n1bqy7a7yf] { display: none; }
}

/* ── Kleine Hilfsjekte ──────────────────────────────────────── */

kbd[b-n1bqy7a7yf] {
    background: var(--mud-palette-action-default-hover);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 0.68rem;
    font-family: inherit;
}
