/* Estilos para o CRM */
:root {
  --azul-cronos: #00274e;
  --amarelo-cronos: #ffd700;
  --cinza-bg: #f5f7fa;
  --cinza-card: #e7ecf3;
  --verde-status: #28a745;
  --laranja-status: #fd7e14;
  --vermelho-status: #dc3545;
  --radius: 18px;
  --shadow: 0 4px 20px #0002;
}

.crm-container {
  margin-top: 35px;
  display: none;
}

.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.crm-title {
  color: var(--azul-cronos);
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
}

.crm-actions {
  display: flex;
  gap: 10px;
}

.crm-btn {
  background: var(--azul-cronos);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.crm-btn:hover {
  background: var(--amarelo-cronos);
  color: var(--azul-cronos);
}

.crm-btn-secondary {
  background: var(--cinza-card);
  color: var(--azul-cronos);
}

.crm-btn-secondary:hover {
  background: #d0d7e3;
}

.crm-search-bar {
  display: flex;
  margin-bottom: 20px;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-search-input {
  flex: 1;
  min-width: 250px;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
}

.crm-filter-select {
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  min-width: 180px;
}

.crm-table-container {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
}

.crm-table th {
  background: var(--azul-cronos);
  color: white;
  text-align: left;
  padding: 12px 15px;
}

.crm-table th:first-child {
  border-top-left-radius: var(--radius);
}

.crm-table th:last-child {
  border-top-right-radius: var(--radius);
}

.crm-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

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

.crm-table tr:hover {
  background: var(--cinza-bg);
}

.crm-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

.crm-status-cliente {
  background: var(--verde-status);
  color: white;
}

.crm-status-lead {
  background: var(--laranja-status);
  color: white;
}

.crm-status-inativo {
  background: var(--vermelho-status);
  color: white;
}

.crm-actions-cell {
  display: flex;
  gap: 5px;
}

.crm-action-btn {
  background: var(--cinza-card);
  color: var(--azul-cronos);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.crm-action-btn:hover {
  background: var(--amarelo-cronos);
}

.crm-pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.crm-page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.crm-page-btn:hover, .crm-page-btn.active {
  background: var(--azul-cronos);
  color: white;
  border-color: var(--azul-cronos);
}

/* Modal de Detalhes da Empresa */
.crm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  overflow-y: auto;
}

.crm-modal-content {
  background: white;
  width: 90%;
  max-width: 800px;
  margin: 50px auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.crm-modal-header {
  background: var(--azul-cronos);
  color: white;
  padding: 15px 20px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crm-modal-title {
  margin: 0;
  font-size: 1.5em;
}

.crm-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5em;
  cursor: pointer;
}

.crm-modal-body {
  padding: 20px;
}

.crm-modal-section {
  margin-bottom: 20px;
}

.crm-modal-section-title {
  color: var(--azul-cronos);
  border-bottom: 2px solid var(--cinza-card);
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.crm-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.crm-modal-field {
  margin-bottom: 10px;
}

.crm-modal-label {
  font-weight: 600;
  color: #555;
  display: block;
  margin-bottom: 3px;
  font-size: 0.9em;
}

.crm-modal-value {
  font-size: 1em;
}

.crm-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsividade */
@media (max-width: 768px) {
  .crm-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .crm-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .crm-table th:nth-child(3),
  .crm-table td:nth-child(3),
  .crm-table th:nth-child(4),
  .crm-table td:nth-child(4) {
    display: none;
  }
  
  .crm-modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Estilos para o enriquecimento de empresas */
.enriquecimento-empresa-section {
  background: #f0f8ff;
  border: 2px solid var(--azul-cronos);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}

.enriquecimento-empresa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.enriquecimento-empresa-title {
  color: var(--azul-cronos);
  margin: 0;
  font-size: 1.5em;
}

.enriquecimento-empresa-status {
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 600;
}

.enriquecimento-empresa-status.pendente {
  background: #ffc107;
  color: #212529;
}

.enriquecimento-empresa-status.concluido {
  background: #28a745;
  color: white;
}

.enriquecimento-empresa-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.enriquecimento-empresa-field {
  margin-bottom: 10px;
}

.enriquecimento-empresa-label {
  font-weight: 600;
  color: #555;
  display: block;
  margin-bottom: 3px;
  font-size: 0.9em;
}

.enriquecimento-empresa-value {
  font-size: 1em;
}

.enriquecimento-empresa-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.enriquecimento-empresa-results {
  margin-top: 20px;
  display: none;
}

.enriquecimento-empresa-results.active {
  display: block;
}

.enriquecimento-empresa-result-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.enriquecimento-empresa-result-title {
  color: var(--azul-cronos);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.enriquecimento-empresa-result-source {
  font-style: italic;
  color: #666;
  font-size: 0.9em;
  margin-top: 10px;
}

.enriquecimento-empresa-progress {
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  margin: 15px 0;
  overflow: hidden;
}

.enriquecimento-empresa-progress-bar {
  height: 100%;
  background: var(--azul-cronos);
  width: 0%;
  transition: width 0.5s;
}

.enriquecimento-empresa-stats {
  background: #e7f3ff;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.enriquecimento-empresa-stat {
  margin-bottom: 5px;
}

.enriquecimento-empresa-stat-label {
  font-weight: 600;
}
