:root { font-family: 'Inter', sans-serif; }
html { scroll-behavior: smooth; }
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Remove ícone de calendário nativo */
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

/* Z-index para modais e painéis */
#quick-forms-panel { z-index: 30; }
#modal { z-index: 50; }
#confirm-modal { z-index: 60; }
#import-clientes-modal { z-index: 50; }
#import-vendas-modal { z-index: 50; }
#client-profile-modal { z-index: 50; }

/* ============ Tema claro (UI branca) ============ */
body[data-theme="light"] {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%) !important;
  color: #334155 !important;
}

body[data-theme="light"] #login-container {
  background: linear-gradient(135deg, #e2e8f0 0%, #e0e7ff 50%, #f1f5f9 100%) !important;
}

body[data-theme="light"] .bg-slate-800,
body[data-theme="light"] .bg-slate-800\/50,
body[data-theme="light"] .bg-slate-800\/60,
body[data-theme="light"] .bg-slate-700\/50,
body[data-theme="light"] .bg-slate-700\/40,
body[data-theme="light"] .bg-slate-900\/50 {
  background-color: rgba(255, 255, 255, 0.92) !important;
}

body[data-theme="light"] [class*="border-slate-"] {
  border-color: #cbd5e1 !important;
}

body[data-theme="light"] [class*="text-slate-"] {
  color: #475569 !important;
}

body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] h3,
body[data-theme="light"] h4,
body[data-theme="light"] th,
body[data-theme="light"] td {
  color: #0f172a;
}

/* Texto de conteúdo no tema branco */
body[data-theme="light"] .text-white {
  color: #0f172a !important;
}

/* Campos do formulário precisam manter contraste no tema branco */
body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea {
  color: #0f172a !important;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

body[data-theme="light"] [class*="placeholder-slate-"]::placeholder {
  color: #64748b !important;
}

body[data-theme="light"] #global-search-results,
body[data-theme="light"] #tabs-container,
body[data-theme="light"] #header-followup-alert {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .tab-btn {
  color: #1e293b !important;
}

body[data-theme="light"] ::-webkit-scrollbar-track { background: #e2e8f0; }
body[data-theme="light"] ::-webkit-scrollbar-thumb { background: #94a3b8; }
body[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ============ Badge de status (Vendas) ============ */
.crm-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  border: 1px solid transparent;
}

.crm-status-concluido { background: rgba(34, 197, 94, 0.2) !important; color: #86efac !important; border-color: rgba(34, 197, 94, 0.35) !important; }
.crm-status-cancelado { background: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.35) !important; }
.crm-status-negociando { background: rgba(245, 158, 11, 0.2) !important; color: #fcd34d !important; border-color: rgba(245, 158, 11, 0.35) !important; }
.crm-status-aguardando-aceite { background: rgba(59, 130, 246, 0.2) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.35) !important; }
.crm-status-inputado { background: rgba(168, 85, 247, 0.2) !important; color: #d8b4fe !important; border-color: rgba(168, 85, 247, 0.35) !important; }
.crm-status-aguardando-fatura { background: rgba(99, 102, 241, 0.2) !important; color: #c7d2fe !important; border-color: rgba(99, 102, 241, 0.35) !important; }
.crm-status-aguardando-distribuidora { background: rgba(6, 182, 212, 0.2) !important; color: #67e8f9 !important; border-color: rgba(6, 182, 212, 0.35) !important; }
.crm-status-default { background: rgba(100, 116, 139, 0.2) !important; color: #cbd5e1 !important; border-color: rgba(100, 116, 139, 0.35) !important; }

/* Paleta específica para o tema branco */
body[data-theme="light"] .crm-status-concluido { background: #dcfce7; color: #166534; border-color: #86efac; }
body[data-theme="light"] .crm-status-cancelado { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
body[data-theme="light"] .crm-status-negociando { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
body[data-theme="light"] .crm-status-aguardando-aceite { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
body[data-theme="light"] .crm-status-inputado { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
body[data-theme="light"] .crm-status-aguardando-fatura { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
body[data-theme="light"] .crm-status-aguardando-distribuidora { background: #cffafe; color: #155e75; border-color: #67e8f9; }
body[data-theme="light"] .crm-status-default { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }

/* ============ Acabamento premium da UI branca ============ */
body[data-theme="light"] #app-header,
body[data-theme="light"] #app-nav {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.9)) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

body[data-theme="light"] #tab-vendas > div:first-child {
  background: rgba(255,255,255,0.7);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 12px;
}

body[data-theme="light"] #tab-vendas .overflow-x-auto table thead {
  background: linear-gradient(90deg, #eff6ff, #eef2ff) !important;
}

body[data-theme="light"] #tab-vendas tbody tr:hover {
  background: rgba(37, 99, 235, 0.06) !important;
}

body[data-theme="light"] #tab-vendas input,
body[data-theme="light"] #tab-vendas select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body[data-theme="light"] #tab-vendas button[id^="btn-"] {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

/* Reforço de contraste para ações no tema branco */
body[data-theme="light"] #btn-notificacoes,
body[data-theme="light"] #btn-theme-toggle {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

body[data-theme="light"] #btn-logout {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5;
}

body[data-theme="light"] #btn-export-vendas,
body[data-theme="light"] #btn-export-clientes {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #047857 !important;
}

body[data-theme="light"] #btn-import-vendas,
body[data-theme="light"] #btn-import-clientes-vendas,
body[data-theme="light"] #btn-import-clientes,
body[data-theme="light"] #btn-dedupe-clientes {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #6d28d9 !important;
}

body[data-theme="light"] #btn-dedupe-clientes {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
}

/* Contraste forte para botões da aba Campanhas no tema branco */
body[data-theme="light"] #btn-campanhas-open-create { background: #7c3aed !important; color: #ffffff !important; border-color: #6d28d9 !important; }
body[data-theme="light"] #btn-campanhas-refresh { background: #334155 !important; color: #ffffff !important; border-color: #1e293b !important; }
body[data-theme="light"] #btn-campanhas-export { background: #059669 !important; color: #ffffff !important; border-color: #047857 !important; }
body[data-theme="light"] #btn-campanhas-delete { background: #dc2626 !important; color: #ffffff !important; border-color: #b91c1c !important; }
body[data-theme="light"] #btn-campanhas-reset-filters { background: #1d4ed8 !important; color: #ffffff !important; border-color: #1e40af !important; }
body[data-theme="light"] #campanhas-copy-script { background: #0891b2 !important; color: #ffffff !important; border-color: #0e7490 !important; }

/* Preserva contraste dos principais botões coloridos no tema branco */
body[data-theme="light"] #btn-nova-venda,
body[data-theme="light"] #btn-novo-cliente,
body[data-theme="light"] #btn-open-quick-forms,
body[data-theme="light"] #btn-campanha-create-save,
body[data-theme="light"] #btn-campanha-create-import,
body[data-theme="light"] #btn-campanha-delete-confirm,
body[data-theme="light"] #btn-campanha-lead-save,
body[data-theme="light"] #btn-campanha-lead-whatsapp,
body[data-theme="light"] #btn-campanha-lead-email {
  color: #ffffff !important;
}

/* Nao sobrescrever texto dos badges de status */
body[data-theme="light"] .crm-status-badge {
  color: inherit !important;
}