/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:       #0ea5e9;
  --teal-dark:  #0284c7;
  --teal-light: #e0f2fe;
  --bg:         #f5f7fa;
  --surface:    #ffffff;
  --border:     #e8ecf0;
  --text:       #1e2a38;
  --text-sub:   #64748b;
  --text-muted: #94a3b8;
  --red:        #ef4444;
  --green:      #22c55e;
  --radius:     10px;
  --shadow:     0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

/* ===== Layout ===== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #0d1b5e;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(13,27,94,.3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.18);
}

.sidebar-brand-icon {
  color: #fff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: .1px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,.85);
  font-size: 15px;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.sidebar-link.ativo {
  background: rgba(255,255,255,.25);
  color: #fff;
  font-weight: 600;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: .9;
}

.sidebar-bottom {
  padding: 10px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.18);
  margin-top: auto;
}

/* ===== Layout body ===== */
.layout-body {
  flex: 1;
  margin-left: 220px;
  min-width: 0;
}

/* ===== Main ===== */
.main-content {
  padding: 28px;
  max-width: 100%;
  overflow-x: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, box-shadow .15s;
  letter-spacing: .1px;
}
.btn:hover { opacity: .88; }
.btn-primary   { background: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(14,165,233,.3); }
.btn-secondary { background: var(--border); color: var(--text-sub); }
.btn-danger    { background: var(--red); color: #fff; }

/* ===== Alerts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-erro    { background: #fef2f2; color: #991b1b; border-left: 3px solid var(--red); }
.alert-sucesso { background: #f0fdf4; color: #166534; border-left: 3px solid var(--green); }
.erros-lista   { margin-top: 8px; padding-left: 20px; }

/* ===== Page header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 20px; font-weight: 700; color: var(--text); }

/* ===== Kanban Header ===== */
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.kanban-header h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.kanban-actions { display: flex; gap: 10px; align-items: center; }

.filtro-form select {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}
.filtro-form select:focus { outline: none; border-color: var(--teal); }

/* ===== Kanban Board ===== */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 160px);
}

.kanban-column {
  flex: 0 0 220px;
  background: #edf0f5;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  border: 1px solid var(--border);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.column-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-sub);
}

.column-count {
  background: var(--teal);
  color: #fff;
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

.kanban-cards.drag-over {
  background: var(--teal-light);
  border-radius: 6px;
}

/* ===== Kanban Card ===== */
.kanban-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: grab;
  transition: box-shadow .2s, transform .1s;
  border: 1px solid var(--border);
}
.kanban-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging {
  opacity: .5;
  transform: rotate(2deg);
}

.card-link {
  display: block;
  padding: 11px 13px;
}

.card-nome {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--text);
}

.card-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-vendedora.ana   { background: #dbeafe; color: #1d4ed8; }
.badge-vendedora.keila { background: #fce7f3; color: #9d174d; }
.badge-tipo.novo          { background: #d1fae5; color: #065f46; }
.badge-tipo.reengajamento { background: #fef3c7; color: #92400e; }

.card-telefone {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Forms ===== */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 16px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-sub);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14,165,233,.12);
}

.form-group small { color: var(--text-muted); font-size: 11px; display: block; margin-top: 4px; }
.form-group code  { background: var(--bg); padding: 1px 5px; border-radius: 3px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

.form-meta { margin: 12px 0; color: var(--text-muted); }

/* ===== Lead Detalhe ===== */
.detalhe-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .detalhe-layout { grid-template-columns: 1fr; }
}

.card-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-section h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* ===== Histórico ===== */
.historico-lista {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.historico-vazio {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.historico-item {
  position: relative;
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--teal);
}

.historico-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.historico-header strong { font-size: 12px; color: var(--text); }
.historico-data { font-size: 11px; color: var(--text-muted); }
.historico-mensagem { font-size: 13px; color: var(--text-sub); white-space: pre-wrap; }

.historico-del-form {
  position: absolute;
  top: 8px;
  right: 8px;
}

.btn-del-historico {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--border);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .2s;
}
.btn-del-historico:hover { color: var(--red); }

.historico-form { border-top: 1px solid var(--border); padding-top: 14px; }

/* ===== Central de Agentes — botão navbar ===== */


/* ===== Central de Agentes — página dedicada ===== */
.agentes-page {
  display: flex;
  height: 100vh;
  margin: -28px;
  overflow: hidden;
}

/* ===== Central de Agentes — sidebar ===== */
.agentes-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 0 12px;
  height: 100%;
}

.agentes-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  padding: 0 18px 10px;
}

