/* =========================================================
   Navegador de fluxo (simulação do editor do Waipe Flow)
   Nós brancos com a cor da categoria, fios coloridos e canvas pontilhado,
   como no produto. As cores dos nós são as do produto (como logos em telas).
   ========================================================= */
.fx { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow); }

/* Barra de cima */
.fx__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fx__name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink); }
.fx__name .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.fx__name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx__tag { padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fx__steps { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.fx__count { min-width: 112px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx__btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--ink);
  transition: background-color .15s, border-color .15s;
}
.fx__btn:hover { border-color: var(--line-strong); background: var(--surface); }
.fx__btn .icon { width: 15px; height: 15px; }
.fx__btn--icon { width: 34px; padding: 0; justify-content: center; }
.fx__btn--run { background: var(--dark); border-color: var(--dark); color: #fff; }
.fx__btn--run:hover { background: #262626; border-color: #262626; }
.fx__btn--run .icon { fill: currentColor; }
.fx__btn--run.is-running { background: #fff; color: var(--ink); border-color: var(--line-strong); }

/* Corpo: mapa + painel */
.fx__body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 520px; }
.fx__view { position: relative; display: flex; min-width: 0; }
.fx__canvas {
  position: relative; flex: 1; min-width: 0; overflow: auto; cursor: grab;
  background-color: #F8F9FB;
  background-image: radial-gradient(#D4D7DD 1px, transparent 1.2px);
  background-size: 18px 18px;
  scrollbar-width: thin;
}
.fx__canvas.is-dragging { cursor: grabbing; user-select: none; }
.fx__canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.fx__zoom { position: relative; }
.fx__stage { position: relative; transform-origin: 0 0; }
.fx__zctl { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.fx__zctl button { display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); }
.fx__zctl button + button { border-top: 1px solid var(--line); }
.fx__zctl button:hover { background: var(--surface); color: var(--ink); }
.fx__zctl .icon { width: 15px; height: 15px; }
.fx__edges { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.fx__edge { fill: none; stroke: var(--c); stroke-width: 2; opacity: .75; transition: opacity .2s; }
.fx__edge--wait { stroke: var(--line-strong); stroke-dasharray: 5 6; opacity: 1; }
.fx__edge.is-active { opacity: 1; stroke-width: 2.5; stroke-dasharray: 8 8; animation: fxFlow .6s linear infinite; }
@keyframes fxFlow { to { stroke-dashoffset: -16; } }
.fx__edge-label { font-size: 11px; font-weight: 700; fill: var(--muted); text-anchor: middle; paint-order: stroke; stroke: #F8F9FB; stroke-width: 4px; }
.fx__lane { position: absolute; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--subtle); white-space: nowrap; }
.fx__lane .icon { width: 13px; height: 13px; }

/* Nó (como no editor do Waipe Flow) */
.fx-node {
  position: absolute; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  width: 208px; height: 62px; padding: 0 12px;
  border: 1px solid #E3E5E9; border-radius: 10px; background: #fff;
  text-align: left; box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: border-color .15s, box-shadow .2s, opacity .2s;
}
.fx-node::before, .fx-node::after {
  content: ""; position: absolute; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%;
}
.fx-node::before { left: -5px; background: #fff; border: 2px solid #C9CDD3; }
.fx-node::after { right: -5px; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--c); }
.fx-node:hover { border-color: color-mix(in srgb, var(--c) 45%, #E3E5E9); }
.fx-node.is-selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 8px 20px -10px rgba(0, 0, 0, .3); }
.fx-node.is-running { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.fx-node.is-skipped { opacity: .45; }
.fx-node__icon {
  display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c);
}
.fx-node__icon .icon { width: 16px; height: 16px; }
.fx-node__text { display: grid; min-width: 0; }
.fx-node__cat { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-node__title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-node__sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-node__badge {
  position: absolute; top: -10px; right: 8px;
  display: none; align-items: center; gap: 4px;
  padding: 2px 8px 2px 4px; border-radius: var(--pill);
  background: var(--success-bg); color: var(--success); font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.fx-node__badge .icon { width: 12px; height: 12px; }
.fx-node.is-done .fx-node__badge { display: inline-flex; animation: fxPop .3s var(--ease); }
@keyframes fxPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Aviso no meio da execução (ex.: o gerente respondeu) */
.fx__toast {
  position: absolute; left: 50%; bottom: 18px; z-index: 3;
  width: max-content; max-width: 86%; padding: 9px 16px;
  border-radius: var(--pill); background: var(--dark); color: #fff; font-size: 13px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.fx__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Painel */
.fx__panel { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-left: 1px solid var(--line); overflow: auto; max-height: 620px; }
.fx__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); }
.fx__lead { font-size: 15px; line-height: 1.55; color: var(--text); }
.fx__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.fx__legend li { display: inline-flex; align-items: center; gap: 6px; }
.fx__dot { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.fx__hint { display: flex; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); font-size: 13px; line-height: 1.5; color: var(--muted); }
.fx__hint .icon { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; }
.fx__chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: var(--pill); background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.fx__chip .icon { width: 14px; height: 14px; }
.fx__chip em { margin-left: 4px; font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); }
.fx__title { font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.fx__sub { margin-top: -10px; font-size: 13px; color: var(--muted); }
.fx__sec { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.fx__sec > span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); }
.fx__sec p { font-size: 14px; line-height: 1.55; color: var(--text); }
.fx__sec--type p { font-size: 13px; color: var(--muted); }
.fx__table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.fx__table th { padding: 5px 6px; text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--subtle); border-bottom: 1px solid var(--line); }
.fx__table td { padding: 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.fx__table tr:last-child td { border-bottom: 0; }
.fx__quote { margin-top: 8px; padding: 10px 12px; border-left: 3px solid #8B5CF6; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #F5F3FF; font-size: 13px; line-height: 1.5; color: var(--text); }
.fx__link { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fx__link .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.fx__link:hover .icon { transform: translateX(3px); }
.fx__link--next { color: var(--muted); }

/* Registro da execução */
.fx__log { display: grid; gap: 6px; counter-reset: fx; }
.fx__log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; animation: fxPop .25s var(--ease); }
.fx__log b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx__log em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--success); white-space: nowrap; }

/* Resultado: abas e prévias */
.fx__tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--surface-2); }
.fx__tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fx__tabs button .icon { width: 14px; height: 14px; }
.fx__tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.fx-chat { border: 1px solid var(--line); }
.fx-chat .chat__body { gap: 8px; }
.fx-chat .bubble { font-size: 13px; animation: fxPop .3s var(--ease) both; }
.fx-chat .bubble:nth-child(2) { animation-delay: .25s; }
.fx-chat .bubble:nth-child(3) { animation-delay: .5s; }
.fx-mail { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.fx-mail__head { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fx-mail__head .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: #DC2626; }
.fx-mail__head b { display: block; font-size: 14px; color: var(--ink); }
.fx-mail__head span { font-size: 12px; color: var(--muted); }
.fx-mail__body { display: grid; gap: 10px; padding: 14px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
/* Atividade no painel do Waipe Canvas */
.fx-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.fx-card__head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.fx-card__head .icon { width: 16px; height: 16px; color: var(--ink); }
.fx-card__head em { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-style: normal; font-size: 11px; }
.fx-card__body { display: grid; gap: 8px; margin: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.5; color: var(--text); animation: fxPop .3s var(--ease) both; }
.fx-card__key { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.fx-card__title { font-size: 14px; color: var(--ink); }
.fx-card__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.fx-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.fx-card__meta .icon { width: 13px; height: 13px; }
.fx-card__run { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; }
.fx-card__run .icon { width: 12px; height: 12px; }
.fx__impact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink); }

@media (max-width: 960px) {
  .fx__body { grid-template-columns: minmax(0, 1fr); }
  .fx__view { height: 380px; }
  .fx__panel { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .fx__steps { margin-left: 0; }
}
@media (max-width: 640px) {
  .fx__bar { padding: 10px 12px; }
  .fx__name b { max-width: 70vw; }
  .fx__btn--run { flex: 1; justify-content: center; }
  .fx__panel { padding: 18px; }
}

/* Seu sistema: troca os nós de sistema do fluxo (Gestor/Bime, ERP com API, ERP sem API, planilhas) */
.fx__sis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fx__sis-k { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--subtle); }
.fx__sis-k .icon { width: 14px; height: 14px; }
.fx__sis-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.fx__sis-opts button { padding: 5px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.fx__sis-opts button:hover { border-color: var(--ink); }
.fx__sis-opts button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.fx__sis-txt { flex-basis: 100%; font-size: 13px; color: var(--muted); }
