*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  min-height: 100vh;
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-box {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
}

.auth-box h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-box p {
  color: #6b7280;
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-box input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.auth-box input:focus {
  border-color: #6366f1;
}

.auth-box button {
  width: 100%;
  padding: 12px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-box button:hover {
  background: #4f46e5;
}

.auth-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Mobile header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #1a1a2e;
  color: #fff;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
}

.hamburger {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-title {
  font-size: 18px;
  font-weight: 600;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-link {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

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

.nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.2);
  border-left-color: #6366f1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 24px;
  min-height: 100vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.refresh-btn {
  padding: 8px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: #4f46e5;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0ff;
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

/* Chart cards */
.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.chart-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.chart-card canvas {
  width: 100% !important;
  max-width: 100%;
}

/* Funnel chart */
.funnel-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.funnel-label {
  width: 140px;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
  color: #374151;
}

.funnel-bar-bg {
  flex: 1;
  height: 28px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.funnel-stats {
  width: 120px;
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
}

/* Answers cards */
.answer-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

.answer-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
}

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

.answer-text {
  width: 220px;
  font-size: 14px;
  color: #374151;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-bar-bg {
  flex: 1;
  height: 22px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.answer-bar-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.answer-stats {
  width: 100px;
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
  text-align: right;
}

/* Filters */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-bar input,
.filters-bar select {
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.filters-bar input:focus,
.filters-bar select:focus {
  border-color: #6366f1;
}

.filter-btn {
  padding: 8px 20px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-btn:hover {
  background: #4f46e5;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.data-table th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e5e7eb;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: #6366f1;
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

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

.data-table tbody tr:hover {
  background: #f9fafb;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-red {
  background: #fef2f2;
  color: #991b1b;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 8px 14px;
  border: 2px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.pagination button.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* Session detail */
.session-detail {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.session-detail h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.detail-step {
  width: 160px;
  font-weight: 600;
  color: #6366f1;
  flex-shrink: 0;
}

.detail-answer {
  color: #374151;
}

.close-detail {
  margin-top: 16px;
  padding: 8px 20px;
  background: #6b7280;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

.close-detail:hover {
  background: #4b5563;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .funnel-label {
    width: 80px;
    font-size: 11px;
  }

  .funnel-stats {
    width: 80px;
    font-size: 11px;
  }

  .answer-text {
    width: 120px;
    font-size: 12px;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filters-bar input,
  .filters-bar select {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Sidebar variant filter */
.sidebar-filter {
  padding: 12px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-filter label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
  font-weight: 600;
}
.sidebar-filter select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}
.sidebar-filter select:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.15);
}

/* Variant breakdown cards */
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.variant-card {
  background: #f9fafb;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.variant-card:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}
.variant-card.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}
.variant-name {
  font-weight: 700;
  color: #6366f1;
  font-size: 15px;
  margin-bottom: 4px;
}
.variant-total {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.variant-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.variant-stat {
  font-size: 12px;
  color: #6b7280;
}

/* Date filter bar (Dashboard) */
.date-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.date-filter-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}
.date-presets {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}
.date-preset {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.date-preset:hover {
  color: #111827;
}
.date-preset.active {
  background: #fff;
  color: #6366f1;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.date-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-custom label {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-custom input {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.date-apply {
  padding: 7px 14px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.date-apply:hover { background: #4f46e5; }
.date-filter-current {
  margin-left: auto;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

/* Improved funnel rows (drop-off info) */
.funnel-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 160px;
}
.funnel-primary {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}
.funnel-dropoff {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}
.funnel-dropoff.dropoff-high { color: #dc2626; font-weight: 600; }
.funnel-dropoff.dropoff-low  { color: #16a34a; font-weight: 600; }

/* Filters bar hint */
.filters-hint {
  margin-left: auto;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* Variant badge in sessions table */
.variant-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}
.variant-badge.variant-desafio { background: #ddd6fe; color: #5b21b6; }
.variant-badge.variant-ga       { background: #fef3c7; color: #92400e; }
.variant-badge.variant-tk1      { background: #fce7f3; color: #9d174d; }
.variant-badge.variant-tk2      { background: #cffafe; color: #155e75; }
.variant-badge.variant-tkads    { background: #fee2e2; color: #991b1b; }
.variant-badge.variant-tk2_v2   { background: #d1fae5; color: #065f46; }

/* ============================================
   FUNIL NOVO (página redesigned)
   ============================================ */

.fv2-hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.4);
}
.fv2-hero-text h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #fff;
}
.fv2-hero-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}
.fv2-hero .refresh-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  backdrop-filter: blur(10px);
}
.fv2-hero .refresh-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* KPI Cards */
.fv2-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.fv2-kpi {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.04), 0 2px 4px -2px rgba(0,0,0,0.02);
  border: 1px solid #f3f4f6;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fv2-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(0,0,0,0.08);
}
.fv2-kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
}
.fv2-kpi-visitors::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.fv2-kpi-q1::before       { background: linear-gradient(90deg, #ec4899, #f472b6); }
.fv2-kpi-aceite::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fv2-kpi-checkout::before { background: linear-gradient(90deg, #10b981, #34d399); }

.fv2-kpi-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fv2-kpi-visitors .fv2-kpi-icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.fv2-kpi-q1 .fv2-kpi-icon       { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.fv2-kpi-aceite .fv2-kpi-icon   { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.fv2-kpi-checkout .fv2-kpi-icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }

.fv2-kpi-body { flex: 1; min-width: 0; }
.fv2-kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.fv2-kpi-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fv2-kpi-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  font-weight: 500;
}

/* Cards grid layout */
.fv2-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.fv2-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.04), 0 2px 4px -2px rgba(0,0,0,0.02);
  border: 1px solid #f3f4f6;
}
.fv2-card-fullwidth { margin-bottom: 20px; }
.fv2-card-header {
  margin-bottom: 18px;
}
.fv2-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
}
.fv2-card-subtitle {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* Vertical funnel viz */
.fv2-funnel-row {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f9fafb;
}
.fv2-funnel-row:last-child { border-bottom: none; }
.fv2-funnel-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.fv2-funnel-bar-wrap {
  background: #f9fafb;
  border-radius: 8px;
  height: 28px;
  overflow: hidden;
  position: relative;
}
.fv2-funnel-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
}
.fv2-funnel-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.fv2-count-num {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}
.fv2-count-pct {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}
.fv2-retention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 4px;
  font-weight: 600;
}
.fv2-retention.is-good { background: #d1fae5; color: #065f46; }
.fv2-retention.is-medium { background: #fef3c7; color: #92400e; }
.fv2-retention.is-bad { background: #fee2e2; color: #991b1b; }
.fv2-retention-arrow { font-weight: 700; }
.fv2-retention-text { opacity: 0.85; font-weight: 500; }

/* Chart containers */
.fv2-chart-wrap {
  position: relative;
  height: 240px;
}
.fv2-chart-tall {
  height: 280px;
}

/* Legend below donut */
.fv2-legend {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fv2-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}
.fv2-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}
.fv2-legend-text {
  flex: 1;
  color: #374151;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fv2-legend-stat {
  color: #111827;
  font-weight: 700;
  font-size: 12px;
}

/* Empty state */
.fv2-empty {
  text-align: center;
  padding: 30px;
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

/* Variant breakdown (Funil Novo style) */
.fv2-variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.fv2-variant-card {
  background: #f9fafb;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.fv2-variant-card:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
}
.fv2-variant-card.is-active {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 6px 16px -4px rgba(99,102,241,0.25);
}
.fv2-variant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fv2-variant-total {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}
.fv2-variant-progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.fv2-variant-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.fv2-variant-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}
.fv2-variant-stats strong {
  color: #111827;
  margin-right: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .fv2-kpis { grid-template-columns: repeat(2, 1fr); }
  .fv2-grid { grid-template-columns: 1fr; }
  .fv2-funnel-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .fv2-funnel-count {
    align-items: flex-start;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .fv2-hero { padding: 20px; }
  .fv2-hero-text h2 { font-size: 22px; }
  .fv2-kpis { grid-template-columns: 1fr; }
  .fv2-kpi-value { font-size: 26px; }
  .fv2-card { padding: 18px; }
}

/* ============================================
   INSIGHTS (comparativo Funil Antigo vs Funil Novo)
   ============================================ */
.ins-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.4);
}
.ins-hero-text h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #fff;
}
.ins-hero-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
}
.ins-hero .refresh-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.ins-hero .refresh-btn:hover { background: rgba(255, 255, 255, 0.22); }

/* Periods header */
.ins-periods {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
}
.ins-period-card {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 2px solid #e5e7eb;
}
.ins-period-old { border-color: #fde68a; background: #fffbeb; }
.ins-period-new { border-color: #c7d2fe; background: #eef2ff; }
.ins-period-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ins-period-old .ins-period-tag { color: #b45309; }
.ins-period-new .ins-period-tag { color: #4338ca; }
.ins-period-range {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.ins-period-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: #6b7280;
  font-weight: 700;
  font-size: 18px;
}

/* KPI comparison cards */
.ins-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.ins-kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.04);
  border: 1px solid #f3f4f6;
}
.ins-kpi-title {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.ins-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.ins-kpi-side {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid;
}
.ins-kpi-old {
  background: #fffbeb;
  border-color: #fde68a;
}
.ins-kpi-new {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.ins-kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ins-kpi-old .ins-kpi-label { color: #b45309; }
.ins-kpi-new .ins-kpi-label { color: #4338ca; }
.ins-kpi-val {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.ins-kpi-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.ins-kpi-delta {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.ins-kpi-delta.is-positive { background: #d1fae5; color: #065f46; }
.ins-kpi-delta.is-negative { background: #fee2e2; color: #991b1b; }
.ins-kpi-delta.is-neutral { background: #f3f4f6; color: #4b5563; }
.ins-arrow { margin-right: 4px; }

/* Analysis card */
.ins-analysis-card, .ins-funnel-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 12px -2px rgba(0,0,0,0.04);
  border: 1px solid #f3f4f6;
  margin-bottom: 20px;
}
.ins-analysis-header {
  margin-bottom: 18px;
}
.ins-analysis-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
}
.ins-analysis-subtitle {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.ins-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ins-finding {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid;
}
.ins-finding-positive { background: #f0fdf4; border-left-color: #16a34a; }
.ins-finding-negative { background: #fef2f2; border-left-color: #dc2626; }
.ins-finding-neutral  { background: #f8fafc; border-left-color: #6366f1; }
.ins-finding-warning  { background: #fffbeb; border-left-color: #f59e0b; }
.ins-finding-icon {
  font-size: 22px;
  line-height: 1.2;
  flex-shrink: 0;
}
.ins-finding-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.ins-finding-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.ins-finding-text b { color: #111827; }

/* Side-by-side funnel comparison */
.ins-funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ins-funnel-row:last-child { border-bottom: none; }
.ins-funnel-stage {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.ins-funnel-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ins-funnel-bar-wrap {
  background: #f3f4f6;
  border-radius: 6px;
  height: 22px;
  overflow: hidden;
}
.ins-funnel-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.ins-funnel-bar-old { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.ins-funnel-bar-new { background: linear-gradient(90deg, #818cf8, #6366f1); }
.ins-funnel-stats {
  font-size: 12px;
  color: #374151;
  font-weight: 600;
}
.ins-funnel-stats span { color: #6b7280; font-weight: 500; }

@media (max-width: 900px) {
  .ins-kpis { grid-template-columns: 1fr; }
  .ins-funnel-row { grid-template-columns: 1fr; gap: 6px; }
  .ins-periods { flex-direction: column; }
  .ins-period-vs { padding: 6px; }
}
