:root {
  --verde: #5DC635;
  --verde-escuro: #3fa81f;
  --teal: #00A99D;
  --cinza: #3f4448;
  --cinza-claro: #eef1f5;
  --branco: #ffffff;
  --borda: #ebeef2;
  --sombra: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --sombra-hover: 0 6px 20px rgba(16,24,40,.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background:
    radial-gradient(1100px 620px at 100% -5%, rgba(93,198,53,.06), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(0,169,157,.05), transparent 55%),
    var(--cinza-claro);
  background-attachment: fixed;
  color: var(--cinza);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL / SIDEBAR ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--borda);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo { display: flex; align-items: center; gap: 11px; padding: 2px 6px 26px; }
.sidebar-logo .logo-box {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--verde) 0%, var(--teal) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(93,198,53,.28);
}
.sidebar-logo .logo-box svg { width: 22px; height: 22px; }
.sidebar-logo .logo-brand { min-width: 0; }
.sidebar-logo .logo-img { display: block; height: 20px; width: auto; max-width: 132px; object-fit: contain; }
.sidebar-logo .logo-sub { font-size: 10px; color: #a2abb4; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 5px; font-weight: 600; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: none; background: none;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  color: #7c858e;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #f3f5f7; color: var(--cinza); }
.nav-item.active { background: rgba(93,198,53,0.12); color: var(--verde-escuro); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--verde); }

