/* ============================================================
   layout.css — casca do dashboard (sidebar à esquerda + topo fino)
   Depende das variáveis do Tabler (--tblr-*). Sem sombras, sem gradientes.
   Estados no <body>:
     .sb-collapsed  → sidebar em trilho de ícones (desktop)
     .sb-open       → sidebar aberta como gaveta (mobile)
   ============================================================ */

:root {
  --sb-width: 248px;
  --sb-width-collapsed: 64px;
  --topbar-height: 56px;
  --shell-border: var(--tblr-border-color);
  --shell-surface: var(--tblr-bg-surface);
  --shell-muted: var(--tblr-secondary);
  --shell-hover: rgba(var(--tblr-body-color-rgb), 0.05);
  --shell-active: rgba(var(--tblr-body-color-rgb), 0.08);
}

[data-bs-theme="dark"] {
  --shell-hover: rgba(255, 255, 255, 0.06);
  --shell-active: rgba(255, 255, 255, 0.1);
}

html, body { height: 100%; }

body.layout-fluid { background: var(--tblr-bg-surface-secondary); }

/* ---------- shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.app-sidebar {
  flex: 0 0 var(--sb-width);
  width: var(--sb-width);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--shell-surface);
  border-right: 1px solid var(--shell-border);
  transition: width .18s ease, flex-basis .18s ease, transform .2s ease;
  z-index: 1045;
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: var(--topbar-height);
  padding: 0 .9rem 0 1rem;
  border-bottom: 1px solid var(--shell-border);
  flex-shrink: 0;
}

.sb-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--tblr-body-color);
  color: var(--tblr-bg-surface);
  font-weight: 700;
  font-size: calc(.72rem * var(--aia-text-scale, 1));
  letter-spacing: .04em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sb-brand-text {
  min-width: 0;
  line-height: 1.15;
}

.sb-brand-text strong {
  display: block;
  font-size: calc(.9rem * var(--aia-text-scale, 1));
  font-weight: 600;
  white-space: nowrap;
}

.sb-brand-text small {
  display: block;
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  white-space: nowrap;
}

.sb-brand-close {
  margin-left: auto;
  display: none;
}

/* Studio switcher no topo da sidebar */
.sb-studio {
  padding: .75rem .75rem .25rem;
  flex-shrink: 0;
}

.sb-studio label {
  display: block;
  font-size: calc(.68rem * var(--aia-text-scale, 1));
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--shell-muted);
  margin: 0 .25rem .3rem;
}

.sb-studio .form-select {
  font-size: calc(.85rem * var(--aia-text-scale, 1));
  font-weight: 500;
}

.sb-studio .btn {
  width: 100%;
  margin-top: .4rem;
  justify-content: center;
}

/* Navegação */
.sb-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem .6rem 1rem;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap; /* .nav do Bootstrap é wrap: em janela baixa os itens iam para uma 2ª coluna */
  gap: 2px;
  scrollbar-width: thin;
}

.sb-group {
  font-size: calc(.68rem * var(--aia-text-scale, 1));
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--shell-muted);
  padding: .9rem .5rem .3rem;
  white-space: nowrap;
}

.sb-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: 6px;
  color: var(--tblr-body-color);
  font-size: calc(.875rem * var(--aia-text-scale, 1));
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  border: 0;
  background: transparent;
  transition: background-color .12s ease;
}

.sb-nav .nav-link .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
  flex-shrink: 0;
  color: var(--shell-muted);
}

.sb-nav .nav-link:hover {
  background: var(--shell-hover);
  color: var(--tblr-body-color);
}

.sb-nav .nav-link.active {
  background: var(--shell-active);
  color: var(--tblr-body-color);
}

.sb-nav .nav-link.active .icon {
  color: var(--tblr-primary);
}

.sb-nav .nav-link .sb-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge de tarefas e de mídia nova: contador inline à direita (a .badge-notification do Tabler é absoluta !important) */
.sb-badge {
  color: #fff; /* sem isto herdava o cinza do link e o número sumia no fundo colorido */
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  font-weight: 600;
  line-height: 1.35rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sb-badge[hidden] { display: none; }

/* Extensão do WhatsApp (Chrome Web Store): link fixo em destaque logo acima do rodapé */
.sb-extensao {
  flex-shrink: 0;
  padding: .5rem .6rem;
  border-top: 1px solid var(--shell-border);
}

.sb-extensao-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: 6px;
  color: var(--tblr-primary);
  background: rgba(var(--tblr-primary-rgb), .1);
  font-size: calc(.875rem * var(--aia-text-scale, 1));
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
  transition: background-color .12s ease;
}

.sb-extensao-link:hover {
  background: rgba(var(--tblr-primary-rgb), .18);
  color: var(--tblr-primary);
  text-decoration: none;
}

.sb-extensao-link .icon { width: 20px; height: 20px; stroke-width: 1.6; flex-shrink: 0; }
.sb-extensao-link .sb-label { flex: 1 1 auto; min-width: 0; white-space: normal; } /* com o selo "Nova", o nome quebra em 2 linhas em vez de cortar */

/* Rodapé: usuário + menu */
.sb-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--shell-border);
  padding: .6rem;
  position: relative;
}

.sb-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .5rem;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.sb-user:hover { background: var(--shell-hover); }

.sb-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tblr-primary-lt);
  color: var(--tblr-primary);
  font-size: calc(.72rem * var(--aia-text-scale, 1));
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sb-user-text {
  min-width: 0;
  line-height: 1.15;
  flex: 1 1 auto;
}

.sb-user-text strong {
  display: block;
  font-size: calc(.82rem * var(--aia-text-scale, 1));
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user-text small {
  display: block;
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-user .sb-user-caret {
  color: var(--shell-muted);
  flex-shrink: 0;
}

/* Painel do menu do usuário abre para cima, alinhado ao rodapé */
.sb-footer .top-menu-panel {
  top: auto;
  bottom: calc(100% + .35rem);
  left: .6rem;
  right: .6rem;
  min-width: 0;
  transform: translateY(4px);
  box-shadow: none;
  border-color: var(--shell-border);
  background: var(--shell-surface);
}

.sb-footer .top-menu-panel.open { transform: translateY(0); }

/* Ponto de alerta no botão do usuário (classe mantida do main.js/alertsPanel) */
.sb-user.has-alerts::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 30px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid var(--shell-surface);
}

/* ---------- sidebar retraída (desktop) ---------- */
@media (min-width: 992px) {
  body.sb-collapsed .app-sidebar {
    flex-basis: var(--sb-width-collapsed);
    width: var(--sb-width-collapsed);
  }

  body.sb-collapsed .sb-brand { padding: 0; justify-content: center; }
  body.sb-collapsed .sb-brand-text,
  body.sb-collapsed .sb-studio,
  body.sb-collapsed .sb-group,
  body.sb-collapsed .sb-label,
  body.sb-collapsed .sb-user-text,
  body.sb-collapsed .sb-user-caret { display: none; }

  body.sb-collapsed .sb-nav { padding: .5rem .5rem 1rem; }
  body.sb-collapsed .sb-nav .nav-link { justify-content: center; padding: .55rem 0; }
  body.sb-collapsed .sb-extensao { padding: .5rem; }
  body.sb-collapsed .sb-extensao-link { justify-content: center; padding: .55rem 0; }
  body.sb-collapsed .sb-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    margin: 0;
    min-width: 1rem;
    height: 1rem;
    line-height: 1rem;
    font-size: calc(.6rem * var(--aia-text-scale, 1));
    padding: 0 .3rem;
  }
  body.sb-collapsed .sb-user { justify-content: center; padding: .45rem 0; }
  body.sb-collapsed .sb-footer .top-menu-panel {
    left: calc(100% + .35rem);
    right: auto;
    bottom: .6rem;
    min-width: 240px;
  }
  body.sb-collapsed .sb-footer { overflow: visible; }
  body.sb-collapsed .app-sidebar { overflow: visible; }
}

/* ---------- mobile: gaveta ---------- */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    width: var(--sb-width);
    flex-basis: var(--sb-width);
  }

  body.sb-open .app-sidebar { transform: translateX(0); }

  .sb-brand-close { display: inline-flex; }

  .sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1044;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sb-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  body.sb-open { overflow: hidden; }
}

/* ---------- área principal ---------- */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1.25rem 0 .9rem;
  background: var(--shell-surface);
  border-bottom: 1px solid var(--shell-border);
}

.app-topbar .btn-icon {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--shell-muted);
  border-radius: 6px;
}

.app-topbar .btn-icon:hover {
  background: var(--shell-hover);
  color: var(--tblr-body-color);
}

.app-topbar .btn-icon svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* Botão de recolher/expandir a sidebar: ícone de painel com seta, muda com o estado */
.tb-sb-toggle .tb-sb-icon-expand { display: none; }
body.sb-collapsed .tb-sb-toggle .tb-sb-icon-collapse { display: none; }
body.sb-collapsed .tb-sb-toggle .tb-sb-icon-expand { display: block; }

