/* Workflows screen (workflows.js). Uses the portal --sh-* tokens, so it follows light/dark. */
.wf-root { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.wf-root .material-symbols-outlined { font-size: 18px; line-height: 1; vertical-align: middle; flex-shrink: 0; }
.wf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; background: var(--sh-surface-lowest); box-shadow: var(--sh-shadow); border-radius: 12px; padding: 20px 24px; }
.wf-head h1 { margin: 4px 0 0; font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.wf-head p { margin: 6px 0 0; font-size: 14px; color: var(--sh-on-surface-variant); max-width: 640px; }
.wf-kicker { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; font-weight: 700; color: var(--sh-on-surface-variant); text-transform: uppercase; letter-spacing: .06em; }
.wf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--sh-surface-container); }
.wf-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--sh-primary-container); }
.wf-chip.wf-live i { background: #2e9e5b; } .wf-chip.wf-off i { background: var(--sh-error); }
.wf-root .btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; font-family: var(--sh-font); font-weight: 600; cursor: pointer; }
.wf-root .btn-sm { font-size: 12px; padding: 7px 12px; }
.wf-root .btn-secondary { background: var(--sh-surface-lowest); color: var(--sh-on-surface); border: none; box-shadow: var(--sh-shadow); }
.wf-root .btn-ghost { background: transparent; color: var(--sh-on-surface-variant); border: none; }
.wf-root .btn-ghost:hover, .wf-root .btn-secondary:hover { background: var(--sh-surface-low); }
.wf-root .wf-gold { background: var(--sh-primary-container); color: var(--sh-on-primary-container); border: none; font-weight: 700; }
.wf-root .wf-gold:disabled { opacity: .5; cursor: not-allowed; }
.wf-root .wf-danger:hover { color: var(--sh-error); }
.wf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.wf-kpi { position: relative; overflow: hidden; background: var(--sh-surface-lowest); box-shadow: var(--sh-shadow); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.wf-kpi::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--sh-surface-high); }
.wf-kpi.wf-accent::before { background: var(--sh-primary-container); }
.wf-lbl { font-size: 11px; font-weight: 700; color: var(--sh-on-surface-variant); text-transform: uppercase; letter-spacing: .06em; }
.wf-val { font-size: 22px; line-height: 28px; font-weight: 800; }
.wf-pos { display: flex; gap: 12px; flex-wrap: wrap; }
.wf-pos-item { display: flex; gap: 10px; align-items: flex-start; background: var(--sh-surface-lowest); box-shadow: var(--sh-shadow); border-radius: 12px; padding: 12px 16px; font-size: 13px; min-width: 0; }
.wf-pos-item .material-symbols-outlined { color: var(--sh-primary); }
.wf-meta { font-size: 12px; color: var(--sh-on-surface-variant); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.wf-card, .wf-new { background: var(--sh-surface-lowest); box-shadow: var(--sh-shadow); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wf-card.wf-on { box-shadow: var(--sh-shadow), inset 3px 0 0 var(--sh-primary-container); }
.wf-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.wf-title { min-width: 0; } .wf-title h3 { margin: 0 0 4px; font-size: 16px; }
.wf-desc { margin: 0; font-size: 13px; color: var(--sh-on-surface-variant); }
.wf-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.wf-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: wf; }
.wf-step { counter-increment: wf; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--sh-surface-low); font-size: 13px; }
.wf-step::before { content: counter(wf); font-size: 11px; font-weight: 800; color: var(--sh-on-surface-variant); width: 16px; }
.wf-step .material-symbols-outlined { color: var(--sh-primary); }
.wf-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; padding: 8px 12px; border-radius: 8px; background: var(--sh-surface-container); color: var(--sh-on-surface-variant); }
.wf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wf-runs { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--sh-surface-high); padding-top: 12px; }
.wf-run-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wf-badge { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--sh-surface-container); }
.wf-s-succeeded { background: rgba(46,158,91,.16); color: #1f7a45; } .wf-s-failed { background: rgba(186,26,26,.14); color: var(--sh-error); }
.wf-s-waiting, .wf-s-running, .wf-s-queued { background: rgba(245,158,11,.18); }
.wf-log { margin: 0; padding-left: 18px; font-size: 12px; color: var(--sh-on-surface-variant); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.wf-log b { color: var(--sh-on-surface); } .wf-log-failed { color: var(--sh-error); }
.wf-error { font-size: 12px; color: var(--sh-error); margin-bottom: 4px; }
.wf-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--sh-on-surface-variant); grid-column: 1 / -1; }
.wf-new h2 { margin: 0; font-size: 18px; }
.wf-new label, .wf-custom label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--sh-on-surface-variant); }
.wf-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.wf-tpl { text-align: left; font-family: inherit; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; border: 2px solid transparent; background: var(--sh-surface-low); color: var(--sh-on-surface); cursor: pointer; }
.wf-tpl span { font-size: 12px; color: var(--sh-on-surface-variant); }
.wf-tpl.active { border-color: var(--sh-primary-container); background: var(--sh-surface-lowest); }
.wf-custom { display: flex; flex-direction: column; gap: 12px; }
.wf-addrow { display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) { .wf-head { padding: 16px; } .wf-list { grid-template-columns: 1fr; } }
