/* 
  =============================================
  PALETA DE CORES DO CRM - VENDAS
  Roxo Escuro + Amarelo
  =============================================
*/

:root {
  /* Cores Principais */
  --primary-dark: #4A235A;        /* Roxo Escuro Vitriun */
  --primary-medium: #7D3C98;      /* Roxo Médio Vitriun */
  --primary-light: #9B59B6;       /* Roxo Claro Vitriun */
  
  /* Cores Secundárias */
  --accent-teal: #00D1B2;         /* Teal Vitriun */
  --accent-yellow: #ffc107;       /* Amarelo Vibrante */
  --accent-gold: #ffb300;         /* Ouro (variação do amarelo) */
  --accent-light-yellow: #ffe082; /* Amarelo Claro */
  
  /* Cores Neutras */
  --dark-gray: #2c3e50;           /* Cinza Escuro */
  --light-gray: #ecf0f1;          /* Cinza Claro */
  --white: #ffffff;               /* Branco */
  --text-dark: #2c3e50;           /* Texto Escuro */
  --text-light: #7f8c8d;          /* Texto Claro */
  
  /* Cores de Status */
  --success-green: #27ae60;        /* Verde Sucesso */
  --warning-orange: #f39c12;       /* Laranja Aviso */
  --danger-red: #e74c3c;           /* Vermelho Perigo */
  --info-blue: #3498db;            /* Azul Informação */
  
  /* Cores para Interações */
  --hover-dark: #3A1A4A;           /* Hover Roxo Mais Escuro */
  --hover-teal: #00B89F;           /* Hover Teal */
  --hover-yellow: #ffb300;         /* Hover Amarelo Ouro */
  
  /* Sombras */
  --shadow-sm: 0 2px 4px rgba(74, 35, 90, 0.1);
  --shadow-md: 0 4px 12px rgba(74, 35, 90, 0.15);
  --shadow-lg: 0 8px 24px rgba(74, 35, 90, 0.2);
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #4A235A 0%, #7D3C98 100%);
  --gradient-accent: linear-gradient(135deg, #00D1B2 0%, #00E6C3 100%);
  --gradient-overlay: linear-gradient(135deg, rgba(74, 35, 90, 0.95) 0%, rgba(125, 60, 152, 0.95) 100%);
}

/* =============================================
  APLICAÇÃO GLOBAL DAS CORES
  ============================================= */

body {
  background-color: var(--light-gray);
  color: var(--text-dark);
}

/* Botões Primários */
.btn-primary,
.btn-outline-primary,
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  border-color: var(--primary-dark);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--hover-dark);
  border-color: var(--hover-dark);
  box-shadow: var(--shadow-md);
}

/* Botões Secundários (Amarelo) */
.btn-warning,
.btn-outline-warning {
  background: var(--accent-yellow);
  color: var(--dark-gray);
  border-color: var(--accent-yellow);
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-warning:hover,
.btn-outline-warning:hover {
  background: var(--hover-yellow);
  border-color: var(--hover-yellow);
  box-shadow: var(--shadow-md);
}

/* Links */
a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-yellow);
  text-decoration: underline;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  background-color: var(--white);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 12px 12px 0 0;
  border: none;
  padding: 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Navbar */
.navbar {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  padding: 1rem 1.5rem;
}

.navbar-brand {
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  transition: color 0.3s ease;
  margin: 0 0.5rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent-yellow) !important;
}

/* Formulários */
.form-control,
.form-select {
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 0.2rem rgba(74, 35, 90, 0.15);
}

.form-label {
  color: var(--text-dark);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Tabelas */
.table {
  background-color: var(--white);
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table thead th {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  font-weight: 600;
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: all 0.3s ease;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.table tbody tr:hover {
  background-color: rgba(74, 35, 90, 0.05);
  box-shadow: var(--shadow-md);
}

.table tbody td {
  border: none;
  padding: 1rem;
  vertical-align: middle;
}

/* Badges */
.badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-primary {
  background: var(--primary-dark);
  color: var(--white);
}

.badge-warning {
  background: var(--accent-yellow);
  color: var(--dark-gray);
}

.badge-success {
  background: var(--success-green);
  color: var(--white);
}

.badge-danger {
  background: var(--danger-red);
  color: var(--white);
}

.badge-info {
  background: var(--info-blue);
  color: var(--white);
}

/* Alertas */
.alert {
  border: none;
  border-radius: 12px;
  border-left: 4px solid;
  padding: 1rem 1.5rem;
}

.alert-success {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success-green);
  border-left-color: var(--success-green);
}

.alert-danger {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger-red);
  border-left-color: var(--danger-red);
}

.alert-warning {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning-orange);
  border-left-color: var(--warning-orange);
}

.alert-info {
  background: rgba(52, 152, 219, 0.1);
  color: var(--info-blue);
  border-left-color: var(--info-blue);
}

/* Modais */
.modal-header {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 12px 12px 0 0;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--white);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid var(--light-gray);
  padding: 1.5rem;
}

/* Pagination */
.pagination .page-link {
  color: var(--primary-dark);
  border-color: var(--light-gray);
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
}

