﻿/* Destaque para campos preenchidos pela IA */
.ia-preenchido {
  background: #fff !important;
  border: 2px solid #2196f3 !important;
  box-shadow: 0 0 0 2px #e3f2fd;
  transition: border 0.2s, box-shadow 0.2s;
}
/* Modal de confirmação de exclusão */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
  min-width: 320px;
}
.modal-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-secondary {
  background: #f4f4f4;
  color: #333;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
}
/* Subtítulo das integrações alinhado à esquerda e em uma linha */
.integrations-subtitle {
  text-align: left;
  white-space: nowrap;
  width: 100%;
  margin-left: 0;
}
/* =================================================================== */
/* === 1. DESIGN SYSTEM - VARIÁVEIS E TOKENS
/* =================================================================== */
:root {
  /* Paleta de Cores Primárias */
  --primary-50: #f0f7ff;
  --primary-100: #e6f0ff;
  --primary-200: #c4d9fb;
  /* requested */
  --primary-300: #8cb6f5;
  --primary-400: #3f8efc;
  --primary-500: #0068e0;
  /* requested primary */
  --primary-600: #005bc3;
  --primary-700: #004ea6;
  --primary-800: #003f85;
  --primary-900: #0b1215;
  /* requested deep */

  /* Cores do Sistema */
  --primary: var(--primary-500);
  --primary-light: var(--primary-100);
  --primary-dark: var(--primary-900);

  /* Cores Neutras */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Cores Semânticas */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --info-50: #eff6ff;
  --info-500: #3b82f6;
  --info-600: #2563eb;

  /* Aplicação das Cores */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-inverse: #ffffff;

  --surface-primary: #ffffff;
  /* #FFFFFF */
  --surface-secondary: #f6f9ff;
  /* subtle light */
  --background: #f7faff;
  --border: var(--gray-200);
  --border-focus: var(--primary-500);

  --success: var(--success-500);
  --warning: var(--warning-500);
  --error: var(--error-500);

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-width-collapsed: 80px;
  --topbar-height: 72px;
  --content-max-width: 1400px;

  /* Espaçamento */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */

  /* Bordas */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transições */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Tipografia */
  --font-family-sans: "DM Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-family-mono: "JetBrains Mono", "Fira Code", monospace;

  --font-size-xs: 0.75rem;
  /* 12px */
  --font-size-sm: 0.875rem;
  /* 14px */
  --font-size-base: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.5rem;
  /* 24px */
  --font-size-3xl: 1.875rem;
  /* 30px */
  --font-size-4xl: 2.25rem;
  /* 36px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
}

body,
button,
input,
select,
textarea {
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

/* Reset e Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  height: 100%;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Tipografia */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-sm);
}

p {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.text-muted {
  color: var(--text-muted);
}

.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

/* =================================================================== */
/* === 2. LAYOUT PRINCIPAL - ARQUITETURA MODERNA
/* =================================================================== */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--background);
}

/* Sidebar Redesenhada */
.sidebar {
  width: var(--sidebar-width-collapsed);
  background: linear-gradient(180deg, #0068e0 0%, #045cc4 100%);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(9, 48, 99, 0.35);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border-top-left-radius: 0;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
}

.sidebar.expanded {
  width: var(--sidebar-width);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
}

/* Layout Principal */
.main-content {
  margin-left: var(--sidebar-width-collapsed);
  width: calc(100% - var(--sidebar-width-collapsed));
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left 300ms cubic-bezier(0.4, 0, 0.2, 1),
    width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  background: var(--background);
  border-top-left-radius: 15px;
}

.main-content.expanded-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}

.sidebar .nav-link-text {
  opacity: 0;
  white-space: nowrap; /* Impede que o texto quebre a linha durante a animação */

  /* Opcional: faz o texto deslizar um pouco */
  transform: translateX(-10px);

  /* Transição para quando ele for RECOLHER */
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}

/* 2. Quando a sidebar expandir... */
.sidebar.expanded .nav-link-text {
  opacity: 1;
  transform: translateX(0);

  /* A MÁGICA: Atraso na transição */
  /* Começa a animar SÓ DEPOIS de 200ms (quando a sidebar já está abrindo) */
  transition-delay: 200ms;
}

/* Container Principal */
.main {
  flex: 1;
  padding: var(--space-8);
  padding-top: 0;
  max-width: 100%;
  margin: 0;
  width: 100%;
}

/* Header da Sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  height: var(--topbar-height);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.sidebar-toggle i {
  transition: transform var(--transition-normal);
}

.sidebar.expanded .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar-logo-mark,
.sidebar-logo-full {
  display: block;
  transition: opacity var(--transition-normal),
    transform var(--transition-normal);
}

.sidebar-logo-mark {
  display: block;
}

.sidebar-logo-full {
  display: none;
  width: 140px;
  height: auto;
}

/* Quando colapsada, empilha o botão acima da logo */
.sidebar:not(.expanded) .sidebar-header {
  flex-direction: column;
  align-items: stretch;
  height: auto;
  gap: var(--space-3);
}

.sidebar:not(.expanded) .sidebar-logo {
  justify-content: center;
}

.sidebar.expanded .sidebar-logo-full {
  display: block;
}

.sidebar.expanded .sidebar-logo-mark {
  display: none;
}

/* Overlay para mobile quando sidebar aberta */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 21, 0.5);
  /* #0B1215 */
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

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

/* Navegação */
.sidebar-nav {
  flex-grow: 1;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  border-radius: var(--radius-lg);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.sidebar:not(.expanded) .nav-link {
  justify-content: center;
  padding: var(--space-3);
}

.sidebar:not(.expanded) .nav-link span {
  display: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(196, 217, 251, 0.65) 100%
  );
  opacity: 0;
  transform: translateX(8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-link.active {
  background: rgba(196, 217, 251, 0.24);
  color: #ffffff;
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px -18px rgba(12, 30, 64, 0.6);
}

.nav-link:hover::after,
.nav-link.active::after {
  opacity: 1;
  transform: translateX(0);
}

.nav-link i {
  width: 20px;
  height: 20px;
  font-size: 1.125rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer da Sidebar */
.sidebar-footer {
  padding: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer .btn.logout-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  padding: 0.65rem 1rem;
  transition: background 0.2s ease, transform 0.15s ease;
}

.sidebar-footer .btn.logout-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.sidebar-footer .btn.logout-trigger i {
  font-size: 1rem;
}

.sidebar-footer .btn.logout-trigger span {
  display: none;
}

.sidebar.expanded .sidebar-footer .btn.logout-trigger span {
  display: inline;
}

.connection-status i {
  font-size: 0.75rem;
}

.version {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.5);
  font-weight: var(--font-weight-medium);
}

/* Responsividade da Sidebar */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .main-content.expanded-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-overlay {
    display: block;
  }
}

@media (min-width: 1025px) {
  .sidebar-overlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

.sidebar:not(.expanded) .sidebar-footer {
  text-align: center;
}

.sidebar:not(.expanded) .sidebar-footer .version {
  display: none;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 0 var(--space-8);
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 104, 224, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.topbar-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-title {
  font-size: 1.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: 1.1;
}

.topbar-title-icon {
  font-size: 1.8rem;
  color: #0068e0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 104, 224, 0.16);
  background: rgba(255, 255, 255, 0.82);
  transition: border var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  width: 220px;
}

.topbar-search i {
  color: rgba(0, 104, 224, 0.65);
}

.topbar-search:focus-within {
  border-color: rgba(0, 104, 224, 0.32);
  box-shadow: 0 0 0 3px rgba(196, 217, 251, 0.4);
  background: rgba(255, 255, 255, 0.94);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 104, 224, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: #0b1215;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
  border-color: rgba(0, 104, 224, 0.32);
  color: #0068e0;
  box-shadow: 0 6px 18px -12px rgba(0, 104, 224, 0.6);
  transform: translateY(-1px);
}

.topbar-icon-btn:focus-visible {
  outline: none;
  border-color: rgba(0, 104, 224, 0.4);
  box-shadow: 0 0 0 3px rgba(196, 217, 251, 0.45);
}

.topbar-icon-btn.spinning i {
  animation: topbarSpin 0.9s linear infinite;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

@keyframes topbarSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1200px) {
  .topbar-search input {
    width: 160px;
  }
}

@media (max-width: 960px) {
  .topbar-search {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }

  .topbar-title-group {
    gap: var(--space-3);
  }
}

/* Topbar Actions */
.profile-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 104, 224, 0.16);
  border-radius: var(--radius-full);
  padding: 0 0.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
  height: 100%;
  border-radius: var(--radius-lg);
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 104, 224, 0.32);
  box-shadow: 0 6px 18px -12px rgba(0, 104, 224, 0.6);
}

.profile-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  flex-shrink: 0;
}

.profile-chevron {
  font-size: 0.75rem;
  color: var(--neutral-500);
  transition: transform 0.3s ease;
}

.profile-btn:hover .profile-chevron {
  transform: rotate(180deg);
}

.profile-btn.active,
.profile-btn:focus-visible {
  background: rgba(196, 217, 251, 0.35);
  border-color: rgba(0, 104, 224, 0.4);
  box-shadow: 0 0 0 3px rgba(196, 217, 251, 0.45);
}

.profile-btn.active .profile-chevron {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 190px;
  max-width: 240px;
  width: max-content;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  z-index: 200;
}

.profile-menu-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-size-sm);
}

.profile-menu-label {
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.profile-menu-email {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  word-break: break-word;
}

.profile-menu-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-3) 0;
}

.profile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.profile-menu-danger {
  color: #b91c1c;
}

.profile-menu-item.profile-menu-danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-menu-item:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.profile-menu-item i {
  color: inherit;
}

