/* =============================================================
   ESTILOS GERAIS (TODAS AS PÁGINAS)
============================================================= */
:root {
  --primary-color: #194e71;
  --primary-dark: #02384b;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

body {
  font-family: 'Roboto', sans-serif;
  color: #333;
  background-color: #f5f7fa;
}

/* Navbar Personalizada */
.navbar-custom {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.navbar-dark .navbar-nav .nav-link {
  color: black;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: black;
  font-weight: 500;
  border-bottom: 2px solid black;
}

.navbar-dark .navbar-nav .nav-link.active {
  color: black;
  font-weight: 500;
  border-bottom: 2px solid black;
}

/* Elementos de UI Comuns */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #fff;
  font-weight: 500;
  border-top-left-radius: 10px !important;
  border-top-right-radius: 10px !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Badges de Status */
.status-frio {
  background-color: #17a2b8;
  color: white;
}

.status-morno {
  background-color: #ffc107;
  color: #212529;
}

.status-quente {
  background-color: #dc3545;
  color: white;
}

/* Acessibilidade */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(25, 78, 113, 0.25);
}

/* Customização de tabelas */
.table {
  vertical-align: middle;
}

.table thead th {
  border-top: none;
  border-bottom: 2px solid #e9ecef;
  font-weight: 600;
  color: #6c757d;
}

.table-hover tbody tr:hover {
  background-color: rgba(25, 78, 113, 0.03);
}

/* Animações para notificações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-toast {
  animation: fadeIn 0.3s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsividade Geral */
@media (max-width: 768px) {
  .card {
    margin-bottom: 20px;
  }
}

/* =============================================================
   INDEX.PHP (DASHBOARD PRINCIPAL)
============================================================= */
/* Customização de gráficos */
.chart-container {
  position: relative;
  height: 300px;
}

canvas {
  max-width: 100%;
  max-height: 100%;
}

.card-body canvas {
  width: 100% !important;
  height: auto !important;
}

.chart-wrapper {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

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

.kanban-column {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-height: calc(100vh - 300px);
}

.kanban-column-header {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  font-weight: 600;
}

.kanban-column-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 200px;
}

.kanban-card {
  background-color: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

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

.kanban-card[data-status='quente'] {
  border-left-color: var(--danger-color);
}

.kanban-card[data-status='morno'] {
  border-left-color: var(--warning-color);
}

.kanban-card[data-status='frio'] {
  border-left-color: var(--info-color);
}

.card-details {
  font-size: 0.85rem;
}

.dragging {
  opacity: 0.7;
  transform: rotate(2deg);
}

@media (max-width: 768px) {
  .kanban-board {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 16px;
  }

  .kanban-column {
    flex: 0 0 280px;
    margin-bottom: 0;
  }
}

/* Badges com gradiente para o CRM */
.bg-gradient-primary {
  background: linear-gradient(135deg, #4a69bd, #1e3799);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #28a745, #1e7e34);
}

.bg-gradient-info {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

.bg-gradient-warning {
  background: linear-gradient(135deg, #ffc107, #d39e00);
}

.bg-gradient-danger {
  background: linear-gradient(135deg, #dc3545, #bd2130);
}

/* =============================================================
   CHAT.PHP
============================================================= */
/* Estilo para o chat */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px !important;
  background-color: #f8f9fa;
  border-radius: 0 0 10px 10px;
  height: calc(100vh - 280px);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-bubble {
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: 80%;
  position: relative;
}

.chat-avatar img {
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message {
  padding: 12px 18px;
  border-radius: 18px;
  max-width: 75%;
  margin-bottom: 16px;
  position: relative;
  line-height: 1.5;
}

.user-message {
  margin-left: auto;
  background-color: var(--primary-color);
  color: white;
  border-top-right-radius: 4px;
}

.bot-message {
  margin-right: auto;
  background-color: #e9ecef;
  color: #333;
  border-top-left-radius: 4px;
}

.chat-message {
  display: flex;
  margin-bottom: 20px;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-message-other {
  justify-content: flex-start;
}

.chat-message-content {
  max-width: 80%;
  border-radius: 18px;
  padding: 14px 18px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message-user .chat-message-content {
  background-color: var(--primary-color);
  color: white;
  border-top-right-radius: 4px;
}

.chat-message-other .chat-message-content {
  background-color: #f0f2f5;
  color: #333;
  border-top-left-radius: 4px;
}

.chat-message-text {
  margin-bottom: 5px;
  word-wrap: break-word;
}

.chat-message-time {
  font-size: 0.75rem;
  opacity: 0.8;
}

.chat-date {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.chat-date .badge {
  padding: 8px 16px;
  font-weight: 500;
  background-color: #e9ecef;
  color: #6c757d;
  border-radius: 50px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 40px;
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  opacity: 0.6;
  animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Estilo para a lista de conversas */
.list-group-item {
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.list-group-item.active {
  background-color: rgba(25, 78, 113, 0.1);
  border-color: var(--primary-color);
}

.list-group-item:hover {
  background-color: rgba(25, 78, 113, 0.05);
}

/* Área de digitação de mensagens */
.card-footer {
  background-color: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 15px;
  border-radius: 0 0 10px 10px;
}

.card-footer textarea {
  border-radius: 20px;
  padding: 10px 15px;
  max-height: 100px;
  resize: none;
  border: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.card-footer textarea:focus {
  background-color: #fff;
  border-color: rgba(25, 78, 113, 0.3);
  box-shadow: 0 0 0 0.2rem rgba(25, 78, 113, 0.15);
}

.card-footer .input-group {
  background-color: transparent;
}

.card-footer .btn-send {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background-color: var(--primary-color);
  color: white;
  margin-left: 10px;
}

.card-footer .btn-send:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.bot-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-controls button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid #e0e0e0;
  color: #6c757d;
  background-color: #f8f9fa;
}

.bot-controls button:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Notificações e status online */
.online-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--success-color);
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid white;
}

.notification-badge {
  animation: pulse 2s infinite;
}

/* Estilização das abas no modal */
#leadProfileTab {
  border-bottom: 0;
}

#leadProfileTab .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 15px;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s ease;
}

#leadProfileTab .nav-link:hover {
  color: var(--primary-color);
  background-color: transparent;
  border-color: rgba(25, 78, 113, 0.3);
}

#leadProfileTab .nav-link.active {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

/* Estilização para a lista de conversas */
.conversa-item-status {
  width: 4px;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}

.conversa-item-status.quente {
  background-color: var(--danger-color);
}

.conversa-item-status.morno {
  background-color: var(--warning-color);
}

.conversa-item-status.frio {
  background-color: var(--info-color);
}

/* Modal de perfil */
#perfilLeadModal .img-thumbnail {
  border-radius: 50%;
  padding: 5px;
  border: 2px solid rgba(25, 78, 113, 0.2);
}

#perfilLeadModal .nav-tabs .nav-link {
  color: #6c757d;
  font-weight: 500;
}

#perfilLeadModal .nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

/* Timeline no modal */
#perfilLeadModal .timeline {
  position: relative;
  padding-left: 30px;
}

#perfilLeadModal .timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: #e9ecef;
}

#perfilLeadModal .timeline-item {
  position: relative;
  margin-bottom: 25px;
}

#perfilLeadModal .timeline-date {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 5px;
}

#perfilLeadModal .timeline-content {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#perfilLeadModal .timeline-content::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  left: -26px;
  top: 10px;
}

@media (max-width: 768px) {
  .message {
    max-width: 85%;
  }

  .chat-container {
    height: calc(100vh - 350px);
  }

  .chat-message-content {
    max-width: 90%;
  }
}

/* =============================================================
   LEADS.PHP
============================================================= */
/* Timeline para histórico de leads */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 0;
  height: 100%;
  width: 2px;
  background-color: #e9ecef;
}

.timeline-item {
  display: flex;
  margin-bottom: 20px;
  position: relative;
}

.timeline-item-date {
  width: 70px;
  font-size: 12px;
  text-align: right;
  padding-right: 15px;
  color: #6c757d;
}

.timeline-item-content {
  background-color: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  margin-left: 20px;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeline-item-content::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #4a69bd;
  left: 70px;
  top: 15px;
  transform: translateX(-5px);
}

/* =============================================================
   REPORTS.PHP
============================================================= */
/* Ícones para documentos */
.doc-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ícones e Avatares */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.icon-box.small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Ícones com forma */
.icon-shape {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

.border-radius-md {
  border-radius: 0.5rem;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}

/* =============================================================
   ADS.PHP
============================================================= */
/* Estilos específicos para ADS se existirem */