.pagination .page-item.active .page-link {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Breadcrumb */
.breadcrumb {
  background-color: rgba(74, 35, 90, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.breadcrumb-item {
  color: var(--text-light);
}

.breadcrumb-item.active {
  color: var(--primary-dark);
  font-weight: 600;
}

.breadcrumb-item a {
  color: var(--primary-dark);
}

/* Dropdown */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
}

.dropdown-item {
  color: var(--text-dark);
  transition: all 0.3s ease;
  padding: 0.75rem 1.5rem;
}

.dropdown-item:hover {
  background: rgba(0, 209, 178, 0.1);
  color: var(--primary-dark);
  padding-left: 1.75rem;
}

/* Spinners */
.spinner-border {
  color: var(--primary-dark);
}

/* Progress Bars */
.progress {
  background-color: var(--light-gray);
  border-radius: 20px;
  height: 8px;
}

.progress-bar {
  background: var(--gradient-primary);
  border-radius: 20px;
}

/* Input Groups */
.input-group-text {
  background-color: var(--light-gray);
  border-color: var(--light-gray);
  color: var(--text-dark);
  border-radius: 8px 0 0 8px;
}

/* Utilities */
.text-primary {
  color: var(--primary-dark) !important;
}

.text-warning {
  color: var(--accent-yellow) !important;
}

.bg-primary {
  background: var(--gradient-primary) !important;
}

.bg-light {
  background-color: var(--light-gray) !important;
}

.border-primary {
  border-color: var(--primary-dark) !important;
}

/* Separadores */
hr {
  border-color: var(--light-gray);
  opacity: 1;
}

/* Scrollbar Customizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--hover-dark);
}

/* =============================================
  COMPONENTES CUSTOMIZADOS DO CRM
  ============================================= */

/* Títulos de Seção */
.section-title {
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Cards Especiais */
.card-accent {
  border-left: 4px solid var(--accent-yellow);
}

.card-success {
  border-left: 4px solid var(--success-green);
}

.card-danger {
  border-left: 4px solid var(--danger-red);
}

/* Botões Rounded */
.btn-rounded {
  border-radius: 25px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-rounded.btn-primary {
  background: var(--gradient-primary);
  border: none;
}

.btn-rounded.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-rounded.btn-warning {
  background: var(--gradient-accent);
  border: none;
  color: var(--dark-gray);
}

.btn-rounded.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Responsividade global: todos os wrappers de scroll de tabela */
.table-scroll {
  overflow-x: auto;
}

/* Evita que imagens estourem o layout em mobile */
img {
  max-width: 100%;
  height: auto;
}

/* Tabelas Com Estilo CRM */
.table-crm {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-crm thead th {
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  font-weight: 600;
  padding: 1.25rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table-crm tbody tr {
  border-bottom: 1px solid rgba(0, 209, 178, 0.05);
  transition: all 0.3s ease;
}

.table-crm tbody tr:hover {
  background-color: rgba(255, 193, 7, 0.05);
  box-shadow: inset 0 0 10px rgba(255, 193, 7, 0.1);
}

.table-crm tbody td {
  padding: 1.25rem;
  vertical-align: middle;
}

/* Status Badges */
.badge-status {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status.pending {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning-orange);
}

.badge-status.completed {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success-green);
}

.badge-status.overdue {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger-red);
}

/* Unread Indicator */
.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background-color: var(--danger-red);
  border-radius: 50%;
  border: 2px solid var(--white);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(231, 76, 60, 0);
  }
}

/* Formulários Avançados */
.form-group-crm {
  margin-bottom: 1.5rem;
}

.form-group-crm label {
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: block;
}

.form-group-crm .form-control,
.form-group-crm .form-select {
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-group-crm .form-control:focus,
.form-group-crm .form-select:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 0.2rem rgba(74, 35, 90, 0.15);
}

.form-group-crm .form-text {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Stats Cards */
.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stat-card .stat-value {
  color: var(--primary-dark);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-primary);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-yellow);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary-dark);
}

/* Modais com Estilo CRM */
.modal-crm .modal-header {
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 12px 12px 0 0;
  border: none;
}

.modal-crm .modal-title {
  font-weight: 700;
  font-size: 1.3rem;
}

.modal-crm .modal-body {
  padding: 2rem;
}

.modal-crm .modal-footer {
  border-top: 1px solid var(--light-gray);
  padding: 1.5rem;
  background: rgba(0, 209, 178, 0.02);
}

