/* ==========================================================================
   SPEEDCAR BARÃO — CRM KANBAN & MOTOR DE VENDAS AUTOMOTIVAS (WARP v2.0 LUXURY)
   Design System Executivo: Supercar Cockpit, Glassmorphism, Neon Glow & High Polish
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-app: #03060a;
  --bg-surface: rgba(15, 20, 32, 0.75);
  --bg-surface-elevated: rgba(20, 26, 42, 0.85);
  --bg-surface-hover: rgba(201, 162, 39, 0.12);
  
  --brand-gold: #C9A227;
  --brand-gold-light: #F6E09E;
  --brand-gold-glow: rgba(201, 162, 39, 0.4);
  --brand-gold-subtle: rgba(201, 162, 39, 0.15);
  --brand-red: #C9A227;
  
  --status-lead: #38BDF8;
  --status-lead-bg: rgba(56, 189, 248, 0.15);
  --status-lead-border: rgba(56, 189, 248, 0.4);
  
  --status-nego: #FBBF24;
  --status-nego-bg: rgba(251, 191, 36, 0.15);
  --status-nego-border: rgba(251, 191, 36, 0.4);
  
  --status-testdrive: #A78BFA;
  --status-testdrive-bg: rgba(167, 139, 250, 0.15);
  --status-testdrive-border: rgba(167, 139, 250, 0.4);
  
  --status-followup: #F472B6;
  --status-followup-bg: rgba(244, 114, 182, 0.15);
  --status-followup-border: rgba(244, 114, 182, 0.4);
  
  --status-sold: #34D399;
  --status-sold-bg: rgba(52, 211, 153, 0.15);
  --status-sold-border: rgba(52, 211, 153, 0.4);
  
  --whatsapp-green: #25D366;
  --whatsapp-hover: #128C7E;
  --whatsapp-glow: rgba(37, 211, 102, 0.4);
  
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-card: rgba(255, 255, 255, 0.14);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background: 
    linear-gradient(180deg, rgba(8, 12, 20, 0.72) 0%, rgba(5, 7, 12, 0.88) 100%),
    url('https://images.unsplash.com/photo-1617814076367-b759c7d7e738?q=80&w=2200&auto=format&fit=crop') center/cover no-repeat fixed;
}

/* ==========================================================================
   01. HEADER & NAVIGATION
   ========================================================================== */
