/* =========================================================
   OMNIAGENT STUDIO — ENTERPRISE EDITION DESIGN SYSTEM
   ========================================================= */
:root {
  /* Cores de Fundo - Dark Mode Corporativo */
  --bg-app: #07090e;
  --bg-navbar: #0b0f17;
  --bg-sidebar: #0d121c;
  --bg-console: #111623;
  --bg-inspector: #0d121c;
  --bg-card: #161d2c;
  --bg-card-hover: #1b2436;
  --bg-input: #0f1420;

  /* Cores de Texto e Contraste (Acessibilidade Refinada - Etapa 20) */
  --text-main: #f8fafc;
  --text-body: #e2e8f0;
  --text-muted: #cbd5e1; /* Aumentado contraste para excelente legibilidade */
  --text-dim: #94a3b8;

  /* Tokens de Marca (Azul como cor principal, Verde para positivos) */
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --primary-blue-light: rgba(59, 130, 246, 0.15);
  
  --positive-green: #10b981;
  --positive-green-light: rgba(16, 185, 129, 0.15);
  
  --warning-amber: #f59e0b;
  --warning-amber-light: rgba(245, 158, 11, 0.15);
  
  --purple-main: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.15);

  /* Bordas e Sombras Corporativas */
  --border-color: #1e293b;
  --border-focus: #3b82f6;
  --border-light: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);

  /* Tipografia */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Raios de Borda */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* RESPEITO A PREFERS-REDUCED-MOTION (Etapa 20) */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* FOCO VISÍVEL E ACESSÍVEL PARA NAVEGAÇÃO POR TECLADO */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* =========================================================
   MODAL DE ONBOARDING & MODAL DO CRM (Etapas 2 & 14)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeInModal 0.25s ease;
}
.modal-backdrop.hidden { display: none; }
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.onboarding-card {
  background: var(--bg-navbar);
  border: 1px solid var(--primary-blue);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.onboarding-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  background: var(--primary-blue-light);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  letter-spacing: 0.5px;
}
.onboarding-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}
.onboarding-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}
.step-num {
  width: 26px;
  height: 26px;
  background: var(--primary-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
}
.step-card strong { font-size: 0.92rem; font-weight: 600; color: #fff; }
.step-card span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.btn-primary-xl {
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.8rem 2.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transition: all 0.2s;
}
.btn-primary-xl:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}
.disclaimer-mini { font-size: 0.8rem; color: var(--text-dim); }

/* MODAL CRM */
.crm-modal-card {
  background: #0b0f17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.crm-modal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.crm-brand { display: flex; align-items: center; gap: 0.75rem; }
.lfs-tag { font-size: 0.72rem; background: rgba(139, 92, 246, 0.2); color: #c4b5fd; padding: 0.2rem 0.6rem; border-radius: 4px; font-weight: 700; }
.crm-brand h3 { font-size: 1.2rem; font-weight: 700; color: #fff; }
.btn-icon-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.8rem; cursor: pointer; }

.crm-notice { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #a7f3d0; padding: 0.75rem 1rem; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; }
.status-dot.green { width: 8px; height: 8px; background: var(--positive-green); border-radius: 50%; display: inline-block; }

.kanban-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.kanban-col { background: #131926; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 0.85rem; display: flex; flex-direction: column; gap: 0.65rem; min-height: 250px; }
.kanban-col.active-highlight { border-color: rgba(139, 92, 246, 0.6); background: #161c2e; }
.col-header { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-color); }
.badge-new { background: var(--purple-main); color: #fff; font-size: 0.68rem; padding: 0.1rem 0.4rem; border-radius: 99px; }
.mini-card { background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.08); padding: 0.85rem; border-radius: 6px; font-size: 0.85rem; }
.mini-card.ghost { opacity: 0.5; display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-dim); }
.mini-card.active { border-left: 4px solid var(--purple-main); background: #221c38; border-color: #8b5cf6; display: flex; flex-direction: column; gap: 0.4rem; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25); animation: pulseCard 2s infinite ease-in-out; }
@keyframes pulseCard { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.card-tags { display: flex; gap: 0.4rem; }
.card-tags .tag { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 4px; }
.card-tags .tag.hot { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.card-tags .tag.auto { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.mini-card.active strong { color: #fff; font-size: 0.96rem; }
.mini-card.active span { font-size: 0.78rem; color: var(--text-muted); }
.card-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.5rem; font-size: 0.78rem; font-weight: 600; }
.card-meta .price { color: #34d399; }
.card-meta .date { color: #c4b5fd; font-family: var(--font-mono); font-size: 0.72rem; }

.crm-modal-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 1rem; }
.btn-secondary-link { color: #93c5fd; font-weight: 600; text-decoration: none; font-size: 0.88rem; }
.btn-secondary-link:hover { text-decoration: underline; }
.btn-primary-sm { background: var(--primary-blue); color: #fff; border: none; padding: 0.5rem 1.25rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; }

/* =========================================================
   BARRA DE NAVEGAÇÃO SUPERIOR
   ========================================================= */
.navbar {
  background-color: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
  height: 56px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}
.navbar-left, .navbar-center, .navbar-right { display: flex; align-items: center; gap: 1rem; }
.nav-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-back:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
.divider { width: 1px; height: 20px; background: var(--border-color); }
.brand { display: flex; align-items: baseline; gap: 0.5rem; }
.brand-name { font-size: 1.15rem; font-weight: 400; letter-spacing: -0.3px; }
.brand-name strong { font-weight: 700; color: #60a5fa; }
.brand-tier {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.environment-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.95rem;
  border-radius: 99px;
  font-weight: 500;
}
.status-indicator { width: 8px; height: 8px; background: var(--positive-green); border-radius: 50%; box-shadow: 0 0 8px var(--positive-green); }

.btn-primary-header {
  background: var(--primary-blue);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.btn-primary-header:hover { background: var(--primary-blue-hover); }

/* =========================================================
   WORKSPACE GRID — 3 COLUNAS (Etapa 19)
   ========================================================= */
.workspace {
  display: grid;
  grid-template-columns: 280px 1fr 390px;
  height: calc(100vh - 56px);
  min-height: 640px;
}

/* ---------------------------------------------------------
   COLUNA 1: BARRA LATERAL (Canais & Cenários)
   --------------------------------------------------------- */
.panel-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}
.sidebar-section { display: flex; flex-direction: column; gap: 0.6rem; }
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.section-hint { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }

.channel-list { display: flex; flex-direction: column; gap: 0.5rem; }
.channel-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.channel-item.active { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.06); }
.channel-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.channel-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.channel-icon.purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }
.channel-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.channel-icon.slate { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.channel-info { display: flex; flex-direction: column; flex: 1; }
.channel-info strong { font-size: 0.86rem; font-weight: 600; color: #fff; }
.channel-info span { font-size: 0.72rem; color: var(--text-dim); }
.status-dot-sm { width: 6px; height: 6px; border-radius: 50%; background: var(--positive-green); }

.scenario-tabs { display: flex; flex-direction: column; gap: 0.55rem; }
.scenario-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.scenario-btn:hover { border-color: rgba(255, 255, 255, 0.25); transform: translateX(2px); }
.scenario-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(30, 41, 59, 0.4) 100%);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}
.scenario-icon { font-size: 1.2rem; margin-top: 0.1rem; }
.scenario-btn strong { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.2rem; }
.scenario-btn span { display: block; font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; }

.sidebar-footer-stack { margin-top: auto; display: flex; flex-direction: column; gap: 1.25rem; border-top: 1px solid var(--border-color); padding-top: 1.25rem; }
.agent-card {
  background: #111827;
  border: 1px solid var(--border-color);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.agent-avatar { width: 36px; height: 36px; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 6px; }
.agent-info { display: flex; flex-direction: column; gap: 0.15rem; }
.agent-info strong { font-size: 0.84rem; color: #60a5fa; font-weight: 600; }
.agent-status-tag { font-size: 0.72rem; color: #34d399; font-family: var(--font-mono); }

.metrics-header-row { display: flex; justify-content: space-between; align-items: center; }
.disclaimer-pill { font-size: 0.68rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-dim); padding: 0.15rem 0.5rem; border-radius: 99px; font-weight: 500; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.metric-box { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-color); padding: 0.65rem 0.5rem; border-radius: var(--radius-sm); text-align: center; }
.metric-val { display: block; font-size: 1.1rem; font-weight: 700; color: #60a5fa; font-family: var(--font-mono); }
.metric-lbl { font-size: 0.72rem; color: var(--text-dim); }

/* ---------------------------------------------------------
   COLUNA 2: CONSOLE E CHAT DINÂMICO
   --------------------------------------------------------- */
.panel-console {
  background: var(--bg-console);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.console-header {
  padding: 1rem 1.5rem;
  background: #0f1523;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.progress-bar-container { display: flex; flex-direction: column; gap: 0.5rem; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; }
.scenario-pill { font-size: 0.82rem; font-weight: 700; color: #93c5fd; background: rgba(59, 130, 246, 0.15); padding: 0.2rem 0.75rem; border-radius: 4px; }
.step-count { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }

.step-indicators { display: flex; align-items: center; justify-content: space-between; background: rgba(0, 0, 0, 0.2); padding: 0.4rem 0.75rem; border-radius: 6px; border: 1px solid var(--border-color); overflow-x: auto; }
.step-item { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); padding: 0.25rem 0.6rem; border-radius: 4px; transition: all 0.2s; white-space: nowrap; }
.step-item.active { background: var(--primary-blue); color: #fff; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); font-weight: 700; }
.step-item.completed { color: #34d399; }
.step-arrow { color: var(--border-color); font-weight: 700; }

.attendance-control-bar { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 0.75rem; flex-wrap: wrap; gap: 1rem; }
.attendance-status { display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; color: #a7f3d0; }
.console-action-btns { display: flex; gap: 0.65rem; }
.btn-handoff {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
}
.btn-handoff:hover { background: var(--positive-green); color: #ffffff; border-color: var(--positive-green); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); color: #fff; }

.quick-replies-bar { padding: 0.75rem 1.5rem; background: rgba(0, 0, 0, 0.15); border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 0.5rem; }
.quick-title { font-size: 0.78rem; font-weight: 600; color: #cbd5e1; }
.quick-chips-container { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.quick-chip {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-chip:hover { background: var(--primary-blue); border-color: var(--primary-blue); color: #ffffff; transform: translateY(-1px); }

.chat-viewport {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.02) 0%, transparent 80%);
}
.chat-messages-stream { display: flex; flex-direction: column; gap: 1.25rem; }
.chat-row { display: flex; width: 100%; animation: slideInBubble 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slideInBubble { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-row.user { justify-content: flex-end; }
.chat-row.ai, .chat-row.system-summary { justify-content: flex-start; }

.bubble { max-width: 78%; padding: 1.15rem 1.35rem; border-radius: var(--radius-md); font-size: 0.95rem; line-height: 1.6; box-shadow: var(--shadow-sm); }
.bubble.user-bubble { background: #2563eb; color: #ffffff; border-bottom-right-radius: 2px; }
.bubble.ai-bubble { background: var(--bg-card); border: 1px solid var(--border-color); color: #e2e8f0; border-bottom-left-radius: 2px; }
.bubble-meta { display: flex; align-items: center; justify-content: space-between; font-size: 0.72rem; font-weight: 600; color: #60a5fa; margin-bottom: 0.6rem; font-family: var(--font-mono); }
.bubble-meta .time { color: var(--text-dim); font-weight: 400; }
.bubble p { margin-bottom: 0.6rem; }
.bubble p:last-of-type { margin-bottom: 0; }
.quick-replies-empty { font-size: 0.82rem; color: var(--text-dim); font-style: italic; }

/* RESUMO DE TRANSFERÊNCIA HUMANA (Etapa 8) */
.handoff-summary-box {
  background: #131b2e;
  border: 1px solid #3b82f6;
  border-left: 4px solid #3b82f6;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}
.handoff-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 0.5rem; }
.handoff-top strong { font-size: 0.92rem; color: #60a5fa; font-weight: 700; }
.handoff-body p { font-size: 0.92rem; color: #fff; font-style: italic; background: rgba(0,0,0,0.25); padding: 0.85rem; border-radius: 6px; border: 1px solid var(--border-color); }
.handoff-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; font-size: 0.82rem; margin-top: 0.4rem; }
.handoff-details div { background: rgba(255,255,255,0.02); padding: 0.4rem 0.6rem; border-radius: 4px; border: 1px solid var(--border-color); }
.handoff-details span { color: var(--text-muted); }
.handoff-details strong { color: #34d399; }

/* CTA FINAL (Etapa 18) */
.final-cta-box {
  background: linear-gradient(135deg, #131b2e 0%, #1e1635 100%);
  border: 1px solid var(--purple-main);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  max-width: 90%;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}
.final-cta-box h3 { font-size: 1.35rem; font-weight: 700; color: #fff; }
.final-cta-box p { font-size: 0.95rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }
.cta-buttons-row { display: flex; justify-content: center; gap: 0.85rem; flex-wrap: wrap; margin-top: 0.5rem; }
.btn-cta-primary { background: var(--purple-main); color: #fff; border: none; padding: 0.65rem 1.5rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-cta-primary:hover { background: #7c3aed; }

/* TYPING INDICATOR */
.typing-indicator { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border-color); padding: 0.75rem 1.25rem; border-radius: var(--radius-md); border-bottom-left-radius: 2px; display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.85rem; }
.typing-indicator.hidden { display: none; }
.typing-dots { display: flex; gap: 4px; }
.dot { width: 6px; height: 6px; background: #60a5fa; border-radius: 50%; animation: bounce 1.2s infinite both; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* CHAT FOOTER INPUT */
.chat-input-footer { padding: 1rem 1.5rem; background: #0b0f17; border-top: 1px solid var(--border-color); display: flex; gap: 0.75rem; }
.chat-input-footer input { flex: 1; background: var(--bg-input); border: 1px solid var(--border-color); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.94rem; outline: none; }
.chat-input-footer input:focus { border-color: var(--primary-blue); }
.btn-send-chat { background: var(--primary-blue); color: #fff; border: none; font-weight: 600; font-size: 0.9rem; padding: 0 1.5rem; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-send-chat:hover { background: var(--primary-blue-hover); }

/* ---------------------------------------------------------
   COLUNA 3: PAINEL INSPECTOR (Análise & Dados)
   --------------------------------------------------------- */
.panel-inspector { background: var(--bg-inspector); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; overflow: hidden; }

.inspector-mode-switch-row { padding: 0.85rem 1rem; background: #090e16; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 0.4rem; }
.mode-toggle-group { display: flex; background: #161e2e; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.mode-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; padding: 0.4rem; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.mode-btn.active { background: var(--primary-blue); color: #ffffff; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }
.mode-desc { font-size: 0.72rem; color: var(--text-dim); text-align: center; }

.inspector-tabs-header { display: flex; border-bottom: 1px solid var(--border-color); background: #0d121c; overflow-x: auto; }
.ins-tab-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; padding: 0.75rem 0.4rem; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: all 0.2s; }
.ins-tab-btn.active { color: #60a5fa; border-bottom-color: #60a5fa; background: rgba(59, 130, 246, 0.05); }
.ins-tab-btn.hidden { display: none; }

.inspector-content-viewport { flex: 1; overflow-y: auto; padding: 1.25rem; }
.tab-pane { display: none; flex-direction: column; gap: 1.25rem; }
.tab-pane.active { display: flex; }

.ins-label { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; }
.analysis-box { display: flex; flex-direction: column; gap: 0.45rem; background: var(--bg-card); border: 1px solid var(--border-color); padding: 0.85rem 1rem; border-radius: var(--radius-sm); }
.analysis-box.highlight-border { border-color: rgba(59, 130, 246, 0.5); background: #161e30; }
.intent-chip-lg { font-size: 1.05rem; font-weight: 700; color: #60a5fa; }
.analysis-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.val-text.green { color: #34d399; font-weight: 700; font-size: 0.9rem; }
.val-text.amber { color: #fbbf24; font-weight: 700; font-size: 0.9rem; }
.product-chip { font-size: 0.92rem; color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.04); padding: 0.5rem 0.75rem; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.08); }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.score-badge-hot { font-size: 0.82rem; font-weight: 700; color: #fbbf24; }
.score-progress-bar { width: 100%; height: 8px; background: #1e293b; border-radius: 99px; overflow: hidden; margin-top: 0.3rem; }
.score-progress-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #ef4444); transition: width 0.5s ease; }

.next-action-card { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.88rem; }
.icon-bulb { font-size: 1.3rem; }
.next-action-card strong { display: block; color: #fff; font-weight: 600; }
.next-action-card span { font-size: 0.76rem; color: var(--text-muted); }

/* DESTAQUE DO LEAD FLOW STUDIO NA ABA ANÁLISE */
.crm-integration-showcase-box { background: #131926; border: 1px solid rgba(139, 92, 246, 0.4); border-radius: var(--radius-md); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15); }
.showcase-header { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; font-weight: 700; color: #c4b5fd; }
.showcase-status-desc { font-size: 0.78rem; color: var(--text-muted); }
.crm-summary-card { background: #0f131f; border: 1px solid var(--border-color); border-radius: 6px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; }
.crm-meta-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.crm-meta-row span { color: var(--text-muted); }
.crm-meta-row strong { color: #fff; font-weight: 600; }
.crm-meta-row strong.hl { color: #34d399; }
.btn-secondary-crm { background: rgba(139, 92, 246, 0.15); border: 1px solid #8b5cf6; color: #c4b5fd; font-weight: 600; font-size: 0.84rem; padding: 0.55rem; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.btn-secondary-crm:hover { background: #8b5cf6; color: #fff; }

/* ABA 2: DADOS COLETADOS */
.pane-hint { font-size: 0.82rem; color: var(--text-muted); }
.profile-structured-list { display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0.85rem 1rem; }
.profile-item { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.84rem; border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding-bottom: 0.4rem; }
.profile-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.profile-key { color: var(--text-muted); }
.profile-val { font-weight: 600; color: #fff; font-family: var(--font-mono); font-size: 0.8rem; text-align: right; }
.profile-val.pending { color: var(--text-dim); font-style: italic; font-weight: 400; font-family: var(--font-sans); }
.profile-val.highlight { color: #34d399; }

/* ABA 3: FONTES RAG */
.rag-notice-badge { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; padding: 0.65rem 0.85rem; border-radius: 6px; font-size: 0.82rem; }
.active-source-banner { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.4); padding: 0.85rem; border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 0.75rem; }
.icon-doc { font-size: 1.5rem; }
.active-source-banner strong { display: block; color: #60a5fa; font-size: 0.9rem; font-weight: 600; }
.active-source-banner span { font-size: 0.76rem; color: var(--text-muted); }
.documents-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.doc-item-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 0.75rem; border-radius: 6px; display: flex; align-items: center; gap: 0.65rem; }
.doc-type-tag { font-size: 0.68rem; font-weight: 700; background: rgba(255,255,255,0.06); padding: 0.2rem 0.45rem; border-radius: 4px; font-family: var(--font-mono); }
.doc-item-card strong { display: block; font-size: 0.84rem; color: #fff; font-weight: 600; }
.doc-item-card span { font-size: 0.72rem; color: var(--text-dim); }

/* ABA 4: LINHA DO TEMPO */
.timeline-feed { display: flex; flex-direction: column; gap: 0.65rem; }
.timeline-item { background: var(--bg-card); border: 1px solid var(--border-color); padding: 0.75rem 0.85rem; border-radius: var(--radius-sm); display: flex; align-items: flex-start; gap: 0.65rem; font-size: 0.84rem; }
.check-icon { color: #34d399; font-weight: 800; font-size: 1rem; }
.timeline-item strong { display: block; color: #fff; font-weight: 600; }
.timeline-item span { display: block; font-size: 0.75rem; color: var(--text-muted); }

/* ABAS TÉCNICAS E CODE BLOCKS */
.tech-code-block { background: #0a0e16; border: 1px solid var(--border-color); padding: 1rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.78rem; color: #38bdf8; overflow-x: auto; line-height: 1.5; }
.http-meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; background: #131b2c; padding: 0.4rem 0.75rem; border-radius: 4px; color: #cbd5e1; }
.tag-http { color: #34d399; font-weight: 700; }
.latency { color: #fbbf24; }
.btn-copy-mini { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 4px; cursor: pointer; }
.btn-copy-mini:hover { color: #fff; border-color: #fff; }

/* TOASTS */
.toast-viewport { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast-box { background: #0e1422; border: 1px solid #3b82f6; color: #fff; padding: 0.85rem 1.25rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 0.9rem; font-weight: 600; pointer-events: auto; display: flex; align-items: center; gap: 0.6rem; animation: toastSlideIn 0.3s ease; }
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* =========================================================
   RESPONSIVIDADE FORTE PARA DESKTOP, NOTEBOOKS & MOBILE (Etapa 19)
   ========================================================= */
@media (max-width: 1366px) {
  .workspace { grid-template-columns: 260px 1fr 340px; }
}

@media (max-width: 1100px) {
  /* Em tablets horizontais e notebooks menores, layout vertical inteligente */
  .workspace { grid-template-columns: 1fr; height: auto; }
  .panel-sidebar { max-height: 350px; border-right: none; border-bottom: 1px solid var(--border-color); }
  .panel-console { min-height: 550px; }
  .panel-inspector { max-height: 600px; border-left: none; border-top: 1px solid var(--border-color); }
  .onboarding-steps { grid-template-columns: repeat(2, 1fr); }
  .kanban-preview { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar { height: auto; padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .onboarding-card { padding: 1.5rem; }
  .bubble { max-width: 90%; }
  
  .attendance-control-bar { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .analysis-grid-2 { grid-template-columns: 1fr; }
  
  .crm-modal-card { padding: 1rem; }
  .crm-modal-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .crm-modal-footer { flex-direction: column; gap: 1rem; align-items: stretch; text-align: center; }
  
  .btn-primary-xl { width: 100%; }
  .onboarding-actions { flex-direction: column; gap: 1rem; align-items: stretch; text-align: center; }
}