/* Páginas */
.page-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page-content.visible {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =================================================================== */
/* === 3. SISTEMA DE COMPONENTES MODERNO
/* =================================================================== */

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid rgba(0, 104, 224, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  /* visual arredondado no topo */
  mask-image: radial-gradient(circle at top left, black 15px, black 0),
    radial-gradient(circle at top right, black 15px, black 0);
  -webkit-mask-image: radial-gradient(circle at top left, black 15px, black 0),
    radial-gradient(circle at top right, black 15px, black 0);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-200),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

.card:hover::before {
  opacity: 1;
}

/* KPI Cards */
.kpi-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  flex: 1 1 280px;
  min-height: 120px;
  position: relative;
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.kpi-card:last-child::after {
  display: none;
}

.kpi-card .icon-wrapper {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  color: var(--text-inverse);
  font-size: var(--font-size-xl);
  flex-shrink: 0;
  background: #0068e0;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
  position: relative;
}

.kpi-card .icon-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
}

.kpi-card .kpi-details {
  flex: 1;
}

.kpi-card .kpi-details span {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  display: block;
  margin-bottom: var(--space-1);
}

.kpi-card .kpi-details h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.kpi-card .kpi-details small {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

/* Sistema de Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Variantes de Botões */
.btn-primary {
  background: #0068e0;
  color: var(--text-inverse);
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
  border-radius: 12px;
}

.btn-primary:hover {
  background: #005bc3;
  box-shadow: 0 12px 32px rgba(0, 104, 224, 0.4);
  transform: translateY(-4px);
}

.btn-secondary {
  background: var(--surface-primary);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-500), var(--error-600));
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--error-600), var(--error-600));
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
  color: var(--text-inverse);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--success-600), var(--success-600));
  transform: translateY(-1px);
}

/* Tamanhos de Botões */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  gap: var(--space-1);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-base);
  gap: var(--space-3);
}

/* Botão Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* Sistema de Formulários */
.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-control,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* Estados de Input */
.form-control.error {
  border-color: var(--error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.success {
  border-color: var(--success-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* =================================================================== */
/* === 4. PÁGINAS ESPECÍFICAS - LAYOUT MODERNO
/* =================================================================== */

/* Dashboard */
.dashboard-header,
.products-header,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1,
.products-header h1,
.section-header h1 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin: 0;
}

#flow-selector .section-header {
  justify-content: flex-start;
}

#flow-selector .section-header h1 {
  margin-left: var(--space-4);
}

/* KPIs Layout */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.kpis-left {
  display: contents;
}

.kpi-range-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface-primary);
  border: 1px solid var(--border);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  min-width: 200px;
  grid-column: -1;
}

.kpi-range-wrapper label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-range-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

/* #distributionChart .apexcharts-datalabel-value {
  color: #0068E0 !important;
  font-size: 2.2rem !important;
  font-weight: bold !important;
} Containers */
.chart-block {
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
}

.chart-block h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}

#activityHeatmapCard .chart-container {
  min-height: 420px;
}

/* Goal details styling */
.goal-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-4) 0;
  padding: var(--space-3);
  background-color: var(--neutral-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
}

.goal-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.goal-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--neutral-600);
  margin-bottom: var(--space-1);
}

.goal-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-900);
}

/* === NOVO LAYOUT DASHBOARD === */

/* KPIs Horizontais - Design Aprimorado */
.dashboard-kpis-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
  width: 100%;
  margin-top: 15px;
}

.kpi-card-enhanced {
  background: #ffffff;
  border: 1px solid rgba(0, 104, 224, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 220px;
}

.kpi-card-enhanced:hover {
  border-color: var(--primary-300);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
}

.kpi-card-enhanced::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0068e0, #045cc4);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  background: linear-gradient(135deg, #0068e0, #045cc4);
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(14, 165, 233, 0.3);
}

.kpi-icon.success {
  background: #0068e0;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
}

.kpi-icon.warning {
  background: #0068e0;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
}

.kpi-icon.info {
  background: #0068e0;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
}

.kpi-icon.filter {
  background: #0068e0;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
}

.kpi-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}

.kpi-label {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: var(--neutral-600);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  order: 1;
  white-space: nowrap;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3b82f6;
  line-height: 1.1;
  order: 2;
  margin: var(--space-1) 0;
}

.kpi-variation {
  font-size: 10px;
  color: var(--neutral-500);
  font-weight: 500;
  order: 3;
  white-space: nowrap;
}

.filter-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(196, 217, 251, 0.35) 100%
  );
  border-color: rgba(0, 104, 224, 0.12);
}

.filter-card .kpi-content {
  gap: var(--space-2);
  justify-content: center;
  align-items: flex-start;
}

.filter-card .kpi-label {
  order: 1;
  margin-bottom: var(--space-2);
}

.filter-select-enhanced {
  width: 100%;
  max-width: 140px;
  padding: var(--space-2);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  background: white;
  color: var(--neutral-700);
  font-family: var(--font-family-sans);
  order: 2;
}

/* Novo Grid Layout - Gráficos + Agente */
.new-dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  grid-template-areas: "charts insights";
  min-height: 800px;
}

.charts-container {
  grid-area: charts;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  height: 400px;
}

/* === DASHBOARD PRINCIPAL REFEITO === */
.dashboard-main {
  margin-top: var(--space-4);
  width: 100%;
}

/* ===== DASHBOARD 2x5 GRID - SEM SCROLL - LAYOUT FIXO ===== */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: calc(100vh - 160px); /* viewport menos header/KPIs */
  overflow: hidden; /* SEM SCROLL */
  padding: 0;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  flex-shrink: 0; /* Não permitir redimensionamento */
}

/* LINHA 1: Altura fixa 330px */
.dashboard-row:first-child {
  height: 330px;
}

.dashboard-row:first-child .chart-widget {
  height: 330px;
  max-height: 330px;
  overflow: hidden;
}

/* LINHA 2: Altura fixa 310px (+60px) */
.dashboard-row:last-child {
  height: 310px;
}

.dashboard-row:last-child .chart-widget {
  height: 310px;
  max-height: 310px;
  overflow: hidden;
}

.dashboard-col-1 {
  grid-column: span 1;
}

.dashboard-col-2 {
  grid-column: span 2;
}

/* ===== WIDGETS COMPACTOS ===== */
.chart-widget {
  background: #ffffff;
  border: 1px solid rgba(0, 104, 224, 0.12);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 0;
}

/* CABEÇALHO COMPACTO */
.widget-header {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 104, 224, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  min-height: 42px;
  max-height: 42px;
}

.widget-title h3 {
  font-size: 14px !important;
  font-weight: 600;
  margin: 0 !important;
  color: #1e293b;
  line-height: 1.2;
}

.widget-title p {
  font-size: 11px !important;
  color: #64748b;
  margin: 2px 0 0 0 !important;
  line-height: 1.2;
}

.widget-actions {
  display: flex;
  gap: 4px;
}

.widget-actions .btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* CONTEÚDO */
.widget-content {
  flex: 1;
  overflow: hidden;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.chart-container {
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* ===== MELHORIA VISUAL DOS GRÁFICOS - ESTILO SAAS PREMIUM ===== */

/* TIPOGRAFIA REFINADA PARA GRÁFICOS */
.chart-container {
  flex: 1;
  min-height: 0;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
}

/* Títulos de eixos e labels */
.chart-container text {
  font-size: 11px !important;
  fill: #64748b !important;
  font-weight: 400;
}

/* Valores principais dos gráficos */
.chart-container .value-label {
  font-size: 13px !important;
  fill: #0f172a !important;
  font-weight: 600;
}

/* LINHA 1: Gráfico de Linha Premium (Shopify/Vercel style) */
.dashboard-row:first-child .chart-primary .chart-container {
  height: 260px !important;
  max-height: 260px;
}

/* Estilos ApexCharts - Gráfico de Linha */
.apexcharts-line {
  stroke-width: 2px !important;
  stroke-linecap: round !important;
}

/* Sombra azul na linha do gráfico */
.chart-primary .apexcharts-series path,
.chart-primary .apexcharts-line-series path {
  filter: drop-shadow(0 3px 10px rgba(59, 130, 246, 0.6)) !important;
}

.apexcharts-area {
  fill-opacity: 0.08 !important;
}

.apexcharts-gridline {
  stroke: #e2e8f0 !important;
  stroke-opacity: 0.5 !important;
  stroke-dasharray: 3 !important;
}

.apexcharts-xaxis-label,
.apexcharts-yaxis-label {
  fill: #64748b !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}

.apexcharts-tooltip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
}

.apexcharts-tooltip-title {
  background: transparent !important;
  border: none !important;
  font-size: 11px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  padding: 0 0 4px 0 !important;
  margin: 0 !important;
}

.apexcharts-tooltip-series-group {
  padding: 4px 0 !important;
}

.apexcharts-tooltip-text-y-value {
  font-weight: 600 !important;
  color: #0f172a !important;
  font-size: 13px !important;
}

.apexcharts-legend {
  padding: 8px 0 0 0 !important;
}

.apexcharts-legend-text {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}

.apexcharts-legend-marker {
  border-radius: 2px !important;
  margin-right: 6px !important;
}

/* Remover markers/pontos por padrão (mais clean) */
.apexcharts-marker {
  stroke-width: 0 !important;
}

/* Mostrar markers apenas no hover */
.apexcharts-series:hover .apexcharts-marker {
  stroke-width: 2 !important;
  stroke: #ffffff !important;
  r: 4 !important;
}

/* LINHA 1: Top Subcategorias - Tabela Elegante (Linear/Stripe style) */
.table-widget {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(224, 242, 254, 0.5) 100%
  );
}

.dashboard-row:first-child .table-widget {
  min-height: 330px !important;
  max-height: 330px !important;
  height: 330px !important;
}

.table-widget .widget-content {
  padding: 0 !important;
  overflow-y: auto;
}

/* Scrollbar elegante */
.table-widget .widget-content::-webkit-scrollbar {
  width: 6px;
}

.table-widget .widget-content::-webkit-scrollbar-track {
  background: transparent;
}

.table-widget .widget-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.table-widget .widget-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.top-subcategories-table {
  width: 100%;
  font-size: 11px;
  margin: 0;
  border-collapse: collapse;
}

.top-subcategories-table thead th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: left;
  color: #475569;
}

.top-subcategories-table tbody tr {
  transition: background-color 0.15s ease;
}

.top-subcategories-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.top-subcategories-table tbody tr:hover {
  background-color: #f1f5f9;
}