.agentes-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.agente-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  position: relative;
}
.agente-item:hover { background: var(--surface); }
.agente-item.ativo {
  background: var(--surface);
  border-left-color: #00bcd4;
  box-shadow: var(--shadow);
}

.agente-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.agente-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.agente-info {
  flex: 1;
  min-width: 0;
}

.agente-nome {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.agente-tags {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.agente-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--border);
  color: var(--text-sub);
}

.agente-tag-ia {
  background: #e0f2fe;
  color: #0284c7;
}

.agente-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px rgba(34,197,94,.5);
  flex-shrink: 0;
}

/* ===== Central de Agentes — painel chat ===== */
.agentes-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-header-nome {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.chat-header-cargo {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9fb;
}

.chat-bolha {
  max-width: 75%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bolha.usuario {
  align-self: flex-end;
  background: #00bcd4;
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-bolha.agente {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.chat-bolha.agente.digitando {
  padding: 10px 14px;
  min-width: 48px;
}

.chat-bolha.agente.digitando::after {
  content: '';
  display: inline-flex;
  gap: 4px;
}

.chat-bolha.agente.digitando .dot-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 16px;
}

.chat-bolha.agente.digitando .dot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  animation: dot-bounce 1.2s infinite ease-in-out;
}

.chat-bolha.agente.digitando .dot-typing span:nth-child(2) { animation-delay: .2s; }
.chat-bolha.agente.digitando .dot-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

.chat-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin: auto;
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  max-height: 100px;
  overflow-y: auto;
  transition: border-color .15s;
  line-height: 1.45;
}
.chat-input:focus { outline: none; border-color: #00bcd4; }

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #00bcd4;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.chat-send-btn:hover { opacity: .85; }

/* ===== Central de Agentes — overlay e modal ===== */
.agentes-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.agentes-overlay.open {
  display: flex;
}

.agentes-modal {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  width: 880px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  display: flex;
  overflow: hidden;
}

.agentes-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.agentes-close:hover { background: var(--bg); color: var(--text); }

/* ===== Conversa WhatsApp ===== */
.whatsapp-section {
  margin-top: 24px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 4px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble.recebida {
  align-self: flex-start;
  background: #f0f0f0;
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.chat-bubble.enviada {
  align-self: flex-end;
  background: #d9fdd3;
  color: var(--text);
  border-bottom-right-radius: 3px;
}

.chat-texto {
  white-space: pre-wrap;
}

.chat-hora {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  align-self: flex-end;
}

/* ===== Import info ===== */
.import-info {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.import-info h3 { font-size: 14px; margin-bottom: 8px; }
.import-info p  { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }

.info-table {
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}
.info-table th,
.info-table td {
  border: 1px solid var(--border);
  padding: 6px 12px;
}
.info-table th { background: var(--bg); font-weight: 700; }

/* ===== Vendedoras ===== */
.vendedoras-section { margin-bottom: 20px; }

.vendedoras-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.vendedora-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 240px;
  box-shadow: var(--shadow);
  transition: opacity .2s;
}
.vendedora-card.vendedora-offline {
  opacity: .6;
}
.dash-card-group-start { border-left: 3px solid var(--border); margin-left: 4px; }

@media (max-width: 600px) {
  .vendedoras-cards { flex-direction: column; }
  .vendedora-card { min-width: unset; }
  .btn-trocar-numero { margin-left: 0; }
}

.vendedora-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.keila-avatar  { background: linear-gradient(135deg, #ec4899, #be185d); }
.ana-avatar    { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); }
.joice-avatar  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.vendedora-info { flex: 1; }
.vendedora-nome { font-weight: 700; font-size: 14px; color: var(--text); }
.vendedora-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.vendedora-status-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.dot-online  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.5); }
.dot-offline { background: #f87171; }

.status-label { font-size: 12px; font-weight: 600; color: var(--text-sub); }

.btn-qr {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 7px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  cursor: pointer;
  text-decoration: none;
}

.btn-trocar-numero {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
  cursor: pointer;
  margin-left: 4px;
  transition: background .15s;
}
.btn-trocar-numero:hover { background: var(--teal-light); color: var(--teal-dark); border-color: var(--teal); }
.btn-trocar-numero:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Dashboard ===== */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.dash-header h1 { font-size: 20px; font-weight: 700; color: var(--text); }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 9px 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: box-shadow .2s;
}
.dash-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.09); }

.dash-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.dash-card-value {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.dash-card-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .dash-row { grid-template-columns: 1fr; }
}

.dash-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-col-right { display: flex; flex-direction: column; }

.dash-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.dash-section h2 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.dash-empty { color: var(--text-muted); font-size: 13px; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  background: var(--bg);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .4s ease;
  min-width: 2px;
}

.bar-default    { background: #94a3b8; }
.bar-ganho      { background: var(--green); }
.bar-perdido    { background: #f87171; }
.bar-negociacao { background: #fb923c; }
.bar-qualificado{ background: #34d399; }
.bar-proposta   { background: #60a5fa; }
.bar-ana        { background: var(--teal); }
.bar-keila      { background: #f472b6; }

.bar-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  text-align: right;
}

/* Tipo cards */
.tipo-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tipo-card {
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.tipo-novo  { background: #d1fae5; }
.tipo-reeng { background: #fef3c7; }

.tipo-valor {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.tipo-novo  .tipo-valor { color: #065f46; }
.tipo-reeng .tipo-valor { color: #92400e; }

.tipo-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 4px;
  color: var(--text-sub);
}

/* Tabela recentes */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-table th {
  text-align: left;
  padding: 9px 14px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.dash-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
}

.dash-table tbody tr:hover { background: var(--bg); }
.dash-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 600px) {
  .dash-table thead { display: none; }
  .dash-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--surface);
  }
  .dash-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
    font-size: 13px;
    color: var(--text);
  }
  .dash-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 10px;
  }
  .dash-table tbody tr:last-child td { border-bottom: none; }
}

/* ===== Todos os Leads ===== */
.leads-filtros {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.leads-busca {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  flex: 1;
  min-width: 180px;
  outline: none;
  transition: border-color .15s;
}
.leads-busca:focus { border-color: #00bcd4; }

.leads-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.leads-select:focus { border-color: #00bcd4; }

.leads-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leads-table thead tr {
  border-bottom: 1px solid var(--border);
}

.leads-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-sub);
  text-align: left;
  white-space: nowrap;
}

.leads-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leads-table tbody tr:last-child td { border-bottom: none; }

.leads-table tbody tr:hover { background: var(--bg); }

.lead-nome { font-weight: 600; color: var(--text); }
.lead-data { color: var(--text-muted); }
.leads-vazio { text-align: center; color: var(--text-muted); padding: 32px !important; }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.etapa-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--teal-light);
  color: var(--teal-dark);
}
.etapa-badge.etapa-perdido { background: #fef2f2; color: var(--red); }
.etapa-badge.etapa-fechado-ganho { background: #f0fdf4; color: #166534; }
.etapa-badge.etapa-novo-lead { background: #f0f9ff; color: #0369a1; }

/* ===== Análise de Concorrentes ===== */
.analise-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.analise-tab {
  padding: 9px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color .15s;
}
.analise-tab.ativo {
  color: #00bcd4;
  font-weight: 700;
  border-bottom-color: #00bcd4;
}
.analise-filtros {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.analise-content.hidden { display: none; }

/* Spy */
.spy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.spy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.spy-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.spy-marca { font-weight: 700; font-size: 13px; color: var(--text); }
.spy-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.spy-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.spy-badge.formato  { background: #e0f2fe; color: #0369a1; }
.spy-badge.dias     { background: #f0fdf4; color: #166534; }
.spy-headline { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; }
.spy-desc    { font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.spy-cta-label { font-size: 12px; color: var(--text-muted); }
.spy-porque  { font-size: 12px; color: var(--text-sub); background: #f5f7fa; padding: 8px 10px; border-radius: 6px; line-height: 1.5; }
.spy-porque span { font-weight: 700; }
.spy-usar { margin-top: 4px; align-self: flex-start; }
.spy-ver-anuncio { font-size: 12px; color: var(--teal); text-decoration: none; display: inline-block; margin-top: 6px; }
.spy-ver-anuncio:hover { text-decoration: underline; }

/* Hooks */
.hooks-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
.hooks-categorias h3,
.hooks-formulas h3 {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-sub); margin-bottom: 16px;
}
.hooks-categoria { margin-bottom: 20px; }
.hooks-cat-header {
  font-size: 13px; font-weight: 700; padding: 8px 14px;
  border-radius: 6px 6px 0 0; margin-bottom: 0;
}
.hooks-cat-header.urgencia   { background: #fff7ed; color: #c2410c; }
.hooks-cat-header.curiosidade{ background: #f0f9ff; color: #0369a1; }
.hooks-cat-header.prova      { background: #f0fdf4; color: #166534; }
.hooks-cat-header.dor        { background: #fef2f2; color: #991b1b; }
.hooks-lista {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.hook-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
  line-height: 1.5;
}
.hook-item:last-child { border-bottom: none; }
.hook-item:hover { background: #f0fdff; color: #00bcd4; }

.formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.formula-nome { font-size: 16px; font-weight: 800; color: #00bcd4; margin-bottom: 2px; }
.formula-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.formula-exemplo { font-size: 13px; color: var(--text-sub); line-height: 1.7; background: #f5f7fa; padding: 10px 12px; border-radius: 6px; }

.hook-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e2a38; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 999;
}
.hook-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Pizza chart legenda ===== */
.pizza-legenda { display: flex; flex-direction: column; gap: 8px; }
.pizza-legenda-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pizza-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.pizza-cor-0 { background: #00bcd4; }
.pizza-cor-1 { background: #34d399; }
.pizza-cor-2 { background: #fb923c; }
.pizza-cor-3 { background: #22c55e; }
.pizza-cor-4 { background: #f87171; }
.pizza-fase-nome { color: var(--text); font-weight: 500; flex: 1; }
.pizza-fase-val  { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ===== Painéis compactos lateral ===== */
.dash-section-sm { padding: 14px 16px; }
.dash-section-sm h2 { font-size: 11px; margin-bottom: 10px; }
.bar-row-sm .bar-label { font-size: 12px; }
.bar-row-sm .bar-track { height: 6px; }
.bar-row-sm .bar-count { font-size: 12px; }

.tipo-cards-sm { gap: 8px; }
.tipo-card-sm  { padding: 8px 10px; }
.tipo-valor-sm { font-size: 20px; }

/* ===== Card faturamento ===== */
.dash-card-faturamento { position: relative; }
.btn-ocultar-fat {
  position: absolute;
  top: 8px; right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .5;
  transition: opacity .15s;
  padding: 2px;
  display: flex;
  align-items: center;
  color: #64748b;
}
.btn-ocultar-fat:hover { opacity: 1; }
