/* Chatbots: lista e editor de fluxo */
.cb-lead { color: var(--text-secondary); font-size: 14px; margin: 0 0 16px; }
.cb-card { background: var(--bg-card); border-radius: 16px; padding: 16px; }
.cb-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.cb-primary { background: var(--accent); border: 0; border-radius: 30px; color: #fff; height: 40px; padding: 7px 16px; font: inherit; font-size: 16px; cursor: pointer; }
.cb-primary:hover { background: var(--accent-hover); }
.cb-empty { text-align: center; padding: 48px 0; color: var(--text); }
.cb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cb-table th { text-align: left; font-weight: 600; padding: 12px 16px; }
.cb-table td { padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.cb-link { background: transparent; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.cb-danger { color: var(--alert); }
.cb-editor { position: relative; display: flex; flex-direction: column; height: calc(100vh - 48px); }
.cb-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 0 12px; flex-wrap: wrap; }
.cb-toolbar button { height: 36px; min-width: 36px; border: 1px solid var(--border); border-radius: 30px; background: transparent; color: var(--text); font: inherit; cursor: pointer; padding: 0 12px; }
.cb-toolbar .cb-plus { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 20px; padding: 0; width: 36px; }
.cb-toolbar input { margin-left: auto; height: 36px; border: 2px solid var(--border); border-radius: 16px; background: transparent; color: var(--text); padding: 0 12px; font: inherit; width: 180px; }
.cb-dirty { font-size: 13px; color: var(--text-warning, #FAAD14); }
.cb-canvas { position: relative; flex: 1; overflow: auto; border-radius: 16px; background: var(--bg-card) radial-gradient(var(--border-soft) 1px, transparent 1px) 0 0 / 20px 20px; min-height: 480px; }
.cb-edges { position: absolute; inset: 0; width: 2400px; height: 1600px; pointer-events: none; }
.cb-edges path { fill: none; stroke: var(--text-secondary); stroke-width: 2; }
.cb-edges .cb-ghost { stroke: var(--accent); stroke-dasharray: 6 4; }
.cb-node { position: absolute; width: 260px; background: var(--bg-surface, var(--bg-list)); border: 1px solid var(--border); border-radius: 16px; padding-bottom: 8px; box-shadow: 0 6px 18px #0004; }
.cb-node > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; cursor: grab; font-size: 13px; touch-action: none; user-select: none; }
.cb-x { background: transparent; border: 0; color: var(--text-secondary); font-size: 18px; cursor: pointer; line-height: 1; }
.cb-body { padding: 0 14px; display: grid; gap: 8px; }
.cb-body label { display: grid; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.cb-body input:not([type=checkbox]), .cb-body textarea, .cb-body select { width: 100%; border: 2px solid var(--border); border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: 13px; padding: 6px 10px; }
.cb-check { display: flex !important; align-items: center; gap: 8px; }
.cb-ports { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; }
.cb-ports li { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.cb-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-surface, var(--bg-list)); display: inline-block; }
.cb-out { margin-right: -7px; cursor: crosshair; }
.cb-in { position: absolute; left: -7px; top: 18px; }
.cb-steps { position: absolute; top: 56px; left: 0; width: 360px; max-height: calc(100% - 70px); overflow: auto; background: var(--bg-modal, var(--bg-list)); border: 1px solid var(--border); border-radius: 16px; z-index: 20; padding: 12px; }
.cb-steps header { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.cb-steps header input { flex: 1; height: 32px; border: 2px solid var(--accent); border-radius: 16px; background: transparent; color: var(--text); padding: 0 12px; font: inherit; }
.cb-steps h4 { margin: 12px 0 6px; font-size: 12px; color: var(--text-secondary); letter-spacing: .04em; }
.cb-steps [data-step] { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid var(--border-soft); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; color: var(--text); font: inherit; cursor: pointer; }
.cb-steps [data-step]:hover { background: var(--bg-hover); }
.cb-steps small { display: block; color: var(--text-secondary); font-size: 12px; }
.cb-steps header span { white-space: nowrap; }
.cb-steps header input { min-width: 0; }
.preference-light .cb-node { background: #FFFFFF; border-color: #DFDFDF; box-shadow: 0 4px 14px rgba(31,31,31,.12); color: #1F1F1F; }
.preference-light .cb-dot { border-color: #FFFFFF; }
.preference-light .cb-canvas { background-color: #FAFAFA; }
.preference-light .cb-steps { background: #FFFFFF; border-color: #DFDFDF; box-shadow: 0 8px 24px rgba(31,31,31,.15); }
.preference-light .cb-card { background: #FFFFFF; }
.preference-light .cb-edges path { stroke: #83858C; }
.preference-light .cb-edges .cb-ghost { stroke: #557CF2; }
.preference-light .cb-toolbar .cb-plus, .preference-light .cb-primary { color: #fff; }
@media (max-width: 767.98px) {
  .cb-editor { height: calc(100dvh - 88px); }
  .cb-steps { width: calc(100% - 8px); max-width: 360px; }
  .cb-toolbar input { margin-left: 0; flex: 1; }
}