.top-subcategories-table tbody td {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-weight: 400;
}

.top-subcategories-table tbody td:first-child {
  font-weight: 500;
  color: #0f172a;
}

.top-subcategories-table tbody td:last-child {
  color: #64748b;
  font-size: 11px;
}

/* Badge para números */
.top-subcategories-table .count-badge {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  color: #ffffff;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* LINHA 1: Meta Mensal - Progress elegante (Vercel style) */
.chart-goal .goal-setup {
  padding: 6px 0;
  margin-bottom: 8px;
}

.chart-goal .goal-input-group label {
  font-size: 11px;
  margin-bottom: 4px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chart-goal .goal-input-group input {
  height: 34px;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #0f172a;
}

.chart-goal .goal-input-group input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.chart-goal .btn-action {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-goal .btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chart-goal .goal-metrics {
  display: flex;
  gap: 8px;
  padding: 8px 0 0 0;
  flex-wrap: wrap;
}

.chart-goal .goal-metric {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.chart-goal .goal-metric:hover {
  background: #f1f5f9;
}

.chart-goal .goal-metric-label {
  font-size: 10px;
  color: #64748b;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chart-goal .goal-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  display: block;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chart-goal #goalProgressChart {
  height: 200px !important;
  max-height: 200px;
}

/* Semicírculo 180° com visual profissional */
.chart-goal .apexcharts-radialbar-track {
  stroke: #e2e8f0 !important;
  stroke-width: 18 !important;
  opacity: 1 !important;
}

.chart-goal .apexcharts-radialbar-area {
  stroke-width: 18 !important;
  filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.4));
}

/* Background do centro */
.chart-goal .apexcharts-radialbar-hollow {
  fill: #ffffff !important;
}

/* LINHA 1: Distribuição (Donut Chart Premium - Moderno) */
.chart-distribution .chart-container {
  height: 260px !important;
  max-height: 260px;
}

/* Donut Chart com visual profissional */
.chart-distribution .apexcharts-pie-series path {
  stroke: #ffffff !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0 3px 8px rgba(59, 130, 246, 0.15));
  transition: all 0.3s ease;
}

.chart-distribution .apexcharts-pie-series path:hover {
  filter: drop-shadow(0 6px 16px rgba(59, 130, 246, 0.3));
  transform: scale(1.02);
}

.chart-distribution .apexcharts-datalabels-group text {
  font-weight: 700 !important;
  fill: #0f172a !important;
}

.chart-distribution .apexcharts-datalabel-label {
  font-size: 13px !important;
  fill: #64748b !important;
  font-weight: 600 !important;
}

.chart-distribution .apexcharts-datalabel-value {
  font-size: 28px !important;
}

.apexcharts-datalabel-label {
  font-size: 11px !important;
  fill: #64748b !important;
  font-weight: 500 !important;
}

/* LINHA 2: Canais de Venda - Cards organizados (SEM SCROLL) */
.sales-channels-carousel {
  height: 240px;
  overflow: hidden; /* SEM SCROLL - apenas setas */
  padding: 2px;
  position: relative;
}

/* Remove scrollbar completamente */
.sales-channels-carousel::-webkit-scrollbar {
  display: none;
}

#salesChannelsTrack {
  display: flex;
  gap: 12px;
  transition: transform 0.3s ease;
}

.sales-channel-card {
  display: flex;
  flex-direction: column;
  min-width: 260px;
  height: 230px !important;
  padding: 18px !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  flex-shrink: 0;
}

.sales-channel-card:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15) !important;
  transform: translateY(-3px) !important;
}

/* Header do card com ícone e informações */
.sales-channel-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

/* Logo Wrapper - Container para logo ou ícone */
.sales-channel-logo-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* Logo oficial do canal */
.channel-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* Ícone fallback (quando não houver logo) */
.sales-channel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sales-channel-header > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-channel-header strong {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.3;
  display: block;
}

.sales-channel-header span {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.3;
  display: block;
}

/* Métricas do card */
.sales-channel-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
  flex: 1;
}

.sales-channel-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sales-channel-metric span {
  font-size: 10px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sales-channel-metric strong {
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Status badge */
.sales-channel-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #e0f2fe;
  align-self: flex-start;
}

/* Empty state */
.empty-sales-channels {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 13px;
  font-style: italic;
}

/* LINHA 2: Completude - Layout Grid Moderno */
.completeness-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  height: 100%;
}

.completeness-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.completeness-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.completeness-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  font-size: 18px;
}

.completeness-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.completeness-card-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.completeness-card-value {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.completeness-health-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(37, 99, 235, 0.08) 100%
  );
  border: 2px solid #3b82f6;
  border-radius: 10px;
}

.completeness-health-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.completeness-health-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.completeness-health-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.completeness-health-value strong {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.completeness-health-status {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.completeness-highlights {
  list-style: none;
  padding: 12px 0 0 0;
  margin: 0;
  font-size: 11px;
  max-height: 80px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.completeness-highlights::-webkit-scrollbar {
  width: 4px;
}

.completeness-highlights::-webkit-scrollbar-track {
  background: transparent;
}

.completeness-highlights::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.completeness-highlights li {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.completeness-highlights li:last-child {
  border-bottom: none;
}

.completeness-highlights li::before {
  content: "→";
  color: #3b82f6;
  font-weight: 600;
  font-size: 12px;
  font-size: 14px;
}

/* LINHA 2: Importações - Layout em Cards Moderno */
.import-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.import-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
  min-height: 70px;
}

.import-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.import-card.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  min-height: 76px;
}

.import-card.secondary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.import-card.tertiary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.import-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 20px;
}

.import-card.primary .import-card-icon {
  color: white;
}

.import-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.import-card-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-card.primary .import-card-label {
  color: rgba(255, 255, 255, 0.9);
}

.import-card.secondary .import-card-label,
.import-card.tertiary .import-card-label {
  color: #64748b;
}

.import-card-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-card.primary .import-card-value {
  color: white;
}

.import-card.secondary .import-card-value,
.import-card.tertiary .import-card-value {
  color: #0f172a;
}

.import-timestamp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.import-timestamp i {
  color: #3b82f6;
  font-size: 14px;
}

/* LINHA 1: Top Subcategorias (tabela compacta) */
.table-widget {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(224, 242, 254, 0.5) 100%
  );
}

.dashboard-row:first-child .table-widget {
  min-height: 330px !important;
  max-height: 330px !important;
  height: 330px !important;
}

.table-widget .widget-content {
  padding: 0 !important;
  overflow-y: auto;
}

.top-subcategories-table {
  width: 100%;
  font-size: 11px;
  margin: 0;
  border-collapse: collapse;
}

.top-subcategories-table thead th {
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: left;
}

.top-subcategories-table tbody td {
  padding: 6px 8px;
  font-size: 11px;
  border-bottom: 1px solid #f1f5f9;
}

/* LINHA 1: Meta Mensal (330px - compacto) */
.chart-goal .goal-setup {
  padding: 6px 0;
  margin-bottom: 8px;
}

.chart-goal .goal-input-group label {
  font-size: 11px;
  margin-bottom: 4px;
}

.chart-goal .goal-input-group input {
  height: 32px;
  font-size: 12px;
  padding: 4px 8px;
}

.chart-goal .goal-metrics {
  display: flex;
  gap: 8px;
  padding: 8px 0 0 0;
  flex-wrap: wrap;
}

.chart-goal .goal-metric {
  flex: 1;
  min-width: 70px;
  text-align: center;
}

.chart-goal .goal-metric-label {
  font-size: 10px;
  color: #64748b;
  display: block;
  margin-bottom: 2px;
}

.chart-goal .goal-metric-value {
  font-size: 16px;
  font-weight: 700;
  color: #0ea5e9;
  display: block;
}

.chart-goal #goalProgressChart {
  height: 180px !important;
  max-height: 180px;
}

/* LINHA 1: Distribuição (Donut Chart - 330px) */
.chart-distribution .chart-container {
  height: 260px !important;
  max-height: 260px;
}

/* Responsividade */
@media (max-width: 1440px) {
  .dashboard-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1200px) {
  .dashboard-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-col-2 {
    grid-column: span 3;
  }
}

@media (max-width: 960px) {
  .dashboard-main {
    height: auto;
    overflow-y: auto;
  }

  .dashboard-row {
    grid-template-columns: repeat(2, 1fr);
    height: auto !important;
  }

  .dashboard-row:first-child .chart-widget,
  .dashboard-row:last-child .chart-widget {
    height: auto !important;
    max-height: none !important;
  }

  .dashboard-col-1,
  .dashboard-col-2 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .dashboard-col-1,
  .dashboard-col-2 {
    grid-column: span 1;
  }
}

/* MANTER GRID ANTIGO PARA COMPATIBILIDADE */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
  width: 100%;
  align-items: stretch;
}

.grid-span-2 {
  grid-column: span 2;
}

@media (max-width: 1440px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-span-2 {
    grid-column: span 3;
  }
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .grid-span-2 {
    grid-column: span 1;
  }
}

.chart-widget {
  background: #ffffff;
  border: 1px solid rgba(0, 104, 224, 0.12);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.chart-primary {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(196, 217, 251, 0.55) 100%
  );
}

/* OVERRIDE: Forçar altura fixa no dashboard 2x5 */
.dashboard-row:first-child .chart-primary {
  min-height: 330px !important;
  max-height: 330px !important;
  height: 330px !important;
}

.chart-secondary {
  grid-column: span 4;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(196, 217, 251, 0.35) 100%
  );
}

.chart-distribution {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(196, 217, 251, 0.45) 100%
  );
}

/* OVERRIDE: Forçar altura fixa no dashboard 2x5 */
.dashboard-row:first-child .chart-distribution {
  min-height: 330px !important;
  max-height: 330px !important;
  height: 330px !important;
}

.chart-goal {
  background: linear-gradient(
    135deg,
    rgba(240, 249, 255, 0.95) 0%,
    rgba(191, 219, 254, 0.55) 100%
  );
}

