/* =====================================================================
   Componentes do design system. Todas as páginas montam a UI só com
   estas classes — nada de estilo inline além de cores de nicho.
   ===================================================================== */

/* ---------- Shell / layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
}

.content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 767px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
}

/* ---------- Sidebar ---------- */
.sidebar-head {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 13px; height: 13px; }

.sidebar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 2px 0 10px;
}
.sidebar-back:hover { color: var(--text); text-decoration: none; }

.sidebar-tenant-name {
  font-size: var(--fs-md);
  font-weight: 550;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-tenant-meta { margin-top: 4px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section {
  font-size: var(--fs-xs);
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active { background: #e9e9ec; color: var(--text); font-weight: 500; }
.nav-item.active .nav-icon { color: var(--accent-strong); }
.nav-icon { color: var(--text-3); display: inline-flex; flex-shrink: 0; }
.nav-item.active:hover { background: #e9e9ec; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-user {
  padding: 4px 8px 6px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Página ---------- */
.page { padding: 28px 32px 48px; width: 100%; }
/* Formulários/detalhes: largura controlada p/ leitura, alinhado à esquerda. */
.page-narrow { max-width: 860px; }
/* Listas: ocupam a tela toda (sem teto de largura). */
.page-wide { max-width: 100%; }

.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-xl); font-weight: 550; letter-spacing: -0.014em; }
.page-sub { margin-top: 3px; font-size: var(--fs-base); color: var(--text-2); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: 10px;
}
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--border-strong); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 20px;
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }

.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--surface-3); }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-danger-outline { background: var(--surface); border-color: #ecc8c8; color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }

.btn-sm { padding: 3px 9px; font-size: var(--fs-sm); }
.btn-sm svg { width: 12px; height: 12px; }

.btn-icon {
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  display: inline-flex;
}
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-icon svg { width: 14px; height: 14px; }

/* ---------- Formulários ---------- */
.field { margin-bottom: 14px; }
.label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.input, .textarea, .select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-base);
  line-height: 20px;
  color: var(--text);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input-mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.textarea { resize: vertical; min-height: 72px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239d9da6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }

.hint { font-size: var(--fs-sm); color: var(--text-3); margin-top: 4px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-base);
  color: var(--text-2);
  cursor: pointer;
}
.check input { accent-color: var(--accent); width: 14px; height: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}

/* ---------- Card / seção ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-pad { padding: 20px; }
.card + .card { margin-top: 14px; }
.card-title { font-size: var(--fs-md); font-weight: 550; }
.card-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.card-head { margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---------- Tabela (listas de tela cheia) ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-base);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .row-click { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-mono { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-2); }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn-icon { visibility: hidden; }
.table tbody tr:hover .cell-actions .btn-icon { visibility: visible; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 99px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge-gray { background: var(--surface-3); color: var(--text-2); }
.badge-green { background: var(--accent-soft); color: var(--accent-strong); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- Estados vazios / banners ---------- */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-base);
}
.empty svg { width: 22px; height: 22px; margin-bottom: 8px; opacity: .7; }
.empty .empty-title { color: var(--text-2); font-weight: 500; margin-bottom: 2px; }

.banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  margin-bottom: 14px;
}
.banner svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.banner-warn { background: var(--warn-soft); border-color: #f0e0bd; color: var(--warn); }
.banner-info { background: var(--info-soft); border-color: #cfe5f2; color: var(--info); }
.banner-danger { background: var(--danger-soft); border-color: #ecc8c8; color: var(--danger); }

/* ---------- KPI (Uso & Custos) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi-label { font-size: var(--fs-xs); font-weight: 550; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-label svg { width: 12px; height: 12px; }
.kpi-value { font-size: 22px; font-weight: 550; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }

.bar-track { flex: 1; background: var(--surface-3); border-radius: 99px; height: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- Toolbar de filtros ---------- */
.toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { margin-bottom: 0; }

.search { position: relative; max-width: 320px; width: 100%; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 30px; }

/* ---------- Toast ---------- */
.toast-region { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--text);
  color: #fff;
  font-size: var(--fs-base);
  padding: 9px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: toastIn .22s ease, toastOut .25s ease 2.75s forwards;
  max-width: 380px;
}
.toast svg { width: 13px; height: 13px; flex-shrink: 0; }
.toast-success svg { color: #6fcf8f; }
.toast-error svg { color: #f08c8c; }
.toast-info svg { color: #7cb8e0; }
@keyframes toastIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px 28px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.auth-brand .brand-mark svg { width: 17px; height: 17px; }
.auth-title { font-size: var(--fs-lg); font-weight: 550; }
.auth-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--text-3); font-size: var(--fs-xs); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-msg { font-size: var(--fs-sm); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 12px; }
.auth-msg.ok { background: var(--accent-soft); color: var(--accent-strong); }
.auth-msg.err { background: var(--danger-soft); color: var(--danger); }

/* ---------- Editor JSONB ---------- */
.jt-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0 4px 10px; border-left: 2px solid var(--border); margin-left: 2px; }
.jt-row:hover { border-left-color: var(--border-strong); }
.jt-key {
  width: 168px; flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
}
.jt-key:focus, .jt-val:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.jt-idx { width: 34px; flex-shrink: 0; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); padding-top: 7px; }
.jt-val {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  background: var(--surface);
}
.jt-branch { width: 100%; }
.jt-branch > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.jt-branch > summary::-webkit-details-marker { display: none; }
.jt-chevron { transition: transform .15s; color: var(--text-3); display: inline-flex; }
.jt-chevron svg { width: 11px; height: 11px; }
details[open] > summary .jt-chevron { transform: rotate(90deg); }
.jt-children { margin-left: 14px; margin-top: 2px; }
.jt-add-bar { display: flex; gap: 14px; margin: 6px 0 2px 12px; }
.jt-add {
  font-size: var(--fs-sm);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.jt-add:hover { color: var(--accent-strong); }
.jt-add svg { width: 11px; height: 11px; }

/* ---------- Chat de testes (simulador) ---------- */
.chat-frame { display: flex; flex-direction: column; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-avatar svg { width: 14px; height: 14px; }
.chat-bg {
  background: #efedeb;
  background-image: radial-gradient(rgba(0,0,0,.028) 1px, transparent 1px);
  background-size: 20px 20px;
  scroll-behavior: smooth;
  padding: 14px 16px;
  height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.msg-row { display: flex; }
.msg-bubble {
  position: relative;
  max-width: 78%;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: var(--fs-base);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  animation: popIn .18s ease;
}
.msg-in { background: var(--surface); color: var(--text); border-top-left-radius: 3px; }
.msg-out { background: var(--accent); color: #fff; border-top-right-radius: 3px; }
.msg-text { white-space: pre-wrap; }
.msg-time { float: right; margin: 7px 0 -2px 8px; font-size: 10px; line-height: 1; opacity: .55; white-space: nowrap; }
.msg-out .msg-time { color: #eafff0; opacity: .85; }
.msg-note {
  background: var(--warn-soft);
  border: 1px solid #f0e0bd;
  color: var(--warn);
  font-size: var(--fs-xs);
  border-radius: var(--radius);
  padding: 5px 10px;
  max-width: 85%;
  text-align: center;
}
@keyframes popIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.typing-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-3);
  display: inline-block; animation: typingBounce 1.3s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: .18s; }
.typing-dot:nth-child(3) { animation-delay: .36s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(56,153,85,.45); }
  70% { box-shadow: 0 0 0 6px rgba(56,153,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(56,153,85,0); }
}

.chat-input-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-bar .input { border-radius: 99px; padding-left: 14px; }
.chat-send {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-send:hover { background: var(--accent-strong); }
.chat-send svg { width: 14px; height: 14px; }

/* ---------- Página do editor embed (iframe) ---------- */
.embed-page { display: flex; flex-direction: column; height: 100vh; }
.embed-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.embed-frame { flex: 1; width: 100%; border: 0; background: var(--surface); }
.embed-foot { padding: 6px 16px; font-size: var(--fs-xs); color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface); }

/* ---------- Grupos de lista (fluxos) ---------- */
.group-label {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-xs); font-weight: 550;
  text-transform: uppercase; letter-spacing: .06em;
  margin: 18px 0 8px;
}
.group-label svg { width: 12px; height: 12px; }
.group-label .count { color: var(--text-3); font-weight: 400; }

/* Linha de item rica (fluxos/missões em lista cheia) */
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
}
.item-row.inactive { opacity: .55; }
.item-icon {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.item-icon svg { width: 15px; height: 15px; }
.item-title { font-size: var(--fs-base); font-weight: 550; }
.item-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 1px; }
.item-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

/* ---------- Abas de canal ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 8px 14px;
  font-size: var(--fs-base);
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

/* ---------- Pipeline visual (fluxos) ---------- */
.pipeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 22px;
}
.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.pstep {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
}
.pstep svg { color: var(--text-3); }
.pipe-arrow { color: var(--border-strong); display: inline-flex; }

.slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .slots { grid-template-columns: 1fr; } }

.slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slot-head { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.slot-head > div { min-width: 0; }
.slot-title { font-size: var(--fs-base); font-weight: 550; }
.slot-desc { font-size: var(--fs-sm); color: var(--text-3); margin-top: 1px; line-height: 1.35; }
.slot-drop {
  flex: 1;
  min-width: 0;
  min-height: 76px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  overflow: hidden;
  transition: background .12s, border-color .12s;
}
.slot-drop.filled { border-style: solid; border-color: var(--border); background: var(--surface-2); }
.slot-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.slot-empty {
  margin: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* ---------- Biblioteca + cartões arrastáveis ---------- */
.lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lib-head .group-label { margin: 0; }
.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.flow-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: grab;
}
.flow-card:active { cursor: grabbing; }
.flow-card.dragging { opacity: .4; }
.slot-drop .flow-card { width: 100%; }
.flow-card-name { font-size: var(--fs-base); font-weight: 550; }
.flow-card-actions { display: flex; align-items: center; gap: 1px; flex-shrink: 0; }
.flow-card-actions .btn-icon { visibility: hidden; }
.flow-card:hover .flow-card-actions .btn-icon { visibility: visible; }