/* Selo do studio de demonstração (dados fictícios) */
.tb-demo {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 .55rem;
  margin-left: .6rem;
  border: 1px solid rgba(217, 119, 6, .4);
  border-radius: 999px;
  background: rgba(245, 158, 11, .12);
  color: #b45309;
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
[data-bs-theme="dark"] .tb-demo { color: #fbbf24; }
.tb-demo[hidden] { display: none; }

/* Chip de clima */
.tb-weather {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 34px;
  padding: 0 .65rem;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  background: var(--shell-surface);
  color: var(--tblr-body-color);
  font-size: calc(.82rem * var(--aia-text-scale, 1));
  line-height: 1;
  cursor: pointer;
  margin-right: .25rem;
}

.tb-weather:hover { background: var(--shell-hover); }
.tb-weather svg { color: var(--shell-muted); flex-shrink: 0; }
.tb-weather-temp { font-weight: 600; }
.tb-weather-label { color: var(--shell-muted); white-space: nowrap; }
.tb-weather[hidden] { display: none; }

@media (max-width: 1199.98px) { .tb-weather-label { display: none; } }
@media (max-width: 575.98px) { .tb-weather { display: none; } }

.tb-title {
  font-size: calc(1rem * var(--aia-text-scale, 1));
  font-weight: 600;
  margin: 0 0 0 .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Controle de período: ‹ Mês › + personalizar */
.tb-period {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px;
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  background: var(--shell-surface);
}

.tb-period > .dropdown {
  display: inline-flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.tb-period > .btn,
.tb-period > .dropdown > .btn {
  height: 28px;
  min-height: 0;
  line-height: 1;
  padding: 0 .55rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--tblr-body-color);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: calc(.82rem * var(--aia-text-scale, 1));
  font-weight: 500;
  box-shadow: none;
}

.tb-period > .btn svg,
.tb-period > .dropdown > .btn svg { display: block; }

.tb-period > .btn:hover,
.tb-period > .dropdown > .btn:hover { background: var(--shell-hover); }

/* separadores curtos, centralizados — não encostam nos cantos arredondados */
.tb-period > .btn + .btn,
.tb-period > .dropdown {
  position: relative;
  margin-left: 3px;
}

.tb-period > .btn + .btn::before,
.tb-period > .dropdown::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 1px;
  height: 14px;
  transform: translateY(-50%);
  background: var(--shell-border);
}

.tb-period #mesLabel {
  font-weight: 500;
  color: var(--tblr-body-color);
  white-space: nowrap;
  line-height: 1;
}

.tb-period .tb-period-icon { display: none; }

.tb-period .dropdown-menu {
  min-width: 300px;
  padding: .85rem;
  border-color: var(--shell-border);
  box-shadow: none;
}

.tb-period-range { flex-wrap: nowrap; }

.tb-period-range input[type="date"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.tb-period .dropdown-menu label {
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--shell-muted);
  margin-bottom: .35rem;
  display: block;
}

/* Painel de alertas sob o sino */
.tb-alerts { position: relative; }

.tb-alerts .top-menu-panel {
  min-width: 320px;
  box-shadow: none;
  border-color: var(--shell-border);
  background: var(--shell-surface);
}

.tb-alerts .badge-notification {
  top: 6px;
  right: 6px;
  transform: none;
  min-width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
}

.app-topbar #btnAiAnalysis {
  height: 34px;
  border-radius: 6px;
  font-size: calc(.82rem * var(--aia-text-scale, 1));
  font-weight: 500;
}

/* Conteúdo */
.app-content {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 2rem;
  min-width: 0;
}

/* Telas médias (992–1199): a sidebar vira trilho automaticamente (main.js) e o topo enxuga */
@media (max-width: 1199.98px) {
  .app-topbar #btnHelpTop { display: none; }
  .app-topbar #btnAiAnalysis span { display: none; }
}

@media (max-width: 767.98px) {
  .app-content { padding: 1rem .9rem 1.5rem; }
  .app-topbar { padding: 0 .75rem 0 .5rem; gap: .35rem; }
  .tb-title { font-size: calc(.95rem * var(--aia-text-scale, 1)); }
  .tb-actions { gap: .2rem; min-width: 0; }
  .app-topbar #btnAiAnalysis span,
  .app-topbar #btnExportCsv,
  .app-topbar #btnHelpTop { display: none; }
  .tb-period > .btn,
  .tb-period > .dropdown > .btn { padding: 0 .4rem; font-size: calc(.78rem * var(--aia-text-scale, 1)); }
}

@media (max-width: 575.98px) {
  .tb-title { display: none; }
  .app-topbar #btnRefreshAll { display: none; }
  .tb-period .tb-period-icon { display: inline-block; }
  .tb-period > .dropdown > .btn > span { display: none; }
  .tb-period #mesLabel { font-size: calc(.74rem * var(--aia-text-scale, 1)); }
}

/* ---------- abas secundárias da Visão geral ---------- */
.ov-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: .15rem;
  border-bottom: 1px solid var(--shell-border);
  margin: -.25rem 0 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.ov-tabs::-webkit-scrollbar { display: none; }

.ov-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .55rem .8rem;
  margin-bottom: -1px;
  color: var(--shell-muted);
  font-size: calc(.85rem * var(--aia-text-scale, 1));
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
}

.ov-tabs .nav-link:hover { color: var(--tblr-body-color); }

.ov-tabs .nav-link.active {
  color: var(--tblr-body-color);
  border-bottom-color: var(--tblr-body-color);
  background: transparent;
}

/* ---------- cards planos ---------- */
.app-content .card {
  box-shadow: none;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
}

.app-content .card .card-status-top { display: none; }

.app-content .row-cards { --tblr-gutter-x: 1rem; --tblr-gutter-y: 1rem; }

.app-content .subheader {
  font-size: calc(.72rem * var(--aia-text-scale, 1));
  letter-spacing: .04em;
  color: var(--shell-muted);
}

/* KPIs: uma escala só (o h1 dos 4 principais desce para o tamanho dos demais) */
#tab-dash .card .h1 { font-size: calc(1.75rem * var(--aia-text-scale, 1)); font-weight: 600; }
#tab-dash .card .h2 { font-size: calc(1.5rem * var(--aia-text-scale, 1)); font-weight: 600; }

/* ---------- Cards do topo do Resultado do mês (26/10/2026) ----------
   Compactos e iguais nos 5: título numa linha · número grande + variação, com meta e mês anterior (ícone + número)
   empilhados à direita · sparkline de 64 px colado na base (a fileira tem a mesma altura, então os sparklines alinham).
   O detalhe longo do período mora no "?" (dist/js/ui/cards/_kpiTopo.js). */
#ov-resultado .kpi-topo { container-type: inline-size; }
#ov-resultado .kpi-topo .card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1rem 1rem .75rem;
}
#ov-resultado .kpi-topo .subheader {
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  white-space: nowrap;
}
#ov-resultado .kpi-topo .kpi-titulo { overflow: hidden; text-overflow: ellipsis; }
#ov-resultado .kpi-topo .kpi-dica { flex: none; display: inline-flex; cursor: help; }
#ov-resultado .kpi-topo .kpi-dica:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; border-radius: 50%; }
#ov-resultado .kpi-topo .kpi-numero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: .3rem;
  row-gap: .25rem;
  margin: .25rem 0 .5rem;
}
/* o número do KPI um pouco maior que o resto do painel (Ali, 26/10/2026); Corporativos segue um degrau abaixo */
#ov-resultado .kpi-topo .kpi-numero .h1 { font-size: calc(2.25rem * var(--aia-text-scale, 1)); line-height: 1; }
#ov-resultado .kpi-topo .kpi-numero .h2 { font-size: calc(2rem * var(--aia-text-scale, 1)); line-height: 1; }
/* variação um pouco menor, para número de 3 dígitos + variação + meta/mês anterior caberem numa linha no card de 181 px */
#ov-resultado .kpi-topo .kpi-delta { font-size: calc(.8125rem * var(--aia-text-scale, 1)); }
#ov-resultado .kpi-topo .kpi-delta .icon { width: 14px; height: 14px; }
/* meta e mês anterior, um embaixo do outro, à direita do número */
#ov-resultado .kpi-topo .kpi-lado {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  min-width: 0;
  line-height: 1.1;
}
#ov-resultado .kpi-topo .kpi-meta,
#ov-resultado .kpi-topo .kpi-linha {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* ícone no lugar das palavras "meta" e "mês anterior" (a palavra fica no title) */
#ov-resultado .kpi-topo .kpi-icone { width: 14px; height: 14px; margin-right: .25rem; vertical-align: -2px; }
#ov-resultado .kpi-topo .kpi-meta[title],
#ov-resultado .kpi-topo .kpi-linha[title] { cursor: help; }
#ov-resultado .kpi-topo .kpi-spark { margin-top: auto; flex: none; }
/* card estreito (5 por linha numa tela de 1280 px com a barra lateral aberta): título e número um pouco menores */
@container (max-width: 200px) {
  #ov-resultado .kpi-topo .card-body { padding-left: .875rem; padding-right: .875rem; }
  #ov-resultado .kpi-topo .subheader { font-size: calc(.66rem * var(--aia-text-scale, 1)); letter-spacing: 0; }
  #ov-resultado .kpi-topo .kpi-numero .h1 { font-size: calc(2rem * var(--aia-text-scale, 1)); }
  #ov-resultado .kpi-topo .kpi-numero .h2 { font-size: calc(1.75rem * var(--aia-text-scale, 1)); }
}
/* o "?" desses cards traz várias frases: uma por linha, alinhadas à esquerda (o tooltip vai para o body) */
.tooltip.dica-kpi .tooltip-inner { max-width: 320px; text-align: left; white-space: pre-line; }

