@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --iq-bg: #0c1526;
  --iq-card: #ffffff;
  --iq-border: #e2e8f0;
  --iq-text: #0f172a;
  --iq-muted: #64748b;
  --iq-primary: #4f46e5;
  --iq-primary-soft: #e0e7ff;
  --iq-success: #22c55e;
  --iq-danger: #ef4444;
  --iq-shell-border: #1e3054;
  --iq-shell-text: #e2e8f0;
  --iq-shell-muted: #94a3b8;
  --iq-safe-top: env(safe-area-inset-top, 0px);
  --iq-safe-right: env(safe-area-inset-right, 0px);
  --iq-safe-bottom: env(safe-area-inset-bottom, 0px);
  --iq-safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--iq-bg) url("/assets/dashboard-bg-earth-night.jpg") center/cover no-repeat fixed;
  color: var(--iq-text);
}

.topbar {
  min-height: calc(68px + var(--iq-safe-top)) !important;
  padding:
    max(14px, calc(var(--iq-safe-top) + 12px))
    max(16px, calc(var(--iq-safe-right) + 16px))
    12px
    max(16px, calc(var(--iq-safe-left) + 16px)) !important;
}

.content {
  padding-left: max(20px, calc(var(--iq-safe-left) + 20px)) !important;
  padding-right: max(20px, calc(var(--iq-safe-right) + 20px)) !important;
  padding-bottom: max(20px, calc(var(--iq-safe-bottom) + 20px)) !important;
}

.shell.shell-mobile-header .topbar {
  gap: 10px !important;
  min-height: calc(62px + var(--iq-safe-top)) !important;
  padding:
    max(12px, calc(var(--iq-safe-top) + 10px))
    max(14px, calc(var(--iq-safe-right) + 14px))
    10px
    max(14px, calc(var(--iq-safe-left) + 14px)) !important;
}

.shell.shell-mobile-header .subtitle,
.shell.shell-mobile-header .topbar-search,
.shell.shell-mobile-header .topbar-actions {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   PWA desktop (janela instalada) — Window Controls Overlay.
   Tira a barra sólida do navegador e deixa o ÚNICO fundo do body (a Terra, que
   já é `fixed` na viewport) subir até o topo, atrás dos botões da janela.
   Não há segundo fundo: é a mesma imagem esticada. Tudo aqui só liga dentro da
   janela instalada (display-mode: window-controls-overlay); no navegador comum
   nada muda.
   ────────────────────────────────────────────────────────────────────────── */
.wco-drag-strip {
  display: none;
}

/* O banner "Instale o IQ Pipe" não faz sentido dentro do app JÁ instalado, e o
   "X" de fechar fica atrás dos botões da janela no modo WCO. Esconde em qualquer
   modo instalado. */
@media (display-mode: window-controls-overlay),
       (display-mode: standalone),
       (display-mode: minimal-ui),
       (display-mode: fullscreen) {
  .pwa-banner-install {
    display: none !important;
  }
}

@media (display-mode: window-controls-overlay) {
  /* Altura da faixa dos botões da janela. No Mac o env(titlebar-area-height)
     às vezes volta 0, então garantimos no mínimo 40px com max(). */
  :root {
    --wco-bar: max(40px, env(titlebar-area-height, 40px));
  }

  /* Reserva no topo essa faixa, para o conteúdo do app nunca ficar embaixo dos
     botões. O fundo fixo do body (a Terra) aparece nela automaticamente. */
  body {
    padding-top: var(--wco-bar);
  }

  .shell {
    min-height: calc(100vh - var(--wco-bar));
  }

  /* Sidebar e topbar grudam logo ABAIXO da faixa, nunca atrás dos botões. */
  .sidebar {
    top: var(--wco-bar) !important;
  }
  /* O body já desce TODO o conteúdo em --wco-bar. Como o topbar é sticky,
     repetir o offset aqui causaria deslocamento duplo (topbar a 2×--wco-bar) e
     sobreposição com o header de página logo abaixo. Por isso fica em 0.
     (Diagnóstico de runtime: Claude Cowork, medido na janela WCO real.) */
  .topbar {
    top: 0 !important;
  }

  /* Faixa transparente no topo: mostra a Terra do body e permite arrastar a
     janela (clicar e segurar para mover). */
  .wco-drag-strip {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--wco-bar);
    z-index: 60;
    -webkit-app-region: drag;
    app-region: drag;
  }
}

.shell.shell-mobile-header .menu-toggle,
.shell.shell-mobile-header .profile-trigger {
  width: 40px !important;
  height: 40px !important;
}

.shell {
  background: transparent !important;
  grid-template-columns: 260px 1fr !important;
}

.shell.sidebar-collapsed {
  grid-template-columns: 65px 1fr !important;
}