/* OVERRIDE: Forçar altura fixa no dashboard 2x5 */
.dashboard-row:first-child .chart-goal {
  min-height: 330px !important;
  max-height: 330px !important;
  height: 330px !important;
}

.chart-funnel {
  grid-column: span 4;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.5);
}

.widget-title h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: var(--space-1);
  font-family: var(--font-family-sans);
}

.widget-title p {
  font-size: var(--font-sm);
  color: var(--neutral-500);
  font-family: var(--font-family-sans);
}

.widget-actions {
  display: flex;
  gap: var(--space-2);
}

:root[data-theme="dark"] .widget-header {
  background: rgba(6, 12, 26, 0.92);
  border-bottom: 1px solid rgba(28, 43, 72, 0.65);
}

:root[data-theme="dark"] .widget-title h3 {
  color: rgba(226, 232, 240, 0.96);
}

:root[data-theme="dark"] .widget-title p {
  color: rgba(148, 163, 184, 0.78);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-300);
  background: white;
  color: var(--neutral-600);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: var(--font-sm);
}

.btn-icon:hover {
  background: var(--neutral-50);
  color: var(--primary-600);
  border-color: var(--primary-300);
}

.widget-content {
  padding: var(--space-3);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chart-container {
  min-height: 200px;
  flex: 1;
}

.table-widget .widget-content {
  overflow-x: auto;
}

.top-subcategories-table {
  width: 100%;
  border-collapse: collapse;
}

.top-subcategories-table th {
  text-transform: uppercase;
  font-size: var(--font-xs);
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.top-subcategories-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.95rem;
  color: var(--neutral-800);
}

.top-subcategories-table td:nth-child(2),
.top-subcategories-table td:nth-child(3) {
  text-align: center;
  font-weight: 600;
}

.top-subcategories-table tbody tr:last-child td {
  border-bottom: none;
}

.subcategory-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-600);
  font-weight: 600;
  margin-right: var(--space-2);
  font-size: 0.85rem;
}

.trend-positive {
  color: var(--success-600);
}

.trend-negative {
  color: var(--danger-600);
}

.top-subcategories-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sales-channels-widget .widget-content {
  padding-right: var(--space-2);
}

.sales-channels-carousel {
  position: relative;
  display: flex;
  overflow: hidden;
}

.sales-channels-track {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
  width: 100%;
}

.sales-channels-track::-webkit-scrollbar {
  display: none;
}

.empty-sales-channels {
  width: 100%;
  padding: var(--space-3);
  color: var(--neutral-500);
  font-size: var(--font-sm);
}

.sales-channel-card {
  flex: 0 0 240px;
  background: rgba(248, 250, 255, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
}

.sales-channel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sales-channel-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

.sales-channel-header strong {
  font-size: 1rem;
  color: var(--neutral-900);
}

.sales-channel-header span {
  display: block;
  font-size: var(--font-xs);
  color: var(--neutral-500);
}

.sales-channel-metrics {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.sales-channel-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sales-channel-metric span {
  font-size: var(--font-xs);
  color: var(--neutral-500);
}

.sales-channel-metric strong {
  font-size: 1.1rem;
  color: var(--neutral-900);
}

.sales-channel-status {
  align-self: flex-start;
  font-size: var(--font-xs);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-700);
  font-weight: 600;
}

.carousel-actions .btn-icon {
  background: rgba(255, 255, 255, 0.9);
}

.completeness-widget .widget-content {
  gap: var(--space-4);
}

.completeness-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.completeness-item,
.completeness-score {
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: rgba(248, 250, 255, 0.8);
}

.completeness-item span.label {
  font-size: var(--font-xs);
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.completeness-item strong {
  font-size: 1.8rem;
  color: var(--neutral-900);
}

.completeness-score {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.12),
    rgba(59, 130, 246, 0.12)
  );
}

.completeness-score strong {
  font-size: 2rem;
  color: var(--primary-700);
}

.completeness-score small {
  font-size: var(--font-xs);
  color: var(--neutral-600);
}

.completeness-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.completeness-highlights li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--neutral-600);
}

.completeness-highlights li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-600);
  flex-shrink: 0;
}

.import-widget .widget-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible !important;
  padding: 16px !important;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.import-stat {
  background: rgba(248, 250, 255, 0.8);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.import-stat span {
  font-size: var(--font-xs);
  text-transform: uppercase;
  color: var(--neutral-500);
  letter-spacing: 0.04em;
}

.import-stat strong {
  font-size: 1.4rem;
  color: var(--neutral-900);
}

.import-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--neutral-500);
}

.import-meta i {
  color: var(--primary-500);
}

.import-recent h4 {
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  margin-bottom: var(--space-2);
}

.import-recent ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.import-recent li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--neutral-800);
}

.chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4),
    0 4px 8px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  pointer-events: all !important;
}

.chat-bubble::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.6),
    rgba(59, 130, 246, 0.6)
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chat-bubble:hover::before {
  opacity: 1;
}

.chat-bubble:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5),
    0 6px 12px rgba(37, 99, 235, 0.3);
}

.chat-bubble i {
  font-size: 26px;
  transition: transform 0.3s ease;
}

.chat-bubble:hover i {
  transform: scale(1.1);
}

/* Tooltip que aparece no hover */
.chat-bubble-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.chat-bubble-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #1e293b;
}

.chat-bubble:hover .chat-bubble-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.chat-bubble-tooltip strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}

.chat-bubble-tooltip span {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}

.chat-bubble:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

/* Animação de pulsação sutil */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4),
      0 4px 8px rgba(37, 99, 235, 0.2);
  }
  50% {
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.5),
      0 4px 12px rgba(37, 99, 235, 0.3);
  }
}

.chat-bubble {
  animation: pulse-glow 3s ease-in-out infinite;
}

@media (max-width: 1280px) {
  .completeness-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .sales-channel-card {
    flex: 0 0 220px;
  }

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

@media (max-width: 640px) {
  .completeness-kpis {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    right: var(--space-4);
    left: var(--space-4);
    bottom: var(--space-4);
    justify-content: center;
  }
}
.chart-secondary .chart-container,
.chart-goal .chart-container,
.chart-distribution .chart-container {
  min-height: 160px;
}

/* Performance Widget */
.performance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.metric-item {
  text-align: center;
  padding: var(--space-3);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(196, 217, 251, 0.3) 100%
  );
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 104, 224, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
}

.metric-label {
  display: block;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--neutral-600);
  margin-bottom: var(--space-1);
  font-family: var(--font-family-sans);
}

.metric-value {
  display: block;
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--primary-600);
  font-family: var(--font-family-sans);
}

.metric-trend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--success-600);
  font-family: var(--font-family-sans);
}

.metric-trend.negative {
  color: var(--error-600);
}

.mini-chart {
  height: 60px;
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  position: relative;
}

@media (max-width: 640px) {
  .performance-metrics {
    grid-template-columns: 1fr;
  }
}

/* Goal Widget */
.goal-setup {
  margin-bottom: var(--space-4);
}

.goal-input-group label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
  font-family: var(--font-family-sans);
}

.input-with-action {
  display: flex;
  gap: var(--space-2);
}

.form-input {
  flex: 1;
  padding: var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-family: var(--font-family-sans);
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.btn-action {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: #0068e0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: #005bc3;
}

.goal-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.goal-metric {
  text-align: center;
  padding: var(--space-2);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(245, 213, 140, 0.4) 100%
  );
  border-radius: var(--radius-md);
}

.goal-metric-label {
  display: block;
  font-size: var(--font-xs);
  color: var(--neutral-600);
  margin-bottom: var(--space-1);
  font-family: var(--font-family-sans);
}

.goal-metric-value {
  display: block;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--warning-600);
  font-family: var(--font-family-sans);
}

/* AI Assistant Section */
.ai-assistant-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ai-assistant-card.is-disabled {
  background: linear-gradient(
    135deg,
    rgba(248, 250, 255, 0.72) 0%,
    rgba(219, 234, 254, 0.32) 100%
  );
  border: 1px dashed rgba(37, 99, 235, 0.25);
  box-shadow: none;
  cursor: not-allowed;
}

.ai-assistant-card.is-disabled .assistant-card__header,
.ai-assistant-card.is-disabled .assistant-card__body,
.ai-assistant-card.is-disabled .assistant-disabled-placeholder {
  opacity: 0.6;
}

.ai-assistant-card.is-disabled .assistant-card__body {
  pointer-events: none;
}

.assistant-disabled-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.assistant-disabled-placeholder i {
  font-size: 2.4rem;
  color: rgba(37, 99, 235, 0.65);
}

.assistant-disabled-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 340px;
}

.assistant-disabled-copy h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.assistant-disabled-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.assistant-coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot.offline {
  background-color: rgba(107, 114, 128, 0.65);
}

.assistant-placeholder {
  display: none !important;
}

.ai-assistant-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-4);
  background: linear-gradient(
    135deg,
    rgba(248, 250, 255, 0.96) 0%,
    rgba(219, 234, 254, 0.65) 100%
  );
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  width: 100%;
  min-height: 320px;
}

.assistant-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  margin: calc(-1 * var(--space-5));
  margin-bottom: 0;
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  background: linear-gradient(180deg, #0068e0 0%, #045cc4 100%);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  color: #fff;
}

.assistant-card__avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 20px -12px rgba(37, 99, 235, 0.6);
}

.assistant-card__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.assistant-card__label {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
}

.assistant-card__title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: #fff;
}

.assistant-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

:root[data-theme="dark"] .ai-assistant-card {
  background: linear-gradient(
    160deg,
    rgba(8, 12, 28, 0.96) 0%,
    rgba(12, 26, 63, 0.92) 45%,
    rgba(17, 45, 106, 0.78) 100%
  );
  border: 1px solid rgba(37, 99, 235, 0.32);
  box-shadow: 0 28px 48px -28px rgba(17, 43, 89, 0.85);
}

:root[data-theme="dark"] .assistant-card__header {
  background: linear-gradient(
    185deg,
    rgba(14, 44, 101, 0.95) 0%,
    rgba(30, 64, 175, 0.9) 100%
  );
  border-bottom-color: rgba(59, 130, 246, 0.35);
}

