:root {
  /* ==============================================================================
     ADAPTTI BRAND COLOR OVERRIDES
     ============================================================================== */
  
  /* Sobrescreve a paleta de cores azuis do Chatwoot (Radix/Tailwind) para os tons de azul da Adaptti */
  --blue-1: #f4f7fa;
  --blue-2: #e9eff5;
  --blue-3: #d6e3f0;
  --blue-4: #c0d5eb;
  --blue-5: #a8c5e4;
  --blue-6: #8db2dc;
  --blue-7: #6e9cd2;
  --blue-8: #4b82c4;
  --blue-9: #336699;  /* Azul Principal da Adaptti */
  --blue-10: #2a5580; /* Azul Hover/Foco da Adaptti */
  --blue-11: #214366; /* Azul Escuro para Textos */
  --blue-12: #142a40; /* Azul de Alto Contraste */

  /* Sobrescreve as cores de Destaques/Alertas utilizando o laranja da Adaptti */
  --orange-1: #fff8f2;
  --orange-2: #ffedd6;
  --orange-3: #ffddb3;
  --orange-4: #ffcc8a;
  --orange-5: #ffb85c;
  --orange-6: #ffa129;
  --orange-7: #f08d13;
  --orange-8: #d97800;
  --orange-9: #ff7b00;  /* Laranja Destaque da Adaptti */
  --orange-10: #e06c00;
  --orange-11: #b35600;
  --orange-12: #5c2c00;

  /* ==============================================================================
     CHATWOOT NATIVE WOOT & BRAND VARIABLE OVERRIDES
     ============================================================================== */
  
  /* Sobrescreve a cor principal dos botões, inputs ativos e badges do Chatwoot */
  --woot-25: #fff8f2;   /* Laranja bem claro */
  --woot-50: #ffedd6;   /* Laranja claro para fundos secundários */
  --woot-500: #336699;  /* Azul Adaptti padrão nos botões */
  --woot-600: #ff7b00;  /* Laranja Adaptti quando passa o mouse (Hover!) */
  --woot-700: #e06c00;  /* Laranja mais escuro ao clicar (Active!) */

  --brand-25: #fff8f2;
  --brand-50: #ffedd6;
  --brand-500: #336699;
  --brand-600: #ff7b00; /* Laranja no hover */
  --brand-700: #e06c00;
}

/* ==============================================================================
   HIDE CAPITÃO (CAPTAIN) & ENTERPRISE ITEMS
   ============================================================================== */

/* 1. Oculta links de navegação para Capitão e submenus Enterprise */
a[href*="captain"],
a[href*="Captain"],
a[href*="/captain"],
[data-testid*="captain"],
a[href*="/settings/custom-roles"],
a[href*="/settings/sla"],
a[href*="/settings/security"],
a[href*="/settings/audit-logs"],
a[href*="/settings/agent-assistants"] {
  display: none !important;
}

/* 2. Oculta o item pai na sidebar principal e submenus para Capitão e Enterprise */
li:has(a[href*="captain"]),
li:has(a[href*="Captain"]),
li:has(a[href*="/captain"]),
.sidebar-item:has(a[href*="captain"]),
.secondary-menu--item:has(a[href*="captain"]),
div:has(> a[href*="captain"]),
div:has(> a[href*="Captain"]),
div:has(> a[href*="/captain"]),
li:has(> a[href*="/settings/custom-roles"]),
li:has(> a[href*="/settings/sla"]),
li:has(> a[href*="/settings/security"]),
li:has(> a[href*="/settings/audit-logs"]),
li:has(> a[href*="/settings/agent-assistants"]),
.secondary-menu--item:has(a[href*="/settings/custom-roles"]),
.secondary-menu--item:has(a[href*="/settings/sla"]),
.secondary-menu--item:has(a[href*="/settings/security"]),
.secondary-menu--item:has(a[href*="/settings/audit-logs"]),
.secondary-menu--item:has(a[href*="/settings/agent-assistants"]) {
  display: none !important;
}

/* 3. Banners e cards promocionais de upgrade para Enterprise */
.upgrade-banner,
.upgrade-container,
.enterprise-upgrade-card,
[data-testid="upgrade-banner"],
.banner--upgrade,
.captain-upgrade-card,
.assistants-upgrade-card {
  display: none !important;
}

/* ==============================================================================
   CHATWOOT ATTACHED IMAGES (ANEXOS DE IMAGEM NO FEED - TAMANHO AMPLIADO ~4X)
   ============================================================================== */

/* Imagens enviadas nas conversas (skip-context-menu / active_storage) */
img.skip-context-menu,
img[src*="active_storage"],
img[src*="blobs"],
img[src*="redirect"],
.media-container img,
.image-container img,
.attachment img {
  width: auto !important;
  height: auto !important;
  max-width: 320px !important;  /* Amplia a imagem no feed (~4x a 8x maior) */
  max-height: 380px !important;
  min-width: 140px !important;  /* Garante identificação visual nítida */
  min-height: 140px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 6px 0 !important;
}

/* ==============================================================================
   EMOJI DEFENSE & ENLARGEMENT (ISOLADO - SEM AFETAR ANEXOS DE IMAGENS)
   ============================================================================== */