.sidebar {
  background: rgba(8, 14, 28, 0.32) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.sidebar .brand {
  min-height: 54px !important;
  border-bottom: 1px solid var(--iq-shell-border) !important;
  gap: 10px !important;
}

.sidebar .brand-copy {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.sidebar .brand-title {
  font-size: 40px !important;
  letter-spacing: -0.03em !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

.sidebar .brand-version {
  color: var(--iq-shell-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar-close-mobile {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid var(--iq-shell-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.sidebar-collapse {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid var(--iq-shell-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

.sidebar.collapsed .brand {
  justify-content: center !important;
  padding-inline: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}

.sidebar.collapsed .brand-copy {
  display: none !important;
}

.sidebar.collapsed .brand-version {
  display: none !important;
}

.nav-group-label {
  color: var(--iq-shell-muted) !important;
  font-size: 11px !important;
  letter-spacing: 0.16em !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

.nav-link {
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  color: #c8d5e7 !important;
  margin: 0 8px 3px !important;
  min-height: 38px !important;
  padding-left: 30px !important;
  gap: 8px !important;
}

.nav-link-label {
  text-align: left !important;
}

/* Submenu (netos) = SEM bloco próprio. Apenas um container transparente; a
   hierarquia vem só da indentação dos sub-links. Tudo vive no único bloco da
   seção, sem caixinha aninhada (normalizado). */
.nav-submenu {
  display: grid !important;
  gap: 0 !important;
  margin: 0 0 2px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.nav-sub-link {
  text-decoration: none !important;
  color: var(--iq-shell-muted) !important;
  margin: 0 0 5px !important;             /* respiro maior entre netos (#3) */
  min-height: 32px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  padding: 5px 14px 5px 36px !important;  /* dot do neto na coluna 44px = sob a 1ª letra do pai (#2) */
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
}

.nav-sub-link:hover {
  background: rgba(255, 255, 255, 0.12) !important; /* MESMO hover dos itens (normalizado) */
  border-color: transparent !important;
  color: #ffffff !important;
}

.nav-sub-link.active {
  background: rgba(56, 132, 255, 0.22) !important; /* azul da marca, sem roxo/borda (#3) */
  border-color: transparent !important;
  color: #ffffff !important;
}

.nav-sub-link.active .nav-sub-link-dot {
  background: #ffffff !important;        /* dot do neto ativo nítido sobre o azul */
}

.sidebar.collapsed .nav-submenu {
  display: none !important;
}

.sidebar.collapsed .nav-link {
  justify-content: center !important;
  padding: 10px 8px !important;
}

.sidebar.collapsed .nav-link.active {
  padding-left: 8px !important;
  box-shadow: none !important;
}

.sidebar.collapsed .nav-link-icon {
  margin-right: 0 !important;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important; /* visível sobre o bloco 0.06 e igual ao hover dos netos */
  border-color: transparent !important;
  color: #ffffff !important;
}

.nav-link.active {
  background: rgba(56, 132, 255, 0.22) !important; /* azul da marca, limpo (#3) */
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: none !important;                     /* sem a barra lateral legada */
}

.nav-link-icon {
  color: var(--iq-shell-muted) !important;
}

.nav-link:hover .nav-link-icon,
.nav-link.active .nav-link-icon {
  color: #cfe2ff !important;
}

/* Item-pai com sub-páginas ABERTO = linha NORMAL do bloco (nada de caixinha).
   Fundo transparente vence o azul de "ativo" (regra depois de .nav-link.active),
   então só o neto ativo fica azul — nunca pai e filho juntos. */
.nav-link-toggle.open {
  background: transparent !important;
  border-color: transparent !important;
  color: #c8d5e7 !important;   /* mata o azul morto do tailwick-theme; igual aos outros itens */
  box-shadow: none !important;
}

/* mas o hover do pai aberto continua funcionando (vence o transparent acima) */
.nav-link-toggle.open:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.nav-link-toggle.open .nav-link-icon,
.nav-link-toggle.open .nav-link-chevron {
  color: var(--iq-shell-muted) !important; /* igual aos outros itens (normalizado) */
}

/* Cabeçalho-atalho (ex.: CRM) usa o mesmo realce de item ativo. */
.nav-group-link.active {
  background: rgba(56, 132, 255, 0.22) !important; /* atalho ativo (CRM) no mesmo azul limpo (#3) */
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

.nav-group-link.active .nav-group-label,
.nav-group-link.active .nav-group-label-icon {
  color: #ffffff !important;
}

.nav-group-label-icon {
  width: 16px !important;
  min-width: 16px !important;
  justify-content: center !important;
  color: #ffffff !important;
}

.nav-group-toggle:hover {
  background: #f1f5f924 !important;
}

.nav-group-chevron {
  color: #ffffff !important;
  display: inline-flex !important;
  transition: transform .15s ease !important;
}

/* O tailwick-theme.css força width:100% no toggle (vai até a borda, vazando o
   recuo de 8px). Normaliza TODOS os toggles (fechados e abertos) p/ a mesma
   caixa recuada => borda direita e chevrons alinhados em todos. */
.nav-group-toggle {
  width: calc(100% - 16px) !important;
  box-sizing: border-box !important;
}

/* SEÇÃO ABERTA = bloco contínuo (técnica do Bitrix24): o título e todos os
   itens da seção viram um único retângulo arredondado. O título recebe o fundo
   translúcido + cantos de cima; o conteúdo recebe O MESMO fundo + cantos de
   baixo, encostados. Só fora do modo recolhido. */
/* O tailwick-theme.css força gap: 6px no .nav-group — era a folga que separava
   o título dos filhos (#1). Zera no grupo aberto. */
.nav:not(.collapsed) .nav-group.open {
  gap: 0 !important;
}

/* Bloco em LARGURA CHEIA (sem o recuo que fazia o "ninho" parecer estreito).
   Ícone/texto na coluna 18px via padding => o título NÃO desloca ao abrir. */
.nav:not(.collapsed) .nav-group.open .nav-group-toggle {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: transparent !important;
  border-radius: 10px 10px 0 0 !important;
  width: calc(100% - 16px) !important;   /* MESMA caixa do menu fechado: recuo 8px + chevron alinhado (#1) */
  margin: 0 8px 0 !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;          /* base => ícone em 18px, chevron em 100%-18 (igual ao fechado) */
}

.nav:not(.collapsed) .nav-group.open .nav-group-content {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 0 10px 10px !important;
  width: calc(100% - 16px) !important;   /* idêntico ao título */
  margin: 0 8px 6px !important;
  box-sizing: border-box !important;
  padding: 6px 0 6px !important;
}

/* Itens da seção aberta na MESMA coluna do título (ícone em 18px) e com o
   chevron na MESMA coluna do chevron da seção (padding-right 10 = igual ao toggle). */
.nav:not(.collapsed) .nav-group.open .nav-group-content .nav-link {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 10px !important;         /* conteúdo recuado 8px + 10px = ícone em 18px */
  padding-right: 10px !important;        /* chevron do item alinhado com o da seção */
}

.nav:not(.collapsed) .nav-group.open .nav-group-content .nav-submenu {
  margin: 0 0 4px !important;          /* submenu alinhado com o item-pai */
}

.sidebar.collapsed .nav-link .nav-tooltip {
  border: 1px solid var(--iq-shell-border) !important;
  background: #0f1b30 !important;
  color: var(--iq-shell-text) !important;
}

/* ============================================================
   MENU RECOLHIDO — o sidebar de navegação foi reescrito num CSS Module isolado
   (sidebar-nav.module.css). Aqui só resta o que pertence ao <aside> (shell):
   quando recolhido, o aside NÃO pode cortar nem ter scroll próprio, senão o
   overlay-no-hover do módulo (o .nav vira absolute + 260px) fica clipado.
   O scroll vive dentro do .nav (módulo). Ver relatorio-sidebar-bitrix.md.
   ============================================================ */
.sidebar.collapsed {
  overflow: visible !important;
  z-index: 60 !important;
}

.sidebar-backdrop {
  background: rgba(4, 8, 16, 0.62) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
}

.topbar {
  min-height: 72px !important;
  padding: 12px 24px !important;
  background: rgb(0 81 255 / 0%) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  backdrop-filter: blur(5px) !important;
  border-bottom: 0 !important;
  /* grid item de .main: sem isto o header cresce até o min-content e vaza/corta o avatar (min-width:auto padrão de item de grid) */
  min-width: 0 !important;
}

.subtitle {
  color: var(--iq-shell-muted) !important;
  font-size: 12px !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase;
}

.topbar-search {
  height: 40px !important;
  border-radius: 10px !important;
  border-color: var(--iq-shell-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.topbar-search input {
  background: transparent !important;
  border: 0 !important;
  color: var(--iq-shell-text) !important;
}

.topbar-search input::placeholder {
  color: var(--iq-shell-muted) !important;
}

.topbar-icon-btn,
.profile-trigger,
.menu-toggle,
.agency-switch-control {
  border-color: var(--iq-shell-border) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.content {
  padding: 0 18px !important;
  background: transparent !important;
}

.panel {
  border-radius: 5px !important;
  border: 1px solid var(--iq-border) !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.panel-title {
  margin: 0 0 6px;
  color: var(--iq-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
}

.section-title {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--iq-text);
}

.helper {
  margin: 0;
  color: var(--iq-muted);
  font-size: 13px;
}

.setup-reminder {
  border: 1px solid #fde68a !important;
  background: #fef9c3 !important;
}

.btn-primary {
  background: var(--iq-primary) !important;
  border-color: var(--iq-primary) !important;
}

.btn-primary:hover {
  background: #4338ca !important;
}

.btn-inline.neutral {
  background: #334155 !important;
}

.twk-home {
  display: grid;
  gap: 16px;
}

.twk-overline {
  margin: 0 0 8px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
  font-weight: 700;
}

.twk-card {
  border: 1px solid var(--iq-border);
  border-radius: 5px;
  background: #fff;
  padding: 18px;
}

/* ── Public scheduling page ─────────────────────────────────────────────── */

main.public-scheduling-shell {
  padding: 28px 16px !important;
  min-height: 100vh;
}

main.public-scheduling-shell > .twk-card.public-scheduling-card,
main.public-scheduling-shell > .public-scheduling-card {
  width: min(100%, 660px) !important;
  max-width: 660px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

/* Header band */
.psc-header {
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e5e7eb;
}

.psc-overline {
  display: block;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: #6366f1 !important;
  margin: 0 0 8px !important;
}

.psc-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 0 10px !important;
  line-height: 1.3 !important;
}

.psc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.psc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 20px;
  padding: 3px 10px;
  line-height: 1.4;
}

.psc-description {
  margin: 0 !important;
  font-size: 14px !important;
  color: #6b7280 !important;
  line-height: 1.5 !important;
}

.psc-meeting-info {
  margin: 8px 0 0 !important;
  font-size: 13px !important;
  color: #6b7280 !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 6px !important;
  line-height: 1.4 !important;
}

/* Inner sections */
.psc-section {
  padding: 20px 28px;
  border-bottom: 1px solid #f0f0f0;
}
.psc-section:last-child {
  border-bottom: none;
}

.psc-section-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: #6366f1 !important;
  margin: 0 0 14px !important;
}

/* Date input */
.psc-section input[type="date"] {
  width: 100%;
  min-height: 40px;
  margin: 0;
}

/* Slot buttons */
.psc-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.psc-slot-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s, color 0.13s;
  line-height: 1.4;
}
.psc-slot-btn:hover {
  border-color: #818cf8;
  color: #4f46e5;
  background: #f5f3ff;
}
.psc-slot-btn.selected {
  border-color: #4f46e5;
  background: #4f46e5;
  color: #fff;
}

/* Selected slot summary chip */
.psc-slot-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: 13px;
  color: #166534;
  font-weight: 600;
  margin-bottom: 14px;
}

/* Form inside section */
.psc-section .form {
  margin: 0 !important;
}

/* Submit button */
.psc-submit {
  width: 100% !important;
  min-height: 44px !important;
  font-size: 15px !important;
  margin-top: 4px !important;
}

@media (max-width: 500px) {
  .psc-header,
  .psc-section {
    padding-left: 18px;
    padding-right: 18px;
  }
  .psc-title {
    font-size: 19px !important;
  }
}

.twk-home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.twk-home-hero h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.twk-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.twk-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.twk-kpi-card {
  padding: 16px;
  background: linear-gradient(165deg, #fff, #f8fafc);
}

.twk-kpi-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.twk-kpi-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.twk-kpi-card span {
  color: #94a3b8;
  font-size: 12px;
}

.twk-home-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.twk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.twk-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.twk-inline-link {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
}

.twk-inline-link:hover {
  text-decoration: underline;
}

.twk-stage-list {
  display: grid;
  gap: 12px;
}

.twk-stage-row {
  display: grid;
  gap: 8px;
}

.twk-stage-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.twk-stage-row-title strong {
  font-size: 14px;
}

.twk-stage-row-title span {
  color: #64748b;
  font-size: 13px;
}

.twk-stage-row-progress {
  height: 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
}

.twk-stage-row-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #4f46e5);
}

.twk-health-grid {
  display: grid;
  gap: 10px;
}

.twk-health-grid > div {
  padding: 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.twk-health-grid span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.twk-health-grid strong {
  font-size: 18px;
}

.twk-table {
  display: grid;
  gap: 6px;
}

.twk-table-head,
.twk-table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 2fr 0.95fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.twk-table-head {
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--iq-border);
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.twk-table-row {
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  font-size: 13px;
}

.twk-table-row span:nth-child(3) {
  color: #475569;
}

.twk-table-card:last-child .twk-table-head,
.twk-table-card:last-child .twk-table-row {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

.twk-inbox-page .panel.twk-inbox-shell {
  padding: 0;
  border-radius: 10px 10px 0 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: none !important;
}

@media (min-width: 1161px) {
  /* Shell é flex column (ver bloco global ~2455). NÃO redeclarar grid aqui:
     era a duplicata que reintroduzia o auto/1fr e o espaço morto. */
  .twk-inbox-page .panel.twk-inbox-shell {
    display: flex;
    flex-direction: column;
  }

  .inbox-layout {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
  }

  .inbox-leads-panel,
  .inbox-chat,
  .inbox-detail-panel {
    min-height: 0 !important;
    height: 100%;
  }

  .inbox-messages {
    min-height: 0 !important;
    max-height: none !important;
  }
}

.twk-inbox-shell-head {
  align-items: center;
  border-bottom: 1px solid var(--iq-border);
  padding: 4px 4px 12px;
  margin-bottom: 10px;
}

.twk-inbox-shell-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.inbox-layout {
  grid-template-columns: 300px minmax(0, 1fr) 270px !important;
  gap: 0 !important;
}

.inbox-panel {
  background: #fff !important;
  border: 1px solid var(--iq-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Colunas coladas (gap:0): colapsa a borda dobrada removendo a borda
   esquerda dos painéis que não são o primeiro */
.inbox-layout .inbox-panel + .inbox-panel {
  border-left: 0 !important;
}

/* Chat (coluna do meio): sem borda nenhuma — encosta direto na coluna de
   leads (sem divisória esquerda) e a divisória com o detalhe fica por conta
   da borda-esquerda do .inbox-detail-panel. */
.inbox-layout .inbox-chat,
.inbox-layout .inbox-panel.inbox-chat {
  border: 0 !important;
}

/* Coluna de detalhe: borda esquerda é a divisória com o chat; remove topo e
   direita (duplicavam a moldura externa). Cor explícita p/ aparecer na
   transição cinza(chat)->branco(detalhe), igual à divisória da esquerda. */
.inbox-layout .inbox-detail-panel,
.inbox-layout .inbox-panel.inbox-detail-panel {
  border-left: 1px solid #d8e0ec !important;
  border-top: 0 !important;
  border-right: 0 !important;
  background: #f7f9ff !important;
}

/* Coluna de leads: remove borda de cima e da esquerda (duplicavam a moldura
   externa e criavam a fresta); mantém a direita como divisória com o chat */
.inbox-layout .inbox-leads-panel {
  border-top: 0 !important;
  border-left: 0 !important;
}

/* Perfil do contato: avatar maior em cima, nome embaixo, tudo centralizado */
.inbox-detail-body {
  padding: 6px !important;
  gap: 6px !important;
}

/* Card "Marketing" (independente): header cinza + corpo, estilo do tema.
   Campos read-only de origem (campanha/anúncio) como badges outline. */
.iq-marketing-card {
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  /* Reutilizável: pode viver em coluna estreita (grid/flex). min-width:0
     deixa o card encolher em vez de estourar e ser cortado pelo pai. */
  min-width: 0;
}
.iq-marketing-card-head {
  background: #e9edf3;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  color: #334155;
}
.iq-marketing-card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.iq-marketing-card-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #64748b;
}
.iq-marketing-card-group {
  display: grid;
  gap: 5px;
  /* Evita que conteúdo largo (chips/badges) force a coluna a crescer. */
  min-width: 0;
}
.iq-marketing-card-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Outline badge igual ao tema Tailwick. Valores exatos do tema:
   border-radius 0.25rem, border-width 1px, font-weight 500, padding 2px 10px.
   justify-self/align-self start: não estica no grid (largura dinâmica). */
.iq-badge-outline {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 2px 10px;
  border-width: 1px;
  border-style: solid;
  border-color: oklch(62.3% 0.214 259.815);
  border-radius: 0.25rem;
  background: transparent;
  color: oklch(62.3% 0.214 259.815);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  /* Valores longos sem espaço (códigos UTM, URLs) quebram em vez de cortar. */
  overflow-wrap: anywhere;
}
/* Anúncio: azul "info" do tema */
.iq-marketing-card-group:last-child .iq-badge-outline {
  border-color: oklch(68.5% 0.169 237.323);
  color: oklch(68.5% 0.169 237.323);
}

/* Card "Atendimento": reusa o .iq-marketing-card; no last-child o badge volta
   à cor padrão (a regra acima é só para o card Marketing de fato). */
.iq-atendimento-card .iq-marketing-card-group:last-child .iq-badge-outline {
  border-color: oklch(62.3% 0.214 259.815);
  color: oklch(62.3% 0.214 259.815);
}

/* Variantes de cor do Outline Badge (mesma paleta oklch do tema Tailwind/
   Tailwick já usada acima). Usadas nos chips de contexto do popover de SLA do
   inbox: departamento em tom neutro, etapa em tom mais suave; o responsável
   fica no azul primário padrão (.iq-badge-outline). */
.iq-badge-outline--neutral {
  border-color: oklch(55.4% 0.046 257.417); /* slate-500 */
  color: oklch(55.4% 0.046 257.417);
}
.iq-badge-outline--muted {
  border-color: oklch(70.4% 0.04 256.788); /* slate-400 */
  color: oklch(55.4% 0.046 257.417); /* slate-500 */
}

/* F2 — card de sugestão da IA (a IA propõe, o humano confirma/dispensa em 1
   clique). Reusa o .iq-marketing-card; destaque por barra de acento + dot, sem
   fundo pastel (paleta business). */
.iq-suggestion-card {
  border-color: oklch(62.3% 0.214 259.815);
  border-left-width: 3px;
}
.iq-suggestion-card .iq-marketing-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.iq-suggestion-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(62.3% 0.214 259.815);
  flex: 0 0 auto;
}
.iq-suggestion-headline {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #1e293b;
}
/* Reason longo não enterra os botões: máx 3 linhas com ellipsis */
.iq-suggestion-card .iq-marketing-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.iq-suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.iq-suggestion-confirm,
.iq-suggestion-dismiss {
  appearance: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.iq-suggestion-confirm {
  border: 1px solid oklch(62.3% 0.214 259.815);
  background: oklch(62.3% 0.214 259.815);
  color: #fff;
}
.iq-suggestion-confirm:hover:not(:disabled) {
  background: oklch(55% 0.21 259.815);
  border-color: oklch(55% 0.21 259.815);
}
.iq-suggestion-dismiss {
  border: 1px solid var(--iq-border);
  background: #fff;
  color: #475569;
}
.iq-suggestion-dismiss:hover:not(:disabled) {
  background: #f1f5f9;
}
.iq-suggestion-confirm:disabled,
.iq-suggestion-dismiss:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Campos do card Atendimento em formato "chip" (mesmo padrão dos Observadores
   de tarefa): vazio = botão pontilhado "+ Adicionar"; com valor = chip + ×. */
.iq-chip-select {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.iq-chip-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef3ff;
  color: #2747a8;
  border-radius: 14px;
  padding: 4px 8px 4px 12px;
  font-size: 14px;
  font-weight: 500;
}
.iq-chip-select-remove {
  border: none;
  background: transparent;
  color: #5b6b8c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0;
  line-height: 1;
}
.iq-chip-select-remove:hover {
  color: #1f2937;
}
/* Botão pontilhado "+ Adicionar" (um <select> estilizado). Escopado no card
   (não no form): o card Atendimento é irmão independente, fora do
   .inbox-detail-form. 2 classes garantem a especificidade necessária. */
.iq-atendimento-card .iq-chip-select-add {
  /* Largura do TEXTO "+ Adicionar", não da maior option. Um <select> dimensiona
     pela option mais larga; width fixo + text-overflow evita o botão esticar
     conforme nomes longos (ex.: "Assumir para mim (...)"). */
  width: 116px;
  min-height: 0;
  border: 1px dashed #c5d0e4;
  border-radius: 14px;
  background: transparent;
  font-size: 14px;
  color: #4a7dff;
  cursor: pointer;
  padding: 5px 12px;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
}
.iq-atendimento-card .iq-chip-select-add:focus {
  outline: none;
  border-color: #4a7dff;
}
.iq-atendimento-card .iq-chip-select-add:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inbox-detail-profile {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 12px !important;
  margin-top: 14px !important;
  margin-bottom: 14px !important;
}

.inbox-detail-profile .inbox-detail-avatar {
  width: 72px !important;
  height: 72px !important;
  font-size: 24px !important;
}

.inbox-detail-profile > div > strong {
  font-size: 17px !important;
}

/* Altura das colunas é 100% dinâmica (regida pelo flex do .content + grid do
   shell). NADA de min-height fixo aqui: piso fixo (650px) estourava a tela em
   viewports curtas. */

.inbox-panel-head {
  border-bottom: 1px solid var(--iq-border);
}

/* Header "Sobre o contato" com o ícone de etiqueta alinhado à direita.
   Especificidade .inbox-panel > … .inbox-detail-head p/ vencer a regra que
   força flex-direction:column nos cabeçalhos (linha ~1129). */
.inbox-panel > .inbox-panel-head.inbox-detail-head {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
/* Zera o width:100% que a regra base (.inbox-panel-head > *) aplica a TODOS os
   filhos — era o que empilhava h3 e ícone. */
.inbox-panel > .inbox-panel-head.inbox-detail-head > * {
  width: auto !important;
}
.inbox-panel > .inbox-panel-head.inbox-detail-head > h3 {
  margin: 0 !important;
}
.inbox-panel > .inbox-panel-head.inbox-detail-head > .lead-label-selector-wrap {
  flex-shrink: 0 !important;
}

/* Variante só-ícone do seletor de etiquetas (sem borda, só o ícone). */
.lead-label-add-btn.icon-only {
  border: 0 !important;
  border-radius: 8px;
  padding: 0;
  width: 32px;
  height: 32px;
  justify-content: center;
  color: #64748b;
  background: transparent;
  flex-shrink: 0;
}
.lead-label-add-btn.icon-only:hover:not(:disabled) {
  color: #6366f1;
  background: #f5f6ff;
}
/* Dropdown abre alinhado à direita (o botão fica no canto direito do header). */
.lead-label-dropdown-right {
  left: auto !important;
  right: 0 !important;
}

/* Ações do header (ícones de mídia + etiqueta). */
.inbox-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.inbox-detail-head-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.inbox-detail-head-icon:hover {
  color: #6366f1;
  background: #f5f6ff;
}
.inbox-detail-head-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

/* ===== Modal "Arquivos e mídia" ===== */
.inbox-media-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.inbox-media-modal {
  width: min(720px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}
.inbox-media-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--iq-border);
}
.inbox-media-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}
.inbox-media-modal-close {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  padding: 4px;
  border-radius: 6px;
}
.inbox-media-modal-close:hover {
  background: #f1f5f9;
  color: #1a1a2e;
}
.inbox-media-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}
.inbox-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.inbox-media-item {
  display: flex;
  text-decoration: none;
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

/* Thumb (imagem e vídeo) */
.inbox-media-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  cursor: pointer;
}
.inbox-media-thumb img,
.inbox-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inbox-media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
}

/* Áudio */
.inbox-media-audio {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
}
.inbox-media-audio-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2ff;
  color: #6366f1;
}
.inbox-media-audio audio {
  width: 100%;
  height: 34px;
}

/* Documento: mini-página A4 com ícone do tipo + extensão */
.inbox-media-doc {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  color: #334155;
}
.inbox-media-doc-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 58px;
  height: 78px; /* proporção ~A4 */
  background: #fff;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  color: #64748b;
}
/* dobra de canto da "página" */
.inbox-media-doc-page::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 12px 12px 0;
  border-style: solid;
  border-color: #e2e8f0 #f8fafc;
}
.inbox-media-doc-ext {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6366f1;
}
.inbox-media-doc-name {
  width: 100%;
  font-size: 11px;
  color: #475569;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-thread-search {
  background: #fff !important;
}

/* Busca expansível no header do chat: a lupa fica no lugar e o campo
   abre "atrás" dela, com a lupa ancorada à direita dentro do form. */
.inbox-search-expand {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.inbox-search-expand.open {
  flex: 1 1 auto;
}
.inbox-search-expand-input {
  width: 320px;
  max-width: 42vw;
  box-sizing: border-box;
  height: 38px;
  padding: 8px 42px 8px 14px; /* espaço à direita p/ a lupa */
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  outline: none;
}
.inbox-search-expand-input:focus {
  border-color: #b9c6d9;
}
/* a lupa flutua sobre a borda direita do input */
.inbox-search-expand.open > .inbox-head-action.icon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* Mini-card de lead: sem borda, só linha divisória embaixo;
   hover cinza claro; ativo azul. */
.inbox-lead {
  border: 0 !important;
  border-bottom: 1px solid var(--iq-border) !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: none !important;
  transition: background 0.12s ease !important;
}

.inbox-lead:hover {
  background: #f1f5f9 !important;
}

.inbox-lead.active {
  border-color: transparent !important;
  border-bottom-color: var(--iq-border) !important;
  background: #eef2ff !important;
}

.inbox-lead.active:hover {
  background: #e7edff !important;
}

.inbox-unread-badge {
  background: var(--iq-danger) !important;
  color: #fff !important;
}

.inbox-chat-head {
  border-bottom: 1px solid var(--iq-border);
  background: #fff;
}

/* O widget flutuante do Copilot foi desmontado globalmente em shell-layout.js
   (2026-06-06). A antiga regra que o escondia só no inbox foi removida por ficar
   sem efeito. */

/* Igualar a altura dos 3 cabeçalhos de coluna (busca | chat | sobre o contato) */
.inbox-panel > .inbox-panel-head,
.inbox-panel > .inbox-chat-head {
  min-height: 66px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.inbox-panel > .inbox-panel-head > * {
  width: 100%;
}

.inbox-panel > .inbox-chat-head > .inbox-chat-head-row {
  align-items: center !important;
  width: 100%;
}

.inbox-chat-title {
  font-size: 22px !important;
}

.inbox-messages {
  /* Padrão de doodles bem sutil no fundo do chat (estilo WhatsApp). Os traços
     são pretos sobre branco; o gradiente branco quase opaco por cima + blend
     deixam só um fantasma clarinho. Ajustar a opacidade na 1ª camada (0.94)
     pra mais/menos visível. */
  background:
    linear-gradient(rgba(241, 245, 249, 0.94), rgba(241, 245, 249, 0.94)),
    url("/assets/inbox-doodles.jpg") repeat top left / 420px auto,
    #f1f5f9 !important;
  /* Sem min/max-height fixo: a área de mensagens é a faixa 1fr do grid
     .inbox-chat (auto 1fr auto) e rola sozinha. O max-height calc(100vh-…)
     ignorava topbar/banner e deixava branco embaixo. */
}

/* ===== Modelo WhatsApp: contato à ESQUERDA, EU à DIREITA =====
   Restaurado a pedido do Ederson 2026-06-10 (revertendo o feed all-left de
   2026-06-05). Inbound = avatar+nome+balão à esquerda; outbound = espelhado
   à direita com balão verde. A cor do nome vem do style inline
   avatarColorFromName (por isso o .inbox-msg-sender-name aqui NÃO fixa cor). */
.inbox-msg-row,
.inbox-msg-row.inbound,
.inbox-msg-wrap,
.inbox-msg-wrap.inbound {
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 12px !important;
}
.inbox-msg-row.outbound,
.inbox-msg-wrap.outbound {
  flex-direction: row-reverse !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 12px !important;
}
/* Outbound (EU): coluna, cabeçalho e balão encostam à DIREITA. */
.inbox-msg-row.outbound .inbox-msg-col,
.inbox-msg-wrap.outbound .inbox-msg-col {
  align-items: flex-end !important;
}
.inbox-msg-row.outbound .inbox-msg-header,
.inbox-msg-wrap.outbound .inbox-msg-header {
  flex-direction: row-reverse !important;
}

/* Respiro vertical entre mensagens (o gap:8px da base deixava tudo grudado). */
.inbox-messages {
  gap: 18px !important;
}

/* Avatar colorido por NOME (cor vem do style inline avatarColorFromName).
   NÃO forçar background aqui: !important venceria o inline e deixaria tudo da
   mesma cor — foi o bug do "tudo vermelho". */
.inbox-msg-avatar {
  color: #fff !important;
  border: 0 !important;
  font-weight: 700 !important;
}
.inbox-msg-avatar img {
  background: transparent;
}
/* Avatar do BOT no Copilot não tem cor inline: o .inbox-msg-avatar base
   (#dbe3ee, mais abaixo no source) vencia o gradiente índigo e o ícone branco
   sumia. Reforça o índigo da marca aqui (2 classes + !important vencem). */
.inbox-msg-avatar.inbox-copilot-msg-avatar {
  background: linear-gradient(135deg, #0c1a45 0%, #1a56d6 100%) !important;
}
/* No Copilot o avatar do EU é o ÚLTIMO filho do row (no atendimento é o
   primeiro). Com o row-reverse global ele caía no lado de DENTRO do balão
   ("perdido no espaço"). Aqui forçamos row normal + flex-end pro Copilot,
   colocando bolha e avatar encostados na direita, avatar por fora. */
.inbox-copilot-messages .inbox-msg-row.outbound {
  flex-direction: row !important;
  justify-content: flex-end !important;
}

/* Coluna ao lado do avatar: header (nome+hora) FORA do balão, balão embaixo.
   align-items:flex-start faz o balão encolher ao tamanho do conteúdo em vez de
   esticar pela coluna. */
.inbox-msg-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  min-width: 0 !important;
  max-width: min(92%, 680px) !important;
  flex: 0 1 auto !important;
}

/* Cabeçalho da mensagem: nome + data/hora juntos, FORA e ACIMA do balão. */
.inbox-msg-header {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
  padding: 0 2px 4px !important;
}
.inbox-msg-sender-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 !important;
}
.inbox-msg-header .inbox-msg-time {
  font-size: 11px !important;
  color: #8892a4 !important;
}

/* Balão: largura do CONTEÚDO (fit-content), não da linha. align-self:start
   impede o stretch; max-width limita mensagens longas. */
.inbox-msg,
.inbox-msg.inbound,
.inbox-msg.outbound {
  justify-self: start !important;
  align-self: flex-start !important;
  width: fit-content !important;
  max-width: 100% !important;
  background: #fff !important;
  border: 1px solid #e2e6ec !important;
  border-radius: 0 10px 10px 10px !important;
  box-shadow: 0 1px 2px rgba(17, 27, 33, 0.06) !important;
}

/* Outbound (EU): balão AZUL frio e limpo (família aliceblue, sem roxo/lilás),
   levemente mais saturado que o aliceblue puro pra não sumir contra o balão
   branco do contato. Canto espelhado (chanfro no topo-direito), encostado à
   direita. Vence o grupo acima por vir depois com mesma especificidade. */
.inbox-msg.outbound {
  background: #eaf3ff !important;
  border-color: #c4ddf6 !important;
  border-radius: 10px 0 10px 10px !important;
  align-self: flex-end !important;
}

.inbox-compose {
  border-top: 1px solid var(--iq-border);
  background: #fff;
}

.inbox-compose textarea {
  min-height: 82px;
}

.inbox-head-action,
.inbox-open-card-btn {
  border: 1px solid var(--iq-border) !important;
  background: #fff !important;
}

.inbox-detail-section {
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  background: #f8fafc;
}

.kanban-toolbar-metrics {
  display: none !important;
}

.kanban-board-surface {
  overflow-y: hidden !important;
  overflow-x: auto !important;
  background: transparent !important;
  border-color: transparent !important;
}

.kanban {
  min-width: max-content !important;
}

.kanban-col,
.kanban-col-enterprise {
  background: #f8fafc !important;
  border: 1px solid var(--iq-border) !important;
  min-height: 460px;
}

.twk-calendar-shell {
  background: #fff !important;
  border: 1px solid var(--iq-border) !important;
  border-radius: 5px !important;
  padding: 16px !important;
  overflow: visible;
}

.twk-calendar-app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.twk-calendar-side {
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.twk-calendar-create {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.twk-calendar-side-section {
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.twk-calendar-side-section h4 {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.twk-calendar-side-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.twk-calendar-side-section label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.twk-calendar-side-section input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.twk-calendar-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.twk-calendar-head {
  margin-bottom: 0 !important;
  align-items: flex-start !important;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.twk-calendar-title-wrap {
  display: grid;
  gap: 4px;
}

.twk-calendar-title-wrap .twk-overline {
  margin: 0;
}

.twk-calendar-title-wrap h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.twk-calendar-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.twk-calendar-nav {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap;
}

.twk-icon-btn {
  width: 38px;
  min-width: 38px;
  padding: 0 !important;
}

.twk-btn-today {
  gap: 6px;
}

.twk-calendar-month {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 190px;
  justify-content: center;
  text-transform: capitalize;
  color: #0f172a;
  font-size: 14px;
}

.twk-calendar-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.twk-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--iq-border);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #334155;
  background: #f8fafc;
}

.twk-calendar-legend-item.inbound {
  border-color: #bae6fd;
  color: #0369a1;
  background: #f0f9ff;
}

.twk-calendar-legend-item.outbound {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.twk-calendar-legend-item.created {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
}

.twk-calendar-legend-item.meeting {
  border-color: #ddd6fe;
  color: #6d28d9;
  background: #f5f3ff;
}

.twk-calendar-legend-item.booking {
  border-color: #99f6e4;
  color: #0f766e;
  background: #f0fdfa;
}

.twk-calendar-legend-item.task {
  border-color: #fde68a;
  color: #b45309;
  background: #fffbeb;
}

.twk-calendar-board {
  overflow-x: auto !important;
  overflow-y: visible;
  padding-bottom: 4px;
}

.twk-calendar-weekdays,
.twk-calendar-grid {
  width: max(100%, 980px);
  min-width: 980px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.twk-calendar-weekdays span {
  border: 1px solid var(--iq-border);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 6px;
}

.twk-calendar-day {
  border: 1px solid var(--iq-border);
  border-radius: 5px;
  background: #fff;
  min-height: 175px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
}

.twk-calendar-day.outside {
  background: #f8fafc;
  opacity: 0.75;
}

.twk-calendar-day.today {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
  background: #f5f3ff;
}

.twk-calendar-day.today .twk-calendar-day-head strong {
  background: #4f46e5;
  color: #fff;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.twk-calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.twk-calendar-day-head strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.twk-calendar-day-head span {
  min-width: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  padding: 4px 6px;
}

.twk-calendar-events {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.twk-calendar-event {
  text-align: left;
  border: 1px solid var(--iq-border);
  border-left: 3px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  padding: 6px 7px;
  display: grid;
  gap: 3px;
  color: #0f172a;
}

.twk-calendar-event strong {
  font-size: 11px;
  line-height: 1.15;
}

.twk-calendar-event p {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  color: #475569;
}

.twk-calendar-event small {
  font-size: 10px;
  color: #64748b;
}

.twk-calendar-event.inbound {
  border-left-color: #0ea5e9;
  background: #f0f9ff;
}

.twk-calendar-event.outbound {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.twk-calendar-event.created {
  border-left-color: #6366f1;
  background: #eef2ff;
}

.twk-calendar-event.meeting {
  border-left-color: #7c3aed;
  background: #f5f3ff;
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 2px;
}

.twk-calendar-event.meeting:hover {
  background: #ede9fe;
}

.twk-calendar-event.task {
  border-left-color: #d97706;
  background: #fffbeb;
  cursor: pointer;
}

.twk-calendar-event.task:hover {
  background: #fef3c7;
}

.twk-calendar-event.booking {
  border-left-color: #0d9488;
  background: #f0fdfa;
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 2px;
}

.twk-calendar-event.booking:hover {
  background: #ccfbf1;
}

.twk-calendar-more {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

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

  .inbox-layout {
    grid-template-columns: 280px minmax(0, 1fr) 240px !important;
  }
}

@media (max-width: 1160px) {
  .twk-home-split {
    grid-template-columns: 1fr;
  }

  .twk-calendar-head {
    display: grid !important;
    gap: 10px;
  }

  .twk-calendar-nav {
    flex-wrap: wrap;
  }

  .inbox-layout {
    grid-template-columns: 1fr !important;
  }

  .inbox-leads-panel,
  .inbox-chat,
  .inbox-detail-panel {
    min-height: unset;
  }
}

@media (max-width: 860px) {
  .twk-home-hero {
    display: grid;
  }

  .twk-kpi-grid {
    grid-template-columns: 1fr;
  }

  .twk-table-head,
  .twk-table-row {
    grid-template-columns: 1fr !important;
    gap: 4px;
  }

  .twk-calendar-month {
    min-width: 140px;
  }

  .twk-calendar-legend {
    flex-wrap: wrap;
  }
}

/* Header + button normalization */
.subtitle {
  white-space: nowrap;
}

.topbar-search {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  width: auto !important;
  flex: 0 1 520px !important;
  min-width: 280px !important;
  max-width: 560px !important;
  padding: 0 12px 0 38px !important;
}

.topbar-search > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.topbar-search input {
  width: 100% !important;
  min-width: 0;
  height: 100%;
  font-size: 14px !important;
  line-height: 1;
}

.agency-switch {
  min-width: 270px;
  gap: 0 !important;
}

.btn-primary,
.btn-inline,
.btn-secondary,
.inbox-filter-btn,
.inbox-head-action,
.inbox-open-card-btn,
.inbox-chat-back,
.kanban-view-tab,
.kanban-filter-tab,
.lead-modal-close,
.password-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  border: 1px solid var(--iq-border) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}

.btn-primary {
  background: var(--iq-primary) !important;
  border-color: var(--iq-primary) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: #4338ca !important;
  border-color: #4338ca !important;
}

.btn-inline,
.btn-inline.neutral,
.btn-secondary,
.inbox-head-action,
.inbox-open-card-btn,
.inbox-chat-back,
.kanban-view-tab,
.kanban-filter-tab,
.lead-modal-close,
.password-toggle {
  background: #fff !important;
  color: #334155 !important;
  border-color: var(--iq-border) !important;
}

.btn-inline:hover,
.btn-inline.neutral:hover,
.btn-secondary:hover,
.inbox-head-action:hover,
.inbox-open-card-btn:hover,
.inbox-chat-back:hover,
.kanban-view-tab:hover,
.kanban-filter-tab:hover,
.lead-modal-close:hover,
.password-toggle:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.btn-inline.danger {
  background: #fff1f2 !important;
  color: #b91c1c !important;
  border-color: #fecdd3 !important;
}

.btn-inline.danger:hover {
  background: #ffe4e6 !important;
  border-color: #fda4af !important;
}

.btn-inline.success {
  background: #15803d !important;
  color: #fff !important;
  border-color: #15803d !important;
}

.btn-inline.success:hover {
  background: #166534 !important;
  border-color: #166534 !important;
}

.actions-inline .btn-inline {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.kanban-view-tab.active,
.kanban-filter-tab.active,
.inbox-filter-btn.active {
  background: var(--iq-primary) !important;
  border-color: var(--iq-primary) !important;
  color: #fff !important;
}

@media (max-width: 1200px) {
  .topbar-search {
    min-width: 220px !important;
    flex-basis: 340px !important;
  }
}

.topbar-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-right: 10px !important;
  /* Cluster direito nunca encolhe/corta */
  flex: 0 0 auto !important;
}

.topbar-icon-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
  color: var(--iq-shell-text) !important;
  position: relative;
}

.topbar-icon-btn-notifications {
  overflow: visible !important;
}

.topbar-icon-btn svg {
  width: 16px !important;
  height: 16px !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.topbar-icon-badge {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  border: 2px solid #1a2540;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.topbar-icon-badge.is-zero {
  background: #cbd5e1;
  color: #475569;
  box-shadow: none;
}

.topbar-notifications-menu {
  width: 360px !important;
  max-height: 420px;
  overflow-y: auto;
}

.topbar-notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar-notifications-header strong {
  color: #334155 !important;
  font-size: 12px;
}

.topbar-notifications-empty {
  padding: 12px;
  color: #64748b;
  font-size: 13px;
}

.topbar-notification-item {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 10px !important;
  white-space: normal !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.topbar-notification-item > div {
  flex: 1;
  min-width: 0;
}

.topbar-notification-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.topbar-notification-item p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.topbar-notification-item > span {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.topbar-notification-footer {
  justify-content: center !important;
  font-weight: 700 !important;
}

/* ════════════════════════════════════════════════════════════════════════
   header recauchutado — proposta do Eder 2026-08-19, espelha o artboard
   "IQ Pipe - Header Colaboradores.html" (IconBtn, JourneyBtn/JT, JourneyMenu/
   MTONE). Tailwind v4 compila QUALQUER classe com modificador de opacidade
   (bg-white/[0.05], border-emerald-400/35, text-white/55...) para
   color-mix(), que Chrome/WebView desatualizados da frota da agência pintam
   ERRADO (bug documentado e reproduzido — ver app/components/ui/button.jsx:
   17-20). Por isso todo tom translúcido abaixo é rgba() explícito; classes
   Tailwind SEM opacidade (bg-emerald-50, rounded-2xl, text-[13px]...) seguem
   como utilitário normal direto no JSX, sem precisar de tradução aqui.
   ════════════════════════════════════════════════════════════════════════ */

/* Botão de ícone em vidro translúcido do cluster direito da topbar
   (busca/tema/ajuda/ver como/sino) — artboard IconBtn, linhas 78-85. */
.twk-topbar-glass-btn {
  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.55) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

.twk-topbar-glass-btn svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.twk-topbar-glass-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.twk-topbar-glass-btn:focus-visible {
  outline: none !important;
  /* Offset sólido em #0c1526 (não var(--iq-bg): essa variável é
     redeclarada mais abaixo no arquivo por outra "sweep" pra um tom claro
     que não é mais usado no fundo real — usar o literal evita herdar isso). */
  box-shadow: 0 0 0 2px #0c1526, 0 0 0 4px rgba(96, 165, 250, 0.7) !important;
}

/* Variante ativa (ex.: "Ver como" com um perfil sendo simulado) — âmbar, o
   mesmo tom da jornada em pausa, pra não perder o sinal de estado ativo. */
.twk-topbar-glass-btn--active,
.twk-topbar-glass-btn--active:hover {
  color: #fcd34d !important;
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(251, 191, 36, 0.4) !important;
}

/* Badge do sino — artboard: pílula -top-1.5/-right-1.5, ring escuro do
   chrome (literal #0c1526, o mesmo tom de fundo do body — ver nota acima
   sobre não usar var(--iq-bg)). */
.twk-topbar-badge {
  position: absolute !important;
  top: -6px !important;
  right: -6px !important;
  min-width: 17px !important;
  height: 17px !important;
  padding: 0 4px !important;
  border-radius: 999px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 17px !important;
  text-align: center !important;
  box-shadow: 0 0 0 2px #0c1526 !important;
}

.twk-topbar-badge.is-zero {
  background: rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 0 0 2px #0c1526 !important;
}

/* Avatar — só o ring muda; a imagem/fallback do componente ficam intocados. */
.twk-topbar-avatar-btn {
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: border-color 0.15s ease !important;
}

.twk-topbar-avatar-btn:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* A borda inferior da faixa (item 1 do recauchute) fica com a ÚLTIMA regra
   `.topbar` do arquivo ("Tailwick refresh: pragmatic visual sweep", perto da
   linha 4520) — esse bloco zera border-bottom DEPOIS deste ponto, e como
   nenhum dos dois tem mais especificidade que o outro, quem aparece por
   ÚLTIMO no arquivo vence. Colocar aqui seria letra morta (sobrescrita
   silenciosamente mais abaixo). */

/* ---- Pill da jornada de trabalho — artboard JourneyBtn/JT, linhas 97-112 ---- */
.twk-topbar-journey {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 36px !important;
  padding: 0 14px 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -0.005em !important;
  border-width: 1px !important;
  border-style: solid !important;
  white-space: nowrap !important;
  transition: filter 0.15s ease !important;
}

.twk-topbar-journey:hover,
.twk-topbar-journey.is-open {
  filter: brightness(1.12) !important;
}

.twk-topbar-journey:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #0c1526, 0 0 0 4px rgba(96, 165, 250, 0.7) !important;
}

/* Trabalhando — verde (JT.trabalhando). */
.twk-topbar-journey--working {
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.13) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.06),
    0 6px 18px -8px rgba(16, 185, 129, 0.5) !important;
}

/* Pausado / aguardando aprovação / ausente — âmbar (linguagem de 3 tons: só
   "trabalhando" é verde e só "encerrar" é vermelho; o resto indisponível
   mas ainda em jornada é âmbar). */
.twk-topbar-journey--busy {
  color: #fcd34d !important;
  background: rgba(245, 158, 11, 0.13) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  box-shadow: 0 6px 18px -8px rgba(245, 158, 11, 0.45) !important;
}

/* Offline — neutro (JT.offline). */
.twk-topbar-journey--offline {
  color: rgba(255, 255, 255, 0.55) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
}

/* Ponto pulsando do estado "trabalhando", no lugar do ícone — artboard usa
   `bg-emerald-400/70 animate-ping`; o `animate-ping` do Tailwind é só
   transform/opacity (sem color-mix, pode ficar utilitário normal), mas a cor
   com opacidade vem explícita aqui. */
.twk-topbar-journey-dot-ring {
  background: rgba(52, 211, 153, 0.7) !important;
}

/* Card do dropdown da jornada — artboard JourneyMenu, linhas 130-153. */
.twk-topbar-journey-menu {
  width: 268px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 28px 70px -20px rgba(2, 6, 23, 0.55) !important;
  padding: 8px !important;
}

body.iq-theme-dark {
  --iq-bg: #0f172a;
  --iq-border: #334155;
  --iq-primary: #6366f1;
  color: #e2e8f0;
}

body.iq-theme-dark .shell,
body.iq-theme-dark .content {
  background: transparent !important;
}

body.iq-theme-dark .panel,
body.iq-theme-dark .topbar-icon-btn,
body.iq-theme-dark .profile-trigger,
body.iq-theme-dark .menu-toggle,
body.iq-theme-dark .agency-switch-control {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body.iq-theme-dark .topbar,
body.iq-theme-dark .sidebar {
  background: rgba(8, 14, 28, 0.32) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

body.iq-theme-dark .subtitle,
body.iq-theme-dark .status,
body.iq-theme-dark .hint {
  color: #94a3b8 !important;
}

body.iq-theme-dark .topbar-search {
  background: #0b1220 !important;
  border-color: #334155 !important;
}

body.iq-theme-dark .topbar-search input {
  color: #e2e8f0 !important;
}

/* ===== Dashboard analytics (Tailwick style) ===== */
.iq-analytics-page {
  display: grid;
  gap: 16px;
}

.iq-analytics-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.iq-analytics-overline {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.iq-analytics-hero h1 {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.iq-analytics-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.iq-analytics-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.iq-stat-card {
  padding: 18px;
  background: #ffffff;
}

.iq-stat-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.iq-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.iq-stat-card span {
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}

.iq-stat-card.success {
  border-left: 3px solid #22c55e !important;
}

.iq-stat-card.warning {
  border-left: 3px solid #f59e0b !important;
}

.iq-stat-card.info {
  border-left: 3px solid #3b82f6 !important;
}

.iq-stat-card.danger {
  border-left: 3px solid #ef4444 !important;
}

.iq-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.iq-analytics-card {
  padding: 16px;
}

.iq-analytics-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.iq-analytics-card-head h3 {
  margin: 0;
  font-size: 18px;
}

.iq-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.iq-source-block {
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  padding: 12px;
  background: linear-gradient(
    165deg,
    rgba(79, 70, 229, calc(var(--iq-weight, 0.1) * 0.35 + 0.06)),
    rgba(255, 255, 255, 0.98)
  );
}

.iq-source-block strong {
  display: block;
  font-size: 13px;
}

.iq-source-block span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.iq-stage-list {
  display: grid;
  gap: 10px;
}

.iq-stage-row {
  display: grid;
  gap: 8px;
}

.iq-stage-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.iq-stage-row strong {
  font-size: 14px;
}

.iq-stage-row span {
  color: #64748b;
  font-size: 12px;
}

.iq-stage-progress {
  height: 8px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  overflow: hidden;
}

.iq-stage-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}

.iq-line-chart {
  display: grid;
  gap: 10px;
}

.iq-line-chart svg {
  width: 100%;
  height: 220px;
  border-radius: 5px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
}

.iq-line-fill {
  fill: rgba(79, 70, 229, 0.12);
}

.iq-line-stroke {
  fill: none;
  stroke: #4f46e5;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.iq-line-labels {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  font-size: 11px;
  color: #64748b;
}

.iq-bar-chart {
  min-height: 220px;
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  background: #f8fafc;
  padding: 12px 10px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.iq-bar {
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 4px;
}

.iq-bar-col {
  display: block;
  width: 100%;
  max-width: 26px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #6366f1, #4338ca);
  min-height: 6px;
}

.iq-bar small {
  font-size: 10px;
  color: #64748b;
}

.iq-bar strong {
  font-size: 10px;
  color: #334155;
}

.iq-inline-link {
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.iq-inline-link:hover {
  text-decoration: underline;
}

.iq-analytics-table {
  display: grid;
  gap: 6px;
}

.iq-analytics-table-head,
.iq-analytics-table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 2fr 0.8fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.iq-analytics-table-head {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
}

.iq-analytics-table-row {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
  font-size: 13px;
}

/* ===== Calendar app layout ===== */
.twk-calendar-app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
}

.twk-calendar-side {
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.twk-calendar-create {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.twk-calendar-side-section {
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.twk-calendar-side-section h4 {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.twk-calendar-side-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.twk-calendar-side-section label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.twk-calendar-side-section input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.twk-calendar-main {
  min-width: 0;
}

.twk-calendar-legend-side {
  display: grid;
  gap: 8px;
}

.twk-calendar-legend-side .twk-calendar-legend-item {
  justify-content: center;
}

/* ===== Chat app layout ===== */
.inbox-layout.inbox-layout-tailwick {
  grid-template-columns: 400px minmax(0, 1fr) 300px !important;
}

.inbox-head-action.icon {
  width: 34px;
  min-height: 34px !important;
  padding: 0 !important;
}

.inbox-chat-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Botão voltar do painel de suporte — oculto no desktop,
   visível só no mobile (@media max-width 900px abaixo). */
.inbox-detail-back {
  display: none;
}

.inbox-open-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inbox-messages {
  background: #edf2fb url("/assets/chat-DdXYAt3u.jpg") center/cover no-repeat;
  background-blend-mode: lighten;
}

/* Estado vazio do inbox (nenhuma conversa selecionada): ocupa a faixa do meio
   + a coluna da direita, com o MESMO fundo doodle do chat, imagem centralizada
   e a chamada para ação. */
.inbox-empty-state {
  grid-column: 2 / -1 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  /* Mesmo doodle do chat (.inbox-messages L1360, que vence por !important). */
  background:
    linear-gradient(rgba(241, 245, 249, 0.94), rgba(241, 245, 249, 0.94)),
    url("/assets/inbox-doodles.jpg") repeat top left / 420px auto,
    #f1f5f9;
}
/* No modo Suporte, o estado vazio do meio fica só na coluna do chat (col 2),
   deixando a coluna 3 livre para o painel "Chamados da empresa". */
.inbox-empty-state.inbox-empty-state-support {
  grid-column: 2 / 3 !important;
}
/* Kebab (⋮) do chamado: ícone nu, sem caixa. Hover só escurece o ícone. */
.inbox-ticket-kebab-btn {
  opacity: 0.65;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.inbox-ticket-kebab-btn:hover {
  opacity: 1;
  color: var(--twk-ink, #334155) !important;
}
.inbox-ticket-kebab-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.inbox-empty-state-img {
  width: 70%;
  max-width: 100%;
  height: auto;
  display: block;
  /* Sombra sutil que segue o formato do PNG (respeita transparência). */
  filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.18));
}
.inbox-empty-state-text {
  margin: 0;
  color: #475569;
  font-size: 15px;
  text-align: center;
}
@media (max-width: 900px) {
  /* No mobile o inbox mostra só a lista; o estado vazio do desktop some. */
  .inbox-empty-state {
    display: none !important;
  }
}

.inbox-attach-btn {
  gap: 6px;
}

.inbox-send-btn {
  gap: 6px;
}

.inbox-compose-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.inbox-compose-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.inbox-compose-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inbox-template-menu,
.inbox-attachment-menu {
  border-color: #d7dfeb !important;
  background: #ffffff !important;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16) !important;
}

.inbox-template-menu button,
.inbox-attachment-menu button,
.inbox-template-item {
  color: #0f172a !important;
}

.inbox-template-item:hover,
.inbox-attachment-menu button:hover {
  background: #f3f6fb !important;
}

.inbox-template-name {
  color: #0f172a !important;
}

.inbox-template-body,
.inbox-template-loading,
.inbox-template-empty {
  color: #526179 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 1400px) {
  .iq-analytics-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .inbox-layout.inbox-layout-tailwick {
    grid-template-columns: 260px minmax(0, 1fr) 250px !important;
  }
}

@media (max-width: 1160px) {
  .iq-analytics-grid {
    grid-template-columns: 1fr;
  }

  .iq-analytics-hero {
    display: grid;
  }

  .twk-calendar-app {
    grid-template-columns: 1fr;
  }

  .twk-calendar-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inbox-layout.inbox-layout-tailwick {
    grid-template-columns: 1fr !important;
  }

}

@media (max-width: 640px) {
  .iq-analytics-page {
    gap: 12px;
  }

  .iq-analytics-hero {
    gap: 14px;
    padding: 18px;
  }

  .iq-analytics-overline {
    margin-bottom: 6px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .iq-analytics-hero h1 {
    margin-bottom: 10px;
    font-size: clamp(30px, 9vw, 34px);
    line-height: 1.02;
  }

  .iq-analytics-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .iq-stat-card {
    padding: 16px;
  }

  .iq-stat-card strong {
    font-size: 30px;
  }
}

@media (max-width: 860px) {
  .iq-analytics-stat-grid {
    grid-template-columns: 1fr;
  }

  .iq-source-grid {
    grid-template-columns: 1fr;
  }

  .iq-analytics-table-head,
  .iq-analytics-table-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .twk-calendar-side {
    grid-template-columns: 1fr;
  }

  .twk-calendar-weekdays,
  .twk-calendar-grid {
    min-width: 760px;
    width: max(100%, 760px);
  }

  .twk-calendar-month {
    min-width: 150px;
  }
}

/* ===== Final alignment fixes (Tailwick parity) ===== */
.topbar {
  gap: 16px !important;
}

.subtitle {
  flex: 0 0 auto;
  white-space: nowrap;
}

.topbar-search {
  flex: 0 1 560px !important;
  min-width: 320px !important;
  max-width: 560px !important;
}

.topbar-actions {
  margin-right: 0 !important;
  gap: 12px !important;
}

.topbar-icon-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
}

.topbar-icon-btn svg {
  width: 15px !important;
  height: 15px !important;
}

.agency-switch {
  min-width: 300px !important;
}

.kanban-command-bar {
  align-items: center !important;
}

.kanban-command-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.kanban-toolbar,
.kanban-status-row {
  display: none !important;
}

/* Inbox preenche o espaço disponível do .content (que já é o 1fr do .main),
   em vez de altura fixa calc(100dvh - 56px) que ignorava o banner de "Setup
   pendente" quando ele aparece (sobrava branco embaixo em tenants com banner). */
/* TETO da cadeia de altura. O .shell global usa min-height:100vh (piso, não
   teto) — sem teto, a cadeia flex/height:100% do inbox não resolve: sobra
   branco com poucos leads e estoura a tela com muitos. :has() escopa só no
   inbox (não afeta outras páginas). dvh desconta a barra do browser no mobile. */
.shell:has(.twk-inbox-page) {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Elo intermediário: .main é grid item do .shell e tem min-height:auto por
   padrão (grid items não encolhem) — sem min-height:0 a faixa 1fr dele infla
   com o conteúdo das mensagens e a contenção do .shell não desce. */
.shell:has(.twk-inbox-page) > .main {
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.content:has(.twk-inbox-page) {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

.twk-inbox-page {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Flex column em vez de grid auto/1fr: o header (.twk-inbox-shell-head) é
   CONDICIONAL (só com pushStatus). Com grid auto/1fr e sem o header, o
   .inbox-layout caía na linha 1 (auto) e a linha 2 (1fr) ficava vazia,
   sobrando espaço morto no fim do chat. Flex resolve com ou sem header. */
.twk-inbox-page .panel.twk-inbox-shell {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.inbox-layout.inbox-layout-tailwick {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;        /* remove o cap 780px do base CSS */
  grid-template-rows: 1fr !important; /* linha única preenche a altura do flex → painéis ficam com altura finita → body rola */
}

.inbox-leads-panel,
.inbox-chat,
.inbox-detail-panel {
  min-height: 0 !important;
  height: 100% !important;
}

.inbox-chat {
  display: grid !important;
  grid-template-rows: auto 1fr auto !important;
}

.inbox-leads,
.inbox-detail-body,
.inbox-messages {
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}

.inbox-compose {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

@media (max-width: 1260px) {
  .topbar-search {
    min-width: 260px !important;
    flex-basis: 380px !important;
  }
}

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

  .agency-switch {
    min-width: 220px !important;
  }
}

@media (max-width: 1160px) {
  .twk-inbox-page .panel.twk-inbox-shell {
    min-height: auto !important;
    height: auto !important;
  }
}

/* ===== Dark mode consistency (all screens) ===== */
body.iq-theme-dark {
  --iq-bg: #0a1020;
  --iq-card: #0f172a;
  --iq-border: #25324a;
  --iq-text: #e2e8f0;
  --iq-muted: #94a3b8;
}

body.iq-theme-dark,
body.iq-theme-dark .status,
body.iq-theme-dark .hint,
body.iq-theme-dark .subtitle {
  color: var(--iq-muted) !important;
}

body.iq-theme-dark .panel,
body.iq-theme-dark .table,
body.iq-theme-dark .row,
body.iq-theme-dark .row.head,
body.iq-theme-dark .inbox-panel,
body.iq-theme-dark .inbox-chat-head,
body.iq-theme-dark .inbox-compose,
body.iq-theme-dark .inbox-detail-section,
body.iq-theme-dark .kanban-col,
body.iq-theme-dark .kanban-col-enterprise,
body.iq-theme-dark .kanban-calendar.twk-calendar-shell,
body.iq-theme-dark .twk-calendar-day,
body.iq-theme-dark .twk-calendar-weekdays span,
body.iq-theme-dark .twk-calendar-event,
body.iq-theme-dark .twk-table-head,
body.iq-theme-dark .twk-table-row,
body.iq-theme-dark .topbar-icon-btn,
body.iq-theme-dark .profile-trigger,
body.iq-theme-dark .menu-toggle,
body.iq-theme-dark .agency-switch-control {
  background: #0f172a !important;
  border-color: var(--iq-border) !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark .topbar,
body.iq-theme-dark .sidebar {
  background: rgba(8, 14, 28, 0.32) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark .crm-overline,
body.iq-theme-dark .twk-overline,
body.iq-theme-dark .inbox-panel-head,
body.iq-theme-dark .inbox-chat-sub,
body.iq-theme-dark .inbox-lead-meta,
body.iq-theme-dark .inbox-msg-time,
body.iq-theme-dark .twk-calendar-subtitle,
body.iq-theme-dark .twk-calendar-day-head span,
body.iq-theme-dark .twk-calendar-event p,
body.iq-theme-dark .twk-calendar-event small,
body.iq-theme-dark .kanban-col-summary,
body.iq-theme-dark .kanban-meta,
body.iq-theme-dark .kanban-meta-list span {
  color: var(--iq-muted) !important;
}

body.iq-theme-dark h1,
body.iq-theme-dark h2,
body.iq-theme-dark h3,
body.iq-theme-dark h4,
body.iq-theme-dark strong,
body.iq-theme-dark .inbox-lead-name,
body.iq-theme-dark .inbox-chat-title,
body.iq-theme-dark .kanban-title,
body.iq-theme-dark .kanban-col-title,
body.iq-theme-dark .twk-calendar-day:not(.today) .twk-calendar-day-head strong,
body.iq-theme-dark .twk-calendar-month,
body.iq-theme-dark .twk-calendar-event strong {
  color: var(--iq-text) !important;
}

body.iq-theme-dark .twk-calendar-day.today .twk-calendar-day-head strong {
  background: #6366f1 !important;
  color: #fff !important;
}

body.iq-theme-dark input,
body.iq-theme-dark select,
body.iq-theme-dark textarea,
body.iq-theme-dark .field input,
body.iq-theme-dark .field select,
body.iq-theme-dark .field textarea,
body.iq-theme-dark .inline-input,
body.iq-theme-dark .inbox-thread-search,
body.iq-theme-dark .inbox-compose textarea,
body.iq-theme-dark .inbox-detail-form input,
body.iq-theme-dark .topbar-search,
body.iq-theme-dark .kanban-search input {
  background: #0b1326 !important;
  border-color: #2b3b58 !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark input::placeholder,
body.iq-theme-dark textarea::placeholder {
  color: #7f8da4 !important;
}

body.iq-theme-dark .inbox-lead {
  background: #111b31 !important;
  border-color: #2b3b58 !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark .inbox-lead.active {
  background: #1b2742 !important;
  border-color: #455a86 !important;
}

body.iq-theme-dark .inbox-lead-preview {
  color: #c2d1e6 !important;
}

body.iq-theme-dark .inbox-messages {
  background: #0a1224 !important;
  background-image: none !important;
}

body.iq-theme-dark .inbox-msg.inbound {
  background: #111c33 !important;
  border-color: #2d3f5f !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark .inbox-msg.outbound {
  background: #15382b !important;
  border-color: #235843 !important;
  color: #d9fbe8 !important;
}

body.iq-theme-dark .inbox-msg-status.sent,
body.iq-theme-dark .inbox-msg-status.delivered {
  color: #93c5fd !important;
}

body.iq-theme-dark .inbox-msg-status.read {
  color: #67e8f9 !important;
}

body.iq-theme-dark .inbox-head-action,
body.iq-theme-dark .inbox-open-card-btn,
body.iq-theme-dark .inbox-chat-back,
body.iq-theme-dark .inbox-filter-btn,
body.iq-theme-dark .kanban-view-tab,
body.iq-theme-dark .kanban-filter-tab,
body.iq-theme-dark .btn-inline,
body.iq-theme-dark .btn-inline.neutral,
body.iq-theme-dark .btn-secondary,
body.iq-theme-dark .lead-modal-close,
body.iq-theme-dark .password-toggle {
  background: #131f38 !important;
  border-color: #2b3b58 !important;
  color: var(--iq-text) !important;
}

body.iq-theme-dark .inbox-head-action:hover,
body.iq-theme-dark .inbox-open-card-btn:hover,
body.iq-theme-dark .inbox-chat-back:hover,
body.iq-theme-dark .inbox-filter-btn:hover,
body.iq-theme-dark .kanban-view-tab:hover,
body.iq-theme-dark .kanban-filter-tab:hover,
body.iq-theme-dark .btn-inline:hover,
body.iq-theme-dark .btn-inline.neutral:hover,
body.iq-theme-dark .btn-secondary:hover,
body.iq-theme-dark .lead-modal-close:hover,
body.iq-theme-dark .password-toggle:hover {
  background: #1a2948 !important;
  border-color: #3a4d74 !important;
}

body.iq-theme-dark .btn-inline.danger {
  background: #3a1620 !important;
  border-color: #6b2232 !important;
  color: #fecdd3 !important;
}

body.iq-theme-dark .kanban-view-tab.active,
body.iq-theme-dark .kanban-filter-tab.active,
body.iq-theme-dark .inbox-filter-btn.active,
body.iq-theme-dark .btn-primary {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}

body.iq-theme-dark .kanban-board-surface,
body.iq-theme-dark .kanban-cards,
body.iq-theme-dark .kanban-card,
body.iq-theme-dark .kanban-shell,
body.iq-theme-dark .kanban-list-view,
body.iq-theme-dark .kanban-calendar {
  background: transparent !important;
}

body.iq-theme-dark .kanban-card {
  background: #121d33 !important;
  border-color: #2b3b58 !important;
}

body.iq-theme-dark .kanban-company-name {
  color: #a9bad2 !important;
}

body.iq-theme-dark .kanban-company-name svg,
body.iq-theme-dark .kanban-meta-item svg,
body.iq-theme-dark .kanban-footer-chip svg {
  color: #8ea4c1 !important;
}

body.iq-theme-dark .kanban-meta-item {
  background: rgba(18, 31, 53, 0.92) !important;
  border-color: #31435f !important;
  color: #d4dfef !important;
}

body.iq-theme-dark .kanban-footer-chip {
  background: rgba(18, 31, 53, 0.88) !important;
  border-color: #31435f !important;
  color: #d8e2f0 !important;
}

body.iq-theme-dark .kanban-footer-chip.is-unassigned {
  background: rgba(77, 36, 16, 0.42) !important;
  border-color: #9a5b2f !important;
  color: #fed7aa !important;
}

body.iq-theme-dark .kanban-empty {
  background: #0d172d !important;
  border-color: #2b3b58 !important;
  color: var(--iq-muted) !important;
}

body.iq-theme-dark .twk-calendar-day.outside {
  background: #0d172d !important;
  opacity: 1 !important;
}

body.iq-theme-dark .twk-calendar-legend-item {
  background: #111b31 !important;
  border-color: #2b3b58 !important;
  color: #c8d5e7 !important;
}

body.iq-theme-dark .twk-calendar-event.inbound {
  background: #10263a !important;
  border-left-color: #38bdf8 !important;
}

body.iq-theme-dark .twk-calendar-event.outbound {
  background: #173326 !important;
  border-left-color: #4ade80 !important;
}

body.iq-theme-dark .twk-calendar-event.created {
  background: #1b2542 !important;
  border-left-color: #818cf8 !important;
}

body.iq-theme-dark .topbar-notifications-menu,
body.iq-theme-dark .topbar-notification-item,
body.iq-theme-dark .topbar-notifications-empty {
  background: #0f172a !important;
  color: var(--iq-text) !important;
  border-color: #2b3b58 !important;
}

body.iq-theme-dark .topbar-notification-item strong {
  color: var(--iq-text) !important;
}

body.iq-theme-dark .topbar-notification-item p,
body.iq-theme-dark .topbar-notification-item > span {
  color: var(--iq-muted) !important;
}

body.iq-theme-dark .topbar-icon-badge {
  border-color: #0f172a !important;
}

body.iq-theme-dark .topbar-icon-badge.is-zero {
  background: #334155 !important;
  color: #cbd5e1 !important;
}

/* ===== Inbox icon button refinement ===== */
.inbox-app-rail {
  gap: 10px !important;
  padding: 12px 8px !important;
}

.inbox-rail-btn {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  border: 1px solid #cfd9e7 !important;
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
  transition: all 0.15s ease !important;
}

.inbox-rail-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 1.9 !important;
}

.inbox-rail-btn:hover {
  color: #1e293b !important;
  border-color: #b9c6d9 !important;
  background: #f8fafc !important;
}

.inbox-rail-btn.active {
  color: #4f46e5 !important;
  border-color: #c7d2fe !important;
  background: #eef2ff !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08) !important;
}

.inbox-chat-head-actions {
  gap: 8px !important;
}

.inbox-head-action.icon,
.inbox-chat-back {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid #cfd9e7 !important;
  background: #ffffff !important;
  color: #334155 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

.inbox-chat-back svg,
.inbox-head-action.icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 1.95 !important;
}

/* Avatar do contato no header do chat (no lugar do botão voltar, antes do nome) */
.inbox-chat-head-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbe4f4;
  color: #1b2432;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inbox-chat-head-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inbox-head-action.icon:hover,
.inbox-chat-back:hover {
  color: #0f172a !important;
  border-color: #b9c6d9 !important;
  background: #f8fafc !important;
}

body.iq-theme-dark .inbox-rail-btn,
body.iq-theme-dark .inbox-head-action.icon,
body.iq-theme-dark .inbox-chat-back {
  background: #131f38 !important;
  border-color: #2b3b58 !important;
  color: #dbe5f4 !important;
  box-shadow: none !important;
}

body.iq-theme-dark .inbox-rail-btn.active {
  background: #1a2645 !important;
  border-color: #4f46e5 !important;
  color: #a5b4fc !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2) !important;
}

body.iq-theme-dark .inbox-rail-btn:hover,
body.iq-theme-dark .inbox-head-action.icon:hover,
body.iq-theme-dark .inbox-chat-back:hover {
  background: #1a2948 !important;
  border-color: #3a4d74 !important;
  color: #ffffff !important;
}

/* ===== HOTFIX: VPS deploy sync (logo + icon alignment) ===== */
.sidebar .brand-title {
  font-size: 25px !important;
  line-height: 1.02 !important;
}

.topbar-icon-btn,
.topbar-icon-btn-notifications {
  position: relative !important;
  overflow: visible !important;
}

.topbar-icon-badge {
  top: -6px !important;
  right: -6px !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  line-height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.inbox-head-action.icon,
.inbox-chat-back,
.inbox-rail-btn {
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.inbox-head-action.icon svg,
.inbox-chat-back svg,
.inbox-rail-btn svg {
  width: 17px !important;
  height: 17px !important;
}

.btn-inline {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1 !important;
}

.btn-inline svg {
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
}

/* Project board header actions: icon-only with theme tooltip */
.kanban-shell-actions .project-shell-icon-btn {
  position: relative !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
  gap: 0 !important;
  overflow: visible !important;
}

.kanban-shell-actions .project-shell-icon-btn .nav-tooltip {
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  top: calc(100% + 10px) !important;
  transform: translateX(-50%) translateY(-4px) !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #dbe3ee !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 12px !important;
  letter-spacing: 0.2px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  z-index: 80 !important;
}

.kanban-shell-actions .project-shell-icon-btn .nav-tooltip::before {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: -6px !important;
  width: 10px !important;
  height: 10px !important;
  border-top: 1px solid #dbe3ee !important;
  border-left: 1px solid #dbe3ee !important;
  background: #ffffff !important;
  transform: translateX(-50%) rotate(45deg) !important;
}

.kanban-shell-actions .project-shell-icon-btn:hover .nav-tooltip,
.kanban-shell-actions .project-shell-icon-btn:focus-visible .nav-tooltip {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

body.iq-theme-dark .kanban-shell-actions .project-shell-icon-btn .nav-tooltip {
  border-color: #1f2835 !important;
  background: #111922 !important;
  color: #e8edf5 !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34) !important;
}

body.iq-theme-dark .kanban-shell-actions .project-shell-icon-btn .nav-tooltip::before {
  border-color: #1f2835 !important;
  background: #111922 !important;
}

/* ===== Inbox bubble density compact fix (contacts + messages) ===== */
.inbox-lead {
  min-height: unset !important;
  height: auto !important;
  padding: 8px 10px !important;
  line-height: 1.25 !important;
}

.inbox-lead-head {
  gap: 6px !important;
}

.inbox-lead-meta {
  margin-top: 2px !important;
  line-height: 1.25 !important;
}

.inbox-lead-preview {
  margin-top: 4px !important;
  line-height: 1.3 !important;
}

.inbox-msg {
  min-height: unset !important;
  height: auto !important;
  padding: 6px 9px 5px !important;
  line-height: 1.3 !important;
  gap: 3px !important;
}

/* Cartão "Lead capturado" (lead-form-card.js) — layout medido e especificado
   pelo Eder (docs/planos/2026-09-01-traduzir-ids-lead-meta-ads.md, reabertura
   2026-09-02): 3 max-width empilhados (.inbox-msg-col 92%, .inbox-msg 78%
   DAQUELES 92%, card 420px) se multiplicavam — 0,92 × 0,78 = 71,8% — e com o
   painel de contato aberto o card caía pra ~277px de largura útil, esticando
   uma única mensagem pela coluna inteira em altura (662px de card contra
   ~682px de área visível). `.has-card` é aplicado via JS (page.js,
   MessageBubble/isCard) só quando a mensagem realmente vira card — decisão
   do Eder de NÃO usar `:has()` em produção (troca a regra anterior). O balão
   comum (fundo/borda/box-shadow, com `!important` em tailwick-theme.css:
   1426/1698) não deve aparecer por trás do cartão — o próprio cartão já
   desenha sua borda. */
.inbox-msg-row.has-card {
  align-items: flex-start !important;
}

.inbox-msg-col.has-card {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: min(96%, 680px) !important;
}

.inbox-msg.has-card {
  width: min(100%, 460px) !important;
  max-width: 100% !important;
  padding: 0 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.iq-lead-card {
  /* Sem !important de propósito (achado da revisão): nada no JSX compete
     com isto hoje (max-w-[420px] foi removido da raiz do componente) — um
     !important aqui abafaria em silêncio qualquer w-*/max-w-* que alguém
     adicionar depois no JSX. */
  width: 100%;
  max-width: none;
  container-type: inline-size;
}

/* Grid de 2 colunas pra identidade (nome/telefone/e-mail) e "Origem do
   anúncio" quando o card tiver espaço — container query, não media query,
   porque a largura da coluna do chat não acompanha a viewport (o painel
   "Sobre o contato" abre/fecha independente do tamanho da janela). Abaixo de
   340px de largura do PRÓPRIO card, volta pra coluna única (base do
   `.iq-lead-fields`, sem overflow horizontal). */
.iq-lead-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@container (min-width: 340px) {
  .iq-lead-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 2px;
    align-items: start;
  }

  .iq-lead-fields > .iq-lead-section-title {
    grid-column: 1 / -1;
  }
}

.inbox-msg-text {
  line-height: 1.3 !important;
}

.inbox-msg-meta {
  margin-top: 1px !important;
}

/* ===== Inbox anti-stretch hotfix ===== */
.inbox-leads,
.inbox-messages {
  /* align-content:start já encosta as mensagens no topo. NÃO usar
     grid-auto-rows:max-content: ele inflava o container com a soma de todas as
     mensagens (empurrando o compose pra fora da tela) em vez de respeitar a
     faixa 1fr do grid .inbox-chat e rolar internamente. */
  align-content: start !important;
}

.inbox-lead,
.inbox-msg {
  align-self: start !important;
}

/* ===== MOBILE RESPONSIVENESS FIXES ===== */

/* --- 768px: tablets e celulares grandes --- */
@media (max-width: 768px) {
  /* Compactar topbar */
  .topbar {
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  /* Esconder subtitle ("Leads e Conversas") para liberar espaço no topbar */
  .subtitle {
    display: none !important;
  }

  /* Comprimir o seletor de agência no topbar */
  .agency-switch {
    min-width: 0 !important;
    max-width: 130px !important;
    flex: 0 1 130px !important;
  }

  .agency-switch select {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Notificações: adaptar largura ao viewport */
  .topbar-notifications-menu {
    width: min(calc(100vw - 20px), 360px) !important;
  }

  /* Conteúdo interno um pouco mais apertado */
  .content {
    padding:
      10px
      max(10px, calc(var(--iq-safe-right) + 10px))
      max(20px, calc(var(--iq-safe-bottom) + 20px))
      max(10px, calc(var(--iq-safe-left) + 10px)) !important;
  }

  /* Calendário: garantir que o painel lateral colapse */
  .twk-calendar-app {
    grid-template-columns: 1fr !important;
  }

  /* Grids de estatísticas: 1 coluna */
  .iq-analytics-stat-grid {
    grid-template-columns: 1fr !important;
  }

  .twk-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  /* Home split: 1 coluna */
  .twk-home-split {
    grid-template-columns: 1fr !important;
  }
}

/* --- 480px: celulares pequenos --- */
@media (max-width: 480px) {
  /* Esconder seletor de agência (feature de platform_dev, não cabe em tela pequena) */
  .agency-switch {
    display: none !important;
  }

  /* Topbar ainda mais compacto */
  .topbar {
    padding: 8px 12px !important;
    gap: 6px !important;
  }

  /* Botões do topbar menores */
  .topbar-icon-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .topbar-icon-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  /* Avatar do perfil menor */
  .profile-trigger {
    width: 32px !important;
    height: 32px !important;
  }

  /* Menu hambúrguer menor */
  .menu-toggle {
    width: 34px !important;
    height: 34px !important;
  }

  /* Padding de conteúdo mínimo */
  .content {
    padding: 8px 8px 16px !important;
  }

  /* Panel padding menor */
  .panel {
    padding: 12px 10px !important;
  }

  /* Inbox: painel de compose mais compacto */
  .inbox-compose textarea {
    min-height: 60px;
  }
}

/* ===== MOBILE INBOX CHAT FIXES ===== */
@media (max-width: 900px) {
  /* 1. Esconder IQ Copilot no mobile — sobrepõe a área de digitação */
  .iq-copilot-widget {
    display: none !important;
  }

  /* 0. Messenger (inbox) em tela cheia no mobile: a lista de conversas preenche
        toda a largura/altura abaixo do topbar. Remove o padding do .content
        (escopo só inbox via :has) e a borda/raio do card do shell, que deixavam
        o fundo escuro aparecer nas laterais e no topo. */
  .content:has(.twk-inbox-page) {
    padding: 0 !important;
  }

  .twk-inbox-page .panel.twk-inbox-shell {
    border: none !important;
    border-radius: 0 !important;
  }

  /* Título do chat: fonte menor e sem quebrar linha no mobile. Trunca com
     reticências (cadeia flex com min-width:0 para o ellipsis engatar). */
  .inbox-chat-title-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .inbox-chat-title-row {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .inbox-chat-title {
    font-size: 16px !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Chat oculto por padrão no mobile — abre apenas ao clicar num lead.
     Necessário pois .inbox-chat { display: grid !important } acima
     sobrescreve o display: none do globals.css. */
  .inbox-chat {
    display: none !important;
  }

  /* Quando lead selecionado: exibir chat em tela cheia */
  .inbox-layout.mobile-chat-open .inbox-chat {
    display: grid !important;
  }

  /* 2. Textarea compacto em mobile para caber na tela */
  .inbox-compose textarea {
    min-height: 50px !important;
    max-height: 120px !important;
    resize: none !important;
  }

  /* 3. Ações do compose: manter em linha para o botão de envio ficar visível.
        No mobile com teclado aberto, coluna faz o botão sair da tela. */
  .inbox-compose-actions {
    display: grid !important;
    gap: 8px !important;
  }

  .inbox-compose-primary-row {
    align-items: center !important;
    gap: 10px !important;
  }

  .inbox-compose-shortcuts {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
  }

  .inbox-compose-btn-label {
    display: none !important;
  }

  .inbox-attach-btn {
    width: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    justify-content: center !important;
  }

  .inbox-send-btn {
    margin-left: auto !important;
    min-height: 42px !important;
    padding-inline: 16px !important;
  }

  .inbox-compose-meta {
    width: 100% !important;
  }

  .inbox-template-menu,
  .inbox-attachment-menu {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(320px, 46dvh) !important;
  }

  /* 4. Chat overlay: corrigir dimensionamento e overflow no mobile.
        Usa 100dvh (dynamic viewport height) para descontar teclado e chrome do browser.
        Remove as margens laterais (10px cada) que impediam preencher a tela. */
  .inbox-layout.mobile-chat-open .inbox-chat {
    left: 0 !important;
    right: 0 !important;
    top: 72px !important;
    bottom: auto !important;
    height: calc(100dvh - 72px) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* 5. Compose: padding inferior para home indicator do iOS */
  .inbox-layout.mobile-chat-open .inbox-compose {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
  }

  /* 6. Mensagens: garantir scroll correto dentro do grid */
  .inbox-layout.mobile-chat-open .inbox-messages {
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  /* 7. Suporte — lista de chamados no mobile (inbox-support-list).
        Esconde a coluna esquerda (lista de leads, redundante nesse estado)
        e exibe o painel de detalhe (lista de chamados) em tela cheia,
        abaixo do topbar, igual ao padrão do .inbox-chat mobile-chat-open. */
  .inbox-layout.inbox-support-list .inbox-leads-panel {
    display: none !important;
  }

  .inbox-layout.inbox-support-list .inbox-detail-panel {
    display: grid !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 72px !important;
    bottom: auto !important;
    height: calc(100dvh - 72px) !important;
    z-index: 24 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Cabeçalho com o ← ao lado do título (não empilhado) nesta tela */
  .inbox-layout.inbox-support-list .inbox-detail-head {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* Botão voltar: visível e com alvo de toque adequado no mobile */
  .inbox-detail-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    min-width: 40px !important;
    padding: 8px 12px !important;
  }
}

@media (max-width: 980px) {
  .sidebar {
    background:
      linear-gradient(180deg, rgba(4, 10, 24, 0.94) 0%, rgba(7, 15, 31, 0.97) 100%) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 24px 48px rgba(3, 8, 20, 0.22) !important;
    width: 320px !important;
    max-width: calc(100vw - 44px) !important;
  }

  .sidebar-close-mobile {
    display: inline-flex !important;
  }

  .sidebar-collapse {
    display: none !important;
  }
}

/* ===== DARK SHELL THEME (dark chrome, light cards) ===== */

/* Agency switch: light text on dark shell */
.agency-switch label {
  color: var(--iq-shell-muted) !important;
}

.agency-switch-control {
  color: var(--iq-shell-text) !important;
}

.agency-switch-control svg {
  color: var(--iq-shell-muted) !important;
}

.agency-switch-control select {
  color: var(--iq-shell-text) !important;
}

/* Brand text in topbar */
.brand {
  color: #ffffff !important;
}

/* Profile trigger on dark shell */
.profile-trigger {
  color: var(--iq-shell-text) !important;
}

.profile-initials {
  color: var(--iq-shell-text) !important;
}

/* Menu toggle on dark shell */
.menu-toggle {
  color: var(--iq-shell-text) !important;
}

/* Topbar search icon */
.topbar-search > svg {
  color: var(--iq-shell-muted) !important;
}

/* Page title in topbar area */
.page-title {
  color: var(--iq-shell-text) !important;
}

/* Notification badge border matches dark shell */
.topbar-icon-badge {
  border-color: #1a2540 !important;
}

/* Setup reminder stays visible on dark bg */
.setup-reminder {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Note: overline and heading text is inside white panels/cards, stays dark.
   Only kanban-shell-head sits directly on the dark content bg. */

/* Panel box-shadow boost for contrast on dark bg */
.panel {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
}

/* KPI cards gradient adjusted for contrast on white card */
.twk-kpi-card {
  background: linear-gradient(165deg, #fff, #f8fafc) !important;
}

/* Kanban cols need solid bg to not show dark bg through */
.kanban-col,
.kanban-col-enterprise {
  background: rgba(248, 250, 252, 0.95) !important;
}

/* Calendar shell stays white */
.twk-calendar-shell {
  background: #fff !important;
}

/* Inbox shell stays white */
.twk-inbox-shell {
  background: #fff !important;
}

/* Profile dropdown stays white (card-like popup) */
.profile-dropdown {
  background: #ffffff !important;
  border-color: var(--iq-border) !important;
}

/* Notification dropdown stays white */
.topbar-notifications-menu {
  background: #ffffff !important;
  border: 1px solid var(--iq-border) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25) !important;
}

/* Lead modal overlay should have dark backdrop */
.lead-modal-overlay {
  background: rgba(4, 10, 22, 0.6) !important;
}

/* Lead modal card background */
.lead-modal {
  background: #f6f6f6;
}

/* ===== Tailwick refresh: pragmatic visual sweep ===== */
:root {
  --iq-bg: #edf4ff;
  --iq-border: #d8e5f4;
  --iq-muted: #5f7188;
  --iq-primary: #2563eb;
  --iq-primary-soft: #dbeafe;
  --iq-shell-border: rgba(191, 219, 254, 0.24);
  --iq-shell-text: #eaf2ff;
  --iq-shell-muted: #bfdbfe;
}

body {
  background:
    linear-gradient(180deg, rgba(12, 21, 38, 0.32) 0%, rgba(12, 21, 38, 0.22) 100%),
    url("/assets/dashboard-bg-earth-night.jpg") center center / cover no-repeat fixed,
    #0c1526 !important;
}

.shell {
  background: transparent !important;
}

.sidebar {
  background: rgba(8, 14, 28, 0.32) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

.topbar {
  border: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  min-height: 56px !important;
  padding: 0 18px !important;
}

/* header recauchutado 2026-08-19 (item 1) — faixa segue TRANSPARENTE de
   propósito (não repintar fundo aqui), só ganha o fio inferior do chrome
   escuro do artboard. Precisa ficar DEPOIS do bloco `.topbar` acima: aquele
   zera `border-bottom`, e como as duas regras têm a mesma especificidade,
   quem vem por último no arquivo vence. */
.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Agency switch: ensure light pill on transparent topbar (was inheriting
   dark-shell styles that left it nearly invisible over the planet bg). */
.agency-switch-control {
  background: linear-gradient(180deg, #ffffff, #eff6ff) !important;
  border: 1px solid rgba(191, 219, 254, 0.78) !important;
  color: #1e3a8a !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18) !important;
}

.agency-switch-control svg {
  color: #1e3a8a !important;
  stroke: #1e3a8a !important;
}

.agency-switch-control select {
  color: #1e3a8a !important;
  background: transparent !important;
}

.agency-switch-control select option {
  color: #1e3a8a !important;
  background: #ffffff !important;
}

.agency-switch label {
  color: var(--iq-shell-text) !important;
}

.subtitle {
  padding: 0 12px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(191, 219, 254, 0.72) !important;
  background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
  color: #1d4ed8 !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}

.topbar-search {
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  border-color: rgba(191, 219, 254, 0.75) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75) !important;
}

.topbar-search input {
  color: #0f172a !important;
}

.topbar-search input::placeholder,
.topbar-search > svg {
  color: #94a3b8 !important;
}

.topbar-icon-btn,
.profile-trigger,
.menu-toggle,
.agency-switch-control {
  border-color: rgba(191, 219, 254, 0.78) !important;
  background: linear-gradient(180deg, #ffffff, #eff6ff) !important;
  color: #1e3a8a !important;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08) !important;
}

.topbar-icon-btn svg {
  color: #1e3a8a !important;
  stroke: #1e3a8a !important;
}

.topbar-icon-btn:hover,
.profile-trigger:hover,
.menu-toggle:hover {
  background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
}

.content {
  padding-top: 0 !important;
}

.panel {
  position: relative;
  border-radius: 5px !important;
  border: 1px solid rgba(216, 229, 244, 0.96) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%) !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.22) !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%) !important;
  border-color: transparent !important;
}

.btn-inline,
.btn-inline.neutral,
.btn-secondary,
.inbox-head-action,
.inbox-open-card-btn,
.inbox-chat-back,
.kanban-view-tab,
.kanban-filter-tab,
.lead-modal-close,
.password-toggle {
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  color: #334155 !important;
  border-color: rgba(216, 229, 244, 0.96) !important;
}

.btn-inline.neutral,
.btn-secondary {
  color: #1e3a8a !important;
}

/* Botão "voltar" do chat: só faz sentido quando o chat vira overlay
   (coluna única, <=1160px). No desktop (3 colunas) ele não tem função.
   Colocado por ÚLTIMO porque havia outra regra (.inbox-chat-back display:
   inline-flex) depois do media query anterior, anulando-o. */
@media (min-width: 1161px) {
  .inbox-chat-back {
    display: none !important;
  }
}

/* x "fechar conversa": e o equivalente desktop do botao "voltar" (.inbox-chat-back),
   que so aparece no mobile (<=1160px). Entao o x some no mobile pra nao duplicar. */
@media (max-width: 1160px) {
  .inbox-chat-close {
    display: none !important;
  }
}

.btn-inline.accent {
  background: linear-gradient(180deg, #eff6ff, #dbeafe) !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}

.btn-inline.accent:hover {
  background: linear-gradient(180deg, #dbeafe, #bfdbfe) !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
}

.iq-analytics-hero {
  padding: 28px !important;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.98)) !important;
}

.iq-stat-card,
.iq-analytics-card,
.twk-kpi-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98)) !important;
}

.twk-page-hero .status {
  max-width: 64ch;
}

.twk-empty-state {
  display: grid;
  gap: 18px;
  padding: 28px !important;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.98)) !important;
}

.twk-empty-state-copy {
  display: grid;
  gap: 8px;
}

.twk-empty-state-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: -0.03em;
}

.project-empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 56px 24px !important;
  text-align: center;
}

.project-empty-state-icon {
  color: #60a5fa;
  opacity: 0.9;
}

.project-empty-state-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.project-empty-state-copy {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.12);
}

.project-card-header {
  min-height: 34px;
  padding-right: 42px;
}

.project-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.project-card-logo {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #dbeafe;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.18);
}

.project-card-client {
  margin-top: 2px;
  font-weight: 500;
}

.project-card-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
}

.project-card-gear {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.project-create-modal {
  max-width: 520px !important;
}

.project-modal-header,
.project-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-modal-header {
  margin-bottom: 16px;
}

.project-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.project-modal-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.project-form-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-color-option {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.project-color-option.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.acct-profile-card,
.dashboard-metrics .metric-card,
.gestor-block,
.gestor-ai-controls,
.gestor-ai-chat,
.iq-users-table-card,
.iq-users-mobile-card,
.iq-users-agency-list {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98)) !important;
}

.dashboard-metrics .metric-card {
  border-color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dashboard-metrics .metric-value {
  color: #1d4ed8;
}

.gestor-highlight {
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border-color: #bfdbfe;
}

.acct-profile-card {
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98)) !important;
}

.acct-avatar-button {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.acct-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.18);
}

.acct-status-msg,
.iq-users-message-success,
.iq-users-message-error {
  padding: 12px 14px;
  border-radius: 5px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
}

.iq-users-message-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.iq-users-message-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.sensitive-card-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.98));
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

/* ===== Tailwick palette sweep — colored KPIs, soft buttons, lively tabs ===== */

/* Tailwick palette tokens */
:root {
  --twk-primary: #4b69fd;
  --twk-primary-soft: #e6ebff;
  --twk-primary-ink: #1d3bd0;
  --twk-success: #1ab394;
  --twk-success-soft: #d8f5ec;
  --twk-success-ink: #0f7a64;
  --twk-warning: #f1932c;
  --twk-warning-soft: #fdecd2;
  --twk-warning-ink: #a35a08;
  --twk-info: #2eaedb;
  --twk-info-soft: #d6f0fa;
  --twk-info-ink: #0c6f95;
  --twk-danger: #ee5d50;
  --twk-danger-soft: #fde0dd;
  --twk-danger-ink: #b53528;
  --twk-secondary: #7d5bbe;
  --twk-secondary-soft: #ece4f9;
  --twk-secondary-ink: #4c2e8e;
}

/* --- Financeiro & dashboard KPI cards: semantic colors via :nth-child --- */
/* shared-crm.module.css scopes .metricCard with a hash, so we color via the
   parent container that we DO control globally (.metrics is hashed too — fall
   back to article role + position inside known panels). */
.panel article[class*="metricCard"]:nth-child(4n+1),
.dashboard-metrics .metric-card:nth-child(5n+1) {
  background: linear-gradient(160deg, var(--twk-primary-soft), #ffffff) !important;
  border-color: #cdd5fb !important;
}
.panel article[class*="metricCard"]:nth-child(4n+1) strong,
.dashboard-metrics .metric-card:nth-child(5n+1) .metric-value {
  color: var(--twk-primary-ink) !important;
}

.panel article[class*="metricCard"]:nth-child(4n+2),
.dashboard-metrics .metric-card:nth-child(5n+2) {
  background: linear-gradient(160deg, var(--twk-warning-soft), #ffffff) !important;
  border-color: #f8d59a !important;
}
.panel article[class*="metricCard"]:nth-child(4n+2) strong,
.dashboard-metrics .metric-card:nth-child(5n+2) .metric-value {
  color: var(--twk-warning-ink) !important;
}

.panel article[class*="metricCard"]:nth-child(4n+3),
.dashboard-metrics .metric-card:nth-child(5n+3) {
  background: linear-gradient(160deg, var(--twk-danger-soft), #ffffff) !important;
  border-color: #f5b6b0 !important;
}
.panel article[class*="metricCard"]:nth-child(4n+3) strong,
.dashboard-metrics .metric-card:nth-child(5n+3) .metric-value {
  color: var(--twk-danger-ink) !important;
}

.panel article[class*="metricCard"]:nth-child(4n+4),
.dashboard-metrics .metric-card:nth-child(5n+4) {
  background: linear-gradient(160deg, var(--twk-success-soft), #ffffff) !important;
  border-color: #a6e6d4 !important;
}
.panel article[class*="metricCard"]:nth-child(4n+4) strong,
.dashboard-metrics .metric-card:nth-child(5n+4) .metric-value {
  color: var(--twk-success-ink) !important;
}

.dashboard-metrics .metric-card:nth-child(5n+5) {
  background: linear-gradient(160deg, var(--twk-info-soft), #ffffff) !important;
  border-color: #b9e4f1 !important;
}
.dashboard-metrics .metric-card:nth-child(5n+5) .metric-value {
  color: var(--twk-info-ink) !important;
}

/* --- Soft buttons: replace the white "neutral/secondary" with tinted variants --- */
.btn-inline.neutral,
.btn-secondary {
  background: linear-gradient(180deg, var(--twk-primary-soft), #f3f5ff) !important;
  color: var(--twk-primary-ink) !important;
  border-color: #cdd5fb !important;
}

.btn-inline.neutral:hover,
.btn-secondary:hover {
  background: linear-gradient(180deg, #d8e0ff, #c8d2fc) !important;
  border-color: #a8b6f7 !important;
  color: var(--twk-primary-ink) !important;
}

/* Atualizar / refresh actions land everywhere — give them an info tint to
   distinguish from the primary blue gradient on submit buttons. */
.btn-inline.refresh,
.btn-inline.info {
  background: linear-gradient(180deg, var(--twk-info-soft), #ecf8fd) !important;
  color: var(--twk-info-ink) !important;
  border-color: #b9e4f1 !important;
}

.btn-inline.refresh:hover,
.btn-inline.info:hover {
  background: linear-gradient(180deg, #c5e8f4, #a9dcee) !important;
  border-color: #7fcae0 !important;
}

.btn-inline.warning {
  background: linear-gradient(180deg, var(--twk-warning-soft), #fef4e3) !important;
  color: var(--twk-warning-ink) !important;
  border-color: #f8d59a !important;
}

.btn-inline.warning:hover {
  background: linear-gradient(180deg, #fbe2b8, #f8d29a) !important;
  border-color: #f1b766 !important;
}

/* --- Inbox header actions: sem fundo, só ícone --- */
.inbox-chat-head-actions .inbox-head-action.icon {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #64748b !important;
}
.inbox-chat-head-actions .inbox-head-action.icon svg {
  color: currentColor !important;
  stroke: currentColor !important;
}
.inbox-chat-head-actions .inbox-head-action.icon:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
.inbox-chat-head-actions .inbox-head-action.icon.active {
  background: transparent !important;
  color: #2563eb !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Toggle da coluna de detalhe: recolhe o painel direito e vira grid 2 colunas */
.inbox-layout.detail-collapsed {
  grid-template-columns: 400px minmax(0, 1fr) !important;
}
.inbox-layout.detail-collapsed .inbox-detail-panel {
  display: none !important;
}

/* Footer actions of the chat composer (Anexar / Modelos / IQ Reply) */
.inbox-compose-shortcuts > div:nth-child(1) > .inbox-attach-btn {
  background: linear-gradient(180deg, var(--twk-info-soft), #ecf8fd) !important;
  color: var(--twk-info-ink) !important;
  border-color: #b9e4f1 !important;
}
.inbox-compose-shortcuts > div:nth-child(2) > .inbox-attach-btn {
  background: linear-gradient(180deg, var(--twk-secondary-soft), #f4eefc) !important;
  color: var(--twk-secondary-ink) !important;
  border-color: #d8c8f2 !important;
}
.inbox-compose-shortcuts > div:nth-child(3) > .inbox-attach-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.22) !important;
}

/* --- Kanban view & filter tabs: inactive tabs get a soft tint instead of white --- */
.kanban-view-tab,
.kanban-filter-tab {
  background: linear-gradient(180deg, var(--twk-primary-soft), #f3f5ff) !important;
  color: var(--twk-primary-ink) !important;
  border-color: #cdd5fb !important;
}

.kanban-view-tab:hover,
.kanban-filter-tab:hover {
  background: linear-gradient(180deg, #d8e0ff, #c8d2fc) !important;
  border-color: #a8b6f7 !important;
  color: var(--twk-primary-ink) !important;
}

.kanban-view-tab.active,
.kanban-filter-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22) !important;
}

/* --- Kanban columns: clean white card, color identification comes only from
   the .kanban-col-top stripe (already tone-aware in globals.css). --- */
.kanban-col {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96)) !important;
  border: 1px solid rgba(216, 229, 244, 0.96) !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08) !important;
}

.kanban-col-header,
.kanban-col-summary {
  background: transparent !important;
}

/* --- Default .btn-inline (without modifier) is the section's primary action;
   give it the same blue gradient as .btn-primary so "Atualizar", "Criar
   lançamento", "Salvar" etc. don't look like dead outlined boxes. --- */
.btn-inline:not(.neutral):not(.danger):not(.success):not(.warning):not(.info):not(.refresh):not(.accent) {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22) !important;
}

.btn-inline:not(.neutral):not(.danger):not(.success):not(.warning):not(.info):not(.refresh):not(.accent):hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

/* Submit buttons sometimes inherit white from the .btn-inline rule above —
   force their inner SVG/icons to follow currentColor on the primary variants. */
.btn-inline:not(.neutral):not(.danger):not(.success):not(.warning):not(.info):not(.refresh):not(.accent) svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

/* The .actions-inline row (table row actions) uses smaller .btn-inline; keep
   those soft-tinted instead of solid blue so the row doesn't look like a
   button bar. */
.actions-inline .btn-inline:not(.neutral):not(.danger):not(.success):not(.warning):not(.info):not(.refresh):not(.accent) {
  background: linear-gradient(180deg, var(--twk-primary-soft), #f3f5ff) !important;
  color: var(--twk-primary-ink) !important;
  border-color: #cdd5fb !important;
  box-shadow: none !important;
}

.actions-inline .btn-inline:not(.neutral):not(.danger):not(.success):not(.warning):not(.info):not(.refresh):not(.accent):hover {
  background: linear-gradient(180deg, #d8e0ff, #c8d2fc) !important;
  border-color: #a8b6f7 !important;
  color: var(--twk-primary-ink) !important;
}

/* ===========================================================================
 * Form controls — checkboxes & radios
 * Native controls render almost invisible against light backgrounds. Force a
 * brand-tinted accent and a sane minimum size so users can actually see the
 * selection state (e.g. CRM lead offer picker, settings toggles).
 * =========================================================================== */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--twk-primary, #4f46e5);
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Lead offer picker (CRM card "Produtos" tab): make each row read as a
   selectable option with a visible checkbox and a clear active state. */
.lead-offer-option {
  background: #ffffff !important;
  border: 1px solid #cfd9e7 !important;
  border-radius: 5px !important;
  padding: 12px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
  cursor: pointer;
}

.lead-offer-option:hover {
  border-color: #93a4c5 !important;
  background: #f8fafc !important;
}

.lead-offer-option:has(input[type="checkbox"]:checked) {
  border-color: var(--twk-primary, #4f46e5) !important;
  background: var(--twk-primary-soft, #eef2ff) !important;
  box-shadow: 0 0 0 1px var(--twk-primary, #4f46e5) inset !important;
}

.lead-offer-option input[type="checkbox"] {
  margin-top: 2px !important;
}

/* ===== Project tasks: bulk selection mode ===== */
.kanban-card { position: relative; }

.kanban-card.selection-mode {
  -webkit-user-select: none;
  user-select: none;
  transition: box-shadow 150ms ease, background 150ms ease, transform 150ms ease;
}

.kanban-card.selection-mode:hover {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35), 0 6px 14px rgba(15, 23, 42, 0.08) !important;
}

.kanban-card.selected {
  box-shadow: 0 0 0 2px var(--twk-primary, #4f46e5), 0 8px 18px rgba(79, 70, 229, 0.18) !important;
  background: var(--twk-primary-soft, #eef2ff) !important;
}

.kanban-card-checkbox {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--twk-primary, #4f46e5);
  pointer-events: none;
  z-index: 2;
}

/* docs/planos/2026-09-25-mover-cards-em-lote-kanban.md — achado da revisão:
   no canto inferior direito, o checkbox padrão (regra acima, herdada do
   Kanban de Projetos) sobrepõe o avatar do atendente do card do CRM
   (`.kanban-owner-avatar`, app/globals.css:6586 — não existe em Projetos).
   Reposiciona SÓ no card do CRM, sem tocar Projetos nem a variante do
   calendário (`.kanban-calendar-event .kanban-card-checkbox`, acima).

   BLOQUEANTE corrigido na re-revisão: `.kanban-shell--transparent` sozinha
   NÃO basta — Projetos também tem essa classe, só que numa `<section>`
   ANCESTRAL separada (project-board.js:4735, `className="panel kanban-shell
   kanban-shell--transparent"`), envolvendo o MESMO `.kanban-board-surface`
   (project-board.js:5551, sem a 2ª classe nele) que já tem seus próprios
   `.kanban-card-checkbox`. Um seletor descendente `.kanban-shell--transparent
   .kanban-card-checkbox` bate nos dois boards. As DUAS classes no MESMO
   elemento só acontecem em kanban-board.js:4276
   (`className="kanban-board-surface kanban-shell--transparent"`, sem
   `.kanban-shell` "pai" nenhum antes disso) — daqui pra baixo, sempre
   selector COMPOSTO (sem espaço entre as duas classes), nunca descendente,
   pra isolar de verdade o CRM.

   Posição: canto superior direito tem `.kanban-card-corner` (selo de
   Ganho/Perdido + contador de tarefas abertas, kanban-board.js ~2370,
   condicional); canto inferior direito tem `.kanban-owner-avatar` (sempre
   presente). Canto superior ESQUERDO é o único livre — só a 1ª linha do
   título (`.kanban-title-link`) começa ali, então o recuo abaixo (só em
   `.selection-mode`) empurra a linha inteira do cabeçalho (`.kanban-lead-
   head`, flex: título à esquerda + `.kanban-card-corner` à direita) pra não
   ficar embaixo do ícone — os dois lados do cabeçalho se movem juntos, sem
   sobrepor nada. */
.kanban-board-surface.kanban-shell--transparent .kanban-card-checkbox {
  top: 8px;
  left: 8px;
  right: auto;
  bottom: auto;
}

.kanban-board-surface.kanban-shell--transparent .kanban-card.selection-mode .kanban-lead-head {
  padding-left: 22px;
}

.kanban-list-table tr.selected {
  background: var(--twk-primary-soft, #eef2ff);
}

.kanban-list-table .bulk-checkbox-cell {
  width: 32px;
  text-align: center;
  padding-left: 8px;
  padding-right: 0;
}

.kanban-list-table .bulk-checkbox-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--twk-primary, #4f46e5);
}

.kanban-calendar-event.selection-mode { cursor: pointer; }

.kanban-calendar-event.selected {
  outline: 2px solid var(--twk-primary, #4f46e5);
  background: var(--twk-primary-soft, #eef2ff) !important;
}

.kanban-calendar-event {
  position: relative;
}

.kanban-calendar-event .kanban-card-checkbox {
  top: 4px;
  bottom: auto;
  right: 4px;
}

.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(148, 163, 184, 0.1);
  font-size: 13px;
  max-width: calc(100vw - 32px);
  animation: bulk-action-bar-in 180ms ease-out;
}

@keyframes bulk-action-bar-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.bulk-action-bar .bulk-count {
  font-weight: 700;
  letter-spacing: 0.01em;
  padding-right: 4px;
  border-right: 1px solid rgba(148, 163, 184, 0.25);
  margin-right: 4px;
}

.bulk-action-bar .bulk-action-select {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  outline: none;
  transition: border-color 120ms ease;
}

.bulk-action-bar .bulk-action-select:hover:not(:disabled) {
  border-color: #64748b;
}

.bulk-action-bar .bulk-action-select:disabled,
.bulk-action-bar button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bulk-action-bar .bulk-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 120ms ease;
}

.bulk-action-bar .bulk-delete-btn:hover:not(:disabled) {
  background: #b91c1c;
}

.bulk-action-bar .bulk-clear-btn {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background 120ms ease, border-color 120ms ease;
}

.bulk-action-bar .bulk-clear-btn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.12);
  border-color: #64748b;
}

.bulk-action-bar .bulk-close-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 2px;
  transition: background 120ms ease;
}

.bulk-action-bar .bulk-close-btn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.16);
  color: #f8fafc;
}

@media (max-width: 600px) {
  .bulk-action-bar {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 16px;
    padding: 10px 12px;
  }

  @keyframes bulk-action-bar-in {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}

/* ===== IQ COPILOT WIDGET — ANTI-OVERLAP ===== */
/* Sobe o copilot quando a bulk-action-bar (barra de seleção em massa) está visível */
body:has(.bulk-action-bar) .iq-copilot-widget {
  bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 134px)) !important;
}

/* Quando o popover está aberto e a bulk-action-bar está presente, limita altura para não sair da tela */
body:has(.bulk-action-bar) .iq-copilot-popover {
  max-height: min(56vh, 480px) !important;
}

/* ===== Contextual topnav (Fase 1 NOVAUI) ===== */
.topbar-contextnav {
  display: flex;
  align-items: center;
  gap: 2px;
  /* Único filho que cede: basis 0 → largura = espaço que sobra, independentemente
     de quantas abas existem (leitura estável pro ResizeObserver do ContextualTopNav).
     overflow:hidden é a rede: nunca vaza sobre o cluster direito nem corta aba no
     meio da palavra (só rende abas inteiras; o excedente vai pro "Mais"). */
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

.topbar-contextnav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.topbar-contextnav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.topbar-contextnav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 600;
}

/* Botão "Mais" (o menu é Radix DropdownMenu nativo — sem CSS caseiro) */
.topbar-contextnav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.iq-theme-dark .topbar-contextnav-item {
  color: rgba(255, 255, 255, 0.65);
}

body.iq-theme-dark .topbar-contextnav-item:hover,
body.iq-theme-dark .topbar-contextnav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ===== Ícone-botão quadrado para barras de comando ===== */
.iq-icon-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  border: 1px solid rgba(158, 192, 255, 0.2) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(210, 230, 255, 0.85) !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  line-height: 1 !important;
  font-size: 0 !important;
  transition: background 0.12s, color 0.12s !important;
}

.iq-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.iq-icon-btn.active {
  background: rgba(37, 99, 235, 0.5) !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  color: #ffffff !important;
}

.iq-icon-btn svg {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
}

/* ===== CRM — botão inbox ===== */
.crm-inbox-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #f0f6ff !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.crm-inbox-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* ===== Project board — breadcrumb selectors ===== */

.project-breadcrumb-selectors {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.project-breadcrumb-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
}

/* ===== Kanban — column header ===== */

.kanban-col-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 10px 14px 6px !important;
}

.kanban-col-header-left {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.kanban-col-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
  color: #5a6a80 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-col-count {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #8a9ab5 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  box-shadow: none !important;
}

.kanban-col-header-right {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.kanban-col-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #8a9ab5;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  padding: 0;
}

.kanban-col-action-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

/* docs/planos/2026-09-12-kanban-paginacao-servidor.md — "carregar mais" por
   coluna do Kanban paginado. Estilo mínimo (slate, sem cor de marca),
   consistente com o restante do board. */
.kanban-load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px dashed rgba(100, 116, 139, 0.4);
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.kanban-load-more-btn:hover:not(:disabled) {
  background: rgba(100, 116, 139, 0.08);
  color: #334155;
}

.kanban-load-more-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ===== Kanban — subtarefa accordion ===== */

.kanban-subtask-accordion {
  width: 100%;
}

.kanban-subtask-accordion > summary {
  list-style: none;
}

.kanban-subtask-accordion > summary::-webkit-details-marker {
  display: none;
}

.kanban-subtask-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  padding: 0;
  user-select: none;
}

/* Dot quando colapsado */
.kanban-subtask-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.kanban-subtask-dot--pending {
  background: #f59e0b;
}
.kanban-subtask-dot--done {
  background: #22c55e;
}

.kanban-subtask-accordion[open] .kanban-subtask-dot {
  display: none;
}

.kanban-subtask-summary-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #1a2535);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.kanban-subtask-accordion[open] .kanban-subtask-summary-title {
  white-space: normal;
  overflow: visible;
}

/* Subtarefa: esconder meta e assignee externos sempre */
.kanban-subtask-accordion ~ .kanban-task-meta,
.kanban-subtask-accordion ~ .kanban-task-assignee {
  display: none !important;
}

/* Sem espaço sobrando após "Abrir tarefa →" */
.kanban-subtask-body > *:last-child {
  margin-bottom: 0;
}

/* Cards menos arredondados */
.kanban-card {
  border-radius: 6px !important;
}

/* Badge bottom-right */
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.kanban-card-footer-info {
  font-size: 11px;
  color: #4f46e5;
}

.kanban-card-footer .task-hierarchy-head {
  margin: 0;
  margin-left: auto;
}

.kanban-card-footer .task-hierarchy-badges {
  flex-direction: row;
}

/* No accordion expandido: footer com badge à direita do "Abrir tarefa →" */
.kanban-subtask-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.kanban-subtask-body {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kanban-subtask-body-assignee {
  font-size: 11px;
  color: #6b7a8d;
}

.kanban-subtask-open-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #2563eb);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.kanban-subtask-open-btn:hover {
  text-decoration: underline;
}

/* ── Tree connector lines ── */
.kanban-subtask-wrapper {
  position: relative;
}

/* Linha vertical (conecta do gap acima até o centro do card) */
.kanban-subtask-wrapper::before {
  content: "";
  position: absolute;
  left: calc(var(--sub-indent, 18px) * 0.44);
  top: -10px;
  bottom: 50%;
  width: 1.5px;
  background: rgba(129, 140, 248, 0.3);
  border-radius: 1px;
}

/* Para não-último filho: estende a linha pelo gap até o próximo card */
.kanban-subtask-wrapper:not(.last-child)::before {
  bottom: -10px;
}

/* Linha horizontal (cotovelo até o card) */
.kanban-subtask-wrapper::after {
  content: "";
  position: absolute;
  left: calc(var(--sub-indent, 18px) * 0.44);
  top: calc(50% - 1px);
  width: calc(var(--sub-indent, 18px) * 0.5);
  height: 1.5px;
  background: rgba(129, 140, 248, 0.3);
  border-radius: 1px;
}

/* ===== Kanban — colunas estilo Bitrix ===== */

/* Largura das colunas reduzida */
.kanban-shell--transparent .kanban {
  grid-auto-columns: minmax(220px, 250px) !important;
}

/* Coluna: transparente, só borda esquerda pontilhada */
body .kanban-shell--transparent .kanban-col,
body .kanban-shell--transparent .kanban-col-enterprise,
body .kanban-shell--transparent .kanban-col.kanban-col-enterprise,
body .kanban-board-surface.kanban-shell--transparent .kanban-col,
body .kanban-board-surface.kanban-shell--transparent .kanban-col-enterprise {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-left: 2px dashed rgba(150, 170, 210, 0.3) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  min-height: unset !important;
}

/* Remove também o board-surface de fundo (quando ele mesmo tem a classe) */
body .kanban-board-surface.kanban-shell--transparent,
body .kanban-shell--transparent .kanban-board-surface {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  /* altura flui por 100% (casca ancorada na viewport); sem calc mágico */
  height: 100% !important;
  min-height: 0 !important;
  align-items: stretch !important;
}

body .kanban-board-surface.kanban-shell--transparent .kanban,
body .kanban-shell--transparent .kanban-board-surface .kanban {
  height: 100% !important;
  min-height: 0 !important;
  align-items: stretch !important;
}

body .kanban-board-surface.kanban-shell--transparent .kanban-col,
body .kanban-shell--transparent .kanban-board-surface .kanban-col {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
}

/* ===== Cadeia de altura do Kanban ancorada na viewport =====
   Escopado por :has(.kanban-page) para NÃO afetar outras telas. A casca fica do
   tamanho da viewport (100dvh) e a altura flui por 100%/minmax(0,1fr) até as
   colunas, que vão da NOVO/header à base; o scroll é interno (por coluna, em
   .kanban-cards). Spec validada via inspeção do CSS computado. */
.shell:has(.kanban-page) {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.shell:has(.kanban-page) > .main {
  grid-template-rows: auto minmax(0, 1fr) !important;
  min-height: 0 !important;
}
.shell:has(.kanban-page) .content {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
/* flex:1 (não height:100%) para a kanban-page pegar só o espaço RESTANTE do
   content — descontando irmãos como o banner "Instale o IQ Pipe" (pwa-banner). */
.kanban-page {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

/* Header da coluna: seta Bitrix + cor por tone */
.kanban-board-surface.kanban-shell--transparent .kanban-col-header,
.kanban-shell--transparent .kanban-col-header {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  padding: 7px 28px 7px 12px !important;
  margin-bottom: 10px !important;
  background: var(--kanban-stage-bg, #3d5169) !important;
  clip-path: polygon(3px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px) !important;
  border-radius: 0 !important;
}

.kanban-shell--transparent .kanban-col.tone-a .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-a .kanban-col-header { background: #4a6484 !important; }
.kanban-shell--transparent .kanban-col.tone-b .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-b .kanban-col-header { background: #3a5f7a !important; }
.kanban-shell--transparent .kanban-col.tone-c .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-c .kanban-col-header { background: #2e6a8c !important; }
.kanban-shell--transparent .kanban-col.tone-d .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-d .kanban-col-header { background: #2a5298 !important; }
.kanban-shell--transparent .kanban-col.tone-e .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-e .kanban-col-header { background: #2d7070 !important; }
.kanban-shell--transparent .kanban-col.tone-f .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-f .kanban-col-header { background: #4a3f8a !important; }
.kanban-shell--transparent .kanban-col.tone-won .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-won .kanban-col-header { background: #2d6a4f !important; }
.kanban-shell--transparent .kanban-col.tone-lost .kanban-col-header,
.kanban-board-surface.kanban-shell--transparent .kanban-col.tone-lost .kanban-col-header { background: #7a3535 !important; }

.kanban-shell--transparent .kanban-col-summary,
.kanban-board-surface.kanban-shell--transparent .kanban-col-summary {
  background: transparent !important;
  color: rgba(255,255,255,0.6) !important;
  font-size: 11px !important;
  padding: 4px 12px 6px !important;
}

/* Remover a barra de cor no topo (substituída pelo header colorido) */
.kanban-shell--transparent .kanban-col-top,
.kanban-board-surface.kanban-shell--transparent .kanban-col-top {
  display: none !important;
}

/* Valor monetário no header da coluna CRM */
.kanban-col-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--kanban-stage-fg, rgba(255, 255, 255, 0.75));
  white-space: nowrap;
}

/* Badges won/lost sobre fundo escuro */
.kanban-shell--transparent .kanban-col-badge {
  font-size: 10px !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
}

.kanban-shell--transparent .kanban-col-badge.won {
  background: rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
}

.kanban-shell--transparent .kanban-col-badge.lost {
  background: rgba(255,255,255,0.15) !important;
  color: rgba(255,255,255,0.85) !important;
}

/* Texto e ícones brancos no header escuro */
.kanban-shell--transparent .kanban-col-title {
  color: var(--kanban-stage-fg, #ffffff) !important;
  font-weight: 700 !important;
}

.kanban-shell--transparent .kanban-col-count {
  color: var(--kanban-stage-fg, rgba(255, 255, 255, 0.75)) !important;
}

.kanban-shell--transparent .kanban-col-action-btn {
  color: var(--kanban-stage-fg, rgba(255, 255, 255, 0.8)) !important;
}

.kanban-shell--transparent .kanban-col-action-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

/* Cards sem padding */
.kanban-shell--transparent .kanban-cards {
  padding: 0 !important;
  gap: 8px !important;
}

/* Botão "Adicionar tarefa" dentro da coluna */
.kanban-shell--transparent .kanban-add-card-btn {
  margin: 4px 4px 4px 10px;
  width: calc(100% - 14px);
}

/* ── Subtask group toggle ── */
.kanban-subtask-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 26px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  position: relative;
  margin-top: -8px;
}

.kanban-subtask-group-toggle::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5px;
  height: 14px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
}

.kanban-subtask-group-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.kanban-subtask-group-toggle--collapse {
  margin-left: 18px;
  padding-left: 8px;
}

.kanban-subtask-group-toggle--collapse::before {
  display: none;
}

/* ===== Project Board — barra de controles + card transparente ===== */

/* Compactar espaçamento vertical do board */
.kanban-page {
  gap: 6px !important;
}

/* Tabs da command bar no contexto escuro do board */
.kanban-page .ws-command-bar {
  padding-bottom: 2px;
}

.kanban-page .ws-view-tab,
.kanban-page .ws-filter-tab {
  color: rgba(196, 220, 255, 0.65);
}

.kanban-page .ws-view-tab:hover,
.kanban-page .ws-filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f6ff;
}

.kanban-page .ws-view-tab.active,
.kanban-page .ws-filter-tab.active {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  font-weight: 700;
}

.kanban-page .ws-command-bar .ws-filter-tabs {
  border-left-color: rgba(255, 255, 255, 0.12);
}

/* Sem espaço entre barra e colunas */
.kanban-shell--transparent {
  padding-top: 0 !important;
}

.kanban-shell--transparent .kanban {
  padding: 0 !important;
}

/* Minibotões na barra escura */
.project-board-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.project-board-bar-right .project-shell-icon-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(158, 192, 255, 0.2) !important;
  color: rgba(210, 230, 255, 0.85) !important;
  border-radius: 8px !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.project-board-bar-right .project-shell-icon-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.project-board-bar-right .project-shell-icon-btn.accent {
  background: rgba(37, 99, 235, 0.5) !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  color: #ffffff !important;
}

/* Kanban shell transparente — sem fundo, sem sombra, sem padding lateral */
.kanban-shell--transparent {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Overflow "⋯" e chip de filtro do CRM (caminho LEGADO — sem
   kanban_paginado — Meus/Recebidos/Planejado): existem só no mobile
   (ver @600). Revertido para o original: docs/planos/2026-09-15-filtro-
   usuario-kanban.md exige ZERO mudança visual pra quem não tem
   kanban_paginado ligada — o controle novo (abaixo) usa uma classe
   PRÓPRIA, nunca esta. */
.kanban-page .crm-overflow-btn,
.kanban-page .crm-filter-chip {
  display: none;
}

.kanban-page .crm-filter-chip {
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(158, 192, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(210, 230, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}

/* docs/planos/2026-09-15-filtro-usuario-kanban.md — chip do controle ÚNICO
   "de quem ver os cards", só existe no caminho PAGINADO (kanban_paginado
   ligada — hoje só Elevar). Classe PRÓPRIA (nunca `.crm-filter-chip`, que é
   do caminho legado e precisa ficar bit-a-bit igual a antes desta frente):
   fica visível em QUALQUER largura de tela, porque a lista de opções aqui
   tem tamanho VARIÁVEL (colegas/usuários da agência) e não cabe numa barra
   de abas fixas como o controle legado. Mesmo visual do chip legado
   (raio/borda/cor), só a regra de `display` muda. */
.kanban-page .crm-owner-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(158, 192, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(210, 230, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ===== Header do CRM enxuto no mobile (de ~6 faixas para 3) =====
   Escopado em .kanban-page + @600 → desktop e outras telas intactos. */
@media (max-width: 600px) {
  /* Faixa 1: título + ações ([+] e "⋯") na mesma linha. O seletor desce. */
  .kanban-page .context-page-topline {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .kanban-page .context-page-breadcrumb {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Separador ">" pendurado some quando o seletor quebra pra própria linha. */
  .kanban-page .context-page-separator {
    display: none;
  }

  /* Faixa 2: pipeline + busca; a busca ocupa o espaço restante (era fixa 170px). */
  .kanban-page .context-page-selector-slot {
    flex: 1 1 100%;
    min-width: 0;
  }

  .kanban-page .crm-selector-group {
    width: 100%;
    flex-wrap: nowrap;
  }

  .kanban-page .crm-board-search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .kanban-page .crm-board-search input {
    width: 100% !important;
    max-width: none !important;
  }

  /* Ações: só "Criar negócio" (vira ícone +) e o "⋯"; Inbox e Criar reunião
     migram pro menu. Neutraliza o width:100% global (globals.css:12664). */
  .kanban-page .context-page-actions {
    width: auto !important;
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  .kanban-page .crm-action-collapse {
    display: none !important;
  }

  .kanban-page .crm-create-deal-btn .crm-btn-text {
    display: none;
  }

  .kanban-page .crm-create-deal-btn {
    padding: 8px !important;
  }

  .kanban-page .crm-overflow-btn {
    display: inline-flex;
  }

  /* Faixa 3: abas de visão + chip de filtro numa única faixa rolável.
     Some as filter-tabs (viraram chip) e os ícones utilitários (foram pro "⋯"). */
  .kanban-page .ws-command-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .kanban-page .ws-command-bar::-webkit-scrollbar {
    display: none;
  }

  .kanban-page .ws-filter-tabs,
  .kanban-page .project-board-bar-right {
    display: none !important;
  }

  .kanban-page .crm-filter-chip {
    display: inline-flex;
  }
}

/* ===== Usuários Lista — filtros no header ===== */

.iq-users-header-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.context-header-search {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(158, 192, 255, 0.5);
  border-radius: 999px;
  background: rgba(10, 22, 46, 0.62);
  color: #f4f8ff;
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.context-header-search::placeholder {
  color: rgba(180, 210, 255, 0.5);
}

.context-header-search:focus {
  outline: none;
  border-color: rgba(139, 189, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(79, 145, 255, 0.28);
}

/* ===== Permissions Manager — novo layout ===== */

/* Wrapper inline: tabs + select na mesma linha */
.iq-perm-header-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Tabs Usuário / Time — estilo dark (contexto do header escuro) */
.iq-perm-mode-tabs {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 22, 46, 0.45);
  border: 1px solid rgba(158, 192, 255, 0.35);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.iq-perm-mode-tab {
  padding: 4px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: rgba(196, 220, 255, 0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.iq-perm-mode-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f8ff;
}

.iq-perm-mode-tab.active {
  background: rgba(255, 255, 255, 0.95);
  color: #1d3bd0;
  font-weight: 700;
}

/* Accordion de módulos */
.iq-perm-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iq-perm-section {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.iq-perm-section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: #f1f5fb;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.iq-perm-section-toggle:hover {
  background: #e8eef8;
}

.iq-perm-section.open .iq-perm-section-toggle {
  background: #e8f0fe;
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

.iq-perm-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #2d3f55;
  flex: 1;
  letter-spacing: 0.01em;
}

.iq-perm-section.open .iq-perm-section-label {
  color: #1d4ed8;
}

.iq-perm-section-count {
  font-size: 11px;
  color: var(--text-muted, #7a8ca3);
  background: rgba(0, 0, 0, 0.07);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.iq-perm-section-chevron {
  font-size: 10px;
  color: #8a9ab5;
}

.iq-perm-section-body {
  padding: 0;
  overflow-x: auto;
}

/* Tabela de permissões */
.iq-perm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.iq-perm-table thead tr {
  background: rgba(0, 0, 0, 0.03);
}

.iq-perm-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #7a8ca3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.iq-perm-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

.iq-perm-row:last-child td {
  border-bottom: none;
}

.iq-perm-row:hover td {
  background: rgba(37, 99, 235, 0.02);
}

.iq-perm-cell-label {
  min-width: 180px;
}

.iq-perm-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary, #1a2535);
}

.iq-perm-key {
  display: block;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted, #7a8ca3);
  margin-top: 1px;
}

.iq-perm-cell-origin {
  min-width: 160px;
}

.iq-perm-origin-text {
  font-size: 12px;
  color: var(--text-secondary, #4a5c72);
}

.iq-perm-cell-effective {
  min-width: 90px;
}

/* Badge efetivo */
.iq-perm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.iq-perm-badge--allow {
  background: #d1fae5;
  color: #065f46;
}

.iq-perm-badge--deny {
  background: #fee2e2;
  color: #7f1d1d;
}

.iq-perm-cell-toggle {
  min-width: 220px;
}

/* Botões de override tri-state */
.iq-perm-toggle-group {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}

.iq-perm-btn {
  padding: 5px 10px;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #4a5c72);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.iq-perm-btn:last-child {
  border-right: none;
}

.iq-perm-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Herdado ativo — neutro */
.iq-perm-btn--inherit.active {
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
}

/* Liberado ativo — verde */
.iq-perm-btn--allow.active {
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

/* Bloqueado ativo — vermelho */
.iq-perm-btn--deny.active {
  background: #fee2e2;
  color: #7f1d1d;
  font-weight: 600;
}

@media (max-width: 768px) {
  .iq-perm-toggle-group {
    flex-wrap: nowrap;
  }

  .iq-perm-btn {
    padding: 5px 7px;
    font-size: 11px;
  }
}

/* ------------------------------------------------------------------ */
/* "Ver como" (view-as) — seletor de perfil no topbar + banner de aviso */
/* Apenas platform_dev vê o seletor; o banner aparece enquanto ativo.   */
/* ------------------------------------------------------------------ */
/* Botão "Ver como" no padrão dos demais ícones do topbar; quando um perfil  */
/* está sendo simulado, o ícone ganha destaque âmbar (mesma cor do banner).   */
.topbar-icon-btn.is-active {
  border-color: #d97706;
  background: #fff7ed;
  color: #b45309;
}
.topbar-viewas-menu {
  min-width: 180px;
}
.viewas-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: #fff7ed;
  color: #92400e;
  font-size: 13px;
}
.viewas-banner strong {
  font-weight: 700;
}
.viewas-banner-exit {
  margin-left: auto;
  flex: none;
  padding: 5px 12px;
  border: 1px solid #d97706;
  border-radius: 8px;
  background: #d97706;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.viewas-banner-exit:hover {
  background: #b45309;
  border-color: #b45309;
}
@media (max-width: 768px) {
  .viewas-banner {
    flex-wrap: wrap;
    font-size: 12px;
  }
}

/* TipTap editor — remove outline azul no foco */
.ProseMirror:focus {
  outline: none !important;
}

/* ── TipTap editor content styles ── */
.ProseMirror h1 { font-size: 1.6em; font-weight: 700; margin: 0.8em 0 0.4em; line-height: 1.3; color: #1a1a2e; }
.ProseMirror h2 { font-size: 1.3em; font-weight: 700; margin: 0.8em 0 0.4em; line-height: 1.3; color: #1a1a2e; }
.ProseMirror h3 { font-size: 1.1em; font-weight: 700; margin: 0.6em 0 0.3em; line-height: 1.3; color: #1a1a2e; }
.ProseMirror p { margin: 0.4em 0; }
.ProseMirror ul { list-style: disc; padding-left: 1.5em; margin: 0.4em 0; }
.ProseMirror ol { list-style: decimal; padding-left: 1.5em; margin: 0.4em 0; }
.ProseMirror li { margin: 0.2em 0; }
.ProseMirror blockquote { border-left: 3px solid #d9e0ea; margin: 0.6em 0; padding: 4px 0 4px 14px; color: #64748b; font-style: italic; }
.ProseMirror pre { background: #1e1e2e; color: #e2e8f0; border-radius: 8px; padding: 12px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-x: auto; margin: 0.6em 0; }
.ProseMirror code { background: #f1f5f9; color: #c7254e; border-radius: 4px; padding: 1px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.ProseMirror pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.ProseMirror hr { border: none; border-top: 2px solid #eef1f6; margin: 1em 0; }
.ProseMirror a { color: #4a7dff; text-decoration: underline; }
.ProseMirror mark { background: #fef08a; border-radius: 2px; padding: 0 2px; }
.ProseMirror img { max-width: 100%; border-radius: 6px; margin: 0.4em 0; }
.ProseMirror ul[data-type="taskList"] { list-style: none; padding-left: 0.4em; }
.ProseMirror ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 8px; }
.ProseMirror ul[data-type="taskList"] li > label { margin-top: 2px; }
.ProseMirror sub { vertical-align: sub; font-size: 0.8em; }
.ProseMirror sup { vertical-align: super; font-size: 0.8em; }

/* ── HTML mode syntax highlight ── */
.iq-html-editor .tok-tag    { color: #79b8ff; }
.iq-html-editor .tok-attr   { color: #ffab70; }
.iq-html-editor .tok-val    { color: #9ecbff; }
.iq-html-editor .tok-cmt    { color: #6a737d; font-style: italic; }
.iq-html-editor .tok-txt    { color: #e2e8f0; }

/* ── HTML editor light mode ── */
.iq-html-editor.light .tok-tag  { color: #0070c1; }
.iq-html-editor.light .tok-attr { color: #e07400; }
.iq-html-editor.light .tok-val  { color: #067d17; }
.iq-html-editor.light .tok-cmt  { color: #8c8c8c; font-style: italic; }
.iq-html-editor.light .tok-txt  { color: #1a1a2e; }

/* ── HTML highlight tokens v2 ── */
.iq-html-editor .tok-punct { color: #808080; }
.iq-html-editor .tok-tag   { color: #4ec9b0; }
.iq-html-editor .tok-attr  { color: #9cdcfe; }
.iq-html-editor .tok-val   { color: #ce9178; }
.iq-html-editor .tok-cmt   { color: #6a9955; font-style: italic; }
.iq-html-editor .tok-txt   { color: #d4d4d4; }

.iq-html-editor.light .tok-punct { color: #808080; }
.iq-html-editor.light .tok-tag   { color: #267f99; }
.iq-html-editor.light .tok-attr  { color: #0070c1; }
.iq-html-editor.light .tok-val   { color: #a31515; }
.iq-html-editor.light .tok-cmt   { color: #008000; font-style: italic; }
.iq-html-editor.light .tok-txt   { color: #1a1a2e; }

/* ── TipTap table styles ── */
.ProseMirror table { border-collapse: collapse; width: 100%; margin: 0.8em 0; table-layout: fixed; }
.ProseMirror table td,
.ProseMirror table th { border: 1px solid #d1d9e0; padding: 8px 12px; vertical-align: top; min-width: 60px; position: relative; }
.ProseMirror table th { background: #f1f5f9; font-weight: 600; color: #334155; }
.ProseMirror table tr:nth-child(even) td { background: #f8fafc; }
.ProseMirror table .selectedCell:after { content: ""; position: absolute; inset: 0; background: rgba(59,91,219,0.08); pointer-events: none; }
.ProseMirror .tableWrapper { overflow-x: auto; }

/* ── Task description readonly table ── */
.task-description-readonly table { border-collapse: collapse; width: 100%; margin: 0.8em 0; }
.task-description-readonly table td,
.task-description-readonly table th { border: 1px solid #d1d9e0; padding: 8px 12px; vertical-align: top; }
.task-description-readonly table th { background: #f1f5f9; font-weight: 600; }
.task-description-readonly table tr:nth-child(even) td { background: #f8fafc; }

/* ── TipTap figure with caption ── */
.ProseMirror figure { display: block; margin: 12px 0; text-align: center; }
.ProseMirror figure img { max-width: 100%; border-radius: 6px; border: 1px solid #e2e8f0; display: inline-block; }
.ProseMirror figure figcaption { font-size: 12px; color: #6b7a8d; margin-top: 4px; font-style: italic; }

/* ── Task description readonly figure ── */
.task-description-readonly figure { display: block; margin: 12px 0; text-align: center; }
.task-description-readonly figure img { max-width: 100%; border-radius: 6px; border: 1px solid #e2e8f0; display: inline-block; }
.task-description-readonly figure figcaption { font-size: 12px; color: #6b7a8d; margin-top: 4px; font-style: italic; }

/* ── Auth login v2 ── */
body:has(.auth-modern) {
  background: #f8fafc !important;
}

.auth-modern {
  display: grid !important;
  grid-template-columns: minmax(460px, 0.95fr) minmax(520px, 1.05fr) !important;
  min-height: 100vh !important;
  background: #f8fafc !important;
}

.auth-modern-form {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 48px 56px !important;
  background:
    radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.08), transparent 34%),
    #f8fafc !important;
}

.auth-modern-form main {
  width: min(460px, 100%) !important;
}

.auth-modern-form .auth-login-card.twk-card,
.auth-modern-form .auth-login-card.panel {
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: grid !important;
  gap: 18px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.auth-login-header {
  display: grid !important;
  gap: 8px !important;
}

.auth-login-logo {
  display: inline-flex !important;
  width: fit-content !important;
  align-items: center !important;
  gap: 10px !important;
  color: #111827 !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  margin-bottom: 12px !important;
}

.auth-login-logo img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
}

.auth-login-header .twk-overline {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
}

.auth-login-card .auth-login-header h2 {
  margin: 0 !important;
  color: #111827 !important;
  font-size: 1.9rem !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

.auth-login-intro {
  max-width: 380px !important;
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
}

.auth-login-card .form {
  display: grid !important;
  gap: 16px !important;
  margin-top: 0 !important;
}

.auth-login-card .field {
  display: grid !important;
  gap: 8px !important;
}

.auth-field-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.auth-login-card .field label {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

.auth-login-link {
  color: #4f46e5 !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.auth-input-shell {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 46px !important;
  border: 1px solid #dbe1ea !important;
  border-radius: 10px !important;
  padding: 0 12px !important;
  background: #ffffff !important;
  color: #64748b !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.auth-input-shell:focus-within,
.auth-login-card .password-field:focus-within {
  border-color: #a5b4fc !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.13) !important;
}

.auth-login-card .auth-input-shell input,
.auth-login-card .auth-password-input {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 11px 0 !important;
  color: #111827 !important;
  font-size: 0.95rem !important;
  outline: none !important;
  box-shadow: none !important;
}

.auth-login-card .password-field {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 46px !important;
  border: 1px solid #dbe1ea !important;
  border-radius: 10px !important;
  padding: 0 8px 0 12px !important;
  background: #ffffff !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.auth-login-card .password-field input {
  flex: 1 1 auto !important;
}

.auth-login-card .password-toggle {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #64748b !important;
  padding: 8px !important;
}

.auth-login-card .password-toggle:hover {
  background: #eef2ff !important;
  color: #4338ca !important;
}

.auth-login-card .auth-login-submit,
.auth-login-card .form .auth-login-submit {
  width: 100% !important;
  min-height: 44px !important;
  justify-self: stretch !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #4f46e5 !important;
  color: #ffffff !important;
  padding: 10px 18px !important;
  font-weight: 800 !important;
}

.auth-login-card .auth-login-submit:hover:not(:disabled) {
  background: #4338ca !important;
}

.auth-login-status {
  color: #b42318 !important;
  font-weight: 700 !important;
}

.auth-mobile-download {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 14px !important;
  align-items: center !important;
  padding: 14px !important;
  border: 1px solid #dbe1ea !important;
  border-radius: 12px !important;
  background: #ffffff !important;
}

.auth-mobile-copy {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.auth-mobile-icon {
  display: inline-flex !important;
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  background: #e0e7ff !important;
  color: #4338ca !important;
}

.auth-mobile-title {
  margin: 0 0 3px !important;
  color: #111827 !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}

.auth-mobile-text {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.78rem !important;
  line-height: 1.35 !important;
}

.auth-qr-link {
  display: block !important;
  width: 92px !important;
  height: 92px !important;
  padding: 8px !important;
  border: 1px solid #dbe1ea !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

.auth-qr-link img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.auth-download-button {
  grid-column: 1 / -1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  border: 1px solid #c7d2fe !important;
  border-radius: 10px !important;
  color: #4338ca !important;
  background: #eef2ff !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
}

.auth-login-footer {
  display: grid !important;
  gap: 8px !important;
}

.auth-login-footer .auth-switch-link {
  margin: 0 !important;
}

.auth-legal-links {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  color: #64748b !important;
  font-size: 0.75rem !important;
}

.auth-legal-links a,
.auth-login-footer a {
  font-weight: 800 !important;
}

.auth-modern-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 48px !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.38)),
    url("/assets/auth-bg-Dbv9BhkR.jpg") center / cover no-repeat !important;
}

.auth-modern-brand::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 48%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 48%) !important;
  background-size: 40px 40px !important;
  background-position: 0 0, 20px 20px !important;
}

.auth-modern-brand > * {
  position: relative !important;
  z-index: 1 !important;
}

.auth-modern-brand-logo {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #0f172a !important;
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  margin-bottom: 32px !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.68) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.74) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12) !important;
  backdrop-filter: blur(12px) !important;
}

.auth-modern-brand-panel {
  width: min(480px, 100%) !important;
  padding: 10px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18) !important;
  margin-bottom: 36px !important;
  backdrop-filter: blur(16px) !important;
}

.auth-modern-brand-img {
  display: block !important;
  width: 100% !important;
  border-radius: 8px !important;
}

.auth-modern-brand h2 {
  color: #0f172a !important;
  font-size: 1.4rem !important;
  font-weight: 800 !important;
  text-align: center !important;
  margin: 0 0 12px !important;
}

.auth-modern-brand p {
  max-width: 440px !important;
  margin: 0 !important;
  color: #334155 !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  text-align: center !important;
}

@media (max-width: 900px) {
  .auth-modern {
    grid-template-columns: 1fr !important;
  }

  .auth-modern-form {
    min-height: 100vh !important;
    padding: 32px 20px !important;
  }

  .auth-modern-brand {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .auth-mobile-download {
    grid-template-columns: 1fr !important;
  }

  .auth-qr-link {
    width: 118px !important;
    height: 118px !important;
    justify-self: center !important;
  }
}

/* Lead autocomplete dropdown */
.lead-autocomplete-dropdown {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
}
.lead-autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid #f1f5f9;
}
.lead-autocomplete-item:last-child { border-bottom: none; }
.lead-autocomplete-item:hover { background: #f8fafc; }
.lead-autocomplete-name { font-size: 13px; font-weight: 500; color: #1e293b; }
.lead-autocomplete-sub { font-size: 11px; color: #64748b; }