:root[data-theme="dark"] .assistant-card__meta,
:root[data-theme="dark"] .assistant-card__label,
:root[data-theme="dark"] .assistant-card__status {
  color: rgba(226, 232, 240, 0.9);
}

:root[data-theme="dark"] .assistant-card__refresh {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.65);
  color: rgba(226, 232, 240, 0.95);
}

:root[data-theme="dark"] .assistant-card__refresh:hover {
  background: rgba(30, 58, 138, 0.78);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success-500);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.assistant-card__refresh {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.assistant-card__refresh:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg);
}

.assistant-card__body {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-4);
  align-content: stretch;
  height: 100%;
}

.assistant-card__body > .assistant-pane {
  height: auto;
}

.assistant-card__body > .assistant-pane--insights,
.assistant-card__body > .assistant-pane--chat {
  min-height: 0;
}

.assistant-pane {
  background: rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.assistant-pane__title h4 {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.assistant-pane__subtitle {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

:root[data-theme="dark"] .assistant-pane {
  background: rgba(7, 14, 30, 0.92);
  border-color: rgba(37, 69, 141, 0.32);
  box-shadow: inset 0 1px 0 rgba(96, 165, 250, 0.12);
}

:root[data-theme="dark"] .assistant-pane__title h4 {
  color: rgba(226, 232, 240, 0.95);
}

:root[data-theme="dark"] .assistant-pane__subtitle {
  color: rgba(148, 163, 184, 0.78);
}

:root[data-theme="dark"] .quick-btn {
  background: rgba(17, 34, 70, 0.7);
  border-color: rgba(59, 130, 246, 0.32);
  color: rgba(191, 219, 254, 0.92);
}

:root[data-theme="dark"] .quick-btn:hover {
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.95);
  box-shadow: 0 10px 18px -16px rgba(59, 130, 246, 0.7);
}

.assistant-pane--insights .insights-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.assistant-pane--chat {
  gap: var(--space-3);
}

.assistant-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.quick-btn {
  font-size: var(--font-size-xs);
  padding: var(--space-1) var(--space-3);
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #2563eb;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 600;
}

.quick-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 10px 18px -16px rgba(37, 99, 235, 0.7);
}

.chat-messages {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-right: var(--space-1);
}

.message {
  display: flex;
  gap: var(--space-3);
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: var(--gray-200);
  color: var(--gray-700);
}

.message-content {
  flex: 1;
}

.message-content p {
  margin: 0;
  background: rgba(219, 234, 254, 0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.5;
}

.assistant-message .message-content p {
  background: rgba(219, 234, 254, 0.6);
}

.user-message .message-content p {
  background: rgba(248, 250, 255, 0.9);
}

/* Indicador de digitação */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-3);
  background: rgba(219, 234, 254, 0.6);
  border-radius: var(--radius-lg);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-input-wrapper {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.chat-input {
  flex: 1;
  padding: var(--space-3);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-lg);
  background: #fff;
  font-size: var(--font-size-sm);
}

.chat-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(191, 219, 254, 0.6);
}

.btn-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 10px 24px -18px rgba(37, 99, 235, 0.7);
}

.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -20px rgba(37, 99, 235, 0.85);
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.insight-card {
  background: rgba(248, 250, 255, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: all var(--transition-fast);
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
}

.insight-card h5 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-1) 0;
}

.insight-card p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

.insight-card .insight-type {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-1);
  display: block;
}

@media (min-width: 1080px) {
  .assistant-card__body {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ai-assistant-card {
    padding: var(--space-4);
  }

  .assistant-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .assistant-card__refresh {
    align-self: flex-end;
  }
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.charts-main-column {
  flex: 1;
}

.charts-main-column .card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(59, 130, 246, 0.1);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}

.charts-main-column .chart-header {
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.05),
    rgba(16, 185, 129, 0.05)
  );
  margin: -var(--space-4) -var(--space-4) var(--space-4) -var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.charts-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.chart-card {
  min-height: 400px;
  position: relative;
  overflow: hidden;
}

.chart-card .card {
  transition: all 0.3s ease;
  position: relative;
}

.chart-card .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chart-card .card:hover::before {
  opacity: 1;
}

.insights-column {
  display: flex;
  flex-direction: column;
}

.insights-panel {
  padding: var(--space-4);
  height: fit-content;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.insights-header h2 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: var(--space-1);
  font-family: var(--font-family-sans);
}

.insights-header h3 {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--neutral-600);
  margin-bottom: var(--space-4);
  font-family: var(--font-family-sans);
}

.insight-item {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(196, 217, 251, 0.35) 100%
  );
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-500);
}

.insight-item h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--neutral-900);
  margin: 0 0 var(--space-2) 0;
}

:root[data-theme="dark"] .insight-item h4 {
  color: rgba(226, 232, 240, 0.95);
}

:root[data-theme="dark"] .insight-item p {
  color: rgba(148, 163, 184, 0.78);
}

.insight-item p {
  font-size: var(--text-sm);
  color: var(--neutral-600);
  margin: 0;
  line-height: 1.4;
}

.chat-area {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
}

.chat-input {
  flex: 1;
  padding: var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.chat-send {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* Insights Panel Redesenhado */
.insights-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.insights-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 500px;
  overflow-y: auto;
  padding-right: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.insights-list::-webkit-scrollbar {
  width: 4px;
}

.insights-list::-webkit-scrollbar-track {
  background: transparent;
}

.insights-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

.insight-item {
  background: var(--surface-primary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-fast);
  position: relative;
  animation: slideInUp 0.3s ease-out;
}

.insight-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-300);
}

.insight-item.info {
  border-left-color: var(--primary-500);
  background: linear-gradient(
    135deg,
    var(--primary-50),
    var(--surface-primary)
  );
}

.insight-item.warning {
  border-left-color: var(--warning-500);
  background: linear-gradient(
    135deg,
    var(--warning-50),
    var(--surface-primary)
  );
}

.insight-item.alert {
  border-left-color: var(--error-500);
  background: linear-gradient(135deg, var(--error-50), var(--surface-primary));
}

.insight-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--line-height-tight);
}

.insight-message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-normal);
}

.insight-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.insight-chip {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: var(--gray-100);
  color: var(--text-secondary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.insight-item.alert .insight-chip {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-700);
  border-color: rgba(239, 68, 68, 0.2);
}

.insight-item.warning .insight-chip {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-700);
  border-color: rgba(245, 158, 11, 0.2);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ApexCharts Customizations */
.apexcharts-canvas {
  width: 100% !important;
  height: auto !important;
}

.apexcharts-legend-series span {
  font-size: var(--font-size-xs) !important;
  font-weight: var(--font-weight-medium) !important;
}

.apexcharts-tooltip {
  background: var(--surface-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-lg) !important;
}

/* ====================================
   PÁGINA DE IDENTIFICAÇÃO DE PRODUTOS
   ==================================== */

/* Step Management */
.identify-step {
  display: none;
  animation: fadeIn 0.4s ease-in;
}

.identify-step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Vertical Selector */
.vertical-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.vertical-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid var(--border);
  background: var(--surface-primary);
  position: relative;
  overflow: hidden;
}

.vertical-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.vertical-card:hover::before {
  transform: scaleX(1);
}

.vertical-card:hover {
  border-color: var(--primary-200);
  background: var(--primary-25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.vertical-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: #0068e0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  transition: all var(--transition-normal);
}

.vertical-card:hover .vertical-icon {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.vertical-icon i {
  font-size: 2rem;
  color: white;
}

.vertical-content {
  text-align: center;
}

.vertical-content h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.vertical-content p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.vertical-features {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
}

.vertical-features .badge {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Workflow Header */
.workflow-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.workflow-title h1 {
  margin: 0;
  color: var(--text-primary);
}

.workflow-title p {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
}

/* Upload Sections */
.upload-section {
  margin: var(--space-6) 0;
}

.upload-grid.single-upload {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

.upload-grid.dual-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  background: var(--surface-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.upload-area.required::after {
  content: "Obrigatório";
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--error-500);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.upload-area.optional::after {
  content: "Opcional";
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--gray-500);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.upload-area:hover {
  border-color: var(--primary-400);
  background: var(--primary-25);
}

.upload-area.drag-over {
  border-color: var(--primary-500);
  background: var(--primary-50);
  transform: scale(1.02);
}

.upload-area.has-file {
  border-color: var(--success-400);
  background: var(--success-25);
}

.upload-content i {
  font-size: 3rem;
  color: var(--primary-500);
  margin-bottom: var(--space-4);
}

.upload-content h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.upload-content p {
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.upload-formats {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
}

.required-label {
  color: var(--error-500);
  font-weight: var(--font-weight-medium);
}

.optional-label {
  color: var(--gray-500);
  font-weight: var(--font-weight-medium);
}

.upload-area input[type="file"] {
  display: none;
}

/* Upload Preview */
.upload-preview {
  display: none;
  margin-top: var(--space-4);
}

.upload-preview.show {
  display: block;
}

.preview-item {
  position: relative;
  max-width: 200px;
  margin: 0 auto;
}

.preview-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--error-500);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
}

.preview-remove:hover {
  background: var(--error-600);
  transform: scale(1.1);
}

/* XML NFe Preview Styles */
.xml-file-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-3);
}

.xml-icon-wrapper {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  color: var(--primary-600);
  border-radius: var(--radius-md);
}

.xml-details {
  flex: 1;
  min-width: 0;
}

.xml-filename {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xml-filesize {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.btn-remove-xml {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--error-50);
  color: var(--error-600);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-remove-xml:hover {
  background: var(--error-600);
  color: white;
  transform: scale(1.05);
}

/* Workflow Actions */
.workflow-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

/* AI Processing Overlay */
.processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
}

.processing-overlay.hidden {
  display: none;
}

.processing-content {
  text-align: center;
  padding: var(--space-8);
}

.processing-animation {
  position: relative;
  margin-bottom: var(--space-6);
}

.ai-brain {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: #0068e0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
  animation: pulse 2s ease-in-out infinite;
}

.ai-brain i {
  font-size: 2rem;
  color: white;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--primary-500-rgb), 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(var(--primary-500-rgb), 0);
  }
}

.processing-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.processing-dots span {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary-500);
  animation: bounce 1.4s ease-in-out infinite both;
}

