/* =====================================================
   MÓDULO APV - Acompanhamento do Processo de Venda
   Estilos para CRM e Funil de Vendas
   ===================================================== */

/* ===== CONTAINER PRINCIPAL ===== */
.apv-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== HEADER DO MÓDULO ===== */
.apv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.apv-header h2 {
  font-size: 1.5em;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.apv-header h2 i {
  color: #6366f1;
}

/* ===== FILTROS ===== */
.apv-filtros {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.apv-filtros select,
.apv-filtros input {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: #334155;
  transition: all 0.2s;
}

.apv-filtros select:focus,
.apv-filtros input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.apv-busca {
  position: relative;
  min-width: 250px;
}

.apv-busca input {
  width: 100%;
  padding-left: 40px;
}

.apv-busca i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

/* ===== TABS ===== */
.apv-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.apv-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.apv-tab:hover {
  color: #6366f1;
}

.apv-tab.active {
  color: #6366f1;
}

.apv-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #6366f1;
  border-radius: 2px 2px 0 0;
}

.apv-tab-content {
  display: none;
}

.apv-tab-content.active {
  display: block;
}

/* ===== ESTATÍSTICAS ===== */
.apv-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.apv-stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  transition: all 0.2s;
}

.apv-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.apv-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.apv-stat-icon.leads { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }
.apv-stat-icon.novos { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.apv-stat-icon.propostas { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }
.apv-stat-icon.vendas { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.apv-stat-icon.conversao { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.apv-stat-icon.pipeline { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: #db2777; }

.apv-stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apv-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.apv-stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* ===== FUNIL ===== */
.apv-funil-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.apv-funil-stage {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  margin: 0 auto;
  transition: all 0.3s;
}

.apv-funil-stage:hover {
  transform: scale(1.02);
}

.apv-funil-stage.lead { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.apv-funil-stage.contato { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.apv-funil-stage.proposta { background: linear-gradient(135deg, #f59e0b, #d97706); }
.apv-funil-stage.negociacao { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.apv-funil-stage.fechado { background: linear-gradient(135deg, #10b981, #059669); }

.apv-funil-stage .stage-name {
  font-size: 14px;
}

.apv-funil-stage .stage-count {
  font-size: 20px;
  font-weight: 700;
}

/* ===== GRID DE LEADS ===== */
#apv-leads-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ===== CARD DE LEAD ===== */
.apv-lead-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  border-left: 4px solid #e2e8f0;
  transition: all 0.2s;
}

.apv-lead-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.apv-lead-card.status-lead { border-left-color: #6366f1; }
.apv-lead-card.status-contato { border-left-color: #3b82f6; }
.apv-lead-card.status-proposta { border-left-color: #f59e0b; }
.apv-lead-card.status-negociacao { border-left-color: #8b5cf6; }
.apv-lead-card.status-ganho { border-left-color: #10b981; background: linear-gradient(135deg, #f0fdf4, white); }
.apv-lead-card.status-perdido { border-left-color: #ef4444; background: linear-gradient(135deg, #fef2f2, white); opacity: 0.8; }

.apv-lead-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.apv-lead-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.apv-lead-title h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apv-lead-temp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.apv-lead-temp.temp-quente { background: #fef2f2; color: #dc2626; }
.apv-lead-temp.temp-morno { background: #fef3c7; color: #d97706; }
.apv-lead-temp.temp-frio { background: #e0f2fe; color: #0284c7; }

.apv-lead-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.apv-lead-status.status-lead { background: #e0e7ff; color: #4f46e5; }
.apv-lead-status.status-contato { background: #dbeafe; color: #2563eb; }
.apv-lead-status.status-proposta { background: #fef3c7; color: #d97706; }
.apv-lead-status.status-negociacao { background: #ede9fe; color: #7c3aed; }
.apv-lead-status.status-ganho { background: #d1fae5; color: #059669; }
.apv-lead-status.status-perdido { background: #fee2e2; color: #dc2626; }

.apv-lead-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.apv-lead-info span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}

.apv-lead-info i {
  color: #94a3b8;
  font-size: 12px;
}

.apv-lead-interesse {
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.apv-lead-interesse i {
  color: #94a3b8;
  margin-right: 6px;
}

.apv-lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.apv-lead-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.apv-lead-meta span i {
  color: #94a3b8;
}

.apv-lead-meta span.atrasado {
  color: #dc2626;
  font-weight: 600;
}

.apv-lead-meta span.atrasado i {
  color: #dc2626;
}

.apv-lead-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.apv-lead-actions .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 14px;
}

.apv-lead-actions .btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Botão Interação - Azul */
.apv-lead-actions .btn-interacao {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #2563eb;
}
.apv-lead-actions .btn-interacao:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Botão Avançar - Verde */
.apv-lead-actions .btn-avancar {
  background: #dcfce7;
  border-color: #86efac;
  color: #16a34a;
}
.apv-lead-actions .btn-avancar:hover {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

/* Botão Perda - Vermelho */
.apv-lead-actions .btn-perda {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
.apv-lead-actions .btn-perda:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

/* Botão Editar - Amarelo */
.apv-lead-actions .btn-editar {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #d97706;
}
.apv-lead-actions .btn-editar:hover {
  background: #d97706;
  color: white;
  border-color: #d97706;
}

/* Botão Detalhes - Roxo */
.apv-lead-actions .btn-detalhes {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}
.apv-lead-actions .btn-detalhes:hover {
  background: #7c3aed;
  color: white;
  border-color: #7c3aed;
}

/* ===== FOLLOW-UP ===== */
.apv-followup-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.apv-followup-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apv-followup-card h3 i {
  color: #f59e0b;
}

.apv-followup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.apv-followup-item:hover {
  background: #e0e7ff;
}

.apv-followup-item:last-child {
  margin-bottom: 0;
}

.apv-followup-info strong {
  display: block;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 2px;
}

.apv-followup-info span {
  font-size: 12px;
  color: #64748b;
}

.apv-followup-data {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.apv-followup-data.atrasado {
  color: #dc2626;
}

/* ===== EMPTY STATE ===== */
.apv-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.apv-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #cbd5e1;
}

.apv-empty p {
  font-size: 16px;
  margin-bottom: 20px;
}

.apv-empty-small {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 20px;
}

/* ===== MODAIS ===== */
.apv-modal-detalhes-content {
  max-width: 800px !important;
  width: 95vw !important;
}

.apv-detalhes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.apv-detalhes-section {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
}

.apv-detalhes-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.apv-detalhes-section h4 i {
  color: #6366f1;
}

.apv-detalhes-section p {
  margin: 8px 0;
  font-size: 14px;
  color: #475569;
}

.apv-detalhes-section p strong {
  color: #1e293b;
}

.apv-detalhes-perda {
  background: #fef2f2;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border-left: 4px solid #dc2626;
}

.apv-detalhes-perda h4 {
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
  margin: 0 0 12px 0;
}

.apv-detalhes-interacoes {
  margin-top: 24px;
}

.apv-detalhes-interacoes h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apv-detalhes-interacoes h4 i {
  color: #6366f1;
}

/* ===== TIMELINE ===== */
.apv-timeline {
  position: relative;
  padding-left: 24px;
}

.apv-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.apv-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.apv-timeline-item:last-child {
  padding-bottom: 0;
}

.apv-timeline-marker {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #e2e8f0;
}

.apv-timeline-item.positivo .apv-timeline-marker { background: #10b981; }
.apv-timeline-item.negativo .apv-timeline-marker { background: #ef4444; }
.apv-timeline-item.neutro .apv-timeline-marker { background: #f59e0b; }

.apv-timeline-content {
  background: #f8fafc;
  padding: 14px;
  border-radius: 10px;
}

.apv-timeline-tipo {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  display: block;
  margin-bottom: 6px;
}

.apv-timeline-content p {
  font-size: 14px;
  color: #475569;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.apv-timeline-data {
  font-size: 12px;
  color: #94a3b8;
}

/* ===== BOTÃO WHATSAPP ===== */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #25d366;
  color: white;
  border-radius: 50%;
  margin-left: 8px;
  transition: all 0.2s;
}

.btn-whatsapp:hover {
  background: #128c7e;
  transform: scale(1.1);
}

/* ===== MODAL DE LEAD - FIX RESPONSIVO ===== */
#apv-modal-lead .modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#apv-modal-lead .modal-content form {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 100px; /* Espaço para o botão */
  position: relative;
}

#apv-modal-lead .modal-content form button[type="submit"] {
  position: fixed;
  bottom: calc(5vh + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 80px);
  max-width: 500px;
  z-index: 100;
  padding: 14px 24px;
  font-size: 1.1em;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

/* ===== FORMULÁRIOS DO MODAL ===== */
.apv-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.apv-form-grid .form-group.full {
  grid-column: 1 / -1;
}

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

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .apv-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .apv-filtros {
    flex-direction: column;
  }
  
  .apv-filtros select,
  .apv-filtros input {
    width: 100%;
  }
  
  .apv-busca {
    min-width: auto;
    width: 100%;
  }
  
  .apv-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .apv-stat-card {
    padding: 16px;
  }
  
  .apv-stat-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  
  .apv-stat-value {
    font-size: 20px;
  }
  
  #apv-leads-lista {
    grid-template-columns: 1fr;
  }
  
  .apv-detalhes-grid {
    grid-template-columns: 1fr;
  }
  
  .apv-form-grid,
  .apv-form-row {
    grid-template-columns: 1fr;
  }
  
  .apv-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .apv-tab {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .apv-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .apv-lead-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .apv-lead-status {
    align-self: flex-start;
  }
  
  .apv-lead-actions {
    justify-content: space-between;
  }
  
  .apv-lead-actions .btn-icon {
    flex: 1;
    max-width: 50px;
  }
  
  #apv-modal-lead .modal-content,
  #apv-modal-interacao .modal-content,
  #apv-modal-perdido .modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }
  
  #apv-modal-lead .modal-content form {
    padding-bottom: 120px; /* Mais espaço pro botão fixo */
  }
  
  #apv-modal-lead .modal-content form button[type="submit"] {
    bottom: 15px;
    width: calc(100% - 40px);
  }
  
  .apv-form-grid {
    grid-template-columns: 1fr;
  }
  
  #apv-modal-lead .modal-footer,
  #apv-modal-interacao .modal-footer,
  #apv-modal-perdido .modal-footer {
    flex-direction: column;
  }
  
  #apv-modal-lead .modal-footer .btn,
  #apv-modal-interacao .modal-footer .btn,
  #apv-modal-perdido .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== FIX EXTRA: Modal Lead em telas muito pequenas ===== */
@media (max-width: 400px) {
  #apv-modal-lead .modal-content {
    margin: 5px;
    max-height: calc(100vh - 10px);
  }
  
  #apv-modal-lead .modal-header {
    padding: 12px 16px;
  }
  
  #apv-modal-lead .modal-header h2 {
    font-size: 1.1em;
  }
  
  #apv-modal-lead .modal-content form {
    padding: 12px;
    padding-bottom: 130px;
  }
  
  #apv-modal-lead .modal-content form label {
    font-size: 0.95em;
    margin-bottom: 6px;
  }
  
  #apv-modal-lead .modal-content form input,
  #apv-modal-lead .modal-content form select {
    height: 40px;
    font-size: 0.95em;
    padding: 8px 10px;
  }
  
  #apv-modal-lead .modal-content form button[type="submit"] {
    bottom: 10px;
    width: calc(100% - 30px);
    padding: 12px 16px;
    font-size: 1em;
  }
}

/* ===== FIX: Título do modal APV em branco ===== */
#apv-modal-lead .modal-header h2,
#apv-modal-interacao .modal-header h2,
#apv-modal-perdido .modal-header h2,
#apv-modal-detalhes .modal-header h2 {
  color: white !important;
  margin-bottom: 0 !important;
  text-align: left !important;
}

/* ===== FIX: Visibilidade dos modais APV ===== */
#apv-modal-lead,
#apv-modal-interacao,
#apv-modal-perdido,
#apv-modal-detalhes {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#apv-modal-lead.modal-visible,
#apv-modal-interacao.modal-visible,
#apv-modal-perdido.modal-visible,
#apv-modal-detalhes.modal-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== ABA VENDAS FECHADAS ===== */
.apv-vendas-header {
  margin-bottom: 24px;
}

.apv-vendas-header h3 {
  font-size: 1.25em;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.apv-vendas-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.apv-vendas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
}

/* Card de Venda Fechada */
.apv-venda-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  border-left: 4px solid #10b981;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.apv-venda-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, transparent 50%, rgba(16, 185, 129, 0.05) 50%);
  pointer-events: none;
}

.apv-venda-card:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.apv-venda-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.apv-venda-cliente {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.apv-venda-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-size: 18px;
  flex-shrink: 0;
}

.apv-venda-cliente h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apv-venda-origem {
  font-size: 12px;
  color: #64748b;
}

.apv-venda-valor {
  font-size: 18px;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.apv-venda-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.apv-venda-info span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
}

.apv-venda-info i {
  color: #94a3b8;
  font-size: 12px;
}

.apv-venda-produto {
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.apv-venda-produto i {
  color: #6366f1;
  margin-right: 8px;
}

/* Timeline de conversão */
.apv-venda-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 16px;
}

.apv-venda-timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-dot.lead {
  background: #6366f1;
}

.timeline-dot.venda {
  background: #10b981;
}

.timeline-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 2px;
}

.timeline-info {
  display: flex;
  flex-direction: column;
}

.timeline-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.timeline-date {
  font-size: 12px;
  color: #1e293b;
  font-weight: 600;
}

/* Estatísticas da venda */
.apv-venda-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.venda-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.venda-stat i {
  font-size: 14px;
  color: #6366f1;
  margin-bottom: 4px;
}

.venda-stat span {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.venda-stat small {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
}

/* Ações da venda */
.apv-venda-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-venda-action {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-venda-action:hover {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #4f46e5;
}

.btn-venda-action.btn-ver-venda {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #2563eb;
}

.btn-venda-action.btn-ver-venda:hover {
  background: #2563eb;
  color: white;
}

.btn-venda-whatsapp {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: #25d366;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-venda-whatsapp:hover {
  background: #128c7e;
  transform: translateY(-2px);
}

/* Loading */
.apv-loading {
  text-align: center;
  padding: 40px;
  color: #64748b;
}

.apv-loading i {
  margin-right: 8px;
}

/* Responsivo */
@media (max-width: 768px) {
  .apv-vendas-grid {
    grid-template-columns: 1fr;
  }
  
  .apv-venda-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .apv-venda-valor {
    align-self: flex-start;
  }
  
  .apv-venda-timeline {
    flex-direction: column;
    gap: 12px;
  }
  
  .timeline-line {
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, #6366f1, #10b981);
  }
  
  .apv-venda-stats {
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .venda-stat {
    min-width: 80px;
  }
  
  .apv-venda-actions {
    flex-direction: column;
  }
  
  .btn-venda-action,
  .btn-venda-whatsapp {
    width: 100%;
  }
}
