/* Atelier Prisma · Fluxo de orçamentos (demonstração ZENT). Painel de automação escuro, tela inteira no computador. */
:root {
  --ink-0: #08080d; --ink-1: #0c0c13; --ink-2: #111119; --ink-3: #171722; --ink-4: #1e1e2b; --ink-5: #272737;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.12); --line-3: rgba(255, 255, 255, 0.18);
  --tx: #efeef8; --tx-2: #bebcd2; --tx-3: #9391ad;
  --violet: #9d8fff; --violet-2: #6d4dff; --violet-3: #5a3bea;
  --mint: #44e2b4; --sky: #62cbff; --indigo: #a9afff; --amber: #f7bd52; --coral: #ff7d89; --slate: #cfcde2;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Sora", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --r-lg: 18px; --r: 14px; --r-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus: 0 0 0 2px var(--ink-1), 0 0 0 4px #b3a8ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; font: 13px/1.45 var(--sans); color: var(--tx); background: var(--ink-0); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

/* Aviso quando aberta fora da vitrine */
.zent-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; align-items: center; padding: 9px 16px; font-size: 0.84rem; color: #e9e5ff; background: #1b1238; border-bottom: 1px solid rgba(157, 143, 255, 0.25); flex: none; }
.zent-bar a { color: #cfc4ff; font-weight: 600; }
.in-frame .zent-bar { display: none; }

/* ---------------- Estrutura ---------------- */
.app { flex: 1; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 18% -10%, rgba(109, 77, 255, 0.16), transparent 60%), radial-gradient(900px 500px at 100% 110%, rgba(68, 226, 180, 0.07), transparent 60%), var(--ink-0); }

.topbar { flex: none; display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); background: rgba(12, 12, 19, 0.7); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-name { font: 650 14px/1 var(--display); letter-spacing: -0.02em; }
.brand-name span { font-weight: 400; color: var(--tx-3); }
.crumbs { display: flex; align-items: center; gap: 6px; padding-left: 16px; border-left: 1px solid var(--line); color: var(--tx-3); font-size: 12.5px; }
.crumbs .ico { width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--tx); font-weight: 550; }
.top-meta { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 550; border: 1px solid var(--line-2); color: var(--tx-2); background: rgba(255, 255, 255, 0.03); white-space: nowrap; }
.pill-env { color: #bff5e3; border-color: rgba(68, 226, 180, 0.28); background: rgba(68, 226, 180, 0.08); }
.pill-env .dot { background: var(--mint); }
.pill-sample { color: #e2dcff; border-color: rgba(157, 143, 255, 0.3); background: rgba(157, 143, 255, 0.08); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--tx-3); flex: none; }
.live-dot { background: var(--mint); box-shadow: 0 0 0 0 rgba(68, 226, 180, 0.55); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(68, 226, 180, 0); } 100% { box-shadow: 0 0 0 0 rgba(68, 226, 180, 0); } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; color: var(--tx-2); background: var(--ink-2); border: 1px solid var(--line); }
.clock-time { font-family: var(--mono); color: var(--tx); font-variant-numeric: tabular-nums; }
.is-held .live-dot, .is-stopped .live-dot { animation: none; background: var(--amber); }
.is-stopped .live-dot { background: var(--tx-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 12.5px; white-space: nowrap; transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { color: #fff; background: linear-gradient(180deg, #7a5cff, var(--violet-2)); border-color: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 24px -10px rgba(109, 77, 255, 0.8); }
.btn-primary:hover { background: linear-gradient(180deg, #8669ff, #6a4af5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 28px -10px rgba(109, 77, 255, 0.95); }
.btn-ghost { color: var(--tx-2); background: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--tx); border-color: var(--line-3); background: var(--ink-3); }
[data-live] .i-play { display: none; }
.is-stopped [data-live] .i-play { display: block; }
.is-stopped [data-live] .i-pause { display: none; }
.team { display: flex; padding-left: 4px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 650 10.5px/1 var(--display); color: #fff; border: 2px solid var(--ink-1); letter-spacing: 0.02em; }
.team .avatar + .avatar { margin-left: -8px; }
.avatar.sm { width: 20px; height: 20px; font-size: 8.5px; border-width: 1.5px; }
.av-bt { background: linear-gradient(135deg, #7357ff, #4a2fd6); }
.av-cf { background: linear-gradient(135deg, #0d8a69, #08654d); }
.av-lm { background: linear-gradient(135deg, #a6620a, #7c4703); }

.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-rows: 332px minmax(0, 1fr) 232px; grid-template-areas: "flow runs" "flow hist" "queue hist"; gap: 12px; padding: 12px; }
.panel { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 120px), var(--ink-1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px -32px rgba(0, 0, 0, 0.9); }
.flow { grid-area: flow; overflow: hidden; }
.runs { grid-area: runs; }
.hist { grid-area: hist; }
.queue { grid-area: queue; }
.tabs { display: none; }
.panel-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { display: flex; align-items: center; gap: 8px; font: 600 13.5px/1.2 var(--display); letter-spacing: -0.01em; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px; font: 600 11px/1 var(--mono); color: var(--tx-2); background: var(--ink-4); }

/* ---------------- Cabeçalho do fluxo ---------------- */
.flow-head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tx-3); margin-bottom: 6px; }
.eyebrow-tag { padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: #d8d1ff; background: rgba(157, 143, 255, 0.14); }
h1 { font: 650 22px/1.1 var(--display); letter-spacing: -0.03em; }
.lede { margin-top: 4px; color: var(--tx-2); font-size: 12.5px; }
.kpis { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); overflow: hidden; }
.kpi { padding: 8px 14px; min-width: 96px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi dt { font-size: 10.5px; color: var(--tx-3); white-space: nowrap; }
.kpi-note { color: var(--tx-3); opacity: 0.85; }
.kpi dd { margin: 2px 0 0; font: 600 19px/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi dd small { font-size: 12px; font-weight: 500; color: var(--tx-2); margin-left: 1px; }
.kpi-bad { color: var(--coral); }

/* ---------------- Tela do fluxo ---------------- */
.canvas { position: relative; flex: 1; min-height: 0; padding: 22px 22px 46px; background-color: var(--ink-1); background-image: radial-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1.3px); background-size: 20px 20px; background-position: 10px 10px; }
.canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(8, 8, 13, 0.75)); }
.edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; }
.nodes { position: relative; z-index: 2; list-style: none; margin: 0; padding: 0; height: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 44px; align-items: center; }
.node[data-node="form"] { grid-area: 1 / 1; }
.node[data-node="valid"] { grid-area: 1 / 2; }
.node[data-node="reg"] { grid-area: 1 / 3; }
.node[data-node="dist"] { grid-area: 1 / 4; }
.node[data-node="rej"] { grid-area: 2 / 2; }
.node[data-node="hist"] { grid-area: 2 / 3; }
.node[data-node="notif"] { grid-area: 2 / 4; }

.node { --tone: var(--violet); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 11px 12px 11px; border-radius: 15px; border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01) 60%), var(--ink-3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 34px -20px rgba(0, 0, 0, 0.95); transition: border-color 0.35s, box-shadow 0.35s, transform 0.45s var(--ease); }
.node::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--tone), transparent); opacity: 0.55; }
.node[data-tone="sky"] { --tone: var(--sky); }
.node[data-tone="indigo"] { --tone: var(--indigo); }
.node[data-tone="mint"] { --tone: var(--mint); }
.node[data-tone="amber"] { --tone: var(--amber); }
.node[data-tone="slate"] { --tone: var(--slate); }
.node[data-tone="coral"] { --tone: var(--coral); }
.node-top { display: flex; align-items: center; gap: 8px; }
.node-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.node-ico .ico { width: 15px; height: 15px; }
.node-step { font: 600 10.5px/1 var(--mono); color: var(--tx-3); }
.node-state { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--tx-3); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); white-space: nowrap; transition: color 0.3s, background-color 0.3s, border-color 0.3s; }
.node-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.node h3 { font: 600 13px/1.2 var(--display); letter-spacing: -0.015em; }
.node-desc { color: var(--tx-3); font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line-2); color: var(--tx-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.node-foot b { color: var(--tx); font-weight: 650; }
.node-foot .t-bad { color: var(--coral); }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--tx-3); }
.node-owners { gap: 10px; }
.load { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 6px 1px 1px; background: rgba(255, 255, 255, 0.04); transition: background-color 0.3s, box-shadow 0.3s; }
.load.is-picked { background: rgba(68, 226, 180, 0.16); box-shadow: 0 0 0 1px rgba(68, 226, 180, 0.45); }
.node-channels { gap: 10px; }
.node-channels > span { display: inline-flex; align-items: center; gap: 4px; }
.node-channels .ico { width: 13px; height: 13px; color: var(--tx-3); }
.q-wait { margin-left: auto; padding: 1px 7px; border-radius: 999px; color: #ffe2a8; background: rgba(247, 189, 82, 0.14); }
.q-wait b { color: inherit; }
.q-wait.is-zero { display: none; }

/* Estados vivos dos nós */
.node.is-active { border-color: color-mix(in srgb, var(--tone) 70%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent), 0 0 34px -6px color-mix(in srgb, var(--tone) 55%, transparent), 0 18px 34px -20px rgba(0, 0, 0, 0.95); transform: translateY(-2px); }
.node.is-active .node-state { color: #e4defe; border-color: rgba(157, 143, 255, 0.45); background: rgba(109, 77, 255, 0.22); }
.node.is-active .node-state::before { animation: blink 0.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.node.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--tone), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: scan 1.1s linear infinite; }
@keyframes scan { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.node.is-ok .node-state { color: #b9f6e2; border-color: rgba(68, 226, 180, 0.4); background: rgba(68, 226, 180, 0.14); }
.node.is-bad { border-color: rgba(255, 125, 137, 0.6); box-shadow: 0 0 0 1px rgba(255, 125, 137, 0.3), 0 0 30px -8px rgba(255, 125, 137, 0.6); }
.node.is-bad .node-state { color: #ffd0d5; border-color: rgba(255, 125, 137, 0.45); background: rgba(255, 125, 137, 0.16); }
.node.is-wait .node-state { color: #ffe2a8; border-color: rgba(247, 189, 82, 0.45); background: rgba(247, 189, 82, 0.14); }

/* Ligações (SVG desenhado pelo script) */
.edge-base { fill: none; stroke: rgba(255, 255, 255, 0.13); stroke-width: 1.5; }
.edge-flow { fill: none; stroke: rgba(157, 143, 255, 0.55); stroke-width: 1.5; stroke-dasharray: 2 9; stroke-linecap: round; animation: dash 1.6s linear infinite; }
.edge.is-aux .edge-base { stroke-dasharray: 3 5; stroke: rgba(255, 255, 255, 0.1); }
.edge.is-aux .edge-flow { display: none; }
.edge.is-bad .edge-flow { stroke: rgba(255, 125, 137, 0.45); }
.edge-hot { fill: none; stroke: #b6abff; stroke-width: 2.4; stroke-linecap: round; opacity: 0; transition: opacity 0.35s; filter: drop-shadow(0 0 6px rgba(140, 120, 255, 0.85)); }
.edge.is-hot .edge-hot { opacity: 1; }
.edge.is-bad .edge-hot { stroke: #ff9aa3; filter: drop-shadow(0 0 6px rgba(255, 125, 137, 0.85)); }
.port { fill: var(--ink-1); stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.5; }
.edge.is-hot .port { stroke: #c9c0ff; }
.edge-label rect { fill: var(--ink-2); stroke: var(--line-2); }
.edge-label text { font: 600 10px/1 var(--sans); fill: var(--tx-2); }
.edge.is-bad .edge-label text { fill: #ffb3bb; }
.edge.is-ok .edge-label text { fill: #a6f1d8; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.token-head { fill: #fff; filter: drop-shadow(0 0 5px rgba(170, 155, 255, 1)); }
.token-trail { fill: #b6abff; }
.token.is-bad .token-head { filter: drop-shadow(0 0 5px rgba(255, 125, 137, 1)); }
.token.is-bad .token-trail { fill: #ff9aa3; }
.is-stopped .edge-flow, .is-stopped .live-dot { animation-play-state: paused; }

.legend { position: absolute; left: 22px; bottom: 14px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: var(--tx-3); font-size: 11px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 8px; height: 8px; border-radius: 50%; }
.lg-run { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.lg-ok { background: var(--mint); }
.lg-wait { background: var(--amber); }
.lg-bad { background: var(--coral); }

/* ---------------- Execuções ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.filter { height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--tx-3); font-size: 11.5px; font-weight: 550; transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.filter:hover { color: var(--tx); border-color: var(--line-2); }
.filter[aria-pressed="true"] { color: var(--tx); background: var(--ink-4); border-color: var(--line-3); }
.run-list { flex: 1; min-height: 0; overflow: auto; list-style: none; margin: 0; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent; }
.run-list > li + li { margin-top: 2px; }
.run { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 9px 8px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; transition: background-color 0.2s, border-color 0.2s; }
.run:hover { background: rgba(255, 255, 255, 0.035); }
.run[aria-pressed="true"] { background: rgba(109, 77, 255, 0.12); border-color: rgba(157, 143, 255, 0.35); }
.run.is-new { animation: slideIn 0.6s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.st-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; }
.st-ico .ico { width: 15px; height: 15px; }
.tone-run { color: #cfc6ff; background: rgba(109, 77, 255, 0.2); }
.tone-run .ico { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tone-ok { color: var(--mint); background: rgba(68, 226, 180, 0.12); }
.tone-wait { color: var(--amber); background: rgba(247, 189, 82, 0.13); }
.tone-bad { color: var(--coral); background: rgba(255, 125, 137, 0.13); }
.run-main { min-width: 0; display: grid; gap: 2px; }
.run-ref { font: 600 12px/1.2 var(--mono); }
.run-ref.is-none { font-family: var(--sans); color: #ffc1c7; }
.run-who { font-size: 11.5px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 5px; }
.run-bar i { height: 3px; border-radius: 2px; background: var(--ink-5); transition: background-color 0.3s; }
.run-bar i.on { background: var(--mint); }
.run-bar i.cur { background: var(--violet); box-shadow: 0 0 6px rgba(157, 143, 255, 0.9); }
.run-bar i.warn { background: var(--amber); }
.run-bar i.bad { background: var(--coral); }
.run-side { display: grid; justify-items: end; gap: 5px; }
.run-time { font: 500 11px/1 var(--mono); color: var(--tx-3); font-variant-numeric: tabular-nums; }
.run-side .avatar { border-color: var(--ink-1); }
.avatar.none { background: var(--ink-4); color: var(--tx-3); }
.empty { padding: 18px 16px; color: var(--tx-3); font-size: 12px; }

/* ---------------- Fila ---------------- */
.policy { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tx-3); }
.policy .ico { width: 13px; height: 13px; }
.pill-fast { height: 20px; font-size: 10.5px; color: #ffe2a8; border-color: rgba(247, 189, 82, 0.35); background: rgba(247, 189, 82, 0.1); margin-left: auto; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent; }
.q-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.q-table th { position: sticky; top: 0; z-index: 1; padding: 8px 14px; text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tx-3); background: var(--ink-1); border-bottom: 1px solid var(--line); white-space: nowrap; }
.q-table td { padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.q-table tr:last-child td { border-bottom: 0; }
.q-table tr.is-new td { animation: rowIn 1.2s var(--ease); }
@keyframes rowIn { from { background: rgba(109, 77, 255, 0.16); } }
.ch { display: inline-flex; align-items: center; gap: 6px; color: var(--tx-2); }
.ch .ico { width: 14px; height: 14px; }
.ch-wa .ico { color: var(--mint); }
.ch-mail .ico { color: var(--sky); }
.to { color: var(--tx-2); }
.tries { display: inline-flex; gap: 4px; align-items: center; }
.tries i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-5); }
.tries i.ok { background: var(--mint); border-color: var(--mint); }
.tries i.fail { background: var(--coral); border-color: var(--coral); }
.tries i.go { border-color: var(--violet); animation: blink 0.8s ease-in-out infinite; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip .ico { width: 12px; height: 12px; }
.chip-ok { color: #b9f6e2; background: rgba(68, 226, 180, 0.12); }
.chip-run { color: #ddd6ff; background: rgba(109, 77, 255, 0.2); }
.chip-run .ico { animation: spin 1.2s linear infinite; }
.chip-wait { color: #ffe2a8; background: rgba(247, 189, 82, 0.14); font-variant-numeric: tabular-nums; }
.chip-bad { color: #ffd0d5; background: rgba(255, 125, 137, 0.15); }
.t-time { font: 500 11.5px/1 var(--mono); color: var(--tx-3); }

/* ---------------- Histórico ---------------- */
.follow { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--tx-3); font-size: 11.5px; font-weight: 550; }
.follow .dot { background: var(--tx-3); animation: none; }
.follow[aria-pressed="true"] { color: #bff5e3; border-color: rgba(68, 226, 180, 0.35); background: rgba(68, 226, 180, 0.08); }
.follow[aria-pressed="true"] .dot { background: var(--mint); animation: live 2s ease-out infinite; }
.hist-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 16px; scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent; }
.h-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.h-ref { font: 600 11.5px/1 var(--mono); color: var(--violet); margin-bottom: 5px; }
.h-ref.is-none { font-family: var(--sans); color: #ffb3bb; }
.h-name { font: 600 15px/1.2 var(--display); letter-spacing: -0.02em; }
.h-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 12px 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); }
.h-meta div { min-width: 0; }
.h-meta dt { font-size: 10.5px; color: var(--tx-3); }
.h-meta dd { margin: 1px 0 0; font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { position: relative; list-style: none; margin: 0; padding: 0; }
.ev { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; padding-bottom: 12px; }
.ev::before { content: ""; position: absolute; left: 9.5px; top: 18px; bottom: -2px; width: 1px; background: var(--line-2); }
.ev:last-child::before { display: none; }
.ev-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx-3); }
.ev-dot .ico { width: 11px; height: 11px; stroke-width: 2.6; }
.ev.t-ok .ev-dot { color: var(--mint); border-color: rgba(68, 226, 180, 0.45); background: #0f231d; }
.ev.t-run .ev-dot { color: #d6ceff; border-color: rgba(157, 143, 255, 0.6); background: #1b1636; box-shadow: 0 0 0 4px rgba(109, 77, 255, 0.15); }
.ev.t-warn .ev-dot { color: var(--amber); border-color: rgba(247, 189, 82, 0.5); background: #261d0d; }
.ev.t-bad .ev-dot { color: var(--coral); border-color: rgba(255, 125, 137, 0.5); background: #2a1216; }
.ev-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.ev-detail { margin-top: 2px; font-size: 11.5px; color: var(--tx-3); line-height: 1.4; }
.ev-actor { display: inline-block; margin-top: 4px; font-size: 10.5px; color: var(--tx-2); padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.ev-time { font: 500 11px/1.3 var(--mono); color: var(--tx-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.ev.is-pending { opacity: 0.55; }
.ev.is-pending .ev-title { font-weight: 500; color: var(--tx-2); }
.ev.is-new { animation: slideIn 0.5s var(--ease); }

/* ---------------- Formulário de simulação ---------------- */
.sheet { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: 20px; color: var(--tx); background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 140px), var(--ink-2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(157, 143, 255, 0.08); overflow: auto; }
.sheet::backdrop { background: rgba(5, 5, 9, 0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheetIn 0.4s var(--ease); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.sheet-form { padding: 20px 22px 20px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font: 650 19px/1.15 var(--display); letter-spacing: -0.025em; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink-3); color: var(--tx-2); }
.icon-btn:hover { color: var(--tx); border-color: var(--line-3); }
.sheet-note { margin-top: 10px; color: var(--tx-2); font-size: 12.5px; line-height: 1.5; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 16px; }
.chip-btn { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid rgba(157, 143, 255, 0.35); background: rgba(109, 77, 255, 0.12); color: #ded8ff; font-size: 12px; font-weight: 550; }
.chip-btn:hover { background: rgba(109, 77, 255, 0.22); }
.chip-btn.chip-bad { border-color: rgba(255, 125, 137, 0.35); background: rgba(255, 125, 137, 0.1); color: #ffd0d5; }
.chip-btn.chip-bad:hover { background: rgba(255, 125, 137, 0.18); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { display: grid; gap: 6px; align-content: start; }
.fld label { font-size: 12px; font-weight: 600; color: var(--tx-2); }
.opt { font-weight: 450; color: var(--tx-3); }
.fld input, .fld select { height: 40px; width: 100%; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--ink-1); color: var(--tx); font-size: 13px; transition: border-color 0.2s, box-shadow 0.2s; }
.fld input::placeholder { color: #75738d; }
.fld input:focus-visible, .fld select:focus-visible { border-color: #9d8fff; box-shadow: 0 0 0 3px rgba(109, 77, 255, 0.3); border-radius: 11px; }
.fld [aria-invalid="true"] { border-color: rgba(255, 125, 137, 0.7); }
.err { font-size: 11.5px; color: #ffb3bb; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-actions .btn { height: 40px; padding: 0 16px; }

/* ---------------- Telas largas e baixas ---------------- */
@media (min-width: 1380px) {
  .main { grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: 360px minmax(0, 1fr) 250px; }
}
@media (min-width: 761px) and (max-height: 700px) {
  body { overflow: auto; height: auto; }
  .app { min-height: 720px; }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .crumbs, .top-meta, .team { display: none; }
  .kpis { grid-template-columns: repeat(2, auto); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---------------- Celular ---------------- */
@media (max-width: 760px) {
  html, body { height: auto; }
  body { overflow: auto; font-size: 14px; }
  .topbar { position: sticky; top: 0; z-index: 20; height: 58px; gap: 8px; padding: 0 12px; }
  .crumbs, .top-meta, .team, .clock, .live-label, .hide-sm { display: none; }
  .brand-name span { display: none; }
  .btn { height: 40px; }
  [data-live] { width: 40px; padding: 0; }
  .main { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
  .flow { overflow: visible; }
  .flow-head { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  h1 { font-size: 24px; }
  .eyebrow { flex-wrap: wrap; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kpi dt { white-space: normal; }
  .canvas { padding: 18px 16px 18px; }
  .canvas::after { display: none; }
  .nodes { display: flex; flex-direction: column; gap: 30px; height: auto; }
  .node[data-node="rej"] { display: none; }
  .node-desc { font-size: 12.5px; }
  .node h3 { font-size: 14px; }
  .legend { position: static; margin-top: 18px; }
  .tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ink-1); border: 1px solid var(--line); position: sticky; top: 66px; z-index: 10; }
  .tabs [role="tab"] { flex: 1; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--tx-3); font-weight: 600; font-size: 13px; }
  .tabs [role="tab"][aria-selected="true"] { color: var(--tx); background: var(--ink-4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
  .panel[hidden] { display: none; }
  .panel-head h2 { font-size: 15px; }
  .run-list, .table-wrap, .hist-body { overflow: visible; }
  .run { padding: 10px; }
  .filter { height: 36px; padding: 0 12px; font-size: 12.5px; }
  .follow { height: 36px; }
  .col-to, .col-time { display: none; }
  .q-table th, .q-table td { padding: 10px 10px; }
  .q-table td:first-child, .q-table th:first-child { padding-left: 14px; }
  .h-meta { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .sheet-form { padding: 18px 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .chip-btn { height: 40px; }
}

/* Ajustes de densidade na tela de 1280x800 */
[hidden] { display: none !important; }
@media (min-width: 761px) {
  .main { grid-template-rows: 300px minmax(0, 1fr) 196px; }
  .flow-head { padding: 12px 18px 10px; align-items: center; }
  .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
  .lede { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi { padding: 6px 11px; min-width: 0; }
  .kpi dt { font-size: 10px; }
  .kpi-note { display: none; }
  .flow-head > :first-child { min-width: 0; }
  .kpi dd { font-size: 17px; }
  .canvas { padding: 14px 20px 36px; }
  .nodes { row-gap: 26px; align-items: stretch; }
  .node { gap: 4px; padding: 9px 11px; }
  .node-desc { -webkit-line-clamp: 1; }
  .node-foot { padding-top: 6px; }
  .crumbs [aria-current] { white-space: nowrap; }
  .clock [data-live-text] { display: none; }
  .top-meta .pill-env { display: none; }
}
@media (max-width: 760px) { .nodes > .node { width: 100%; margin: 0; grid-area: auto; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