.processing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.processing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

.processing-content h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.processing-status {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

.processing-progress {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  margin: 0 auto;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

/* Confidence Indicator */
.confidence-indicator {
  background: var(--surface-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.confidence-score {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.confidence-label {
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
}

.confidence-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
}

.confidence-value.high {
  background: var(--success-100);
  color: var(--success-700);
}

.confidence-value.medium {
  background: var(--warning-100);
  color: var(--warning-700);
}

.confidence-value.low {
  background: var(--error-100);
  color: var(--error-700);
}

/* ====================================
   LAYOUT INTEGRADO DE IDENTIFICAÇÃO
   ==================================== */

/* Identification minimal layout */
.identify-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.identify-toolbar__title h1 {
  margin: 0;
}

.identify-toolbar__title p {
  margin: var(--space-1) 0 0;
}

.identification-container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
  gap: var(--space-6);
  margin-top: var(--space-6);
  min-height: 480px;
  max-width: 100% !important;
  overflow-x: hidden !important;
  width: 100%;
}

@media (max-width: 1200px) {
  .identification-container {
    grid-template-columns: 1fr;
  }
}

.upload-section-container,
.form-section-container {
  background: var(--surface-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.upload-section-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-section-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
}

.identify-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.identify-card-header h2 {
  font-size: var(--font-size-lg);
  margin: 0;
}

.identify-card-header.form-header {
  align-items: center;
}

.identify-card-header.form-header .confidence-indicator {
  margin: 0;
  background: rgba(0, 104, 224, 0.08);
}

.identify-card-header.form-header .confidence-value.high {
  background: rgba(34, 197, 94, 0.18);
  color: #047857;
}

.identify-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.identify-actions .btn {
  min-width: 180px;
}

.identify-form-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.identify-form-actions .btn {
  min-width: 180px;
}

/* Evitar scroll horizontal na página Identificar Produto */
#identify,
#identify .page-content,
#identify .main {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

#identify .page-content {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  box-sizing: border-box;
}

#identify * {
  max-width: 100%;
  box-sizing: border-box;
}

.form-section-container .clean-progress-container {
  margin-top: var(--space-4);
}

.product-form .form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-5);
}

