/* Jornada da Clara — scoped to the Fluxos board. Inherit CRM WhatsApp tokens. */

.flow-board {
  background: #0b141a;
  color: #e9edef;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

.flow-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid #222d34;
  background: #111b21;
  z-index: 4;
}

.flow-toolbar-id h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.flow-toolbar-id p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #8696a0;
}

.flow-toolbar-cluster,
.flow-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-toolbar-cluster {
  padding: 0 8px;
  border-left: 1px solid #222d34;
  border-right: 1px solid #222d34;
}

.flow-toolbar-cluster span {
  min-width: 42px;
  text-align: center;
  font-size: 12px;
  color: #8696a0;
  font-variant-numeric: tabular-nums;
}

.flow-board button {
  min-height: 32px !important;
  height: auto !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.flow-toolbar button,
.flow-empty button,
.flow-inspector footer button,
.flow-inspector .flow-branch-editor-head button,
.flow-confirm-del button {
  border: 1px solid #2a3942;
  background: #202c33;
  color: #e9edef;
  cursor: pointer;
}

.flow-toolbar button:hover,
.flow-inspector footer button:hover,
.flow-empty button:hover {
  background: #2a3942;
}

.flow-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.flow-toolbar button.is-ghost,
.flow-inspector button.is-ghost {
  background: transparent;
}

.flow-toolbar button.is-primary,
.flow-empty button.is-primary,
.flow-inspector button.is-primary {
  background: #00a884;
  border-color: #00a884;
  color: #04251d;
}

.flow-toolbar button.is-primary:hover,
.flow-empty button.is-primary:hover,
.flow-inspector button.is-primary:hover {
  background: #029071;
}

.flow-banner,
.flow-toast {
  padding: 10px 16px;
  font-size: 13px;
}

.flow-banner.is-err,
.flow-toast.is-err {
  background: #3a1d1d;
  color: #f5c2c2;
}

.flow-toast {
  position: absolute;
  top: 68px;
  right: 16px;
  z-index: 20;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.flow-toast.is-ok {
  background: #0c2f27;
  color: #b7f0df;
}

.flow-workspace {
  flex: 1;
  display: flex;
  min-height: 0;
}

.flow-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background-color: #0b141a;
  background-image: radial-gradient(#1a2730 1px, transparent 1px);
  background-size: 22px 22px;
}

.flow-canvas.is-panning {
  cursor: grabbing;
}

.flow-world {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.flow-cables {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.flow-cable {
  fill: none;
  stroke: #5b6b75;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-cable.is-alt {
  stroke-dasharray: 5 4;
}

.flow-cable.is-on {
  stroke: #00a884;
  stroke-width: 2.25;
}

.flow-cable.is-preview {
  stroke-dasharray: 4 4;
}

.flow-cable-label-host {
  overflow: visible;
  pointer-events: auto;
}

.flow-cable-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 20px;
  max-width: 112px;
  padding: 0 8px;
  border: 1px solid #2a3942;
  border-radius: 999px;
  background: #0b141a;
  color: #c8d0d4;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-cable-label span {
  display: none;
}

.flow-cable-label:hover span {
  display: inline;
}

.flow-cable-label:hover {
  border-color: #ef4444;
  color: #fecaca;
}

.flow-card {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 10px;
  border: 1px solid #2a3942;
  border-radius: 14px;
  background: #111b21;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: grab;
  user-select: none;
}

.flow-card:hover {
  border-color: #3d4f5a;
}

.flow-card.is-selected {
  border-color: #00a884;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.flow-card.is-snap {
  border-color: #00a884;
  outline: 3px solid rgba(0, 168, 132, 0.28);
}

.flow-card.is-trigger,
.flow-card.is-outcome {
  border-top: 2px solid #00a884;
}

.flow-card.is-decision {
  border-top: 2px solid #d97706;
}

.flow-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.flow-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: #e9edef;
}

.flow-card-head p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #8696a0;
  line-height: 1.35;
}

.flow-card-index {
  flex-shrink: 0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: #667781;
}

.flow-card-body {
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #0b141a;
  color: #aebac1;
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-card-foot,
.flow-branches li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  font-size: 11px;
  color: #8696a0;
}

.flow-card-foot button {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #00a884;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.flow-branches {
  margin: 0;
  padding: 6px 0 0;
  list-style: none;
  border-top: 1px solid #222d34;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-branches li {
  padding: 4px 10px 4px 8px;
  border-radius: 8px;
  background: #1a242b;
}

.flow-branches li span {
  color: #e9edef;
  font-weight: 600;
}

.flow-branches li em {
  font-style: normal;
  color: #8696a0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-port {
  position: absolute;
  top: 30px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: crosshair;
}

.flow-port.is-in {
  left: -8px;
}

.flow-port.is-out {
  right: -8px;
  top: 30px;
}

.flow-port.is-out.is-main {
  top: 30px;
  margin-top: 0;
}

.flow-branches .flow-port.is-out {
  top: 50%;
  margin-top: -8px;
}

.flow-port span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #00a884;
  background: #0b141a;
}

.flow-port:hover span,
.flow-card.is-snap .flow-port.is-in span {
  background: #00a884;
}

.flow-empty {
  position: absolute;
  inset: 20% 20%;
  max-width: 360px;
  margin: auto;
  text-align: center;
  color: #8696a0;
}

.flow-empty strong {
  display: block;
  color: #e9edef;
  font-size: 16px;
  margin-bottom: 8px;
}

.flow-empty p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
}

.flow-inspector {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-left: 1px solid #222d34;
  background: #111b21;
  overflow-y: auto;
}

.flow-inspector > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flow-inspector h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.flow-inspector label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: #8696a0;
}

.flow-inspector input,
.flow-inspector textarea,
.flow-inspector select {
  width: 100%;
  border: 1px solid #2a3942;
  border-radius: 8px;
  background: #0b141a;
  color: #e9edef;
  font-size: 13px;
  padding: 8px 10px;
}

.flow-inspector textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

.flow-inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.flow-branch-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-branch-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #d97706;
  font-weight: 700;
}

.flow-branch-row {
  display: grid;
  grid-template-columns: 1fr 1fr 28px;
  gap: 6px;
  align-items: center;
}

.flow-icon-btn {
  min-height: 28px !important;
  width: 28px;
  padding: 0 !important;
  border-radius: 8px;
  border: 1px solid #2a3942;
  background: transparent;
  color: #8696a0;
  cursor: pointer;
}

.flow-inspector footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #222d34;
}

.flow-inspector footer > div {
  display: flex;
  gap: 6px;
}

.flow-inspector button.is-danger {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: transparent;
}

.flow-confirm-del {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #fca5a5;
}

.flow-hint {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid #222d34;
  border-radius: 10px;
  background: #111b21;
  font-size: 12px;
  color: #8696a0;
  pointer-events: none;
}

.flow-hint strong {
  color: #e9edef;
  font-size: 12px;
}

@media (max-width: 900px) {
  .flow-inspector {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(100%, 320px);
    z-index: 8;
  }

  .flow-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}
