/* ==========================================================================
   CRM/ERP v3 - Design System & Estilos Proprietários
   Estética: Dark Mode Premium, Glassmorphism, Micro-interações
   ========================================================================== */

/* Identidade "Robotic Light — Remarques": paleta clara de fábrica/precisão,
   dourado real da marca (--rr-dourado da referência de campo) como cor de
   assinatura, azul-aço institucional como acento técnico secundário. É o
   padrão canônico (:root) a partir do redesenho de 2026-09; o tema escuro
   "Latão & Grafite" original continua disponível em body.theme-executive-dark. */
:root {
  --bg-main: #F3F1EA;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FBF9F3;
  --bg-input: #FFFFFF;

  --border-color: #E4DECE;
  --border-active: #A9862F;

  --primary: #A9862F;
  --primary-rgb: 169, 134, 47;
  --primary-hover: #8A6D24;
  --primary-glow: rgba(169, 134, 47, 0.28);

  --accent-cyan: #1F3A5F;
  --accent-cyan-rgb: 31, 58, 95;
  --accent-emerald: #3F8A5C;
  --accent-emerald-rgb: 63, 138, 92;
  --accent-amber: #C97C3D;
  --accent-amber-rgb: 201, 124, 61;
  --accent-rose: #C1503F;
  --accent-rose-rgb: 193, 80, 63;
  --accent-purple: #6C5A8C;
  --accent-purple-rgb: 108, 90, 140;

  --text-primary: #1C1A16;
  --text-secondary: #56503F;
  --text-muted: #8A8071;

  --status-success: #3F8A5C;
  --status-success-rgb: 63, 138, 92;
  --status-warning: #C97C3D;
  --status-warning-rgb: 201, 124, 61;
  --status-danger: #C1503F;
  --status-danger-rgb: 193, 80, 63;
  --status-info: #1F3A5F;
  --status-info-rgb: 31, 58, 95;

  --shadow-sm: 0 1px 3px rgba(28, 26, 22, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   PROPOSTAS VISUAIS DE DESIGN SYSTEM (SELEÇÃO DEFINITIVA)
   ========================================================================== */

/* 1. Proposta 1: Executive Dark Modern — "Latão & Grafite", a identidade
   original do v3. Deixou de ser o padrão canônico (:root, agora "Robotic
   Light — Remarques"), mas continua disponível como opção completa. */
body.theme-executive-dark {
  --bg-main: #16130F;
  --bg-sidebar: #100D0A;
  --bg-card: rgba(32, 27, 21, 0.94);
  --bg-card-hover: rgba(42, 35, 27, 0.98);
  --bg-input: rgba(19, 16, 12, 0.92);
  --border-color: rgba(201, 124, 61, 0.16);
  --border-active: rgba(201, 124, 61, 0.55);
  --primary: #C97C3D;
  --primary-rgb: 201, 124, 61;
  --primary-hover: #AD6730;
  --primary-glow: rgba(201, 124, 61, 0.28);
  --accent-cyan: #2E8B84;
  --accent-cyan-rgb: 46, 139, 132;
  --accent-emerald: #4C9A6A;
  --accent-emerald-rgb: 76, 154, 106;
  --accent-amber: #D9A441;
  --accent-amber-rgb: 217, 164, 65;
  --accent-rose: #C1503F;
  --accent-rose-rgb: 193, 80, 63;
  --accent-purple: #8B6A9C;
  --accent-purple-rgb: 139, 106, 156;
  --text-primary: #F5F1E8;
  --text-secondary: #B4A996;
  --text-muted: #8A7F6E;
  --status-success: var(--accent-emerald);
  --status-success-rgb: var(--accent-emerald-rgb);
  --status-warning: var(--accent-amber);
  --status-warning-rgb: var(--accent-amber-rgb);
  --status-danger: var(--accent-rose);
  --status-danger-rgb: var(--accent-rose-rgb);
  --status-info: var(--accent-cyan);
  --status-info-rgb: var(--accent-cyan-rgb);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
}

body.theme-executive-dark .bg-glow-1 {
  background: repeating-linear-gradient(
    115deg,
    rgba(201, 124, 61, 0.035) 0px,
    rgba(201, 124, 61, 0.035) 2px,
    transparent 2px,
    transparent 64px
  );
}

/* 2. Proposta 2: Industrial Tech & Heavy-Duty B2B — aço escovado + âmbar de
   sinalização industrial, propositalmente mais frio que a Proposta 1. */
body.theme-industrial-tech {
  --bg-main: #10151C;
  --bg-sidebar: #0A0E13;
  --bg-card: rgba(23, 30, 40, 0.94);
  --bg-card-hover: rgba(32, 41, 54, 0.98);
  --bg-input: rgba(16, 21, 28, 0.92);
  --border-color: rgba(219, 158, 35, 0.2);
  --border-active: rgba(219, 158, 35, 0.65);
  --primary: #DB9E23;
  --primary-rgb: 219, 158, 35;
  --primary-hover: #B9820F;
  --primary-glow: rgba(219, 158, 35, 0.32);
  --accent-amber: #DB9E23;
  --accent-amber-rgb: 219, 158, 35;
}

body.theme-industrial-tech .badge-ref {
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
}

body.theme-industrial-tech .bg-glow-1 {
  background: repeating-linear-gradient(
    115deg,
    rgba(219, 158, 35, 0.04) 0px,
    rgba(219, 158, 35, 0.04) 2px,
    transparent 2px,
    transparent 64px
  );
}

/* 3. Proposta 3: Clean Ultra-Light — sala de reunião, papel e cobre, não o
   azul-cobalto padrão de SaaS claro. */
body.theme-clean-light {
  --bg-main: #F6F3EE;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FBF9F5;
  --bg-input: #FFFFFF;
  --border-color: #E7E0D4;
  --border-active: #B3672C;
  --primary: #B3672C;
  --primary-rgb: 179, 103, 44;
  --primary-hover: #94531F;
  --primary-glow: rgba(179, 103, 44, 0.2);
  --text-primary: #221C14;
  --text-secondary: #5C5346;
  --text-muted: #8A8071;
}

body.theme-clean-light {
  background-color: var(--bg-main);
  color: var(--text-primary);
}

body.theme-clean-light .sidebar {
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
}

body.theme-clean-light .sidebar-nav a {
  color: #475569;
}

body.theme-clean-light .sidebar-nav a.active {
  background: rgba(37, 99, 235, 0.08);
  color: #2563EB;
  border-left: 3px solid #2563EB;
  font-weight: 600;
}

body.theme-clean-light .card,
body.theme-clean-light .inbox-threads-sidebar,
body.theme-clean-light .inbox-chat-area,
body.theme-clean-light .inbox-dossier-panel,
body.theme-clean-light .table-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-clean-light .modal-content {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

body.theme-clean-light input,
body.theme-clean-light select,
body.theme-clean-light textarea {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
}

body.theme-clean-light input:focus,
body.theme-clean-light select:focus,
body.theme-clean-light textarea:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.theme-clean-light .btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

body.theme-clean-light .btn-secondary:hover {
  background: #E2E8F0;
}

body.theme-clean-light .btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

body.theme-clean-light table th {
  background: #F8FAFC;
  color: #475569;
  border-bottom: 1px solid #E2E8F0;
}

body.theme-clean-light table td {
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
}

body.theme-clean-light .header-title h1,
body.theme-clean-light .modal-header h3,
body.theme-clean-light .card h3 {
  color: #0F172A;
}

body.theme-clean-light .kanban-column {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
}

body.theme-clean-light .kanban-column h3 {
  color: #334155;
}

body.theme-clean-light .chat-bubble.client {
  background: #F1F5F9;
  color: #0F172A;
  border: 1px solid #E2E8F0;
}

body.theme-clean-light .chat-bubble.agent {
  background: #2563EB;
  color: #FFFFFF;
}

/* 4. Proposta 4 (padrão canônico desde o redesenho de 2026-09): Robotic
   Light — Remarques. Usa os mesmos valores de :root (nenhuma variável de
   cor precisa ser redeclarada aqui), mas corrige os componentes que tinham
   cor "hardcoded" assumindo fundo escuro (texto branco, modais #111827 etc.
   — o mesmo gap que já existia, sem ser notado, no tema Clean Ultra-Light)
   e acrescenta a camada de movimento "robótico" pedida no redesenho. */
body.theme-robotic-light .sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  box-shadow: 2px 0 10px rgba(28, 26, 22, 0.04);
}

body.theme-robotic-light .nav-item:hover {
  color: var(--text-primary);
  background: rgba(var(--primary-rgb), 0.08);
}

body.theme-robotic-light .nav-item.active {
  color: var(--primary-hover);
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.04));
}