.product-form .form-group {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-form .form-group.span-12 {
  grid-column: span 12;
}

.product-form .form-group.span-6 {
  grid-column: span 6;
}

.product-form .form-group.span-4 {
  grid-column: span 4;
}

/* Mantém o formulário de vestuário visível quando a etapa de identificação estiver ativa */

@media (max-width: 1024px) {
  .identification-container {
    grid-template-columns: 1fr;
  }

  .product-form .form-group.span-6,
  .product-form .form-group.span-4 {
    grid-column: span 12;
  }

  .identify-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .identify-form-actions .btn {
    width: 100%;
    max-width: 100%;
  }
}

/* Upload Area Centered - para supermercado */
.upload-area-centered {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: var(--space-4);
}

.upload-area-centered .upload-area {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.upload-actions-centered {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* Upload Grid para Vestuário (2 imagens) */
.upload-grid.dual-upload {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}

.upload-area.required::before,
.upload-area.optional::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 10;
}

.upload-area.required::before {
  background: var(--error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.upload-area.optional::before {
  background: var(--gray-400);
}

.required-label {
  color: var(--error-500);
  font-weight: 600;
  font-size: 0.85rem;
}

.optional-label {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 0.85rem;
}

.upload-actions {
  margin-top: var(--space-3);
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.btn-camera {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 768px) {
  .upload-grid.dual-upload {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Action Buttons Section */
.action-buttons-section {
  text-align: center;
  margin: var(--space-6) 0;
}

.action-buttons-container {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.action-buttons-container .btn {
  min-width: 180px;
  font-size: var(--font-size-base);
  padding: var(--space-3) var(--space-5);
  white-space: nowrap;
}

.action-buttons-container .btn-lg {
  font-size: var(--font-size-lg);
  padding: var(--space-4) var(--space-6);
}

/* ====================================
   CLEAN PROGRESS ANIMATION
   ==================================== */

.clean-progress-container {
  margin-top: var(--space-5);
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  width: 100%;
}

.clean-progress-container.hidden {
  display: none;
}

.clean-progress-container.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.clean-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-3);
  overflow: hidden;
  position: relative;
}

.clean-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
  position: relative;
}

.clean-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: cleanShimmer 1.5s infinite;
}

@keyframes cleanShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.clean-progress-text {
  font-size: var(--font-size-sm);
  color: var(--gray-600);
  font-weight: var(--font-weight-medium);
  margin: 0;
  letter-spacing: 0.025em;
}

/* Success Messages */
.success-message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-4) 0;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  animation: slideInMessage 0.3s ease-out;
  box-shadow: var(--shadow-md);
}

.success-message.success {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border: 2px solid #22c55e;
}

.success-message.info {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 2px solid #3b82f6;
}

.success-message i {
  font-size: var(--font-size-lg);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

@keyframes slideInMessage {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Form State Management */
.form-section-container.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.form-section-container.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  z-index: 10;
  pointer-events: none;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.form-actions .btn {
  min-width: 140px;
  flex: 1;
  max-width: 200px;
}

/* Upload Area Improvements */
.upload-area.has-image {
  border-color: var(--success-300);
  background: var(--success-25);
}

.upload-area.has-image .upload-content i {
  color: var(--success-500);
}

.upload-area.processing {
  border-color: var(--warning-300);
  background: var(--warning-25);
  animation: processingPulse 2s ease-in-out infinite;
}

@keyframes processingPulse {
  0%,
  100% {
    border-color: var(--warning-300);
  }

  50% {
    border-color: var(--warning-400);
  }
}

/* Responsive Design para Layout Integrado */
@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .chart-primary {
    grid-column: span 8;
  }

  .chart-secondary,
  .chart-goal,
  .chart-distribution,
  .chart-funnel {
    grid-column: span 4;
  }
}

@media (max-width: 900px) {
  .identification-container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .upload-section-container {
    order: 1;
  }

  .form-section-container {
    order: 2;
  }
}

@media (max-width: 768px) {
  .identification-container {
    gap: var(--space-4);
  }

  .form-section-container {
    padding: var(--space-4);
  }

  .upload-grid.dual-upload {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .action-buttons-container {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .action-buttons-container .btn {
    width: 100%;
    max-width: 280px;
  }

  .form-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .form-actions .btn {
    width: 100%;
    max-width: 280px;
    min-width: unset;
  }

  .analytics-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .chart-primary,
  .chart-secondary,
  .chart-goal,
  .chart-distribution,
  .chart-funnel {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .topbar-title {
    font-size: var(--font-size-lg);
  }

  /* Novo Layout - Responsividade 480px */
  .dashboard-kpis-horizontal {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .kpi-card-enhanced {
    min-height: 75px;
    padding: var(--space-3);
    min-width: auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .kpi-card-enhanced .kpi-content {
    align-items: center;
    text-align: center;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .kpi-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .chat-area {
    flex-direction: column;
    gap: var(--space-2);
  }

  .kpi-card {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
}

/* ====================================
   PRODUCTS PAGE ENHANCEMENTS
/* ==================================== */

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-controls {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-controls .btn {
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 8px 12px;
  background: var(--card-bg);
  color: var(--muted);
}

.view-controls .btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.view-controls .btn.active {
  background: var(--primary);
  color: white;
}

.view-controls .btn:first-child {
  border-right: 1px solid var(--border);
}

/* Products Table View */
.products-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.products-table th,
.products-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.products-table th {
  background: var(--card-bg);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 10;
}

.products-table tr:hover {
  background: var(--primary-light);
}

.products-table .product-title {
  font-weight: 500;
  color: var(--text);
}

.products-table .product-meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.products-table .product-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.products-table .btn {
  padding: 6px 10px;
  font-size: 0.75rem;
}

/* Componentes Específicos */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-200);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.chart-header {
  margin-bottom: var(--space-4);
}

.chart-header h2 {
  margin-bottom: var(--space-1);
}

.chart-header p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 150px;
}

.filter-group label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-500);
}

.help-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-4);
}

.help-topics {
  margin: var(--space-4) 0;
}

.help-topics h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.help-topics ul {
  list-style: none;
  padding: 0;
}

.help-topics li {
  padding: var(--space-1) 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  position: relative;
  padding-left: var(--space-4);
}

.help-topics li::before {
  content: "•";
  color: var(--primary-500);
  position: absolute;
  left: 0;
}

.contact-info {
  margin: var(--space-4) 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.contact-item i {
  color: var(--primary-500);
  width: 16px;
}

.system-info {
  margin: var(--space-4) 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size-sm);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

.info-row .value {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.status-online {
  color: var(--success-600) !important;
}

.status-online i {
  font-size: var(--font-size-xs);
  margin-right: var(--space-1);
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.logs-filters {
  display: flex;
  gap: var(--space-3);
}

.logs-container {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-relaxed);
  background: var(--gray-900);
  color: var(--gray-100);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.dashboard-actions {
  display: flex;
  gap: var(--space-2);
}

/* Estados Utilitários */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Modal Overlay (forçar regras robustas) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.25s ease;
  opacity: 0;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
}

.modal-overlay .modal {
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* Salvaguarda para classe legacy */
#loginModal.initial-autoshow {
  display: flex !important;
  opacity: 1;
}

/* ===================================================================
MODAIS - COMPONENTES DETALHADOS E MODERNOS
=================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
}

.modal-overlay .modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  border: none;
  transform: scale(0.95) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

/* Modal de Confirmação */
#confirmOverlay .modal {
  max-width: 420px;
  padding: 0;
}

#confirmOverlay .modal-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--warning-50), var(--error-50));
  text-align: center;
}

#confirmOverlay .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--error-700);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

#confirmOverlay .modal-header h3::before {
  content: "⚠️";
  font-size: 1.5rem;
}

#confirmOverlay .modal-body {
  padding: 1.5rem 2rem;
  text-align: center;
}

#confirmOverlay .modal-body p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

#confirmOverlay .modal-footer {
  padding: 1.5rem 2rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Modal de Edição */
.modal-lg {
  max-width: 800px;
  width: 100%;
}

.modal-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0;
}

.modal-header h3::before {
  content: "";
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
  transform: scale(1.05);
}

.modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-sm {
  width: min(460px, 92vw);
}

.logout-modal {
  border-radius: 20px;
  width: min(480px, 94vw);
  overflow: hidden;
  box-shadow: 0 25px 60px -30px rgba(15, 23, 42, 0.35);
}

.logout-modal .modal-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.logout-modal .modal-header h3 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--text-primary, #0f172a);
}

.logout-modal .modal-header p {
  margin: 0.6rem 0 0;
  color: var(--text-secondary, #475569);
  font-weight: 500;
}

.logout-modal .modal-close {
  color: #94a3b8;
}

.logout-modal .modal-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary, #0f172a);
}

.logout-modal .modal-body {
  padding: 1.75rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.logout-modal .modal-body p {
  margin: 0;
  color: var(--text-primary, #0f172a);
  font-size: 1rem;
  line-height: 1.6;
}

.logout-modal .modal-footer {
  background: var(--gray-50, #f8fafc);
  padding: 1.5rem 2rem 2rem;
  justify-content: flex-end;
  gap: 0.75rem;
}

.logout-modal .btn {
  min-width: 130px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.logout-modal .btn i {
  font-size: 0.95rem;
}

/* Formulário do Modal de Edição */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.span-2 {
  grid-column: span 2;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  color: var(--primary-500);
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

.form-label.required::after {
  content: "*";
  color: var(--error-500);
  font-weight: 700;
}

.form-control,
.form-select {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: var(--surface-primary);
  font-family: inherit;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(0, 104, 224, 0.1);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* Botões Modernos */
.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: #0068e0;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 104, 224, 0.3);
  border-radius: 12px;
}

.btn-primary:hover {
  background: #005bc3;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 104, 224, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--error-500), var(--error-600));
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--error-600), #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.btn-danger:active {
  transform: translateY(0);
}

/* Responsividade Aprimorada */
@media (max-width: 768px) {
  .modal-overlay .modal {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.5rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .form-group.span-2 {
    grid-column: span 1;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
  }

  #confirmOverlay .modal-footer {
    flex-direction: row;
    gap: 0.75rem;
  }

  #confirmOverlay .btn {
    flex: 1;
  }
}

/* Efeitos de Foco e Acessibilidade */
.modal:focus-within {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}

/* Animação de entrada suave */
@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-overlay.active .modal {
  animation: modalEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================
   Login Page
   =================================================================== */

.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0ea5e9 0%, #1d4ed8 100%);
  color: var(--text-inverse);
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-page {
  width: min(1100px, 95vw);
  background: var(--surface-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}

.login-card {
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.login-brand {
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
}

.login-brand h1 {
  font-size: var(--font-size-3xl);
  color: var(--primary-600);
  margin-bottom: var(--space-2);
}

.login-brand p {
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
}

.login-tab {
  border: none;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.login-tab.active {
  background: var(--surface-primary);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

.login-view {
  display: grid;
  gap: var(--space-3);
}

.login-view label {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

.login-view input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  font-size: var(--font-size-sm);
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.login-view input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-outline {
  background: var(--surface-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline img {
  width: 18px;
  height: 18px;
}

.btn-outline:hover {
  border-color: var(--primary-300);
  color: var(--primary-600);
}

.full-width {
  width: 100%;
}

.login-error {
  background: var(--error-50);
  color: var(--error-600);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--font-size-sm);
}

.login-footer {
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.login-footer a {
  color: var(--primary-600);
  font-weight: var(--font-weight-medium);
}

.login-hero {
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.15) 0%,
    rgba(14, 165, 233, 0.05) 100%
  );
  padding: var(--space-12);
  display: flex;
  align-items: center;
}

.hero-content {
  color: var(--primary-800);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hero-content h2 {
  font-size: var(--font-size-3xl);
  color: var(--primary-700);
}

.hero-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
  color: var(--primary-600);
  font-weight: var(--font-weight-medium);
}

.hero-content li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-content i {
  color: var(--success-500);
}

@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: var(--space-8);
  }
}

.assistant-pane--insights {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.assistant-pane--insights .insights-list {
  flex: 1;
  max-height: none;
}

.assistant-pane--chat {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
}

/* ====================================
   PRODUCTS PAGE ENHANCEMENTS
/* ==================================== */

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-controls {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-controls .btn {
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 8px 12px;
  background: var(--card-bg);
  color: var(--muted);
}

.view-controls .btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.view-controls .btn.active {
  background: var(--primary);
  color: white;
}

.view-controls .btn:first-child {
  border-right: 1px solid var(--border);
}

/* Export Container */
.export-container {
  position: relative;
}

.export-container .btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.export-container.open .export-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.export-option:hover {
  background: var(--primary-light);
}

.export-option i {
  width: 16px;
  margin-right: 8px;
}

.export-option span {
  font-size: 0.875rem;
}

/* ================================================ */
/* === SOBRESCRITA PARA FUNDO BRANCO SÓLIDO === */
/* ================================================ */

/* ======================================= */
/* ===         CUSTOMIZAÇÕES         === */
/* ======================================= */

/* Cor Padrão para Ícones "Regular" */
.far {
  color: #0068e0;
}

/* Cor dos Ícones na Sidebar */
.sidebar .far {
  color: #ffffff;
}

.card,
.kpi-card-enhanced,
.chart-widget,
.charts-main-column .card,
.metric-item,
.goal-metric,
.insight-item,
.ai-assistant-card {
  background: #ffffff !important;
  background-image: none !important; /* Garante que nenhum gradiente seja aplicado */
  border: 1px solid #e2e8f0 !important; /* Adiciona uma borda cinza para visibilidade */
}

/* ======================================= */
/* === AJUSTE DE ALTURA FIXA DOS CARDS === */
/* ======================================= */

.chart-goal,
.chart-secondary,
.chart-distribution {
  height: 450px; /* Experimente valores como 350px, 320px, etc. */
}

/* =================================================================== */
/* === IDENTIFICATION WORKFLOW - NEW STEPS                         === */
/* =================================================================== */

.identification-step {
  width: 100%;
  animation: fadeIn 0.3s ease-in;
}

.identification-step.active {
  display: block;
}

/* XML Products Grid */
.xml-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
}

.xml-product-card {
  background: var(--card-bg, #fff);
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.xml-product-card:hover {
  border-color: var(--primary-500);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 104, 224, 0.15);
}

.xml-product-card.selected {
  border-color: var(--primary-500);
  background: var(--primary-50, #f0f7ff);
  box-shadow: 0 0 0 3px rgba(0, 104, 224, 0.1);
}

.xml-product-card .product-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.xml-product-card .product-info {
  display: grid;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.xml-product-card .product-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.xml-product-card .product-info-label {
  font-weight: 500;
  color: var(--text-tertiary);
}

.xml-product-card .product-info-value {
  font-weight: 600;
  color: var(--text-primary);
}

.xml-product-card .product-codes {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.xml-product-card .code-badge {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: "Courier New", monospace;
}

[data-theme="dark"] .xml-product-card .code-badge {
  background: var(--gray-700);
  color: var(--gray-300);
}

.xml-product-card .select-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: all 0.3s ease;
}

.xml-product-card.selected .select-icon {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: white;
}

.xml-product-card.selected .select-icon::before {
  content: "✓";
  font-weight: bold;
}

/* Selected Product Summary Card */
.selected-product-card {
  background: var(--primary-50, #f0f7ff);
  border: 2px solid var(--primary-200, #c4d9fb);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.selected-product-card h3 {
  color: var(--primary-700);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.selected-product-card .product-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.selected-product-card .summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.selected-product-card .summary-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.selected-product-card .summary-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Empty State */
.xml-products-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.xml-products-empty i {
  font-size: 4rem;
  color: var(--gray-300);
  margin-bottom: 1rem;
  display: block;
}

.xml-products-empty h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.xml-products-empty p {
  font-size: 1rem;
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Two Column Layout: Steps + Form */
.identification-container-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.identification-steps-column {
  min-height: 400px;
}

/* SCROLL REMOVIDO - formulário livre */
.form-section-container {
  position: relative;
  /* Removidos: position: sticky, max-height, overflow-y */
}

@media (max-width: 1200px) {
  .identification-container-split {
    grid-template-columns: 1fr;
  }

  .form-section-container {
    position: relative;
    top: 0;
  }
}

/* ============================================================ */
/* === INTEGRAÇÕES                                            === */
/* ============================================================ */
.integrations-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.integration-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--card-shadow, 0 10px 30px -20px rgba(15, 23, 42, 0.45));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.integration-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 45px -22px rgba(15, 23, 42, 0.6);
}

.integration-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.integration-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.12),
    rgba(129, 140, 248, 0.08)
  );
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.integration-card-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.integration-card-icon-fallback {
  display: none;
  font-size: 1.5rem;
  color: var(--primary, #6366f1);
}

.integration-card-icon.fallback {
  background: rgba(99, 102, 241, 0.12);
}

.integration-card-icon.fallback .integration-card-icon-fallback {
  display: inline-flex;
}

.integration-card-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.integration-card-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0.15rem 0 0;
}

.integration-status-pill {
  margin-left: auto;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--gray-100, #f1f5f9);
  color: var(--gray-600, #475569);
}

.integration-status-pill[data-status="connected"] {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.integration-status-pill[data-status="error"] {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.integration-card-body p {
  color: var(--text-secondary);
  margin: 0;
}

.integration-card-details dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
}

.integration-card-details dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.integration-card-details dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.integration-help {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.1),
    rgba(14, 116, 233, 0.05)
  );
  border: 1px solid rgba(14, 165, 233, 0.12);
}

.integration-help strong {
  display: block;
  margin-bottom: 0.6rem;
}

.integration-help ol {
  padding-left: 1.2rem;
  margin: 0 0 0.8rem;
}

.integration-help a {
  font-weight: 600;
  color: var(--primary, #2563eb);
  text-decoration: none;
}

.integration-card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.integration-card-footer .btn {
  min-width: 160px;
}

.integration-feedback {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.integration-modal {
  max-width: 560px;
}

.integration-form .form-group + .form-group {
  margin-top: 1rem;
}

.integration-form-help {
  margin-top: 1rem;
  background: var(--gray-50, #f8fafc);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.integration-video-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.integration-video-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
}

.integration-video {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: #000;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.integration-video::-webkit-media-controls-panel {
  background-color: rgba(15, 23, 42, 0.08);
}

.integration-video-caption {
  font-size: 0.85rem;
  color: var(--text-secondary, #475569);
  margin: 0;
}

.integration-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.integration-modal-feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading i {
  margin-right: 0.5rem;
}

:root[data-theme="dark"] .integration-card {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.18);
}

:root[data-theme="dark"] .integration-help {
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.12),
    rgba(14, 116, 233, 0.08)
  );
  border-color: rgba(14, 165, 233, 0.2);
}

:root[data-theme="dark"] .integration-form-help {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.25);
}

:root[data-theme="dark"] .integration-video {
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
}

:root[data-theme="dark"] .integration-video-title {
  color: rgba(226, 232, 240, 0.95);
}

:root[data-theme="dark"] .integration-video-caption {
  color: rgba(148, 163, 184, 0.9);
}

:root[data-theme="dark"] .integration-status-pill[data-status="disconnected"] {
  background: rgba(148, 163, 184, 0.3);
  color: rgba(226, 232, 240, 0.9);
}

/* ===================================================================
   PRODUTOS ERP - PÁGINA DE IMPORTAÇÃO
   =================================================================== */

.erp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.erp-search {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.erp-search i {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.erp-search .form-input {
  padding-left: var(--space-8);
  border-radius: var(--radius-lg);
}

.erp-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.erp-content {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.erp-empty-state {
  text-align: center;
  padding: var(--space-12);
}

.empty-state-icon {
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: center;
  opacity: 0.6;
}

.erp-empty-state h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.erp-empty-state p {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-size: var(--font-size-base);
}

.link-help {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.link-help:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===================================================================
   MODAL DE IMPORTAÇÃO - DESIGN COMPACTO
   =================================================================== */

.import-modal-clean {
  max-width: 700px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.modal-header-import .modal-close {
  position: static;
  margin: 0;
  padding: var(--space-2);
  flex-shrink: 0;
}

.import-header-content h3 {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.import-header-content p {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.import-form-compact {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.import-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hint-text {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.import-dropzone-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.import-dropzone-compact:hover {
  border-color: var(--primary);
  background: rgba(0, 104, 224, 0.03);
}

.import-dropzone-compact i {
  font-size: 2rem;
  color: var(--primary);
}

.import-dropzone-compact p {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.import-dropzone-compact small {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.file-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}

.preview-table-compact {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: auto;
  max-height: 200px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--primary);
  font-size: var(--font-size-sm);
}

.progress-info i {
  animation: spin 2s linear infinite;
}

.import-modal-pro {
  max-width: 880px;
  border-radius: var(--radius-xxl);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.25);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.import-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-7);
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.95) 0%,
    rgba(79, 70, 229, 0.88) 100%
  );
  color: #ffffff;
}

.import-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #ffffff;
}

.import-header-text h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: #ffffff;
}

.import-header-text p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

.import-modal-header .modal-close {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(15, 23, 42, 0.25);
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.import-modal-header .modal-close:hover {
  background: rgba(15, 23, 42, 0.35);
  transform: translateY(-1px);
}

.import-modal-body {
  padding: var(--space-7);
  background: #ffffff;
}

.import-modal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: var(--space-6);
  align-items: start;
}

.import-info-panel {
  background: linear-gradient(
    145deg,
    rgba(37, 99, 235, 0.08) 0%,
    rgba(79, 70, 229, 0.12) 100%
  );
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.import-info-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(37, 99, 235, 0.85);
  background: rgba(37, 99, 235, 0.12);
}

.import-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.import-info-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.import-info-list li i {
  font-size: 1.2rem;
  color: rgba(37, 99, 235, 0.9);
  margin-top: 2px;
}

.import-info-list li div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.import-info-list li div strong {
  font-weight: 600;
  color: var(--text-primary);
}

.import-info-list li div p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.import-help-card {
  margin-top: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: #ffffff;
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.08);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.import-help-card .help-icon i {
  font-size: 1.3rem;
  color: rgba(37, 99, 235, 0.84);
}

.import-help-card .help-text strong {
  color: var(--text-primary);
  display: block;
}

.import-help-card .help-text p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.import-help-card .btn {
  align-self: flex-start;
  padding: 0;
  color: rgba(37, 99, 235, 0.85);
  font-weight: 600;
}

.import-form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.import-fieldset {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.import-fieldset h4 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.import-fieldset h4 i {
  color: rgba(37, 99, 235, 0.85);
}

.fieldset-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.import-template-btn {
  width: 100%;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.import-dropzone-pro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  border: 2px dashed rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-xl);
  background: rgba(37, 99, 235, 0.05);
  min-height: 220px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.import-dropzone-pro:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
}

.import-dropzone-pro .dropzone-illustration i {
  font-size: 2.6rem;
  color: rgba(37, 99, 235, 0.72);
}

.import-dropzone-pro p {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.import-dropzone-pro small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.import-dropzone-pro .file-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: rgba(16, 185, 129, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
}

.import-preview-table {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  min-height: 160px;
  background: var(--bg-secondary);
  padding: var(--space-3);
  overflow: auto;
}

.import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.import-actions .action-hint {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 420px;
}

.import-actions .action-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.import-actions .action-hint i {
  color: rgba(16, 185, 129, 0.85);
  font-size: 1rem;
}

.import-actions .btn {
  min-width: 220px;
}

@media (max-width: 1100px) {
  .import-modal-body {
    padding: var(--space-6);
  }

  .import-modal-grid {
    grid-template-columns: 1fr;
  }

  .import-info-panel {
    order: 2;
  }

  .import-form-grid {
    order: 1;
  }
}

@media (max-width: 768px) {
  .import-modal-pro {
    border-radius: var(--radius-xl);
  }

  .import-modal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .import-modal-body {
    padding: var(--space-5);
  }

  .import-fieldset {
    padding: var(--space-4);
  }

  .import-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .import-actions .action-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: var(--space-2);
  }

  .import-actions .action-buttons .btn {
    width: 100%;
  }
}

.progress-bar-slim {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #01bb88 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.result-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.05) 0%,
    rgba(1, 187, 136, 0.05) 100%
  );
  border-radius: var(--radius-lg);
  text-align: center;
}

.result-success i {
  font-size: 2.5rem;
  color: #22c55e;
}

.result-success h4 {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-primary);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--space-2);
  width: 100%;
  font-size: var(--font-size-sm);
}

.error-details {
  cursor: pointer;
}

.error-details summary {
  padding: var(--space-2) var(--space-3);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-weight: 600;
  font-size: var(--font-size-xs);
  transition: all var(--transition-fast);
}

.error-details summary:hover {
  background: rgba(239, 68, 68, 0.15);
}

.errors-list {
  margin-top: var(--space-2);
  max-height: 150px;
  overflow-y: auto;
  font-size: var(--font-size-xs);
}

.modal-footer-import {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-color);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-weight: 600;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0;
}

.btn-link:hover {
  text-decoration: underline;
  color: var(--primary-dark, #1d4ed8);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.woo-export-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 320px;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  border-left: 4px solid #0068e0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1050;
  pointer-events: none;
}

.woo-export-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.woo-export-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0edff;
  color: #0068e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.woo-export-toast[data-state="loading"] .woo-export-toast-icon {
  background: #e0edff;
  color: #0068e0;
}

.woo-export-toast[data-state="success"] .woo-export-toast-icon {
  background: #dcfce7;
  color: #0f9d58;
}

.woo-export-toast[data-state="error"] .woo-export-toast-icon {
  background: #fee2e2;
  color: #dc2626;
}

.woo-export-toast[data-state="info"] .woo-export-toast-icon {
  background: #fef9c3;
  color: #a16207;
}

.woo-export-toast-icon::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  display: block;
}

.woo-export-toast[data-state="loading"] .woo-export-toast-icon {
  animation: woo-spin 0.9s linear infinite;
}

.woo-export-toast[data-state="loading"] .woo-export-toast-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 104, 224, 0.25);
  border-top-color: #0068e0;
  border-radius: 50%;
  animation: none;
  margin: 0 auto;
}

.woo-export-toast[data-state="success"] .woo-export-toast-icon::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.woo-export-toast[data-state="error"] .woo-export-toast-icon::before {
  content: "\f071";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.woo-export-toast[data-state="info"] .woo-export-toast-icon::before {
  content: "\f05a";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.woo-export-toast-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.woo-export-toast-message {
  font-size: 0.85rem;
  color: #334155;
}

@keyframes woo-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   WhatsApp Support Bubble
   ========================================================= */
.whatsapp-support-bubble {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25d366, #1ebe5d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.35);
  z-index: 1600;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  text-decoration: none;
}

.whatsapp-support-bubble i {
  font-size: 1.8rem;
}

.whatsapp-support-bubble:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 20px 45px rgba(37, 211, 102, 0.45);
  background: linear-gradient(135deg, #28e36e, #1cad56);
}

.whatsapp-support-bubble:active {
  transform: translateY(-2px) scale(0.98);
}

.whatsapp-support-bubble__tooltip {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #101828;
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(16, 24, 40, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.whatsapp-support-bubble:hover .whatsapp-support-bubble__tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .whatsapp-support-bubble {
    width: 52px;
    height: 52px;
    bottom: 65px;
    right: 16px;
  }

  .whatsapp-support-bubble i {
    font-size: 1.5rem;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
#imageUploadArea.uploading-disabled {
  opacity: 0.55;
  pointer-events: none;
  border-style: dashed;
  border-color: rgba(0, 0, 0, 0.1);
}