/* ---------- Abas em tela cheia (body.view-bleed, ligado pelo main.js) ----------
   Conversas, Contatos, Mapa de Calor, Teste sua IA e Config ocupam toda a área abaixo do
   topo: sem padding, sem card externo, sem borda arredondada. Em Conversas as três colunas
   (lista, janela, insights) têm a altura exata da viewport restante; nas outras a página rola. */
body.view-bleed .app-content {
  padding: 0;
  display: flex;
  flex-direction: column;
}

body.view-bleed .app-content > .tab-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.view-bleed #tab-leads.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Qualquer aba em tela cheia: o card externo vira a própria superfície da página */
body.view-bleed .app-content > .tab-content > .tab-pane.active > .card {
  border: 0;
  border-radius: 0;
  background: var(--shell-surface);
  margin: 0;
  min-height: calc(100vh - var(--topbar-height));
}

body.view-bleed .app-content > .tab-content > .tab-pane.active > .card > .card-header {
  border-radius: 0;
}

body.view-bleed #tab-leads > .card,
body.view-bleed #tab-leads > .card > .row {
  flex: 1 1 auto;
  min-height: 0;
}

#tab-leads .chat-window-card,
#tab-leads .chat-insights-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#tab-leads .chat-pane-insights { gap: 0; }

#tab-leads .chat-window-card .card-header,
#tab-leads .chat-insights-card .card-header {
  background: transparent;
}

@media (min-width: 992px) {
  body.view-bleed #tab-leads .chat-pane-contacts,
  body.view-bleed #tab-leads .chat-pane-messages,
  body.view-bleed #tab-leads .chat-pane-insights {
    height: calc(100vh - var(--topbar-height));
    max-height: none;
    min-height: 0;
  }
  body.view-bleed #tab-leads .chat-window-card { min-height: 0; height: 100%; }
}

@media (max-width: 991.98px) {
  body.view-bleed #tab-leads .chat-pane-contacts,
  body.view-bleed #tab-leads .chat-pane-messages {
    height: calc(100vh - var(--topbar-height) - 8px);
  }
}

/* ---------- feed (Últimos acontecimentos / Últimos leads) ---------- */
.feed-list {
  display: flex;
  flex-direction: column;
  margin-top: .35rem;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .5rem .35rem;
  border: 0;
  border-bottom: 1px solid var(--shell-border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--shell-hover); }

.feed-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: calc(1rem * var(--aia-text-scale, 1));
  flex-shrink: 0;
}

.feed-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.feed-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.feed-emoji {
  position: absolute;
  right: -5px;
  bottom: -4px;
  font-size: calc(.72rem * var(--aia-text-scale, 1));
  line-height: 1;
  background: var(--shell-surface);
  border-radius: 50%;
  padding: 1px;
}

.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tblr-primary-lt);
  color: var(--tblr-primary);
  font-size: calc(.7rem * var(--aia-text-scale, 1));
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feed-body { flex: 1 1 auto; min-width: 0; line-height: 1.25; }

.feed-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: calc(.85rem * var(--aia-text-scale, 1));
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-title .chip-dot { width: .5rem; height: .5rem; border-radius: 999px; flex-shrink: 0; background: var(--chip-icon); }
.feed-title .chip-dot.hot { background: var(--temp-hot); }
.feed-title .chip-dot.warm { background: var(--temp-warm); }
.feed-title .chip-dot.cool { background: var(--temp-cool); }