body.theme-robotic-light .card,
body.theme-robotic-light .table-responsive {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

body.theme-robotic-light .inbox-threads-list,
body.theme-robotic-light .inbox-customer-panel {
  background: var(--bg-card);
}

body.theme-robotic-light .inbox-thread-item {
  border-bottom: 1px solid var(--border-color);
}

body.theme-robotic-light .inbox-thread-item:hover {
  background: rgba(var(--primary-rgb), 0.06);
}

body.theme-robotic-light .inbox-thread-item.active {
  background: rgba(var(--primary-rgb), 0.12);
}

body.theme-robotic-light .inbox-chat-header {
  background: rgba(var(--primary-rgb), 0.04);
}

body.theme-robotic-light .modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 20px 25px -5px rgba(28, 26, 22, 0.12);
}

body.theme-robotic-light input,
body.theme-robotic-light select,
body.theme-robotic-light textarea {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body.theme-robotic-light input:focus,
body.theme-robotic-light select:focus,
body.theme-robotic-light textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

body.theme-robotic-light .btn-secondary {
  background: #EFEAD9;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

body.theme-robotic-light .btn-secondary:hover {
  background: #E4DECE;
}

body.theme-robotic-light table th {
  background: #F8F6EF;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

body.theme-robotic-light table td {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

body.theme-robotic-light .header-title h1,
body.theme-robotic-light .modal-header h3,
body.theme-robotic-light .card h3,
body.theme-robotic-light .report-metric-box h3,
body.theme-robotic-light .legal-doc-section h3,
body.theme-robotic-light .catalog-card-body h4,
body.theme-robotic-light .catalog-card-price,
body.theme-robotic-light .kanban-card-client,
body.theme-robotic-light .inbox-thread-name {
  color: var(--text-primary);
}

body.theme-robotic-light .kanban-column {
  background: #F8F6EF;
  border: 1px solid var(--border-color);
}

body.theme-robotic-light .kanban-column h3 {
  color: var(--text-secondary);
}

body.theme-robotic-light .chat-bubble.client {
  background: #F1EEE3;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

body.theme-robotic-light .chat-bubble.agent {
  background: var(--primary);
  color: #FFFFFF;
}

body.theme-robotic-light .settings-tab-btn.active {
  color: #FFFFFF;
}

/* Movimento: pulso de status, varredura de "circuito" no item de menu ativo
   e no botão primário, entrada escalonada de cards/colunas ao carregar uma
   view — a "amplitude de movimento automatizada" pedida no redesenho. */
body.theme-robotic-light .status-dot {
  animation: pulse 2s infinite, roboticPulse 2s infinite;
}

body.theme-robotic-light .nav-item.active,
body.theme-robotic-light .btn-primary {
  background-size: 200% 100%;
  animation: circuitSweep 3.5s linear infinite;
}

body.theme-robotic-light .card,
body.theme-robotic-light .kanban-column {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.theme-robotic-light .card:nth-child(2),
body.theme-robotic-light .kanban-column:nth-child(2) { animation-delay: 0.04s; }
body.theme-robotic-light .card:nth-child(3),
body.theme-robotic-light .kanban-column:nth-child(3) { animation-delay: 0.08s; }
body.theme-robotic-light .card:nth-child(4),
body.theme-robotic-light .kanban-column:nth-child(4) { animation-delay: 0.12s; }
body.theme-robotic-light .card:nth-child(5),
body.theme-robotic-light .kanban-column:nth-child(5) { animation-delay: 0.16s; }

body.theme-clean-light .bg-glow-1,
body.theme-clean-light .bg-glow-2 {
  display: none;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Fundo: uma única faixa diagonal discreta (referência a sinalização
   industrial) no lugar dos dois "blobs" radiais coloridos — o efeito mais
   reconhecível de dashboard genérico gerado por IA. */
.bg-glow-1 {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(var(--primary-rgb), 0.05) 0px,
    rgba(var(--primary-rgb), 0.05) 2px,
    transparent 2px,
    transparent 64px
  );
  pointer-events: none;
  z-index: 0;
}

.bg-glow-2 {
  position: fixed;
  top: -220px;
  right: -220px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.09) 0%, rgba(var(--primary-rgb), 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Sidebar */
aside.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 24px 16px;
  backdrop-filter: blur(4px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bg-sidebar);
  flex-shrink: 0;
}

.brand-info h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-info span {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Navigation Links — agrupados em blocos por área/nível de autoridade, não
   mais uma lista plana de 18 itens (mais fácil de escanear visualmente). */
nav.nav-menu {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0; /* permite o scroll interno em vez de estourar o sidebar */
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-label {
  display: block;
  padding: 0 14px;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.75;
}

/* Bloco de autoridade elevada: separado visualmente do resto do menu com
   divisor, leve realce e um selo no item que exige papel ADMIN. */
.nav-group-admin {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.nav-group-label-admin {
  color: var(--accent-amber, #f59e0b);
  opacity: 0.9;
}

.nav-item-badge {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1206;
  background: var(--accent-amber, #f59e0b);
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition-fast);
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0.05));
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--accent-emerald);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Camada de movimento "robótico" — usada principalmente por
   body.theme-robotic-light, para não alterar o comportamento dos outros
   temas. modalFadeIn conserta uma animação já referenciada por
   .onboarding-modal que nunca teve @keyframes definido. */
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes roboticPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0); }
}

@keyframes circuitSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Main Container */
main.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 32px 40px;
  position: relative;
  z-index: 1;
}

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

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

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

.tenant-badge {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.kpi-content span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-content h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 6px;
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.blue { background: rgba(var(--primary-rgb), 0.15); color: var(--primary); }
.kpi-icon.emerald { background: rgba(var(--accent-emerald-rgb), 0.15); color: var(--accent-emerald); }
.kpi-icon.amber { background: rgba(var(--accent-amber-rgb), 0.15); color: var(--accent-amber); }
.kpi-icon.purple { background: rgba(var(--accent-purple-rgb), 0.15); color: var(--accent-purple); }

/* Tables & Glass Panels */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

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

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

table.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.green, .badge.emerald { background: rgba(var(--accent-emerald-rgb), 0.15); color: var(--accent-emerald); }
.badge.blue { background: rgba(var(--primary-rgb), 0.15); color: var(--primary); }
.badge.amber { background: rgba(var(--accent-amber-rgb), 0.15); color: var(--accent-amber); }
.badge.purple { background: rgba(var(--accent-purple-rgb), 0.15); color: var(--accent-purple); }
.badge.cyan { background: rgba(var(--accent-cyan-rgb), 0.15); color: var(--accent-cyan); }
.badge.rose { background: rgba(var(--accent-rose-rgb), 0.15); color: var(--accent-rose); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

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

.modal-card {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 580px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modality Selector Box */
.modality-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.modality-option {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.02);
}

.modality-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.modality-option h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.modality-option p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Settings Tabs */
.settings-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  padding-bottom: 8px;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.settings-tab-btn.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--primary);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

/* Module Toggle Cards */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.module-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition-fast);
}

.module-card:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.04);
}

.module-card-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.module-card-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Kanban de Notas e Ligações
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(270px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 550px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.kanban-column-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-todo .kanban-column-header { border-bottom-color: var(--accent-cyan); }
.kanban-col-progress .kanban-column-header { border-bottom-color: var(--primary); }
.kanban-col-scheduled .kanban-column-header { border-bottom-color: var(--accent-amber); }
.kanban-col-won .kanban-column-header { border-bottom-color: var(--accent-emerald); }
.kanban-col-lost .kanban-column-header { border-bottom-color: var(--accent-rose); }

.kanban-count-badge {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.kanban-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: var(--transition-fast);
}

.kanban-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.kanban-card-client {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}

.kanban-card-contact {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.kanban-card-subject {
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--accent-cyan);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.kanban-card-brand-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.kanban-notes-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 8px;
  max-height: 110px;
  overflow-y: auto;
  font-size: 0.76rem;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}

.kanban-note-item {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.kanban-note-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.kanban-note-time {
  color: var(--text-muted);
  font-size: 0.68rem;
  display: block;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Badge Instagram & Verificação Oficial API Brasil
   ========================================================================== */
.badge-instagram {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
}

.badge-verified-brasil {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: #34D399;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   Catálogo com Fotos Fixas (Aspect-Ratio 1:1) & Referência Comercial
   ========================================================================== */
.catalog-view-toggle {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.catalog-view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.catalog-view-btn.active {
  background: var(--primary);
  color: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.catalog-category-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 -4px;
  padding: 10px 16px;
  background: var(--accent-amber);
  color: #1a1200;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.catalog-category-header .count {
  margin-left: auto;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.75;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
}

.catalog-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.catalog-photo-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111827;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-photo-container img {
  transform: scale(1.04);
}

.badge-ref-commercial {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(13, 19, 34, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
}

.badge-brand-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(245, 158, 11, 0.9);
  color: #000;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.catalog-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}

.catalog-card-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex: 1;
}

.catalog-card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: auto;
}

.catalog-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-heading);
}

.catalog-card-commission {
  font-size: 0.78rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* ==========================================================================
   Filtros & Toolbar de Orçamentos e Pedidos (Dia / Cliente / Marca)
   ========================================================================== */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Central de Relatórios Multidimensionais
   ========================================================================== */
.reports-kpi-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.report-metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.report-metric-box span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.report-metric-box h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}

/* ==========================================================================
   Console Tátil para Tablet de Rua (Vendedor Externo)
   ========================================================================== */
.tablet-console {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .tablet-console {
    grid-template-columns: 1fr;
  }
}

.tablet-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.tablet-product-card:active {
  transform: scale(0.98);
  border-color: var(--accent-cyan);
}

.tablet-product-thumb {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #111827;
}

.btn-tablet-touch {
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ==========================================================================
   Central de Atendimento Multiatendente (Inbox SocialMaker Style)
   ========================================================================== */
.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 16px;
  height: calc(100vh - 160px);
  min-height: 600px;
}

@media (max-width: 1200px) {
  .inbox-layout {
    grid-template-columns: 280px 1fr;
  }
  .inbox-customer-panel {
    display: none;
  }
}

.inbox-threads-list {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inbox-threads-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
}

.inbox-threads-container {
  overflow-y: auto;
  flex: 1;
}

.inbox-thread-item {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition-fast);
}

.inbox-thread-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.inbox-thread-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--primary);
}

