/* Dashboard Contabilidade Completa */
.dashboard {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: #6b7280;
  font-size: 1.1rem;
}

.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #6b7280;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* CONTABILIDADE COMPLETA */
.contabilidade-section {
  margin-bottom: 3rem;
}

.contabilidade-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contabilidade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.contabilidade-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-left: 4px solid;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contabilidade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

.contabilidade-card.receita {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.contabilidade-card.custo {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.contabilidade-card.despesa {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.contabilidade-card.lucro {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-icon {
  font-size: 1.5rem;
  color: inherit;
}

.receita .card-icon { color: #10b981; }
.custo .card-icon { color: #f59e0b; }
.despesa .card-icon { color: #ef4444; }
.lucro .card-icon { color: #3b82f6; }

.card-header span {
  font-weight: 600;
  color: #374151;
  font-size: 1rem;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.card-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}

/* RESUMO FINANCEIRO */
.resumo-section {
  margin-bottom: 3rem;
}

.resumo-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.resumo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.resumo-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.resumo-card:hover {
  transform: translateY(-2px);
}

.resumo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.resumo-header span {
  font-weight: 600;
  color: #374151;
}

.resumo-icon {
  font-size: 1.5rem;
}

.resumo-icon.success { color: #10b981; }
.resumo-icon.danger { color: #ef4444; }
.resumo-icon.primary { color: #3b82f6; }

.resumo-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.resumo-value.success { color: #10b981; }
.resumo-value.danger { color: #ef4444; }
.resumo-value.primary { color: #3b82f6; }

/* VENDAS A PRAZO */
.vendas-prazo-section {
  margin-bottom: 3rem;
}

.vendas-prazo-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.vendas-prazo-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.vendas-prazo-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.prazo-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prazo-count {
  color: #6b7280;
  font-weight: 500;
}

.prazo-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3b82f6;
}

.vendas-prazo-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.venda-prazo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: background-color 0.2s;
}

.venda-prazo-item:hover {
  background: #f3f4f6;
}

.venda-info {
  flex: 1;
}

.cliente-nome {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.venda-valor {
  color: #10b981;
  font-weight: 600;
}

.venda-vencimento {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  margin: 0 1rem;
}

.vencimento-icon {
  font-size: 1rem;
}

.venda-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-whatsapp:hover {
  background: #22c55e;
}

/* PARCELAS PENDENTES */
.parcelas-section {
  margin-bottom: 3rem;
}

.parcelas-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.parcelas-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.parcela-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parcela-info {
  flex: 1;
}

.parcela-cliente {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.parcela-valor {
  color: #f59e0b;
  font-weight: 600;
}

.parcela-detalhes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  color: #6b7280;
  font-size: 0.9rem;
}

/* EMPRÉSTIMOS */
.emprestimos-section {
  margin-bottom: 3rem;
}

.emprestimos-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.emprestimos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.emprestimo-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-left: 4px solid;
}

.emprestimo-card.aberto {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.emprestimo-card.quitado {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.emprestimo-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.emprestimo-icon {
  font-size: 1.5rem;
}

.aberto .emprestimo-icon { color: #f59e0b; }
.quitado .emprestimo-icon { color: #10b981; }

.emprestimo-header span {
  font-weight: 600;
  color: #374151;
}

.emprestimo-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.emprestimo-count {
  color: #6b7280;
  font-size: 0.9rem;
}

/* ESTATÍSTICAS GERAIS */
.estatisticas-section {
  margin-bottom: 3rem;
}

.estatisticas-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.estatisticas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 2rem;
  color: #3b82f6;
  background: #eff6ff;
  padding: 0.75rem;
  border-radius: 8px;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6b7280;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #d1d5db;
}

.empty-state p {
  font-size: 1.1rem;
  font-weight: 500;
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
  .dashboard {
    padding: 1rem;
  }

  .dashboard-header h1 {
    font-size: 2rem;
  }

  .contabilidade-grid,
  .resumo-grid,
  .emprestimos-grid,
  .estatisticas-grid {
    grid-template-columns: 1fr;
  }

  .venda-prazo-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .venda-vencimento {
    margin: 0;
  }

  .venda-actions {
    align-self: flex-end;
  }

  .parcela-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .parcela-detalhes {
    align-items: flex-start;
  }
}