.crm-header {
  background: rgba(12, 17, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.crm-header-container {
  max-width: 1780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.crm-brand-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crm-logo-img,
.riligar-auth-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(75%) sepia(53%) saturate(614%) hue-rotate(352deg) brightness(85%) contrast(90%) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.crm-brand-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

.crm-brand-meta {
  display: flex;
  flex-direction: column;
}

.crm-app-title {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-badge-system {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--brand-gold), #8A6D15);
  color: #000000;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.crm-store-address {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-sold);
  box-shadow: 0 0 10px var(--status-sold);
  display: inline-block;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Tabs de Navegação Superior */
.crm-top-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-top-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.crm-top-tab:hover {
  color: #FFFFFF;
}

.crm-top-tab.active {
  background: rgba(201, 162, 39, 0.18);
  color: #F6E09E;
  border: 1px solid rgba(201, 162, 39, 0.4);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.15);
}

.crm-top-tab-badge {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.crm-top-tab.active .crm-top-tab-badge {
  background: var(--brand-gold);
  color: #000000;
}

/* Ações da Barra Superior */
.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crm-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-gold), #8A6D15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: #000000;
}

.crm-user-name {
  font-size: 0.80rem;
  font-weight: 700;
  color: #FFFFFF;
}

.crm-user-role {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.crm-btn-logout {
  background: transparent;
  border: none;
  color: #F87171;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.crm-btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Botões Genéricos */
.crm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none;
}

.crm-btn-primary {
  background: linear-gradient(135deg, #C9A227 0%, #A68316 100%);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.35);
}

.crm-btn-primary:hover {
  background: linear-gradient(135deg, #E8D5A3 0%, #C9A227 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.5);
}

.crm-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.crm-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.crm-btn-whatsapp-report {
  background: rgba(37, 211, 102, 0.15);
  color: #34D399;
  border: 1px solid rgba(37, 211, 102, 0.4);
}

.crm-btn-whatsapp-report:hover {
  background: rgba(37, 211, 102, 0.25);
  border-color: #25D366;
  transform: translateY(-1px);
}

.crm-btn-stock {
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
  color: #FFFFFF;
  font-weight: 700;
}

/* ==========================================================================
   02. DASHBOARD DE KPIS (RESUMO EXECUTIVO NO TOPO)
   ========================================================================== */
.crm-kpi-bar {
  max-width: 1780px;
  margin: 20px auto 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.crm-kpi-card {
  background: rgba(15, 20, 32, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.crm-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.6), transparent);
}

.crm-kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(201, 162, 39, 0.15);
}

.crm-kpi-info {
  display: flex;
  flex-direction: column;
}

.crm-kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.crm-kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.crm-kpi-subtext {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.crm-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.crm-kpi-icon--leads { background: var(--status-lead-bg); color: var(--status-lead); border: 1px solid var(--status-lead-border); box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }
.crm-kpi-icon--nego { background: var(--status-nego-bg); color: var(--status-nego); border: 1px solid var(--status-nego-border); box-shadow: 0 0 15px rgba(251, 191, 36, 0.2); }
.crm-kpi-icon--test { background: var(--status-testdrive-bg); color: var(--status-testdrive); border: 1px solid var(--status-testdrive-border); box-shadow: 0 0 15px rgba(167, 139, 250, 0.2); }
.crm-kpi-icon--sold { background: var(--status-sold-bg); color: var(--status-sold); border: 1px solid var(--status-sold-border); box-shadow: 0 0 15px rgba(52, 211, 153, 0.2); }

/* ==========================================================================
   03. BARRA DE BUSCA & FILTROS
   ========================================================================== */
.crm-control-bar {
  max-width: 1780px;
  margin: 18px auto 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.crm-search-box {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.crm-search-input {
  width: 100%;
  background: rgba(15, 20, 32, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 38px;
  color: #FFFFFF;
  font-size: 0.86rem;
  outline: none;
  transition: all 0.2s ease;
}

.crm-search-input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.crm-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.crm-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-filter-btn {
  background: rgba(15, 20, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.crm-filter-btn.active {
  background: rgba(201, 162, 39, 0.18);
  color: #F6E09E;
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.15);
}

/* ==========================================================================
   04. QUADRO KANBAN (5 COLUNAS ULTRA POLIDAS)
   ========================================================================== */
.crm-board-container {
  max-width: 1780px;
  margin: 20px auto 40px auto;
  padding: 0 28px;
}

.crm-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.crm-column {
  background: rgba(12, 17, 28, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
  min-height: 580px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.crm-column::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.crm-column--lead::before { background: linear-gradient(90deg, var(--status-lead), transparent); }
.crm-column--nego::before { background: linear-gradient(90deg, var(--status-nego), transparent); }
.crm-column--test::before { background: linear-gradient(90deg, var(--status-testdrive), transparent); }
.crm-column--follow::before { background: linear-gradient(90deg, var(--status-followup), transparent); }
.crm-column--sold::before { background: linear-gradient(90deg, var(--status-sold), transparent); }

.crm-column.drag-over {
  border-color: rgba(201, 162, 39, 0.6);
  background-color: rgba(201, 162, 39, 0.05);
}

.crm-column-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 24, 0.7);
  position: sticky;
  top: 0;
  z-index: 10;
}

.crm-column-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-column-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.crm-column--lead .crm-column-indicator { background: var(--status-lead); box-shadow: 0 0 8px var(--status-lead); }
.crm-column--nego .crm-column-indicator { background: var(--status-nego); box-shadow: 0 0 8px var(--status-nego); }
.crm-column--test .crm-column-indicator { background: var(--status-testdrive); box-shadow: 0 0 8px var(--status-testdrive); }
.crm-column--follow .crm-column-indicator { background: var(--status-followup); box-shadow: 0 0 8px var(--status-followup); }
.crm-column--sold .crm-column-indicator { background: var(--status-sold); box-shadow: 0 0 8px var(--status-sold); }

.crm-column-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-column-count {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.crm-cards-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}

.crm-cards-list::-webkit-scrollbar {
  width: 5px;
}
.crm-cards-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ==========================================================================
   05. CARDS DE LEADS NO KANBAN (EXECUTIVE TICKET)
   ========================================================================== */
.crm-card {
  background: rgba(20, 26, 42, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px;
  cursor: grab;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.crm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.4);
}

.crm-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
  transform: scale(0.96) rotate(1deg);
}

/* Header do Card */
.crm-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.crm-card-client-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #F6E09E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.crm-card-client-info {
  display: flex;
  flex-direction: column;
}

.crm-card-client-name {
  font-size: 0.90rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.crm-card-phone {
  font-size: 0.70rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.crm-card-time {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brand-gold-light);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Canal de Origem */
.crm-card-channel-row {
  margin-bottom: 10px;
}

.crm-card-origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.crm-origin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.crm-card-origin--google { background: rgba(56, 189, 248, 0.15); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.35); }
.crm-card-origin--site { background: rgba(201, 162, 39, 0.15); color: #F6E09E; border: 1px solid rgba(201, 162, 39, 0.35); }
.crm-card-origin--loja { background: rgba(52, 211, 153, 0.15); color: #34D399; border: 1px solid rgba(52, 211, 153, 0.35); }
.crm-card-origin--insta { background: rgba(244, 114, 182, 0.15); color: #F472B6; border: 1px solid rgba(244, 114, 182, 0.35); }

/* Caixa do Veículo */
.crm-card-car-box {
  display: flex;
  gap: 12px;
  background: rgba(10, 14, 24, 0.65);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}

.crm-card-car-box:hover {
  border-color: rgba(201, 162, 39, 0.3);
}

.crm-card-car-thumb-wrap {
  width: 70px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crm-card-car-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.crm-card-car-box:hover .crm-card-car-thumb {
  transform: scale(1.08);
}

.crm-card-car-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.crm-card-car-title {
  font-size: 0.80rem;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.crm-card-car-price {
  font-size: 0.90rem;
  font-weight: 800;
  color: var(--brand-gold-light);
  font-family: 'JetBrains Mono', monospace;
}

.crm-card-car-specs {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 5px;
  align-items: center;
}

/* Troca */
.crm-card-trade-tag {
  font-size: 0.70rem;
  color: #CBD5E1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Nota */
.crm-card-note {
  font-size: 0.74rem;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--brand-gold);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
  line-height: 1.45;
}

/* Rodapé do Card */
.crm-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-card-btn-wa {
  flex: 1;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.crm-card-btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  background: linear-gradient(135deg, #34D399 0%, #059669 100%);
}

.crm-select-wrapper {
  position: relative;
}

.crm-card-move-select {
  background: rgba(15, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.crm-card-move-select:hover {
  border-color: var(--brand-gold);
}

/* ==========================================================================
   06. PÁTIO & GESTÃO DE ESTOQUE DEDICADA
   ========================================================================== */
.crm-patio-grid-section {
  max-width: 1780px;
  margin: 20px auto 40px auto;
  padding: 0 28px;
}

.crm-patio-car-card {
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-patio-car-card:hover {
  transform: translateY(-5px);
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(201, 162, 39, 0.15);
}

.crm-patio-media-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  background: #000;
  overflow: hidden;
}

.crm-patio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.crm-patio-car-card:hover .crm-patio-img {
  transform: scale(1.06);
}

.crm-patio-badge-pos {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.crm-patio-category-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.crm-stock-badge {
  font-size: 0.70rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.crm-stock-badge-ativo {
  background: rgba(52, 211, 153, 0.2);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.crm-stock-badge-vendido {
  background: rgba(248, 113, 113, 0.2);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.crm-patio-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.crm-patio-title-row {
  margin-bottom: 12px;
}

.crm-patio-car-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 4px;
}

.crm-patio-badge-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-patio-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.crm-patio-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.crm-patio-price-block {
  margin-bottom: 18px;
  background: rgba(10, 14, 24, 0.5);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-patio-price-main {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

.crm-patio-parcela {
  font-size: 0.75rem;
  color: var(--brand-gold-light);
  margin-top: 2px;
}

.crm-patio-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.crm-btn-patio-action {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.crm-btn-patio-edit {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.crm-btn-patio-edit:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--brand-gold);
}

.crm-btn-patio-sell {
  flex: 1;
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
  color: #34D399;
}

.crm-btn-patio-sell:hover {
  background: rgba(52, 211, 153, 0.25);
}

.crm-btn-patio-reactivate {
  flex: 1;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #FBBF24;
}

.crm-btn-patio-delete {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.crm-btn-patio-delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   07. MODAIS (ESTOQUE, NOVO LEAD, PREÇO)
   ========================================================================== */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.crm-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.crm-modal {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(201, 162, 39, 0.15);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.crm-modal-lg {
  max-width: 860px;
}

.crm-modal-backdrop.open .crm-modal {
  transform: translateY(0);
}

.crm-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 24, 0.6);
}

.crm-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.crm-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.crm-modal-close:hover {
  color: #FFFFFF;
}

.crm-modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 14, 24, 0.4);
}

.crm-modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.crm-modal-tab-btn.active {
  color: var(--brand-gold-light);
  border-bottom-color: var(--brand-gold);
  background: rgba(201, 162, 39, 0.08);
}

.crm-modal-body {
  padding: 24px;
  max-height: calc(85vh - 130px);
  overflow-y: auto;
}

.crm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .crm-form-row {
    grid-template-columns: 1fr;
  }
}

.crm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.crm-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #E2E8F0;
}

.crm-form-input,
.crm-form-select,
.crm-form-textarea {
  background: rgba(10, 14, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #FFFFFF;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.crm-form-textarea {
  resize: vertical;
}

.crm-form-input:focus,
.crm-form-select:focus,
.crm-form-textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

.crm-dropzone {
  border: 2px dashed rgba(201, 162, 39, 0.4);
  background: rgba(10, 14, 24, 0.6);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-dropzone:hover,
.crm-dropzone.dragover {
  border-color: var(--brand-gold);
  background: rgba(201, 162, 39, 0.08);
}

.crm-dropzone-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.crm-dropzone-title {
  font-size: 0.90rem;
  font-weight: 700;
  color: #FFFFFF;
}

.crm-dropzone-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.crm-dropzone-formats {
  font-size: 0.70rem;
  color: var(--text-muted);
  display: block;
  margin-top: 8px;
}

.crm-dropzone-preview {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crm-preview-thumb {
  width: 100px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

.crm-preview-name {
  font-size: 0.82rem;
  color: #FFFFFF;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.crm-btn-remove-photo {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.crm-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(10, 14, 24, 0.5);
}

/* ==========================================================================
   08. TOAST NOTIFICATIONS & AUTH OVERLAY
   ========================================================================== */
.crm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s ease;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.riligar-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, 0.94);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.riligar-auth-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  padding: 36px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(201, 162, 39, 0.2);
}

.riligar-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.riligar-auth-logo {
  height: 54px;
  margin: 0 auto 12px auto;
  display: block;
}

.riligar-auth-subtitle {
  font-size: 0.80rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.riligar-auth-error {
  color: #F87171;
  font-size: 0.78rem;
  margin-top: 6px;
}

.riligar-auth-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 20px;
}

.crm-footer {
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 28px;
}

.crm-footer-container {
  max-width: 1780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 12px;
}

.crm-footer-brand {
  font-weight: 800;
  color: #FFFFFF;
}

.crm-footer-link {
  color: var(--brand-gold-light);
  text-decoration: none;
}

.crm-footer-link:hover {
  text-decoration: underline;
}

/* Edit Preço Modal Card */
.crm-edit-price-card {
  display: flex;
  gap: 16px;
  background: rgba(10, 14, 24, 0.6);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.crm-edit-price-thumb {
  width: 90px;
  height: 65px;
  border-radius: 8px;
  object-fit: cover;
}

.crm-edit-price-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

.crm-edit-price-current {
  font-size: 0.80rem;
  color: var(--brand-gold-light);
  font-weight: 700;
  display: block;
  margin-top: 4px;
}

.crm-quick-price-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.crm-tag-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-tag-btn:hover {
  background: rgba(201, 162, 39, 0.2);
  border-color: var(--brand-gold);
  color: #F6E09E;
}

/* ==========================================================================
   09. RESPONSIVO MOBILE
   ========================================================================== */
@media (max-width: 1200px) {
  .crm-header-container, .crm-kpi-bar, .crm-control-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .crm-top-tabs {
    order: 3;
    width: 100%;
    margin-top: 10px;
    justify-content: flex-start;
  }
  .crm-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    gap: 16px;
  }
  .crm-column {
    min-width: 310px;
    scroll-snap-align: center;
    flex-shrink: 0;
  }
  .crm-kpi-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }
  .crm-kpi-card {
    min-width: 260px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  .crm-patio-grid {
    grid-template-columns: 1fr;
  }
  .crm-board-container {
    padding: 0 16px;
  }
  .crm-kpi-bar {
    padding: 0 16px;
  }
  .crm-control-bar {
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .crm-header-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
  .crm-brand-box {
    width: 100% !important;
    justify-content: center !important;
  }
  .crm-top-tabs {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .crm-top-tab {
    flex: 1 !important;
    justify-content: center !important;
  }
  .crm-header-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .crm-header-actions .crm-btn {
    flex: 1 !important;
    min-width: 120px !important;
    justify-content: center !important;
  }
  .crm-user-profile {
    width: 100% !important;
    justify-content: center !important;
  }
  .crm-kpi-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    padding: 0 16px !important;
    width: 100% !important;
  }
  .crm-kpi-card {
    position: relative !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 14px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 6px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .crm-kpi-info {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .crm-kpi-label {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
    max-width: calc(100% - 42px) !important;
    margin-bottom: 4px !important;
    word-break: break-word !important;
  }
  .crm-kpi-card .crm-kpi-value {
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
  }
  .crm-kpi-subtext {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    color: var(--text-muted) !important;
  }
  .crm-kpi-icon {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 10px !important;
    font-size: 1.1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
    box-sizing: border-box !important;
    z-index: 2 !important;
  }
  .crm-board {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible !important;
    gap: 20px !important;
  }
  .crm-column {
    width: 100% !important;
    min-width: 0 !important;
  }
  .crm-control-bar {
    position: relative;
    z-index: 20;
  }
  .crm-control-bar .crm-btn {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .crm-btn * {
    pointer-events: none;
  }
}