.inbox-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.inbox-thread-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.inbox-thread-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Central */
.inbox-chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inbox-chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.inbox-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-bubble.client {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border-color);
}

.chat-bubble.agent {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.chat-bubble-time {
  font-size: 0.68rem;
  opacity: 0.7;
  display: block;
  margin-top: 4px;
  text-align: right;
}

.inbox-chat-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(13, 19, 34, 0.95);
}

.inbox-tools-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-inbox-tool {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-inbox-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--primary);
}

/* Painel Lateral do Cliente */
.inbox-customer-panel {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dossier-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.dossier-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ==========================================================================
   WIZARD DE IMPLANTAÇÃO & SELEÇÃO DEFINITIVA DE TEMA
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.onboarding-modal {
  background: #0D1322;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  max-width: 1100px;
  width: 100%;
  padding: 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  color: #F8FAFC;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 28px;
}

.onboarding-header h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #FFFFFF 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.onboarding-header p {
  color: #94A3B8;
  font-size: 0.95rem;
  max-width: 760px;
  margin: 0 auto;
}

.theme-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

@media (max-width: 900px) {
  .theme-card-grid {
    grid-template-columns: 1fr;
  }
}

.theme-choice-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.theme-choice-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.theme-choice-card.selected[data-theme="robotic_light"] {
  border-color: #D9A441;
  background: rgba(217, 164, 65, 0.08);
  box-shadow: 0 0 25px rgba(217, 164, 65, 0.25);
}

