@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0b1120;
  --bg-card: #111a2e;
  --bg-card-hover: #16223d;
  --bg-input: #090e1a;
  --border-color: #1e293b;
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --purple-glow: rgba(139, 92, 246, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --info: #0ea5e9;
  --info-bg: rgba(14, 165, 233, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #080d19;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 16px;
  min-height: 100vh;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.brand-text span {
  font-size: 10px;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: #18223c;
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-weight: 600;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.sidebar-ai-box {
  background: linear-gradient(145deg, #131b31 0%, #0d1322 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin-top: auto;
}

.sidebar-ai-box .ai-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #c7d2fe;
  margin-bottom: 6px;
}

.sidebar-ai-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Main Container */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 32px;
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.header-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-icon {
  font-size: 28px;
}

.header-title-box h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.header-title-box p {
  font-size: 13px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-badge-active {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
}

.last-analysis-text {
  font-size: 12px;
  color: var(--text-dim);
}

.btn-ai-analyze {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--purple-glow);
  transition: all 0.2s;
}

.btn-ai-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

/* Metric Cards Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.icon-red { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-yellow { background: rgba(234, 179, 8, 0.15); color: #facc15; }

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.kpi-growth {
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
}

.kpi-subtext {
  font-size: 11px;
  color: var(--text-dim);
}

/* Filter Tabs & Search Row */
.filter-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tabs-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.tab-pill {
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-pill:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.tab-pill.active {
  background: #252e4d;
  color: #c7d2fe;
  border-color: var(--primary);
  font-weight: 600;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 14px 8px 34px;
  font-size: 12px;
  color: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-dim);
}

/* Content Area: Table + Customer 360 Card */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-bottom: 24px;
  min-width: 0;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-width: 0;
}

.farmer-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}

.farmer-table th {
  background: #0d1424;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.farmer-table td {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.farmer-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.farmer-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.farmer-table tbody tr.selected {
  background: rgba(99, 102, 241, 0.12);
}

/* Client Avatar & Details */
.client-info-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.client-name-box {
  display: flex;
  flex-direction: column;
}

.client-name-box strong {
  font-size: 13px;
  color: #fff;
}

.client-name-box span {
  font-size: 11px;
  color: var(--text-dim);
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-ativo { background: var(--success-bg); color: #34d399; }
.status-atencao { background: var(--warning-bg); color: #fbbf24; }
.status-risco { background: var(--danger-bg); color: #f87171; }
.status-inativo { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }

/* Score Bar */
.score-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-num {
  font-weight: 700;
  color: #fff;
  font-size: 12px;
  width: 20px;
}

.score-bar-bg {
  width: 50px;
  height: 4px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
}

/* Action Button in Table */
.btn-action-cell {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #162035;
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-action-cell:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-action-purple {
  background: #312e81;
  color: #c7d2fe;
  border-color: #4338ca;
}
.btn-action-purple:hover {
  background: #4f46e5;
  color: #fff;
}

/* Customer 360 Panel (Right) */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.profile-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.profile-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  margin-bottom: 16px;
}

.profile-tab {
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.profile-tab.active {
  color: #a5b4fc;
  border-color: var(--primary);
}

.profile-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.profile-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-scores-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.profile-score-pill {
  background: #0d1424;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.profile-score-pill span {
  font-size: 10px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.profile-score-pill strong {
  font-size: 13px;
  color: #fff;
}

.nba-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.nba-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.nba-title {
  font-size: 12px;
  font-weight: 700;
  color: #e0e7ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-gerar-abordagem {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.nba-box p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
}

.nba-valor {
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}

.reasons-box h4 {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reasons-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reason-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.reason-item span {
  color: #10b981;
  font-weight: 700;
}

/* Bottom Campaign Wizard Section */
.campaign-wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.wizard-title-box {
  margin-bottom: 16px;
}

.wizard-title-box h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.wizard-title-box p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stepper */
.stepper-row {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.step-item.active {
  color: #a5b4fc;
  font-weight: 700;
}

.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.step-item.active .step-num {
  background: var(--primary);
  color: #fff;
}

/* Campaign Form Grid */
.campaign-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 300px;
  gap: 20px;
  margin-bottom: 20px;
}

.form-sub-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.obj-card {
  background: #0d1424;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.obj-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.obj-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
}

.obj-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.obj-card p {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.2;
}

/* Pitch & XTTS */
.pitch-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pitch-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-ia-improve {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.pitch-textarea {
  width: 100%;
  height: 75px;
  background: #090e1a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: #fff;
  resize: none;
  outline: none;
}

.pitch-textarea:focus {
  border-color: var(--primary);
}

.xtts-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d1424;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
}

.xtts-voice-select {
  background: #162035;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  outline: none;
}

.btn-test-voice {
  padding: 4px 10px;
  border-radius: 6px;
  background: #312e81;
  color: #c7d2fe;
  border: 1px solid #4338ca;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* Media Cards */
.media-cards-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.media-thumbnail-card {
  width: 70px;
  height: 70px;
  background: #0d1424;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 10px;
  color: var(--text-dim);
  gap: 4px;
}

.media-thumbnail-card .btn-remove-media {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  cursor: pointer;
}

.btn-add-media-slot {
  width: 70px;
  height: 70px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-media-slot:hover {
  border-color: var(--primary);
  color: #fff;
}

/* Wizard Bottom Action Bar */
.wizard-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.wizard-left-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-outline-action {
  padding: 8px 14px;
  border-radius: 8px;
  background: #162035;
  border: 1px solid var(--border-color);
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline-action:hover {
  background: #1e293b;
  color: #fff;
}

.wizard-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-submit-campaign {
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--purple-glow);
}

.btn-submit-campaign:hover {
  transform: translateY(-1px);
}

/* ============================================================ */
/* NOVOS ESTILOS: INTELIGÊNCIA DE CARTEIRA & CAMPANHAS IA       */
/* ============================================================ */

.btn-header-import {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-import:hover {
  background: #334155;
  color: #fff;
  border-color: #0284c7;
}

/* Banner de Progresso da Análise IA */
.analysis-progress-container {
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
  border: 1px solid #6366f1;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.25);
  animation: fadeIn 0.3s ease;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.progress-header h3 {
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-steps-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #1e293b;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.3s ease;
}

.step-pill.active {
  border-color: #6366f1;
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
}

.step-pill.completed {
  border-color: #10b981;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
}

/* Seção de Oportunidades & Campanhas Sugeridas */
.suggested-section {
  margin-bottom: 28px;
}

.suggested-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.suggested-header-left h2 {
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggested-header-left p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.opportunities-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.opp-badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: #111a2e;
  border: 1px solid #1e293b;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
}

.opp-badge-item strong {
  color: #fff;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Grid de Cards de Campanha */
.campaigns-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.campaign-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.campaign-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.campaign-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.campaign-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.tag-recompra { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.tag-reativacao { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-cross_sell { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.tag-upsell { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-alto_valor { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.tag-prioridade { background: #1e293b; color: #cbd5e1; }

.campaign-audience-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090e1a;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  font-size: 11px;
}

.audience-count {
  font-weight: 800;
  font-size: 14px;
  color: #38bdf8;
}

/* Explicabilidade Aberta */
.campaign-why-box {
  background: rgba(15, 23, 42, 0.75);
  border-left: 3px solid #6366f1;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.45;
}

.campaign-why-box strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c7d2fe;
  margin-bottom: 4px;
  font-size: 11px;
}

.campaign-pitch-preview {
  font-size: 11px;
  color: #94a3b8;
  background: #0d1527;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed #1e293b;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botões de Ação da Campanha */
.campaign-actions-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #1e293b;
}

.btn-card-action {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #162035;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background: #1e293b;
  color: #fff;
}

.btn-card-activate {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  font-weight: 700;
}

.btn-card-activate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--purple-glow);
}

.btn-card-danger {
  color: #f87171;
  background: transparent;
  border-color: #334155;
  flex: 0 0 34px;
  padding: 8px 0;
}

.btn-card-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* ============================================================ */
/* MODAIS (IMPORTAÇÃO E EDIÇÃO)                                 */
/* ============================================================ */

.farmer-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.farmer-modal-overlay.active {
  display: flex;
}

.farmer-modal-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalScale 0.25s ease;
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.farmer-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.farmer-modal-header h3 {
  font-size: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.btn-close-modal:hover {
  color: #fff;
}

.farmer-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.farmer-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #090e1a;
  border-radius: 0 0 16px 16px;
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed #334155;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: #0b1120;
  transition: all 0.2s ease;
}

.file-dropzone:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.file-dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.file-dropzone h4 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.file-dropzone p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Prévia Estatística de Importação */
.preview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.preview-kpi-pill {
  background: #111a2e;
  border: 1px solid #1e293b;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.preview-kpi-pill span {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}

.preview-kpi-pill strong {
  font-size: 18px;
  color: #fff;
  margin-top: 4px;
  display: block;
}

/* Box Ajustar com IA */
.ai-adjust-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(217, 70, 239, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-adjust-box h4 {
  font-size: 13px;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-adjust-input-row {
  display: flex;
  gap: 10px;
}

.ai-adjust-input-row input {
  flex: 1;
  background: #090e1a;
  border: 1px solid #1e293b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
}

.btn-ai-apply {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================================== */
/* MICRO-ANIMAÇÕES E EFEITOS HOVER DINÂMICOS (MENU, BOTÕES, CARDS E ABAS) */
/* ============================================================================== */

/* 1. Efeito Hover no Menu Lateral */
.brand-logo {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.brand-logo:hover {
  transform: scale(1.03);
}

.brand-logo:hover .brand-icon {
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
  transform: rotate(-6deg);
  transition: all 0.25s ease;
}

.nav-item {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #ffffff;
  transform: translateX(5px);
  box-shadow: inset 3px 0 0 #6366f1;
}

.nav-item:active {
  transform: translateX(3px) scale(0.98);
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #818cf8, 0 4px 15px rgba(99, 102, 241, 0.2);
}

/* 2. Efeito Hover nos Botões do Top Header */
.btn-ai-analyze {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ai-analyze:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5), 0 0 15px rgba(217, 70, 239, 0.35);
  filter: brightness(1.08);
}

.btn-ai-analyze:active {
  transform: translateY(0) scale(0.98);
}

.btn-import-header, .btn-header-import {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-import-header:hover, .btn-header-import:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.45);
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  filter: brightness(1.1);
}

.btn-import-header:active, .btn-header-import:active {
  transform: translateY(0) scale(0.98);
}

/* 3. Efeito Hover nos Cards de Campanha da IA */
.campaign-card {
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.campaign-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.12);
}

/* 4. Efeito Hover nos Botões de Ação dos Cards */
.btn-card-action {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn-card-action:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  filter: brightness(1.12);
}

.btn-card-action:active {
  transform: translateY(0) scale(0.96);
}

.btn-card-activate:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  border-color: #34d399;
  filter: brightness(1.1);
}

.btn-card-danger:hover {
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  border-color: #f87171;
}

/* 5. Efeito Hover nos Chips de Resumo de Oportunidades */
.opp-summary-chip, .opp-badge-item {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.opp-summary-chip:hover, .opp-badge-item:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  border-color: rgba(99, 102, 241, 0.5);
  filter: brightness(1.15);
}

/* 6. Efeito Hover nas Abas e Filtros */
.sub-tab-btn, .filter-chip, .profile-tab, .tab-pill {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.sub-tab-btn:hover, .filter-chip:hover, .tab-pill:hover:not(.active) {
  transform: translateY(-2px);
  color: #ffffff;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.profile-tab:hover {
  color: #a5b4fc;
}

/* 7. Efeito Hover nas Linhas de Tabela e Botões de Célula */
.client-row {
  transition: background 0.18s ease;
}

.client-row:hover {
  background: rgba(99, 102, 241, 0.06);
}

.btn-action-cell {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action-cell:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-action-cell:active {
  transform: translateY(0) scale(0.96);
}

/* 8. Botão Ajustar com IA & Botão Gerar Abordagem */
.btn-ai-apply, .btn-gerar-abordagem {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-ai-apply:hover, .btn-gerar-abordagem:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.45);
  filter: brightness(1.12);
}

.btn-ai-apply:active, .btn-gerar-abordagem:active {
  transform: translateY(0) scale(0.97);
}

/* 9. Botões de Modal e Fechar */
.btn-close-modal {
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  transform: rotate(90deg) scale(1.15);
  color: #f87171;
}

.btn-primary, .btn-secondary {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  background: #334155;
  color: #ffffff;
}

/* ============================================================================== */
/* ELEMENTOS DO DRAWER MOBILE & BACKDROP                                         */
/* ============================================================================== */

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #18223c;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: #252e4d;
  border-color: #6366f1;
}

.mobile-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 32px;
  height: 32px;
  background: #18223c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-sidebar-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================================== */
/* RESPONSIVIDADE COMPLETA (NOTEBOOKS, TABLETS E DISPOSITIVOS MÓVEIS)             */
/* ============================================================================== */

/* 1. Notebooks e Resoluções Médias (<= 1366px - Resolução padrão de notebook) */
@media (max-width: 1366px) {
  .main-wrapper {
    padding: 20px 24px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .campaigns-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* 2. Laptops Compactos e Telas Médias (<= 1200px) */
@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .profile-card {
    width: 100%;
    max-width: 100%;
  }

  .campaign-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* 3. Tablets em Modo Paisagem / Retrato (<= 1024px) - Ativação do Drawer Off-Canvas */
@media (max-width: 1024px) {
  body {
    flex-direction: column;
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .mobile-sidebar-close {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100vh;
    z-index: 9999;
    background: #080d19;
    box-shadow: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 16px 0 50px rgba(0, 0, 0, 0.85);
  }

  .main-wrapper {
    padding: 20px 16px;
    width: 100%;
    max-width: 100%;
  }

  .top-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .tabs-group {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
  }
}

/* 4. Tablets em Retrato (<= 860px) */
@media (max-width: 860px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .campaigns-grid-container {
    grid-template-columns: 1fr;
  }

  .campaign-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .progress-steps-row {
    flex-direction: column;
    align-items: stretch;
  }

  .step-pill {
    width: 100%;
  }

  .wizard-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .wizard-left-actions,
  .wizard-right-actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .wizard-left-actions button,
  .wizard-right-actions button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* 5. Smartphones e Telas Pequenas (<= 640px) */
@media (max-width: 640px) {
  .main-wrapper {
    padding: 14px 10px;
  }

  .header-title-box h1 {
    font-size: 20px;
  }

  .header-title-box p {
    font-size: 11px;
  }

  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .header-actions .btn-header-import,
  .header-actions .btn-import-header,
  .header-actions .btn-ai-analyze {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .status-badge-active {
    align-self: flex-start;
  }

  .last-analysis-text {
    align-self: flex-start;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .campaign-actions-footer {
    flex-wrap: wrap;
    gap: 6px;
  }

  .btn-card-action {
    flex: 1 1 calc(50% - 6px);
    min-width: 90px;
    font-size: 11px;
    padding: 8px 6px;
  }

  .btn-card-danger {
    flex: 0 0 38px;
  }

  .btn-card-activate {
    flex: 1 1 100%;
    margin-top: 4px;
    padding: 10px;
  }

  .opp-badge-item {
    font-size: 10px;
    padding: 6px 10px;
  }

  .profile-scores-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .profile-nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
  }

  .profile-tab {
    white-space: nowrap;
  }

  .wizard-left-actions,
  .wizard-right-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .wizard-left-actions button,
  .wizard-right-actions button {
    width: 100%;
    justify-content: center;
  }

  /* Modais no Mobile */
  .farmer-modal-overlay {
    padding: 8px;
  }

  .farmer-modal-box {
    max-height: 94vh;
    border-radius: 12px;
  }

  .farmer-modal-header {
    padding: 12px 16px;
  }

  .farmer-modal-header h3 {
    font-size: 14px;
  }

  .farmer-modal-body {
    padding: 14px;
    gap: 14px;
  }

  .farmer-modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .farmer-modal-footer button {
    width: 100%;
    justify-content: center;
  }

  .preview-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .preview-kpi-pill {
    padding: 8px !important;
  }

  .ai-adjust-input-row {
    flex-direction: column;
  }

  .ai-adjust-input-row button {
    width: 100%;
    padding: 10px;
  }
}