.feed-sub {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: calc(.76rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-tag {
  font-size: calc(.66rem * var(--aia-text-scale, 1));
  padding: 0 .4rem;
  border-radius: 999px;
  border: 1px solid var(--shell-border);
  color: var(--shell-muted);
  line-height: 1.3;
}

.feed-tag-acao {
  color: var(--tblr-orange);
  border-color: color-mix(in srgb, var(--tblr-orange) 40%, transparent);
}

.feed-when {
  font-size: calc(.72rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.feed-empty {
  padding: 1.5rem .5rem;
  font-size: calc(.82rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  text-align: center;
}

.feed-live {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: calc(.66rem * var(--aia-text-scale, 1));
  letter-spacing: .04em;
  text-transform: none;
  color: var(--shell-muted);
}

.feed-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fb344;
  animation: feed-pulse 2s infinite;
}

@keyframes feed-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Config: página única com índice fixo ---------- */
.cfg-page { padding-bottom: 5rem; }

.cfg-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.cfg-index {
  position: sticky;
  top: calc(var(--topbar-height) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfg-index-title {
  font-size: calc(.68rem * var(--aia-text-scale, 1));
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--shell-muted);
  padding: 0 .6rem .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cfg-index-link {
  display: block;
  padding: .4rem .6rem;
  border-radius: 6px;
  font-size: calc(.85rem * var(--aia-text-scale, 1));
  color: var(--tblr-body-color);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.cfg-index-link:hover { background: var(--shell-hover); color: var(--tblr-body-color); }
.cfg-index-link.active { border-left-color: var(--tblr-primary); background: var(--shell-active); font-weight: 600; }

.cfg-index-msg { padding: .75rem .6rem 0; min-height: 1.5rem; }

.cfg-sections { display: flex; flex-direction: column; gap: 1.25rem; max-width: 980px; }

.cfg-section {
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem 1.25rem;
  scroll-margin-top: calc(var(--topbar-height) + 1rem);
}

.cfg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cfg-section-head h3 { font-size: calc(.95rem * var(--aia-text-scale, 1)); font-weight: 600; margin: 0; }

.cfg-switch-inline { white-space: nowrap; }

.cfg-subcard {
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  padding: .75rem .9rem;
  background: var(--tblr-bg-surface-secondary);
}

/* Follow-ups como linha do tempo */
.cfg-timeline {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding: .5rem 0 .25rem;
}

.cfg-timeline::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 1.05rem;
  height: 2px;
  background: var(--shell-border);
}

.cfg-tl-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  position: relative;
  margin: 0;
}

.cfg-tl-step input { position: absolute; opacity: 0; pointer-events: none; }

.cfg-tl-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid var(--shell-border);
  background: var(--shell-surface);
  transition: all .15s ease;
}

.cfg-tl-step input:checked + .cfg-tl-dot { background: var(--tblr-primary); border-color: var(--tblr-primary); }
.cfg-tl-step input:focus-visible + .cfg-tl-dot { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
.cfg-tl-label { font-size: calc(.78rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.cfg-tl-step input:checked ~ .cfg-tl-label { color: var(--tblr-body-color); font-weight: 600; }

/* Saúde */
.cfg-saude {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
}

.cfg-saude-item {
  border: 1px solid var(--shell-border);
  border-radius: 6px;
  padding: .6rem .8rem;
}

.cfg-saude-k { font-size: calc(.68rem * var(--aia-text-scale, 1)); text-transform: uppercase; letter-spacing: .05em; color: var(--shell-muted); }
.cfg-saude-v { font-size: calc(1.05rem * var(--aia-text-scale, 1)); font-weight: 600; margin-top: .15rem; display: flex; align-items: center; gap: .4rem; }
.cfg-saude-sub { font-size: calc(.74rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.cfg-status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--shell-muted); display: inline-block; }
.cfg-status-dot.ok { background: #2fb344; }
.cfg-status-dot.warn { background: #f59f00; }
.cfg-status-dot.bad { background: #d63939; }

/* Barra de salvar */
.cfg-savebar {
  position: sticky;
  bottom: 0;
  margin: 1.5rem -1.25rem -1.25rem;
  padding: .75rem 1.25rem;
  background: var(--shell-surface);
  border-top: 1px solid var(--shell-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  z-index: 5;
}

.cfg-dirty { font-size: calc(.82rem * var(--aia-text-scale, 1)); color: var(--tblr-orange); font-weight: 500; }

@media (max-width: 991.98px) {
  .cfg-layout { grid-template-columns: 1fr; }
  .cfg-index { position: static; flex-direction: row; flex-wrap: wrap; }
  .cfg-index-title, .cfg-index-msg { display: none; }
}

/* ---------- Admin ---------- */
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.admin-kpi { border: 1px solid var(--shell-border); border-radius: 6px; padding: .6rem .8rem; cursor: pointer; }
.admin-kpi:hover { background: var(--shell-hover); }
.admin-kpi.active { border-color: var(--tblr-primary); }
.admin-kpi-k { font-size: calc(.68rem * var(--aia-text-scale, 1)); text-transform: uppercase; letter-spacing: .05em; color: var(--shell-muted); }
.admin-kpi-v { font-size: calc(1.25rem * var(--aia-text-scale, 1)); font-weight: 600; }

.admin-tabs { margin: -.25rem 0 1rem; }

.saude-table td, .saude-table th { white-space: nowrap; vertical-align: middle; }
.saude-table .bar { height: 6px; border-radius: 3px; background: var(--shell-border); width: 90px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.saude-table .bar > span { display: block; height: 100%; background: var(--tblr-primary); }
.saude-muted { opacity: .55; }

.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }

/* ---------- Teste sua IA: conversa e cenários ---------- */
#tab-chattest > .card > .card-header { display: none; }
/* container: a largura util da aba (descontada a sidebar, aberta ou recolhida)
   decide quantas colunas cabem — ver @container no fim deste bloco */
#tab-chattest > .card > .card-body { padding: 0; container-type: inline-size; }

.tia-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas: "chat side";
  height: calc(100vh - var(--topbar-height));
}
.tia-chat { grid-area: chat; }
.tia-side { grid-area: side; }

.tia-col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
}

.tia-side { border-left: 1px solid var(--shell-border); overflow-y: auto; gap: 1.1rem; }

.tia-col-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; margin-bottom: .75rem; }
.tia-col-title { font-size: calc(.95rem * var(--aia-text-scale, 1)); font-weight: 600; }
.tia-col-sub { font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }

.tia-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-right: .25rem; }

.tia-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: .75rem;
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  background: var(--tblr-bg-surface-secondary);
}

.tia-compose { display: flex; gap: .5rem; margin-top: .6rem; }
.tia-compose textarea { flex: 1 1 auto; resize: none; }

.tia-block .form-label { font-size: calc(.82rem * var(--aia-text-scale, 1)); }

.tia-cenarios { display: flex; flex-wrap: wrap; gap: .4rem; }
.tia-cenario {
  border: 1px solid var(--shell-border);
  background: var(--shell-surface);
  border-radius: 999px;
  padding: .3rem .7rem;
  font-size: calc(.78rem * var(--aia-text-scale, 1));
  color: var(--tblr-body-color);
  cursor: pointer;
}
.tia-cenario:hover { background: var(--shell-hover); border-color: var(--shell-muted); }

/* Lint */
.tia-lint { margin-bottom: .75rem; }
.tia-lint-ok { font-size: calc(.78rem * var(--aia-text-scale, 1)); color: var(--tblr-green); }
.tia-lint-title { font-size: calc(.68rem * var(--aia-text-scale, 1)); text-transform: uppercase; letter-spacing: .05em; color: var(--shell-muted); margin: .35rem 0 .2rem; }
.tia-lint-item {
  display: flex; align-items: center; gap: .4rem;
  width: 100%; border: 0; background: transparent; color: inherit;
  text-align: left; font-size: calc(.76rem * var(--aia-text-scale, 1)); padding: .2rem .3rem; border-radius: 4px; cursor: pointer;
}
.tia-lint-item:hover { background: var(--shell-hover); }
.tia-lint-dot { width: .5rem; height: .5rem; border-radius: 50%; flex-shrink: 0; background: var(--shell-muted); }
.tia-lint-vazio { background: #f59f00; }
.tia-lint-curto, .tia-lint-longo { background: #4299e1; }
.tia-lint-exemplo { background: #d63939; }

.tia-lint-item strong { flex-shrink: 0; }
.tia-lint-item span.tia-lint-msg { color: var(--shell-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Linha de sistema no chat (aviso/erro, fora dos baloes) */
.tia-sistema { text-align: center; font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin: .5rem auto .75rem; max-width: 90%; }
.tia-sistema--erro { color: var(--tblr-danger); }

/* Grupo recolhido "Campos que a IA nao le hoje" */
.tia-mortos > summary { font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); cursor: pointer; padding: .25rem 0; }

/* Menos de ~720px úteis (tablet/celular): conversa e cenários empilhados. */
@container (max-width: 719.98px) {
  .tia-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas: "chat" "side";
    height: auto;
  }
  .tia-side { border: 0; border-top: 1px solid var(--shell-border); overflow-y: visible; }
  .tia-messages { height: 55vh; }
}

/* ---------- Mapa de Calor: resumo por turno ---------- */
.hm-turnos { font-size: calc(.82rem * var(--aia-text-scale, 1)); }
.hm-turnos th, .hm-turnos td { text-align: center; vertical-align: middle; padding: .35rem .4rem; }
.hm-turnos tbody th { text-align: left; font-weight: 600; }
.hm-turnos .hm-hoje { background: rgba(var(--tblr-primary-rgb), .08); }
.hm-turnos .hm-total td, .hm-turnos .hm-total th { border-top: 2px solid var(--shell-border); }
.hm-turnos td .small { display: block; line-height: 1.1; }

/* Últimos leads: nome da campanha da Meta em destaque */
.feed-camp { color: var(--tblr-primary); font-weight: 500; }

/* =====================================================
   Lista padrão de leads nos modais (dist/js/ui/modals/leadList.js)
   ===================================================== */
.ll-host { padding-top: .1rem; }

.ll-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .25rem 0 .55rem;
  background: var(--tblr-bg-surface);
}
.ll-toolbar .ll-search { flex: 1 1 220px; max-width: 320px; border-radius: 6px; }
.ll-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ll-chip {
  border: 1px solid var(--shell-border);
  background: transparent;
  color: var(--shell-muted);
  font-size: calc(.74rem * var(--aia-text-scale, 1));
  line-height: 1;
  padding: .32rem .55rem;
  border-radius: 999px;
  cursor: pointer;
}
.ll-chip b { font-weight: 600; margin-left: .15rem; color: inherit; }
.ll-chip:hover { background: var(--shell-hover); color: inherit; }
.ll-chip.active { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
.ll-count { font-size: calc(.74rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-left: .25rem; white-space: nowrap; }

.ll-list { display: flex; flex-direction: column; }
.ll-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .55rem .4rem;
  border: 0;
  border-bottom: 1px solid var(--shell-border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.ll-item:last-child { border-bottom: 0; }
.ll-item:hover, .ll-item:focus-visible { background: var(--shell-hover); outline: none; }
.ll-item[hidden] { display: none; }

.ll-body { flex: 1 1 auto; min-width: 0; line-height: 1.25; display: flex; flex-direction: column; gap: .1rem; }
.ll-title { display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: calc(.86rem * var(--aia-text-scale, 1)); font-weight: 600; }
.ll-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-flag {
  flex-shrink: 0;
  font-size: calc(.64rem * var(--aia-text-scale, 1));
  font-weight: 600;
  line-height: 1;
  padding: .18rem .38rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ll-flag-tarefa { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.ll-flag-aguardando { background: var(--tblr-danger-lt); color: var(--tblr-danger); }
.ll-flag-conv { background: var(--tblr-success-lt); color: var(--tblr-success); }

.ll-sub {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: calc(.75rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.ll-sub > span { overflow: hidden; text-overflow: ellipsis; }
.ll-sub .ll-dot { flex-shrink: 0; opacity: .6; }
.ll-sub .ll-tel { flex-shrink: 0; font-variant-numeric: tabular-nums; }
/* jornada do lead (entrou → aulas no EVO) numa linha própria, sem cortar: o dia da aula é o que se procura */
.ll-extra-linha { font-size: calc(.75rem * var(--aia-text-scale, 1)); color: var(--tblr-body-color, inherit); font-variant-numeric: tabular-nums; }
.ll-snippet {
  font-size: calc(.75rem * var(--aia-text-scale, 1));
  color: var(--shell-muted);
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ll-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex-shrink: 0; }
.ll-time { font-size: calc(.72rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; }
.ll-temp { font-size: calc(.66rem * var(--aia-text-scale, 1)); font-weight: 600; line-height: 1; padding: .2rem .45rem; border-radius: 999px; background: var(--shell-hover); color: var(--shell-muted); }
.ll-temp.hot  { background: var(--temp-hot-lt, var(--tblr-danger-lt));  color: var(--temp-hot,  var(--tblr-danger)); }
.ll-temp.warm { background: var(--temp-warm-lt, var(--tblr-warning-lt)); color: var(--temp-warm, var(--tblr-warning)); }
.ll-temp.cool { background: var(--temp-cool-lt, var(--tblr-info-lt));    color: var(--temp-cool, var(--tblr-info)); }

.ll-empty { padding: 1.25rem .5rem; text-align: center; font-size: calc(.85rem * var(--aia-text-scale, 1)); }

@media (max-width: 575.98px) {
  .ll-snippet { display: none; }
  .ll-toolbar .ll-search { max-width: none; }
}

/* =====================================================
   Gaveta de conversa (dist/js/ui/modals/chatDrawer.js)
   ===================================================== */
.chat-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0, 0, 0, .35);
}
.chat-drawer-backdrop[hidden], .chat-drawer[hidden] { display: none; }
.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1061;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--shell-surface);
  border-left: 1px solid var(--shell-border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
  animation: cd-slide .18s ease-out;
}
@keyframes cd-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cd-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--shell-border);
}
.cd-head-text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.cd-title { font-weight: 600; font-size: calc(.95rem * var(--aia-text-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-sub { font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: .35rem; align-items: center; }
.cd-sub .chat-ctx-aguardando { color: var(--tblr-danger); font-weight: 600; }
.cd-sub .chat-ctx-etapa { color: var(--tblr-body-color); font-weight: 600; }
.cd-sub .chip-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 999px; margin-right: .25rem; background: var(--chip-icon); }
.cd-sub .chip-dot.hot { background: var(--temp-hot); }
.cd-sub .chip-dot.warm { background: var(--temp-warm); }
.cd-sub .chip-dot.cool { background: var(--temp-cool); }
.cd-btn-aba { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; flex-shrink: 0; }
.cd-close { flex-shrink: 0; }
.cd-tarefa { padding: .5rem .9rem; }
.cd-body { flex: 1 1 auto; overflow-y: auto; padding: .75rem .9rem; }
.cd-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .6rem .9rem;
  border-top: 1px solid var(--shell-border);
}
body.chat-drawer-open { overflow: hidden; }
@media (max-width: 575.98px) {
  .cd-btn-aba span { display: none; }
  .cd-hint { display: none; }
}

/* =====================================================
   Análise IA — histórico à esquerda, análise à direita
   ===================================================== */
.ana-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 60vh;
  max-height: 78vh;
}
.ana-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--shell-border);
  min-height: 0;
  overflow-y: auto;
}
.ana-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--shell-border);
  position: sticky;
  top: 0;
  background: var(--shell-surface);
  z-index: 1;
}
.ana-list { display: flex; flex-direction: column; }
.ana-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  width: 100%;
  text-align: left;
  padding: .65rem .9rem;
  border: 0;
  border-bottom: 1px solid var(--shell-border);
  border-left: 3px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: calc(.8rem * var(--aia-text-scale, 1));
}
.ana-item:hover { background: var(--shell-hover); }
.ana-item.active { background: var(--tblr-primary-lt); border-left-color: var(--tblr-primary); }
.ana-item-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.ana-item-badge { font-size: calc(.62rem * var(--aia-text-scale, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--tblr-primary); }
.ana-item-user { color: var(--shell-muted); font-size: calc(.72rem * var(--aia-text-scale, 1)); }
.ana-item-preview {
  color: var(--shell-muted);
  font-size: calc(.74rem * var(--aia-text-scale, 1));
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ana-empty { padding: 1.5rem .9rem; text-align: center; }
.ana-main { min-height: 0; overflow-y: auto; padding: 1rem 1.25rem; }
.ana-placeholder { display: grid; place-items: center; height: 100%; min-height: 240px; font-size: calc(.9rem * var(--aia-text-scale, 1)); text-align: center; }
.ana-meta { margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--shell-border); }
@media (min-width: 992px) {
  #btnAnalysisBack { display: none !important; }
}
@media (max-width: 991.98px) {
  .ana-layout { grid-template-columns: 1fr; max-height: none; }
  .ana-side { border-right: 0; }
  .ana-layout.ana-detail-open .ana-side { display: none; }
  .ana-layout:not(.ana-detail-open) .ana-main { display: none; }
}

/* =====================================================
   Novidades da versão (dist/js/ui/whatsNew.js)
   ===================================================== */
.wn-backdrop { position: fixed; inset: 0; z-index: 1070; background: rgba(0, 0, 0, .45); }
.wn-modal {
  position: fixed;
  z-index: 1071;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 2rem));
  max-height: min(84vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  animation: wn-in .2s ease-out;
}
@keyframes wn-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
body.wn-open { overflow: hidden; }
.wn-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .75rem; border-bottom: 1px solid var(--shell-border); }
.wn-kicker { font-size: calc(.68rem * var(--aia-text-scale, 1)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tblr-primary); }
.wn-h { margin: .1rem 0 0; font-size: calc(1.15rem * var(--aia-text-scale, 1)); font-weight: 600; }
.wn-body { overflow-y: auto; padding: .75rem 1.25rem 1rem; scrollbar-width: thin; }
.wn-versao + .wn-versao { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--shell-border); }
.wn-versao-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.wn-tag { font-size: calc(.7rem * var(--aia-text-scale, 1)); font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.wn-data { font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.wn-titulo { font-size: calc(.98rem * var(--aia-text-scale, 1)); font-weight: 600; margin: 0 0 .6rem; }
.wn-secao { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: .25rem .9rem; padding: .5rem 0; border-top: 1px solid var(--shell-border); }
.wn-secao:first-of-type { border-top: 0; }
.wn-area { font-size: calc(.74rem * var(--aia-text-scale, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--shell-muted); padding-top: .15rem; }
.wn-lista { margin: 0; padding-left: 1rem; font-size: calc(.84rem * var(--aia-text-scale, 1)); line-height: 1.45; }
.wn-lista li + li { margin-top: .2rem; }
.wn-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; border-top: 1px solid var(--shell-border); }
@media (max-width: 575.98px) {
  .wn-secao { grid-template-columns: 1fr; gap: .15rem; }
  .wn-foot { flex-direction: column; align-items: stretch; text-align: center; }
}
.wn-intro { font-size: calc(.86rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin: -.25rem 0 .75rem; line-height: 1.45; }
.wn-lancamento { margin: -.2rem 0 .7rem; padding: .5rem .75rem; border-radius: 8px; font-size: calc(.88rem * var(--aia-text-scale, 1)); font-weight: 600; color: var(--tblr-primary); background: var(--tblr-primary-lt); }
/* 2.11.0: prints da extensão e bloco de instalação */
.wn-galeria { margin: 0 0 .9rem; }
.wn-galeria-link { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--shell-border); }
.wn-galeria-img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 800; object-fit: cover; background: var(--shell-border); }
.wn-galeria-legenda { font-size: calc(.8rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin: .4rem 0 .5rem; }
.wn-miniaturas { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: .4rem; }
.wn-mini { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; opacity: .65; transition: opacity .15s, border-color .15s; }
.wn-mini img { display: block; width: 100%; aspect-ratio: 1280 / 800; object-fit: cover; }
.wn-mini:hover, .wn-mini:focus-visible { opacity: 1; }
.wn-mini.ativa { border-color: var(--tblr-primary); opacity: 1; }
.wn-instalar { margin: 0 0 .9rem; padding: .85rem 1rem; border: 1px solid var(--shell-border); border-left: 4px solid var(--tblr-primary); border-radius: 8px; background: var(--tblr-primary-lt); }
.wn-instalar-topo { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .9rem; }
.wn-instalar-detalhe { font-size: calc(.78rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.wn-instalar-zip { font-size: calc(.78rem * var(--aia-text-scale, 1)); }
.wn-passos { margin: .35rem 0 0; padding-left: 1.2rem; font-size: calc(.84rem * var(--aia-text-scale, 1)); line-height: 1.5; }
.wn-passos li + li { margin-top: .25rem; }
.wn-passos code { font-size: calc(.8rem * var(--aia-text-scale, 1)); padding: .05rem .3rem; border-radius: 4px; background: var(--shell-surface); border: 1px solid var(--shell-border); }
.wn-copiar { margin-left: .25rem; padding: .05rem .45rem; font-size: calc(.72rem * var(--aia-text-scale, 1)); border: 1px solid var(--tblr-primary); border-radius: 5px; background: var(--shell-surface); color: var(--tblr-primary); cursor: pointer; }
.wn-instalar-nota { margin: .55rem 0 0; font-size: calc(.78rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
@media (max-width: 575.98px) { .wn-miniaturas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* =====================================================
   Aba Contatos (dist/js/ui/leads/leadsTable.js)
   ===================================================== */
.lt-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; margin-bottom: .5rem; }
.lt-resumo { font-size: calc(.84rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.lt-resumo strong { color: var(--tblr-body-color); }
.lt-sep { margin: 0 .45rem; opacity: .6; }
.lt-tools { display: flex; align-items: center; gap: .5rem; }
.lt-busca { position: relative; width: min(360px, 60vw); }
.lt-busca-limpar { position: absolute; right: .15rem; top: 50%; transform: translateY(-50%); padding: 0 .4rem; line-height: 1.6; }
.lt-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.lt-chip { border: 1px solid var(--shell-border); background: transparent; color: var(--shell-muted); font-size: calc(.76rem * var(--aia-text-scale, 1)); line-height: 1; padding: .36rem .6rem; border-radius: 999px; cursor: pointer; }
.lt-chip b { font-weight: 600; margin-left: .15rem; }
.lt-chip:hover { background: var(--shell-hover); color: inherit; }
.lt-chip.active { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }
.lt-aviso { font-size: calc(.82rem * var(--aia-text-scale, 1)); padding: .5rem .75rem; margin-bottom: .5rem; border-radius: 6px; background: var(--tblr-primary-lt); color: var(--tblr-body-color); }
.lt-aviso[hidden] { display: none; }

.lt-container { border: 1px solid var(--shell-border); border-radius: 8px; max-height: calc(100vh - 230px); min-height: 360px; overflow: auto; background: var(--shell-surface); }
.lt-table { margin: 0; }
.lt-table thead th { background: var(--shell-surface); font-size: calc(.7rem * var(--aia-text-scale, 1)); letter-spacing: .04em; text-transform: uppercase; color: var(--shell-muted); white-space: nowrap; }
.lt-th[data-sort] { cursor: pointer; user-select: none; }
.lt-sort { opacity: .35; font-size: calc(.8rem * var(--aia-text-scale, 1)); }
.lt-sort.ativo { opacity: 1; color: var(--tblr-primary); }
.lt-row { cursor: pointer; }
.lt-row:hover td { background: var(--shell-hover); }
.lt-row-inativo td { opacity: .72; }
.lt-row-inativo .lt-contato-txt .lt-nome { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.lt-row.lt-editing { cursor: default; }
.lt-row.lt-editing td { background: var(--tblr-primary-lt); }

.lt-contato { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.lt-contato-txt { min-width: 0; line-height: 1.25; }
.lt-nome { font-weight: 600; font-size: calc(.86rem * var(--aia-text-scale, 1)); display: flex; align-items: center; gap: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.lt-sem-nome { font-weight: 500; color: var(--tblr-warning); font-style: italic; }
.lt-origem { font-size: calc(.74rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.lt-muted { color: var(--shell-muted); opacity: .7; }
.lt-td-tel { font-size: calc(.8rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; }
.lt-ultima { font-size: calc(.8rem * var(--aia-text-scale, 1)); white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.lt-rem { font-size: calc(.8rem * var(--aia-text-scale, 1)); }
.lt-aguardando { font-size: calc(.66rem * var(--aia-text-scale, 1)); font-weight: 600; padding: .15rem .38rem; border-radius: 999px; background: var(--tblr-danger-lt); color: var(--tblr-danger); }
.lt-td-idevo { font-size: calc(.8rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; }
.lt-contrato { display: block; font-size: calc(.76rem * var(--aia-text-scale, 1)); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-contrato-venc { display: block; font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.lt-contrato-venc.lt-venc-perto { color: var(--tblr-warning); font-weight: 600; }
.lt-contrato-venc.lt-venc-passou { color: var(--tblr-danger); font-weight: 600; }
.lt-status { font-size: calc(.68rem * var(--aia-text-scale, 1)); font-weight: 600; padding: .18rem .5rem; border-radius: 999px; white-space: nowrap; }
.lt-status.ativo { background: var(--tblr-success-lt); color: var(--tblr-success); }
.lt-status.inativo { background: var(--tblr-secondary-lt, rgba(0,0,0,.06)); color: var(--shell-muted); }
.lt-td-acoes { white-space: nowrap; text-align: right; }
.lt-btn { border: 0; background: transparent; padding: .15rem .35rem; border-radius: 6px; cursor: pointer; opacity: .45; font-size: calc(.9rem * var(--aia-text-scale, 1)); }
.lt-row:hover .lt-btn { opacity: 1; }
.lt-btn:hover { background: var(--shell-hover); }
.lt-confirm { display: inline-flex; align-items: center; gap: .4rem; font-size: calc(.8rem * var(--aia-text-scale, 1)); white-space: nowrap; }
.lt-edit-nome { min-width: 180px; }
.lt-edit-idevo { width: 110px; }
.lt-edit-tipo { min-width: 120px; }

.lt-empty { padding: 3rem 1rem; text-align: center; color: var(--shell-muted); font-size: calc(.9rem * var(--aia-text-scale, 1)); }
.lt-empty-t { font-weight: 600; color: var(--tblr-body-color); margin-bottom: .25rem; }

.lt-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 1080; display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-radius: 8px; background: #1f2937; color: #fff; font-size: calc(.84rem * var(--aia-text-scale, 1)); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.lt-toast[hidden] { display: none; }
.lt-toast-acao { font-weight: 600; }

@media (max-width: 991.98px) {
  .lt-td-tel, .lt-td-idevo { display: none; }
  .lt-nome, .lt-origem { max-width: 180px; }
}

/* =====================================================
   Previsão por coorte (dist/js/ui/cards/previsaoCard.js)
   ===================================================== */
.pv-big { font-size: calc(2.2rem * var(--aia-text-scale, 1)); font-weight: 700; line-height: 1; display: flex; align-items: baseline; gap: .5rem; }
.pv-big-sub { font-size: calc(.8rem * var(--aia-text-scale, 1)); font-weight: 500; color: var(--shell-muted); }
.pv-big.pv-ok { color: var(--tblr-success); }
.pv-big.pv-warn { color: var(--tblr-warning); }
.pv-big.pv-bad { color: var(--tblr-danger); }
.pv-faixa { font-size: calc(.8rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-top: .35rem; }
.pv-linhas { display: flex; gap: 1.25rem; margin: .6rem 0 .35rem; font-size: calc(.82rem * var(--aia-text-scale, 1)); }
.pv-linhas > div { display: flex; flex-direction: column; }
.pv-linhas span { color: var(--shell-muted); font-size: calc(.72rem * var(--aia-text-scale, 1)); }
.pv-segs { list-style: none; margin: 0; padding: 0; font-size: calc(.8rem * var(--aia-text-scale, 1)); }
.pv-segs li { display: flex; justify-content: space-between; gap: .5rem; padding: .18rem 0; border-top: 1px dashed var(--shell-border); }
.pv-nota { font-size: calc(.72rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-top: .5rem; line-height: 1.35; }
.pv-table { margin: 0; font-size: calc(.8rem * var(--aia-text-scale, 1)); }
.pv-table thead th { font-size: calc(.68rem * var(--aia-text-scale, 1)); text-transform: uppercase; letter-spacing: .04em; color: var(--shell-muted); white-space: nowrap; }
.pv-sem { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-maturando td { color: var(--shell-muted); }
.pv-tag { font-size: calc(.62rem * var(--aia-text-scale, 1)); text-transform: uppercase; letter-spacing: .03em; color: var(--tblr-warning); font-weight: 600; margin-left: .25rem; }
.pv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.25rem; }
.pv-sub { font-size: calc(.7rem * var(--aia-text-scale, 1)); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--shell-muted); margin-bottom: .4rem; }
.pv-exp > div { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: baseline; font-size: calc(.84rem * var(--aia-text-scale, 1)); padding: .25rem 0; border-top: 1px dashed var(--shell-border); }
.pv-exp b { font-size: calc(1rem * var(--aia-text-scale, 1)); }
.pv-barra { display: grid; grid-template-columns: 110px 1fr auto auto; gap: .5rem; align-items: center; font-size: calc(.8rem * var(--aia-text-scale, 1)); padding: .2rem 0; }
.pv-barra-trilho { height: 6px; border-radius: 999px; background: var(--shell-hover); overflow: hidden; }
.pv-barra-fill { height: 100%; border-radius: 999px; background: var(--tblr-primary); }
.pv-barra-fill.hot { background: var(--temp-hot, var(--tblr-danger)); }
.pv-barra-fill.warm { background: var(--temp-warm, var(--tblr-warning)); }
.pv-barra-fill.cool { background: var(--temp-cool, var(--tblr-info)); }
.pv-barra-fill.semtemp { background: var(--shell-muted); }
@media (max-width: 991.98px) { .pv-grid { grid-template-columns: 1fr; } }

/* =====================================================
   Barras HTML dos cards (dist/js/ui/cards/_barras.js)
   ===================================================== */
.bh-lista { display: flex; flex-direction: column; gap: .15rem; }
.bh-linha {
  display: grid;
  grid-template-columns: minmax(96px, 150px) 1fr auto auto;
  gap: .55rem;
  align-items: center;
  width: 100%;
  padding: .28rem .35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: calc(.8rem * var(--aia-text-scale, 1));
  text-align: left;
}
.bh-clicavel { cursor: pointer; }
.bh-clicavel:hover { background: var(--shell-hover); }
.bh-destaque .bh-label { font-weight: 700; }
.bh-label { display: flex; align-items: center; gap: .35rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-icone { font-size: calc(.9rem * var(--aia-text-scale, 1)); }
.bh-trilho { display: flex; height: 8px; border-radius: 999px; background: var(--shell-hover); overflow: hidden; }
.bh-fill { height: 100%; background: var(--tblr-primary); }
.bh-fill + .bh-fill { margin-left: 1px; }
.bh-fill.hot { background: var(--temp-hot, var(--tblr-danger)); }
.bh-fill.warm { background: var(--temp-warm, var(--tblr-warning)); }
.bh-fill.cool { background: var(--temp-cool, var(--tblr-info)); }
.bh-fill.semtemp { background: var(--shell-muted); opacity: .6; }
.bh-fill.muted { background: var(--shell-muted); opacity: .5; }
.bh-fill.objecao { background: var(--tblr-danger); opacity: .8; }
.bh-fill.manha { background: #f59e0b; }
.bh-fill.tarde { background: #f97316; }
.bh-fill.noite { background: #6366f1; }
.bh-valor { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bh-detalhe { font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); white-space: nowrap; min-width: 2.5rem; text-align: right; }
.bh-nota { font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-top: .5rem; line-height: 1.35; }
.bh-legenda { display: flex; flex-wrap: wrap; gap: .75rem; font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-bottom: .35rem; }
.bh-legenda span { display: inline-flex; align-items: center; gap: .3rem; }
.bh-sw { width: 10px; height: 10px; border-radius: 2px; background: var(--tblr-primary); display: inline-block; }
.bh-sw.hot { background: var(--temp-hot, var(--tblr-danger)); }
.bh-sw.warm { background: var(--temp-warm, var(--tblr-warning)); }
.bh-sw.cool { background: var(--temp-cool, var(--tblr-info)); }
.bh-sw.semtemp { background: var(--shell-muted); opacity: .6; }

/* faixa das 24 horas */
.bh-pico { font-size: calc(.8rem * var(--aia-text-scale, 1)); margin-bottom: .35rem; }
.bh-horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 56px; align-items: end; }
.bh-hora { position: relative; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; }
.bh-hora-col { width: 100%; border-radius: 3px 3px 0 0; background: var(--tblr-primary); opacity: .55; min-height: 0; }
.bh-hora.manha .bh-hora-col { background: #f59e0b; }
.bh-hora.tarde .bh-hora-col { background: #f97316; }
.bh-hora.noite .bh-hora-col { background: #6366f1; }
.bh-hora.pico .bh-hora-col { opacity: 1; box-shadow: 0 0 0 1px var(--shell-surface), 0 0 0 2px currentColor; }
.bh-hora:hover .bh-hora-col { opacity: 1; }
.bh-hora-eixo { display: flex; justify-content: space-between; font-size: calc(.66rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-top: .25rem; }

/* Follow-ups: etapas em duas colunas quando o card é largo */
@media (min-width: 992px) {
  .fu-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.5rem; row-gap: 0; }
}
.bh-fill.fds { background: var(--tblr-primary); }
.bh-fill.conv { background: var(--tblr-success); }

.tb-weather-cidade { font-size: calc(.72rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-left: .25rem; }
.tb-weather-cidade::before { content: "· "; }
/* a cidade só cabe com folga no topo; abaixo disso fica no tooltip do chip */
@media (max-width: 1499.98px) { .tb-weather-cidade { display: none; } }

/* =====================================================
   Funil (dist/js/ui/cards/funilUnificadoCard.js)
   ===================================================== */
.fn-svg { width: 100%; height: auto; display: block; }
.fn-shape { cursor: pointer; transition: opacity .12s; }
.fn-shape:hover { opacity: .85; }
.fn-label { font-size: calc(10px * var(--aia-text-scale, 1)); font-weight: 700; letter-spacing: .06em; fill: var(--shell-muted); }
.fn-num { font-size: calc(22px * var(--aia-text-scale, 1)); font-weight: 700; fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.25); stroke-width: 2px; }
.fn-sub { font-size: calc(10px * var(--aia-text-scale, 1)); fill: var(--shell-muted); }
.fn-seta { font-size: calc(10px * var(--aia-text-scale, 1)); font-weight: 600; fill: var(--tblr-body-color); }
.fn-rodape { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .25rem; }
.fn-chip { border: 1px solid var(--shell-border); background: transparent; color: var(--shell-muted); font-size: calc(.72rem * var(--aia-text-scale, 1)); padding: .22rem .55rem; border-radius: 999px; cursor: pointer; }
.fn-chip b { color: var(--tblr-body-color); }
.fn-chip:hover { background: var(--shell-hover); }
.fn-nota { font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-left: auto; }
.fn-comp-total { font-size: calc(.82rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-bottom: .4rem; }
.fn-comp { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; }
.fn-fatia { border: 0; color: #fff; font-weight: 700; font-size: calc(.8rem * var(--aia-text-scale, 1)); min-width: 26px; cursor: pointer; display: grid; place-items: center; }
.fn-fatia:hover { filter: brightness(1.08); }
.fn-legenda { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .5rem; }
.fn-leg { border: 0; background: transparent; padding: 0; font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--tblr-body-color); display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.fn-leg i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.fn-leg span { color: var(--shell-muted); }

/* Temperatura dos leads (dist/js/ui/cards/temperaturaCardLinhas.js) */
.tp-topo { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .45rem; }
.tp-total { border: 0; background: transparent; padding: 0; color: inherit; font-size: calc(.9rem * var(--aia-text-scale, 1)); cursor: pointer; text-align: left; }
.tp-total b { font-size: calc(1.5rem * var(--aia-text-scale, 1)); font-weight: 700; margin-right: .25rem; }
.tp-de { color: var(--shell-muted); font-size: calc(.78rem * var(--aia-text-scale, 1)); }
.tp-falta { border: 1px solid var(--shell-border); background: transparent; color: var(--shell-muted); font-size: calc(.72rem * var(--aia-text-scale, 1)); padding: .2rem .55rem; border-radius: 999px; cursor: pointer; }
.tp-falta:hover { background: var(--shell-hover); }
.tp-comp { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--shell-hover); }
.tp-seg.hot { background: var(--temp-hot, var(--tblr-danger)); }
.tp-seg.warm { background: var(--temp-warm, var(--tblr-warning)); }
.tp-seg.cool { background: var(--temp-cool, var(--tblr-info)); }
.tp-seg.semtemp { background: var(--shell-muted); opacity: .45; }

/* Análise IA: markdown legível (sem caixa preta), títulos e listas compactos */
#analysisDetailContent { font-size: calc(.86rem * var(--aia-text-scale, 1)); line-height: 1.5; color: var(--tblr-body-color); }
#analysisDetailContent h1, #analysisDetailContent h2, #analysisDetailContent h3 { font-size: calc(.95rem * var(--aia-text-scale, 1)); font-weight: 700; margin: 1rem 0 .35rem; }
#analysisDetailContent h1:first-child, #analysisDetailContent h2:first-child { margin-top: 0; }
#analysisDetailContent ul, #analysisDetailContent ol { padding-left: 1.1rem; margin: .25rem 0 .6rem; }
#analysisDetailContent li { margin: .15rem 0; }
#analysisDetailContent p { margin: .35rem 0 .6rem; }
#analysisDetailContent pre { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: inherit; background: var(--shell-hover); color: inherit; padding: .6rem .8rem; border-radius: 6px; max-height: none; }
#analysisDetailContent code { font-family: inherit; background: transparent; padding: 0; color: inherit; }

/* ===== Sub-aba Experimentais (dist/js/ui/experimentais/experimentaisTab.js) — 23/10/2026 ===== */
.xp .xp-desc { font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin: -.1rem 0 .75rem; max-width: 70rem; }
.xp .xp-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.xp-funil { display: flex; align-items: stretch; }
.xp-etapa { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .85rem .6rem .7rem;
  background: var(--tblr-bg-surface); border: 1px solid var(--shell-border); border-top: 3px solid var(--xp-cor); border-radius: 10px;
  color: inherit; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.xp-etapa:hover, .xp-etapa:focus-visible { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); transform: translateY(-1px); border-color: var(--xp-cor); outline: none; }
.xp-etapa .xp-num { font-size: calc(1.85rem * var(--aia-text-scale, 1)); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.xp-etapa .xp-rot { font-size: calc(.7rem * var(--aia-text-scale, 1)); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--shell-muted); }
.xp-etapa .xp-barra { width: 70%; height: 4px; border-radius: 2px; background: var(--shell-hover); margin: .45rem 0 .3rem; overflow: hidden; }
.xp-etapa .xp-barra > i { display: block; height: 100%; background: var(--xp-cor); border-radius: 2px; }
.xp-etapa .xp-sub { font-size: calc(.72rem * var(--aia-text-scale, 1)); color: var(--shell-muted); line-height: 1.3; text-align: center; }
.xp-seta { flex: 0 0 auto; align-self: center; display: flex; flex-direction: column; align-items: center; padding: 0 .3rem; min-width: 4.2rem;
  font-size: calc(.82rem * var(--aia-text-scale, 1)); font-weight: 600; color: var(--tblr-body-color); }
.xp-seta small { font-size: calc(.64rem * var(--aia-text-scale, 1)); font-weight: 400; color: var(--shell-muted); text-align: center; line-height: 1.15; }
.xp-seta .xp-ico { color: var(--shell-muted); width: 14px; height: 14px; }
.xp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .8rem; }
.xp-chips-rot { font-size: calc(.7rem * var(--aia-text-scale, 1)); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--shell-muted); margin-right: .2rem; }
.xp-chip { border: 1px solid var(--shell-border); background: transparent; color: var(--tblr-body-color); font-size: calc(.76rem * var(--aia-text-scale, 1)); padding: .2rem .65rem;
  border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s; }
.xp-chip:hover { background: var(--shell-hover); border-color: var(--tblr-primary); }
.xp-chip b { margin-left: .15rem; font-variant-numeric: tabular-nums; }
.xp-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; }
.xp-grande { font-size: calc(2rem * var(--aia-text-scale, 1)); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.xp-pilha { display: flex; gap: 3px; height: 14px; }
.xp-seg { border: 0; padding: 0; border-radius: 4px; cursor: pointer; transition: filter .15s, transform .15s; }
.xp-seg:hover { filter: brightness(1.08); transform: scaleY(1.25); }
.xp-vazia { flex: 1; background: var(--shell-hover); border-radius: 4px; }
.xp-aviso { margin-top: .6rem; font-size: calc(.76rem * var(--aia-text-scale, 1)); color: var(--tblr-warning); }
.xp-acoes { display: flex; flex-direction: column; }
.xp-acao { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .35rem; border: 0; border-bottom: 1px solid var(--shell-border);
  background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; transition: background .15s; }
.xp-acao:last-child { border-bottom: 0; }
.xp-acao:hover { background: var(--shell-hover); }
.xp-acao-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; }
.xp-ico-azul { background: rgba(32, 107, 196, .12); color: var(--tblr-primary); }
.xp-ico-verm { background: rgba(214, 57, 57, .12); color: var(--tblr-red); }
.xp-ico-amar { background: rgba(245, 159, 0, .15); color: #c77700; }
.xp-acao-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: calc(.86rem * var(--aia-text-scale, 1)); }
.xp-acao-sub { font-size: calc(.72rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.xp-acao-n { font-size: calc(1.05rem * var(--aia-text-scale, 1)); font-weight: 700; font-variant-numeric: tabular-nums; }
.xp-acao-seta { color: var(--shell-muted); }
.xp-grupo { display: block; width: 100%; border: 0; background: transparent; color: inherit; padding: .35rem .4rem; margin: 0 -.4rem .15rem;
  border-radius: 6px; text-align: left; cursor: pointer; transition: background .15s; }
.xp-grupo:hover { background: var(--shell-hover); }
.xp-mini { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--shell-hover); margin-top: .3rem; }
.xp-mini > i:nth-child(1) { background: var(--tblr-green); }
.xp-mini > i:nth-child(2) { background: var(--tblr-red); opacity: .75; }
.xp-leg { font-size: calc(.68rem * var(--aia-text-scale, 1)); color: var(--shell-muted); display: inline-flex; align-items: center; gap: .25rem; }
.xp-leg i { display: inline-block; width: .5rem; height: .5rem; border-radius: 2px; margin-left: .3rem; }
.xp-linha { cursor: pointer; }
.xp-th { border: 0; background: transparent; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit;
  cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.xp-th:hover { color: var(--tblr-primary); }
@media (max-width: 991.98px) {
  .xp-funil { flex-wrap: wrap; gap: .5rem; }
  .xp-seta { display: none; }
  .xp-etapa { flex: 1 1 calc(50% - .5rem); }
}

/* ===== Funil da Visão geral (dist/js/ui/cards/funilUnificadoCard.js) — 23/10/2026 ===== */
.fn2 { display: flex; flex-direction: column; }
.fn2-etapa { display: grid; grid-template-columns: minmax(7.5rem, 9.5rem) 1fr 3.4rem 3.4rem; align-items: center; gap: .6rem; width: 100%;
  padding: .35rem .45rem; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.fn2-etapa:hover, .fn2-etapa:focus-visible { background: var(--shell-hover); outline: none; }
.fn2-rot { display: flex; flex-direction: column; font-size: calc(.8rem * var(--aia-text-scale, 1)); font-weight: 600; line-height: 1.2; }
.fn2-rot small { font-size: calc(.68rem * var(--aia-text-scale, 1)); font-weight: 400; color: var(--shell-muted); }
.fn2-trilho { display: flex; justify-content: center; height: 24px; border-radius: 6px; background: var(--shell-hover); overflow: hidden; }
.fn2-trilho > i { display: block; height: 100%; background: var(--fn2-cor); border-radius: 6px; transition: width .3s ease; }
.fn2-num { font-size: calc(1.1rem * var(--aia-text-scale, 1)); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.fn2-pct { font-size: calc(.74rem * var(--aia-text-scale, 1)); color: var(--shell-muted); text-align: right; font-variant-numeric: tabular-nums; }
.fn2-passa { display: grid; grid-template-columns: minmax(7.5rem, 9.5rem) 1fr 3.4rem 3.4rem; gap: .6rem; padding: 0 .45rem; }
.fn2-passa span { grid-column: 2; justify-self: center; font-size: calc(.68rem * var(--aia-text-scale, 1)); color: var(--shell-muted); background: var(--tblr-bg-surface);
  border: 1px solid var(--shell-border); border-radius: 999px; padding: .02rem .55rem; margin: -.15rem 0; position: relative; z-index: 1; }
.fn2-grupos { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; padding-top: .65rem; border-top: 1px dashed var(--shell-border); }
.fn2-grupo { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.fn2-grupo-rot { font-size: calc(.66rem * var(--aia-text-scale, 1)); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--shell-muted); min-width: 6.6rem; }
.fn2-chip { border: 1px solid var(--shell-border); background: transparent; color: var(--tblr-body-color); font-size: calc(.74rem * var(--aia-text-scale, 1)); padding: .18rem .6rem;
  border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; transition: background .15s, border-color .15s; }
.fn2-chip:hover { background: var(--shell-hover); border-color: var(--tblr-primary); }
.fn2-chip i { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; }
.fn2-chip b { font-variant-numeric: tabular-nums; }
.fn2-nota { font-size: calc(.7rem * var(--aia-text-scale, 1)); color: var(--shell-muted); margin-top: .55rem; }
.fn2-aviso { font-size: calc(.74rem * var(--aia-text-scale, 1)); color: #8a5a00; background: rgba(245, 159, 0, .12); border-radius: 6px; padding: .3rem .55rem; margin-bottom: .5rem; }
/* com corporativos */
.fn2-topo { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .7rem; font-size: calc(.82rem * var(--aia-text-scale, 1)); color: var(--shell-muted); }
.fn2-topo-num { font-size: calc(1.6rem * var(--aia-text-scale, 1)); font-weight: 700; color: var(--tblr-body-color); font-variant-numeric: tabular-nums; margin-right: .2rem; }
.fn2-divisao { display: flex; gap: 4px; }
.fn2-div { border: 0; border-radius: 6px; padding: .3rem .55rem; font-size: calc(.74rem * var(--aia-text-scale, 1)); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; background: rgba(32, 107, 196, .1); color: var(--tblr-primary); min-width: max-content; transition: filter .15s; }
.fn2-div-corp { background: rgba(111, 66, 193, .12); color: #6f42c1; }
.fn2-div:hover { filter: brightness(.95); }
.fn2-comp { display: flex; gap: 3px; height: 30px; margin-bottom: .75rem; }
.fn2-seg { border: 0; border-radius: 6px; color: #fff; font-size: calc(.78rem * var(--aia-text-scale, 1)); font-weight: 700; display: grid; place-items: center; min-width: 6px;
  cursor: pointer; transition: filter .15s, transform .15s; }
.fn2-seg:hover { filter: brightness(1.08); transform: translateY(-1px); }
#funnelUnificadoContent { container-type: inline-size; }
.fn2-blocos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; } /* 2×2 no card de meia largura */
@container (min-width: 44rem) { .fn2-blocos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fn2-bloco { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .65rem .55rem; border: 1px solid var(--shell-border); border-top: 3px solid var(--fn2-cor);
  border-radius: 8px; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.fn2-bloco:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.fn2-bloco-rot { font-size: calc(.7rem * var(--aia-text-scale, 1)); font-weight: 600; color: var(--shell-muted); line-height: 1.2; }
.fn2-bloco-num { font-size: calc(1.35rem * var(--aia-text-scale, 1)); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.fn2-bloco-num small { font-size: calc(.72rem * var(--aia-text-scale, 1)); font-weight: 500; color: var(--shell-muted); margin-left: .3rem; }
.fn2-bloco-sub { font-size: calc(.68rem * var(--aia-text-scale, 1)); color: var(--shell-muted); line-height: 1.25; }

@media (max-width: 575.98px) {
  .fn2-etapa, .fn2-passa { grid-template-columns: 6.5rem 1fr 2.8rem 2.8rem; gap: .4rem; }
}