.theme-choice-card.selected[data-theme="executive_dark"] {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
}

.theme-choice-card.selected[data-theme="industrial_tech"] {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.theme-choice-card.selected[data-theme="clean_light"] {
  border-color: #2563EB;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.25);
}

.theme-choice-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.theme-choice-card[data-theme="robotic_light"] .theme-choice-badge {
  background: rgba(217, 164, 65, 0.2);
  color: #D9A441;
}

.theme-choice-card[data-theme="executive_dark"] .theme-choice-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.theme-choice-card[data-theme="industrial_tech"] .theme-choice-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

.theme-choice-card[data-theme="clean_light"] .theme-choice-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #38BDF8;
}

.theme-choice-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 12px 0 6px 0;
  color: #FFFFFF;
}

.theme-choice-card p.theme-desc {
  font-size: 0.85rem;
  color: #94A3B8;
  line-height: 1.45;
  margin-bottom: 14px;
}

.theme-swatches {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.swatch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-highlights {
  list-style: none;
  font-size: 0.8rem;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.theme-highlights li::before {
  content: "✔ ";
  color: var(--primary);
  font-weight: bold;
}

.btn-preview-theme {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}

.btn-preview-theme:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #FFFFFF;
}

.lock-warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.lock-warning-box .warning-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.lock-warning-box .warning-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FCA5A5;
  margin-bottom: 4px;
}