.sidebar-sair {
  margin-top: 10px;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: none; background: none;
  border-radius: 11px;
  font-size: 13px; font-weight: 600;
  color: #aeb6bd;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .16s, color .16s;
}
.sidebar-sair svg { width: 17px; height: 17px; }
.sidebar-sair:hover { background: #fdeeec; color: #e0533f; }
.sidebar-foot { margin-top: 12px; padding: 12px 8px 2px; border-top: 1px solid var(--borda); font-size: 10.5px; color: #b2bac1; line-height: 1.5; }
.sidebar-foot strong { color: #FF6600; font-weight: 700; }

.content { flex: 1; min-width: 0; }

.view { display: none; padding: 32px 36px; max-width: 1200px; }
.view.active { display: block; }
#view-funil.active { display: flex; flex-direction: column; max-width: none; }

.view-header { margin-bottom: 24px; }
.view-header h2 { font-size: 22px; font-weight: 700; color: #2b3034; margin-bottom: 5px; letter-spacing: -0.4px; }
.view-header p { font-size: 13px; color: #98a1aa; }

/* STATS ROW */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 19px 22px;
  box-shadow: var(--sombra);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--sombra-hover); }
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.verde { background: rgba(93,198,53,0.12); color: var(--verde); }
.stat-icon.teal  { background: rgba(0,169,157,0.12); color: var(--teal); }
.stat-icon.cinza { background: rgba(88,89,91,0.10); color: var(--cinza); }
.stat-val { font-size: 28px; font-weight: 700; color: var(--cinza); line-height: 1; }
.stat-label { font-size: 12px; color: #999; margin-top: 3px; font-weight: 500; }

/* SECTION CARD */
.card {
  background: white;
  border: 1px solid var(--borda);
  border-radius: 18px;
  box-shadow: var(--sombra);
  margin-bottom: 24px;
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--cinza);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); }
.card-body { padding: 24px; }

/* WHATSAPP CONNECT */
.wa-area { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.wa-left { flex: 1; min-width: 220px; }
.wa-right { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qr-box {
  width: 200px; height: 200px;
  border: 2px dashed #d0d0d0;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}
.qr-box img { width: 180px; height: 180px; object-fit: contain; display: none; }
.qr-placeholder { text-align: center; color: #bbb; }
.qr-placeholder svg { width: 48px; height: 48px; opacity: 0.4; }
.qr-placeholder p { font-size: 12px; margin-top: 8px; }

.wa-steps { list-style: none; margin-bottom: 20px; }
.wa-steps li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.wa-steps .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--verde), var(--teal));
  color: white; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.wa-steps .txt { font-size: 14px; line-height: 1.5; color: var(--cinza); }
.wa-steps strong { font-weight: 600; }

/* STATUS BADGE */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.status-badge.idle  { background: #f0f0f0; color: #888; }
.status-badge.wait  { background: rgba(93,198,53,0.12); color: var(--verde); }
.status-badge.ok    { background: rgba(0,169,157,0.12); color: var(--teal); }
.status-badge.error { background: rgba(220,50,50,0.10); color: #d33; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-badge.wait .status-dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--verde), var(--teal));
  color: white;
  box-shadow: 0 3px 10px rgba(93,198,53,0.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(93,198,53,0.4); }
.btn-outline { background: white; color: var(--cinza); border: 1.5px solid #e0e0e0; }
.btn-outline:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* SEARCH */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-wrap input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  color: var(--cinza);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--teal); background: white; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #aaa; width: 16px; height: 16px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: #aaa; padding: 10px 16px; border-bottom: 1px solid #f0f0f0;
}
tbody td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f6f6f6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #fafcf9; }
.row-num { color: #cbd0d5; font-size: 12px; width: 36px; }
.date-cell { color: #a7aeb5; font-size: 12px; white-space: nowrap; }
.name-cell { max-width: 440px; }
.phone-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-count { padding: 13px 16px; font-size: 12px; color: #a7aeb5; }

/* Olhinho / modo privacidade */
.th-eye { display: inline-flex; align-items: center; }
.eye-btn { background: none; border: none; cursor: pointer; padding: 3px; margin-left: 5px; color: #c2c8ce; display: inline-flex; align-items: center; line-height: 0; vertical-align: middle; border-radius: 6px; transition: color .15s, background .15s; }
.eye-btn svg { width: 15px; height: 15px; }
.eye-head svg { width: 14px; height: 14px; }
.eye-btn:hover { color: var(--verde); background: #eef8ea; }
.eye-btn.active, .mask.on .eye-btn { color: var(--verde); }
table.reveal-names .name-cell .eye-btn { color: var(--verde); }
table.reveal-phones .phone-cell .eye-btn { color: var(--verde); }
.mask-rest { display: none; }
.mask.on .mask-rest, table.reveal-names .mask-rest { display: inline; }
.ph-full { display: none; }
.mask.on .ph-masked, table.reveal-phones .ph-masked { display: none; }
.mask.on .ph-full, table.reveal-phones .ph-full { display: inline; }
.muted-dash { color: #ccd1d6; }
.source-tag {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  background: rgba(0,169,157,0.10); color: var(--teal);
}

.empty-state { text-align: center; padding: 48px 24px; color: #bbb; }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

.loading { display: flex; align-items: center; gap: 10px; padding: 32px; color: #999; font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid #e0e0e0; border-top-color: var(--verde);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #222; color: white; padding: 12px 22px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.show.success { background: #2d7a1b; }
#toast.show.error { background: #b33a3a; }

/* ===== FUNIL DE ATENDIMENTO ===== */
.funil-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.funil-total {
  display: flex; align-items: center; gap: 14px;
  background: white; border-radius: 14px; box-shadow: var(--sombra);
  padding: 14px 20px;
}
.funil-total-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(93,198,53,0.12); color: var(--verde);
}
.funil-total-val { font-size: 24px; font-weight: 700; color: var(--cinza); line-height: 1; }
.funil-total-label { font-size: 11.5px; color: #999; margin-top: 3px; font-weight: 500; }
.funil-topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.funil-filtro {
  padding: 9px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px;
  font-size: 13px; color: var(--cinza); background: #fafafa; cursor: pointer; outline: none;
}
.funil-filtro:focus { border-color: var(--teal); }

#funil-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.funil-board {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.funil-col {
  /* cresce pra preencher a tela quando cabe; nunca encolhe abaixo do flex-basis,
     então em tela pequena o board rola lateralmente em vez de quebrar pra baixo.
     min-width:0 impede que o texto longo de um card infle só aquela coluna. */
  flex: 1 0 250px;
  min-width: 0;
  background: #f7f8fa;
  border-radius: 14px;
  border: 1px solid #eef0f3;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
}
.funil-col.drop-hover { border-color: var(--teal); background: rgba(0,169,157,0.05); }
.funil-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 14px; border-bottom: 1px solid #eef0f3;
}
.funil-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.funil-col-title { font-size: 12.5px; font-weight: 700; color: var(--cinza); flex: 1; line-height: 1.2; }
.funil-col-count {
  font-size: 11px; font-weight: 700; color: #666;
  background: #e9ebef; border-radius: 10px; padding: 2px 9px; flex-shrink: 0;
}
.funil-col-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.funil-empty { text-align: center; color: #bbb; font-size: 11.5px; padding: 20px 8px; }

/* CARD padronizado — altura fixa, todos idênticos independente do conteúdo */
.funil-card {
  height: 150px;
  background: white;
  border: 1px solid #eceef1;
  border-radius: 11px;
  padding: 12px 13px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(20,16,5,0.03);
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.funil-card:hover { box-shadow: 0 4px 14px -6px rgba(20,16,5,0.18); }
.funil-card:active { cursor: grabbing; }
.funil-card.dragging { opacity: 0.45; }
.funil-card-tags { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; margin-bottom: 7px; }
.funil-card .btn-wa { margin-top: auto; }
.funil-card-name {
  font-size: 15px; font-weight: 700; color: var(--cinza); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px;
}
.funil-card-name.sem-nome { color: #aaa; font-weight: 600; font-style: italic; }
.funil-badge {
  font-size: 9.5px; font-weight: 800; padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-frio      { color: #2f6fb0; background: rgba(47,111,176,0.12); }
.badge-frio-morno{ color: #7a7f52; background: linear-gradient(90deg, rgba(47,111,176,0.14), rgba(185,130,15,0.16)); }
.badge-morno     { color: #b9820f; background: rgba(185,130,15,0.14); }
.badge-quente    { color: #c23b3b; background: rgba(194,59,59,0.12); }
.badge-encerrado { color: #6b7280; background: rgba(107,114,128,0.12); }

/* linha da janela de 24h (ou aguardando resposta) — altura fixa pra padronizar */
.funil-card-janela {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; height: 22px; margin-bottom: 8px;
  color: #888; white-space: nowrap; overflow: hidden;
}
.funil-card-janela svg { width: 12px; height: 12px; flex-shrink: 0; }
.funil-card-janela.ativa { color: #2d7a1b; }
.funil-card-janela.expirada { color: #c23b3b; }
.funil-card-janela.aguardando { color: #a99; }

/* botão WhatsApp */
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 8px; border: none; border-radius: 9px;
  background: linear-gradient(135deg, var(--verde), var(--teal));
  color: white; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: filter 0.15s;
}
.btn-wa:hover { filter: brightness(1.05); }
.btn-wa.expirada { background: #6b7280; }
.btn-wa svg { width: 14px; height: 14px; }

.funil-card.exemplo { border-style: dashed; }
.funil-exemplo-tag {
  display: inline-block; font-size: 8.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #b9820f; background: rgba(185,130,15,0.12);
  border-radius: 5px; padding: 1px 6px; margin-bottom: 7px;
}
.funil-exemplo-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(185,130,15,0.10); color: #8a610b;
  border: 1px solid rgba(185,130,15,0.25);
  border-radius: 10px; padding: 10px 14px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 14px;
}

/* MODAL de detalhes do card */
.card-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,22,25,0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.card-modal-overlay.show { opacity: 1; pointer-events: auto; }
.card-modal {
  background: white; border-radius: 18px; width: 100%; max-width: 460px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.4);
  transform: scale(0.94); transition: transform 0.2s; overflow: hidden;
}
.card-modal-overlay.show .card-modal { transform: scale(1); }
.card-modal-head {
  padding: 22px 24px 18px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.card-modal-head h3 { font-size: 20px; font-weight: 700; color: var(--cinza); line-height: 1.25; }
.card-modal-close {
  width: 30px; height: 30px; border-radius: 8px; border: none; background: #f4f4f4;
  color: #999; font-size: 18px; cursor: pointer; flex-shrink: 0; line-height: 1;
}
.card-modal-close:hover { background: #ececec; color: #666; }
.card-modal-body { padding: 20px 24px 24px; }
.card-modal-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid #f6f6f6; }
.card-modal-row:last-of-type { border-bottom: none; }
.card-modal-row .lbl { color: #999; width: 130px; flex-shrink: 0; }
.card-modal-row .val { color: var(--cinza); font-weight: 600; }
.card-modal-msg {
  background: #fafafa; border-radius: 10px; padding: 12px 14px; margin: 14px 0;
  font-size: 13px; color: #666; line-height: 1.5;
}
.card-modal .btn-wa { margin-top: 8px; padding: 12px; font-size: 14px; }

/* Seletor de fonte no card de Leads */
.stat-select {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
  background: #fff;
  cursor: pointer;
  max-width: 165px;
  margin-bottom: 2px;
  font-family: inherit;
}
.stat-select:focus { outline: none; border-color: var(--teal); }

/* Caixinhas de selecao na conexao */
.cat-label { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #333; cursor: pointer; user-select: none; }
.cat-label input { width: 16px; height: 16px; accent-color: #5DC635; cursor: pointer; }
.cat-label input:disabled { cursor: default; }
.cat-label.cat-sub { font-size: 12.5px; color: #667079; }
.cautela-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #d17d1e; background: #fdf3e5; border: 1px solid #f4e2c6; padding: 3px 9px 3px 7px; border-radius: 20px; margin-left: 8px; }
.cautela-tag svg { width: 12px; height: 12px; }

/* Modal / popup de alerta */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(22,28,34,.5); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); animation: modalFade .2s ease; }
.modal-card { background: #fff; border-radius: 22px; max-width: 448px; width: 100%; padding: 32px 30px 26px; box-shadow: 0 30px 70px rgba(0,0,0,.28); text-align: center; animation: modalPop .28s cubic-bezier(.2,.85,.32,1.15); }
.modal-icon { width: 60px; height: 60px; border-radius: 50%; background: #fdf0e0; color: #ef8a24; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.modal-icon svg { width: 30px; height: 30px; }
.modal-card h3 { font-size: 19px; font-weight: 700; color: #2b3034; margin-bottom: 12px; letter-spacing: -.2px; }
.modal-card p { font-size: 13.5px; color: #5f6b76; line-height: 1.62; margin-bottom: 11px; }
.modal-card p strong { color: #47505a; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.btn-danger { background: #ef5b45; color: #fff; border: none; }
.btn-danger:hover { background: #e04a34; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
.pub-grupos-list { margin: 4px 0 6px 26px; padding: 10px 12px; border-left: 2px solid #e8eef3; background: #fafbfc; border-radius: 0 8px 8px 0; display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.pub-grupos-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: #98a1aa; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid #eef1f4; position: sticky; top: -10px; background: #fafbfc; }
.pub-grupos-actions button { background: none; border: none; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--verde); padding: 2px 4px; }
.pub-grupos-actions button:hover { text-decoration: underline; }
.pub-grupos-actions .sep { color: #d0d5da; margin: 0 2px; }

/* Etiquetas de origem na lista de Leads */
.origem-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; letter-spacing: .1px; }
.origem-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex-shrink: 0; }
.origem-conversa { background: #eaf7ee; color: #1f7a2e; border-color: #cdeed4; }
.origem-grupo { background: #eef0ff; color: #454dce; border-color: #d7dbfb; }
.origem-agenda { background: #f0f1f3; color: #6b7280; border-color: #e5e7eb; }
.origem-internacional { background: #fff2e3; color: #c47712; border-color: #f4e0c2; }
.origem-lid { background: #fdecec; color: #c0392b; border-color: #f6d2cf; }
.origem-planilha { background: #e4f7f4; color: #0a8f80; border-color: #c7ece6; }
.origem-outro { background: #f2f3f5; color: #6b7280; border-color: #e5e7eb; }
.origem-admin { background: #fff4d6; color: #a9720a; border-color: #f2dfa3; }
/* "(numeros)" curto e discreto dentro da etiqueta Conversa, sem alargar a coluna */
.origem-sub { font-weight: 500; font-size: 10px; opacity: .72; letter-spacing: 0; }
/* Aviso entre parenteses ao lado dos rotulos (Conversas) na extracao e no disparo */
.cat-hint { color: #8a94a6; font-weight: 400; font-size: 12px; }

/* Legenda das etiquetas (aba Leads) */
.legend-card { margin-top: 18px; background: #fff; border: 1px solid #eceef0; border-radius: 16px; padding: 16px 18px 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.legend-card-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: #6b7784; margin: 0 2px 12px; }
.legend-card-head svg { color: #9aa3ac; }
.legend-acc { display: flex; flex-direction: column; gap: 8px; }
.legend-item { border: 1px solid #eef0f2; border-radius: 12px; background: #fbfcfd; overflow: hidden; transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
.legend-item:hover { background: #fff; border-color: #e2e6ea; }
.legend-item.open { background: #fff; border-color: #d7dce1; box-shadow: 0 3px 10px rgba(16,24,40,.05); }
.legend-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: none; border: none; cursor: pointer; font: inherit; text-align: left; }
.legend-head .origem-tag { flex-shrink: 0; }
.legend-teaser { flex: 1; min-width: 0; font-size: 12.5px; color: #98a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-chev { flex-shrink: 0; color: #b3bcc4; transition: transform .28s ease, color .2s ease; }
.legend-item.open .legend-chev { transform: rotate(180deg); color: #6b7784; }
.legend-body { max-height: 0; overflow: hidden; transition: max-height .32s cubic-bezier(.4,0,.2,1); }
.legend-item.open .legend-body { max-height: 260px; }
.legend-body p { margin: 0; padding: 2px 15px 14px; font-size: 12.5px; color: #5f6b76; line-height: 1.6; opacity: 0; transform: translateY(-5px); transition: opacity .3s ease .06s, transform .3s ease .06s; }
.legend-item.open .legend-body p { opacity: 1; transform: none; }
.legend-body a { color: #0a8f80; font-weight: 600; }
.legend-body a:hover { text-decoration: underline; }
@media (max-width: 560px) { .legend-teaser { display: none; } }

/* Prefixo do nome do grupo no nome do contato */
.grp-prefix { color: #454dce; font-weight: 600; }
.grp-sep { color: #b9c0c7; font-weight: 400; }

/* Badge de contagem no seletor de publico do Disparo */
.pub-badge { display: inline-block; margin-left: 6px; background: #f0f1f3; color: #555; border-radius: 20px; padding: 1px 9px; font-size: 12px; font-weight: 600; }

/* ===== CHAT (visualizacao estilo WhatsApp Web, somente leitura) ===== */
.chat-banner { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 1px solid #f0e0b5; color: #8a6d1a; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.chat-stats { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.chat-stat { background: #fff; border: 1px solid #e6ebf0; border-radius: 12px; padding: 12px 18px; display: flex; flex-direction: column; min-width: 118px; box-shadow: 0 1px 2px rgba(20,40,60,.04); }
.chat-stat-num { font-size: 26px; font-weight: 800; color: #2f3a2a; line-height: 1; font-variant-numeric: tabular-nums; }
.chat-stat-lbl { font-size: 12px; color: #8a94a6; margin-top: 4px; }
.chat-wrap { display: flex; height: min(66vh, 600px); background: #fff; border: 1px solid #e6ebf0; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(20,40,60,.05); }
.chat-list { width: 320px; min-width: 250px; border-right: 1px solid #eef2f5; display: flex; flex-direction: column; background: #fafcfd; }
.chat-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #eef2f5; color: #9aa4af; }
.chat-search input { border: none; background: transparent; outline: none; font-size: 14px; width: 100%; color: #333; }
.chat-list-body { overflow-y: auto; flex: 1; }
.chat-conv { display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer; border-bottom: 1px solid #f1f4f6; transition: background .12s; }
.chat-conv:hover { background: #f2f7f3; }
.chat-conv.active { background: #e8f5e6; }
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: #d7e9d2; color: #3e7d4c; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.chat-avatar.grupo { background: #dfe7f2; color: #3a5a8a; }
.chat-avatar.big { width: 46px; height: 46px; font-size: 19px; }
.chat-conv-mid { flex: 1; min-width: 0; }
.chat-conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-conv-nome { font-weight: 600; color: #25303a; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-hora { font-size: 11px; color: #a7b0ba; flex-shrink: 0; }
.chat-conv-prev { font-size: 12.5px; color: #8a94a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-conv-count { background: var(--verde); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #ece5dd; }
.chat-thread-empty { margin: auto; text-align: center; color: #9aa4a0; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 14px; }
.chat-thread-inner { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #f4f6f5; border-bottom: 1px solid #e2e7e4; }
.chat-th-nome { font-weight: 700; color: #25303a; font-size: 15px; }
.chat-th-sub { font-size: 12px; color: #8a94a0; margin-top: 2px; }
.chat-thread-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.chat-bolha { max-width: 72%; min-width: 90px; padding: 7px 11px 6px; border-radius: 9px; font-size: 13.5px; line-height: 1.4; color: #2b2b2b; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chat-bolha.ele { align-self: flex-start; background: #fff; }
.chat-bolha.me { align-self: flex-end; background: #d9fdd3; }
.chat-bolha-autor { font-size: 12px; font-weight: 700; color: #3a5a8a; margin-bottom: 2px; }
.chat-bolha-t { white-space: pre-wrap; word-break: break-word; }
.chat-bolha-h { display: block; text-align: right; font-size: 10px; color: #8a938c; margin-top: 3px; }
.chat-thread-foot { padding: 8px 14px; text-align: center; font-size: 11.5px; color: #8a94a0; background: #f4f6f5; border-top: 1px solid #e2e7e4; display: flex; align-items: center; justify-content: center; gap: 6px; }
.chat-vazio { padding: 30px; text-align: center; color: #9aa4af; font-size: 13px; }
@media (max-width: 820px) { .chat-list { width: 45%; min-width: 0; } .chat-conv-prev { display: none; } }

/* ===== Leads organizados automaticamente ===== */
.btn-organizados {
  width: 100%; display: flex; align-items: center; gap: 16px;
  background: linear-gradient(100deg, #5DC635, #3fa524); color: #fff;
  border: none; border-radius: 14px; padding: 18px 22px; margin-bottom: 20px;
  cursor: pointer; text-align: left; box-shadow: 0 6px 18px rgba(63,165,36,.28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-organizados:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(63,165,36,.36); }
.btn-organizados-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.btn-organizados-ico svg { width: 22px; height: 22px; }
.btn-organizados-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.btn-organizados-txt strong { font-size: 15.5px; font-weight: 700; }
.btn-organizados-txt small { font-size: 12.5px; opacity: .9; font-weight: 400; }
.btn-organizados-arrow { width: 22px; height: 22px; flex: 0 0 auto; opacity: .9; }

.org-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.org-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.org-tab {
  display: flex; align-items: center; gap: 9px; padding: 12px 22px; border-radius: 11px;
  background: #fff; border: 1.5px solid #e4e8e4; color: #5c6660; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .12s ease;
}
.org-tab svg { width: 17px; height: 17px; }
.org-tab:hover { border-color: #bfe0b0; color: #3fa524; }
.org-tab.active { background: #5DC635; border-color: #5DC635; color: #fff; box-shadow: 0 4px 12px rgba(93,198,53,.3); }

.org-aviso {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  background: #fff8e8; border: 1px solid #f2e2b8; border-radius: 10px; padding: 12px 15px;
  font-size: 12.8px; color: #8a6d1f; line-height: 1.55;
}

/* ===== Guia do disparo (tira-dúvidas) ===== */
.guia-wrap { max-width: 760px; }
.guia-lead {
  background: #f6faf4; border: 1px solid #e2efdc; border-radius: 14px;
  padding: 18px 22px; margin-bottom: 20px; font-size: 14px; color: #46504a; line-height: 1.65;
}
.guia-lead strong { color: #2f3a2a; }
.card + .card.guia-card { margin-top: 18px; }
.guia-card .card-body { padding-top: 20px; }
.guia-sub { font-size: 13px; color: #8a94a0; line-height: 1.6; margin-bottom: 18px; }

/* balão de mensagem estilo WhatsApp */
.guia-chatbg {
  background: #e7ded4; background-image: linear-gradient(0deg, rgba(0,0,0,.02), rgba(0,0,0,.02));
  border-radius: 14px; padding: 22px 18px; display: flex; flex-direction: column; gap: 4px;
}
.guia-bubble {
  align-self: flex-start; max-width: 88%;
  background: #fff; border-radius: 3px 12px 12px 12px; padding: 10px 13px 7px;
  box-shadow: 0 1px 1px rgba(0,0,0,.13); font-size: 14px; color: #1f2c33; line-height: 1.5;
  position: relative;
}
.guia-bubble.mine { align-self: flex-end; background: #d9fdd3; border-radius: 12px 3px 12px 12px; }
.guia-bubble .var { background: #fff3d6; border-radius: 4px; padding: 0 4px; font-weight: 600; color: #9a6b00; }
.guia-bubble-time { display: block; text-align: right; font-size: 10.5px; color: #8a9aa2; margin-top: 3px; }
.guia-msg-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 20px; margin-bottom: 9px;
}
.guia-msg-tag.bom { background: rgba(93,198,53,.14); color: #3fa81f; }
.guia-msg-tag.evite { background: rgba(220,80,60,.12); color: #c0392b; }
.guia-note { font-size: 12.5px; color: #8a94a0; margin-top: 12px; line-height: 1.6; }
.guia-note strong { color: #5c6660; }

/* regras numeradas (reaproveita ideia do wa-steps) */
.guia-rules { list-style: none; margin: 6px 0 0; }
.guia-rules li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 13px; }
.guia-rules .n {
  width: 25px; height: 25px; border-radius: 50%; background: linear-gradient(135deg, var(--verde), var(--teal));
  color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.guia-rules .t { font-size: 13.8px; line-height: 1.5; color: var(--cinza); }
.guia-rules .t strong { font-weight: 700; color: #2f3a2a; }

/* FAQ */
.guia-faq-item { border-top: 1px solid #f0f0f0; padding: 15px 0; }
.guia-faq-item:first-child { border-top: none; padding-top: 4px; }
.guia-faq-q { font-size: 14px; font-weight: 700; color: #2b3034; margin-bottom: 5px; display: flex; gap: 8px; align-items: flex-start; }
.guia-faq-q svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--verde); }
.guia-faq-a { font-size: 13.5px; color: #6a736c; line-height: 1.6; padding-left: 24px; }

/* o que a Locávoda decide */
.guia-decide { display: flex; flex-direction: column; gap: 12px; }
.guia-decide-item { display: flex; gap: 12px; align-items: flex-start; background: #fafbfa; border: 1px solid #eef1ee; border-radius: 11px; padding: 13px 15px; }
.guia-decide-ico { width: 34px; height: 34px; border-radius: 9px; background: rgba(93,198,53,.12); color: var(--verde); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.guia-decide-ico svg { width: 18px; height: 18px; }
.guia-decide-tt { font-size: 13.8px; font-weight: 700; color: #2b3034; margin-bottom: 2px; }
.guia-decide-tx { font-size: 12.8px; color: #7a837c; line-height: 1.55; }

/* telas do sistema */
.guia-telas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guia-tela { background: #fafbfa; border: 1px solid #eef1ee; border-radius: 11px; padding: 14px 15px; }
.guia-tela-tt { font-size: 13.5px; font-weight: 700; color: #2b3034; margin-bottom: 3px; }
.guia-tela-tx { font-size: 12.6px; color: #7a837c; line-height: 1.5; }
@media (max-width: 620px) { .guia-telas { grid-template-columns: 1fr; } }
.org-aviso svg { flex: 0 0 auto; margin-top: 1px; color: #c79a2a; }

/* ===== Disparo: lista, quantidade, progresso ===== */
.disp-status { background:#f6faf4; border:1px solid #e2efdc; border-radius:12px; padding:14px 16px; }
.disp-status-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.disp-status-nome { font-size:14px; font-weight:700; color:#2f3a2a; }
.disp-status-refresh { background:none; border:none; color:#6a8a5c; cursor:pointer; padding:4px; border-radius:6px; display:flex; }
.disp-status-refresh:hover { background:#e2efdc; }
.disp-status-nums { display:flex; gap:26px; }
.disp-num { display:flex; flex-direction:column; }
.disp-num strong { font-size:22px; font-weight:700; color:#2f3a2a; font-variant-numeric:tabular-nums; line-height:1.1; }
.disp-num span { font-size:11.5px; color:#8aa07f; margin-top:2px; }

.disp-chips { display:flex; flex-wrap:wrap; gap:8px; }
.disp-chip { padding:8px 15px; border-radius:9px; border:1.5px solid #e4e8e4; background:#fff; color:#5c6660; font-size:13px; font-weight:600; cursor:pointer; transition:all .12s ease; }
.disp-chip:hover { border-color:#bfe0b0; color:#3fa524; }
.disp-chip.active { background:#5DC635; border-color:#5DC635; color:#fff; box-shadow:0 3px 10px rgba(93,198,53,.28); }
.disp-chip-teste { border-color:#cfe0ef; color:#3d7fb0; }
.disp-chip-teste:hover { border-color:#a9cae8; color:#2f6a99; }
.disp-chip-teste.active { background:#3d9be9; border-color:#3d9be9; color:#fff; box-shadow:0 3px 10px rgba(61,155,233,.28); }
.disp-qtd-input { width:110px; padding:8px 11px; border:1.5px solid #e4e8e4; border-radius:9px; font-size:13px; color:#333; }
.disp-qtd-input:focus { outline:none; border-color:#5DC635; }

.disp-aviso { display:flex; align-items:flex-start; gap:10px; margin-top:16px; background:#fff8e8; border:1px solid #f2e2b8; border-radius:10px; padding:12px 15px; font-size:12.8px; color:#8a6d1f; line-height:1.55; }
.disp-aviso svg { flex:0 0 auto; margin-top:1px; }
.disp-resumo { margin-top:14px; padding:13px 16px; border-radius:10px; background:#eef7ff; border:1px solid #d3e6f7; font-size:13.5px; color:#2f6a99; line-height:1.5; font-weight:600; }

.disp-progress { margin-top:16px; }
.disp-progress-bar { height:8px; background:#eef1ee; border-radius:5px; overflow:hidden; }
#disp-progress-fill { height:100%; width:0%; background:linear-gradient(90deg,#5DC635,#48a827); border-radius:5px; transition:width .5s ease; }
.disp-progress-txt { font-size:12.5px; color:#6a736c; margin-top:8px; font-weight:600; }

/* ===== Dicas (atalhos) ===== */
.dicas-wrap { display:flex; flex-direction:column; gap:14px; max-width:720px; }
.dica-card { display:flex; align-items:center; gap:16px; background:#fff; border:1px solid var(--borda); border-radius:14px; padding:20px 22px; text-decoration:none; box-shadow:var(--sombra); transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease; position:relative; }
.dica-card:hover { transform:translateY(-1px); box-shadow:var(--sombra-hover); border-color:#bfe0b0; }
.dica-num { position:absolute; top:14px; left:14px; width:22px; height:22px; border-radius:50%; background:#eef1f5; color:#8a94a0; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.dica-ico { flex:0 0 auto; width:52px; height:52px; border-radius:13px; background:linear-gradient(135deg,var(--verde),var(--teal)); color:#fff; display:flex; align-items:center; justify-content:center; margin-left:14px; }
.dica-ico svg { width:26px; height:26px; }
.dica-txt { flex:1; display:flex; flex-direction:column; gap:4px; }
.dica-txt strong { font-size:16px; font-weight:700; color:#2b3034; }
.dica-txt small { font-size:12.8px; color:#8a94a0; line-height:1.5; font-weight:400; }
.dica-arrow { width:22px; height:22px; flex:0 0 auto; color:#c2ccc0; }
.dica-card:hover .dica-arrow { color:#5DC635; }
