/* Visual process editor (Drawflow) - node cards, palette and config panel.
 * Plain CSS (imported from process_editor_controller.js); intentionally outside
 * Tailwind's utility scan since the node markup is generated in JS. */

.pm-editor {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0.75rem;
    height: 70vh;
    min-height: 480px;
}

.pm-canvas {
    position: relative;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 0.5rem;
    background:
        radial-gradient(circle, rgba(0, 0, 0, 0.06) 1px, transparent 1px) 0 0 /
            22px 22px,
        #fafafa;
    overflow: hidden;
}

.dark .pm-canvas {
    border-color: #374151;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px)
            0 0 / 22px 22px,
        #111827;
}

/* Drawflow node body */
.drawflow .pm-node {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    min-width: 180px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.drawflow .pm-node .drawflow_content_node {
    padding: 0.5rem 0.75rem;
}

.pm-node__type {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.pm-node__label {
    font-weight: 600;
    color: #111827;
}

.pm-node__meta {
    font-size: 0.7rem;
    color: #6b7280;
}

.pm-form {
    border-left: 3px solid #3b82f6;
}
.pm-approval {
    border-left: 3px solid #16a34a;
}
.pm-email {
    border-left: 3px solid #f59e0b;
}
.pm-api {
    border-left: 3px solid #8b5cf6;
}

/* Config panel */
.pm-panel {
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem;
    overflow-y: auto;
}

.dark .pm-panel {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

.pm-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pm-panel__title {
    font-weight: 600;
}
.pm-panel__hint {
    font-size: 0.85rem;
    color: #6b7280;
}

.pm-field {
    margin-bottom: 0.75rem;
}
.pm-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.pm-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.85rem;
    background: #fff;
}

.dark .pm-input {
    background: #111827;
    border-color: #374151;
    color: #e5e7eb;
}

.pm-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.pm-role {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.pm-role__levels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pm-btn-secondary,
.pm-btn-danger {
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.pm-btn-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.pm-errors {
    list-style: disc;
    margin: 0.5rem 0 0 1.25rem;
    color: #b91c1c;
    font-size: 0.85rem;
}

.pm-flash {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

.pm-flash--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pm-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pm-trans {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.4rem;
    margin-bottom: 0.4rem;
}

.dark .pm-trans {
    border-color: #374151;
}

.pm-trans__head {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.pm-trans__extra {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

/* Inline hint under a config field (AI / report steps). */
.pm-help {
    margin: 6px 0 0;
    font-size: 11px;
    color: #6b7280;
}
.dark .pm-help {
    color: #9ca3af;
}