.lock-warning-box .warning-text p {
  font-size: 0.85rem;
  color: #E2E8F0;
  line-height: 1.45;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.checkbox-consent-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #CBD5E1;
  cursor: pointer;
  user-select: none;
}

.checkbox-consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-confirm-lock {
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-theme-locked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   18. SETOR DE LEGAL, GOVERNANÇA LGPD & TERMOS
   ========================================================================== */
.legal-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.legal-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.legal-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

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

.legal-doc-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.legal-doc-meta-banner {
  padding: 20px 26px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.legal-doc-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}

.legal-external-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: opacity 0.2s;
}

.legal-external-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.legal-doc-body {
  padding: 28px 32px;
  max-height: 620px;
  overflow-y: auto;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-doc-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-doc-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-doc-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-doc-section p {
  margin-bottom: 10px;
  white-space: pre-line;
}

.legal-callout-box {
  background: rgba(6, 182, 212, 0.08);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 14px 0;
  color: #E2E8F0;
  font-size: 0.88rem;
}

.legal-doc-footer-action {
  padding: 18px 28px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ==========================================================================
   19. CONECTORES, PROTOCOLO MCP & CRÉDITOS DE IA
   ========================================================================== */
.connectors-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.connectors-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.connectors-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

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

.connectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.connector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.connector-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.connector-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.connector-card-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.connector-endpoint-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  word-break: break-all;
}

.connector-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.connectors-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.connectors-mini-icon.emerald { background: rgba(16, 185, 129, 0.12); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.3); }
.connectors-mini-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3B82F6; border: 1px solid rgba(59, 130, 246, 0.3); }
.connectors-mini-icon.amber { background: rgba(245, 158, 11, 0.12); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.3); }