/* Alert com Ícone */
.alert-icon {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-icon::before {
  font-size: 1.5rem;
  min-width: 24px;
  text-align: center;
}

.alert-success .alert-icon::before {
  content: '✓';
  color: var(--success-green);
}

.alert-danger .alert-icon::before {
  content: '✕';
  color: var(--danger-red);
}

.alert-warning .alert-icon::before {
  content: '⚠';
  color: var(--warning-orange);
}

.alert-info .alert-icon::before {
  content: 'ℹ';
  color: var(--info-blue);
}

/* Gradiente de Fundo */
.bg-gradient-primary {
  background: var(--gradient-primary) !important;
  color: var(--white);
}

.bg-gradient-accent {
  background: var(--gradient-accent) !important;
  color: var(--dark-gray);
}

/* Text Utilities */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Separadores */
.divider {
  height: 2px;
  background: var(--gradient-primary);
  margin: 2rem 0;
  border-radius: 1px;
}

/* Hover Effects */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.hover-shadow {
  transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
  box-shadow: var(--shadow-lg);
}

/* =============================================
  RESPONSIVIDADE — NOTEBOOKS E TELAS MENORES
  ============================================= */

/* Notebooks pequenos / telas HD (até 1280px) */
@media (max-width: 1280px) {
  body {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
  }

  .navbar {
    padding: 0.75rem 1.25rem;
  }

  .navbar-brand {
    font-size: 1.25rem !important;
  }

  .card-header {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-card .stat-value {
    font-size: 1.75rem;
  }

  .stat-card .stat-icon {
    font-size: 2rem;
  }

  .table-crm thead th,
  .table thead th {
    padding: 0.9rem;
    font-size: 0.8rem;
  }

  .table-crm tbody td,
  .table tbody td {
    padding: 0.9rem;
    font-size: 0.9rem;
  }

  .modal-body,
  .modal-crm .modal-body {
    padding: 1.5rem;
  }
}

/* Tablets paisagem / laptops pequenos (até 992px) */
@media (max-width: 992px) {
  body {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .navbar {
    padding: 0.6rem 1rem;
    border-radius: 8px;
  }

  .navbar-brand {
    font-size: 1.1rem !important;
  }

  .nav-link {
    margin: 0 0.2rem;
    font-size: 0.88rem;
  }

  .card {
    border-radius: 8px;
  }

  .card-header {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px 8px 0 0;
  }

  .card-body {
    padding: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  .stat-card .stat-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
  }

  .btn {
    font-size: 0.88rem;
    padding: 0.45rem 0.9rem;
  }

  .btn-rounded {
    padding: 0.5rem 1.25rem;
  }

  .form-control,
  .form-select {
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
  }

  .table-crm,
  .table {
    font-size: 0.85rem;
  }

  .table-crm thead th,
  .table thead th {
    padding: 0.75rem;
    font-size: 0.78rem;
  }

  .table-crm tbody td,
  .table tbody td {
    padding: 0.75rem;
  }

  .badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
  }

  .modal-body,
  .modal-crm .modal-body {
    padding: 1.25rem;
  }

  .modal-footer,
  .modal-crm .modal-footer {
    padding: 1rem 1.25rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }
  h4 { font-size: 1.05rem; }
  h5 { font-size: 0.95rem; }
}

/* Tablets retrato / telas pequenas (até 768px) */
@media (max-width: 768px) {
  body {
    padding: 0.5rem;
    font-size: 0.88rem;
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }

  .section-title::after {
    width: 40px;
    height: 3px;
  }

  .navbar {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem !important;
  }

  .navbar-brand {
    font-size: 1rem !important;
  }

  .card {
    border-radius: 6px;
    margin-bottom: 0.75rem;
  }

  .card-header {
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
    border-radius: 6px 6px 0 0;
  }

  .card-body {
    padding: 0.75rem;
  }

  .stat-card {
    padding: 0.85rem;
  }

  .stat-card .stat-value {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
  }

  .stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .stat-card .stat-label {
    font-size: 0.8rem;
  }

  .btn {
    font-size: 0.83rem;
    padding: 0.4rem 0.75rem;
  }

  .btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
  }

  .form-control,
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
  }

  .table-crm,
  .table {
    font-size: 0.8rem;
  }

  .table-crm thead th,
  .table thead th {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
  }

  .table-crm tbody td,
  .table tbody td {
    padding: 0.6rem 0.5rem;
  }

  .badge {
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  .badge-status {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-body,
  .modal-crm .modal-body {
    padding: 1rem;
  }

  .modal-footer,
  .modal-crm .modal-footer {
    padding: 0.75rem 1rem;
  }

  /* Popup de notificação menor em mobile */
  .popup-notificacao {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
    padding: 12px 16px;
  }

  .pagination .page-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
  }

  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1rem; }
  h4 { font-size: 0.95rem; }
  h5 { font-size: 0.9rem; }
}

/* Celulares (até 576px) */
@media (max-width: 576px) {
  body {
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  .navbar-brand {
    font-size: 0.92rem !important;
  }

  .card-header {
    padding: 0.65rem 0.75rem;
    font-size: 0.83rem;
  }

  .card-body {
    padding: 0.65rem;
  }

  .stat-card .stat-value {
    font-size: 1.2rem;
  }

  .table-crm,
  .table {
    font-size: 0.75rem;
  }

  .table-crm thead th,
  .table thead th {
    padding: 0.5rem 0.4rem;
    font-size: 0.7rem;
  }

  .table-crm tbody td,
  .table tbody td {
    padding: 0.5rem 0.4rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
  }

  h1 { font-size: 1.15rem; }
  h2 { font-size: 1rem; }
  h3 { font-size: 0.95rem; }
}