/* 1. Imagens de Emojis estritamente (exclui anexos .skip-context-menu) */
img.emoji:not(.skip-context-menu),
img.twemoji:not(.skip-context-menu),
img[src*="emoji"]:not(.skip-context-menu),
img[src*="twemoji"]:not(.skip-context-menu),
img[src*="unpkg.com"]:not(.skip-context-menu),
img[src*="jsdelivr.net"]:not(.skip-context-menu),
span.emoji,
[data-emoji] {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  vertical-align: -4px !important;
  display: inline-block !important;
  object-fit: contain !important;
  margin: 0 2px !important;
}

/* 2. Emojis no seletor de emojis (Popup) */
.emoji-dialog img,
.emoji-picker-container img,
.emoji-picker--item img,
.emoji-dialog span,
.emoji-picker span {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
}

/* 3. Mensagens exclusivamente de Emoji (Big Emojis) */
.only-emoji img,
[class*="only-emoji"] img,
.message-text--only-emoji img,
.message-text p:only-child img.emoji {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
}

/* 4. Ajuste de tamanho de fonte em mensagens */
.conversation-panel p,
.message-text p,
.chat-bubble p {
  font-size: 15px !important;
  line-height: 1.5 !important;
}

/* ==============================================================================
   CHATWOOT V4 EMOJI PICKER & BUTTON OVERRIDES (EXACT COMPONENT TARGETING)
   ============================================================================== */

/* Amplia os botões e os caracteres dos emojis no seletor do Chatwoot v4 */
button[style*="--ep-tint"],
button.aspect-square[title],
button[class*="hover:bg-[var(--ep-tint)]"] {
  font-size: 1.85rem !important; /* Aumenta a fonte do emoji de text-xl (20px) para ~30px */
  line-height: 1 !important;
  width: 2.75rem !important;      /* Amplia o quadrado do botão no seletor */
  height: 2.75rem !important;
  max-width: 2.75rem !important;
  max-height: 2.75rem !important;
  min-width: 2.75rem !important;
  min-height: 2.75rem !important;
}

/* ==============================================================================
   ADAPTTI CONVERSATION HEADER LABELS (BADGES, SMART COUNTER & RESPONSIVENESS)
   ============================================================================== */

.adaptti-header-labels-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: calc(100% - 20px);
  position: relative;
}

.adaptti-header-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  border-radius: 6px;
  max-width: 145px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.adaptti-header-chip:hover {
  filter: brightness(0.92);
  transform: translateY(-0.5px);
}

.adaptti-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.adaptti-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  color: #1e293b;
}

/* Badge Agrupador "+N mais" */
.adaptti-header-chip-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  border-radius: 6px;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.adaptti-header-chip-more:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* ==============================================================================
   ADAPTTI FLOATING TOOLTIP & POPOVER (GLOBAL FIXED POSITIONING)
   ============================================================================== */

.adaptti-floating-tooltip {
  display: none;
  position: fixed;
  z-index: 9999999;
  background: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.adaptti-floating-popover {
  display: none;
  position: fixed;
  z-index: 9999999;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 170px;
  max-width: 280px;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.adaptti-popover-header {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 2px;
  border-bottom: 1px solid #f1f5f9;
}

.adaptti-popover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.adaptti-popover-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dark mode compatibility */
.dark .adaptti-chip-text {
  color: #f1f5f9;
}
.dark .adaptti-header-chip-more {
  background-color: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}
.dark .adaptti-header-chip-more:hover {
  background-color: #334155;
  color: #ffffff;
}
.dark .adaptti-floating-tooltip {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}
.dark .adaptti-floating-popover {
  background: #0f172a;
  border-color: #334155;
}
.dark .adaptti-popover-header {
  color: #94a3b8;
  border-bottom-color: #1e293b;
}
.dark .adaptti-popover-item {
  color: #f1f5f9;
}

/* Garante coexistência harmoniosa do nome truncado com os chips */
div:has(> #adaptti-header-labels) > span.truncate {
  max-width: 240px !important;
  flex-shrink: 1 !important;
}

/* Indicador sutil de hover no nome do contato caso tenha empresa cadastrada */
.adaptti-has-company {
  cursor: pointer;
  text-decoration: underline dotted rgba(100, 116, 139, 0.45);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.adaptti-has-company:hover {
  color: var(--blue-9, #336699) !important;
  text-decoration-color: var(--blue-9, #336699);
}

.dark .adaptti-has-company {
  text-decoration-color: rgba(148, 163, 184, 0.45);
}

.dark .adaptti-has-company:hover {
  color: #38bdf8 !important;
  text-decoration-color: #38bdf8;
}

/* ==============================================================================
   SIDEBAR LABELS SCROLLBAR & HEIGHT ENHANCEMENT
   ============================================================================== */

.group\/sidebar-section ul > div.max-h-60 {
  max-height: 380px !important;
  scrollbar-width: thin !important;
}

.group\/sidebar-section ul > div.max-h-60::-webkit-scrollbar {
  display: block !important;
  width: 4px !important;
}

.group\/sidebar-section ul > div.max-h-60::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.5) !important;
  border-radius: 4px !important;
}