.ai-credit-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.ai-credit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #06B6D4);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.package-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.package-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent-emerald);
}

.package-card.popular {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.04);
}

/* ==========================================================================
   MAPA DE COBERTURA — ESPÍRITO SANTO
   Geometria real (malha municipal IBGE, UF 32, projeção equirretangular),
   distâncias reais (Haversine) de Vila Velha até pontos de referência na
   fronteira do estado. Ver web/app.js → renderCoverageMap() para a fonte
   dos dados geográficos e app.ES_MAP_SITES para as coordenadas usadas.
   ========================================================================== */
.coverage-map-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .coverage-map-layout {
    grid-template-columns: 1fr;
  }
}

.coverage-map-svg-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
}

.coverage-map-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.es-outline {
  fill: rgba(var(--primary-rgb), 0.07);
  stroke: var(--primary);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.es-distance-line {
  stroke: var(--accent-cyan);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  fill: none;
  opacity: 0.75;
}

.es-distance-line.oceanic {
  stroke: var(--accent-rose);
}

.es-ref-point circle {
  fill: var(--bg-card);
  stroke: var(--accent-cyan);
  stroke-width: 1.6;
}

.es-ref-point.oceanic circle {
  stroke: var(--accent-rose);
}

.es-ref-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--text-secondary);
}

.es-distance-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  fill: var(--accent-cyan);
}

.es-distance-label.oceanic {
  fill: var(--accent-rose);
}

.es-vv-marker circle {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 2;
  animation: roboticPulse 2.2s infinite;
}

.es-vv-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  fill: var(--text-primary);
}

.es-client-dot {
  fill: var(--accent-emerald);
  stroke: var(--bg-card);
  stroke-width: 1.5;
  opacity: 0.88;
}

.coverage-map-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.coverage-legend-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.coverage-legend-item .direction {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.coverage-legend-item .place {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.coverage-legend-item .km {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 1rem;
  white-space: nowrap;
}

.coverage-legend-item.oceanic .km {
  color: var(--accent-rose);
}

.coverage-map-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

/* ---------- Visualizador de senha (aplicado via web/password-toggle.js) ---------- */
.pw-field { position: relative; display: flex; }
.pw-field input[type="password"],
.pw-field input[type="text"] { flex: 1; padding-right: 40px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; min-width: 32px; min-height: 32px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 1rem; line-height: 1;
  color: var(--text-muted);
}
.pw-toggle:hover { background: var(--bg-card-hover); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pw-toggle[aria-pressed="true"] { color: var(--primary); }

/* ---------- Esqueci a senha / redefinição ---------- */
.auth-link-row { text-align: center; margin-top: 10px; }
.auth-link-row a,
.auth-link-row button.link-btn {
  color: var(--primary); background: none; border: none; cursor: pointer;
  font-size: 0.82rem; text-decoration: underline; padding: 6px; min-height: 32px;
}
.auth-message {
  font-size: 0.85rem; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px;
}
.auth-message.success { background: rgba(var(--accent-emerald-rgb), 0.15); color: var(--accent-emerald); }
.auth-message.error { color: var(--accent-rose); background: rgba(var(--accent-rose-rgb), 0.12); }

