/* ── Dashboard — public/css/dashboard.css ──────────────────────────
   Owner: Painel C  |  Contrato: CONTRATO-DASHBOARD.md §2-§3
   Hexadecimais permitidos fora dos tokens: somente a paleta de dados
   do contrato §3: var(--info) · var(--sucesso) · var(--info) · var(--aviso) · var(--accent) · var(--text-muted)
   ─────────────────────────────────────────────────────────────────── */

/* ══ Paleta de séries — validada pelo dataviz skill ═════════════════
   Superfície: #17171c (--panel-bg). Modo: dark.
   Resultado: PASS em todos os 5 checks (lightness band, chroma floor,
   CVD separation deutan ΔE 19.6, normal-vision ΔE 20.9, contrast ≥3:1).
   Mapeamento: mesmos hues dos tokens do sistema, L escalonada para a
   banda escura 0.48–0.67. Definidas em :root para ficarem acessíveis
   via getComputedStyle(documentElement) no JS de inicialização.

   --serie-azul : #3987e5  (hue de --info,    L stepped 0.72→0.58)
   --serie-verde: #199e70  (hue de --sucesso,  L stepped 0.79→0.62)
   --serie-roxo : var(--no-condicao) #8b5cf6   (já na banda, L 0.56)
   --serie-ambar: #c98500  (hue de --aviso,    L stepped 0.78→0.62)

   Os tokens de STATUS (--accent, --sucesso, --aviso, --perigo) continuam
   usados onde a cor carrega significado de estado (erro, ok, atenção).
   ══════════════════════════════════════════════════════════════════════ */
:root {
  --serie-azul:  #3b82f6;
  --serie-verde: #22c55e;
  --serie-roxo:  #a855f7;
  --serie-ambar: #f59e0b;
}

/* ══ Raiz ═══════════════════════════════════════════════════════════ */

.dash {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ══ Topo ════════════════════════════════════════════════════════════ */

.dash__topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dash__titulo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
}

/* ── Seletor de período ──────────────────────────────────────────── */

.dash__periodo {
  display: flex;
  gap: 3px;
  align-items: center;
  background: var(--panel-bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px;
}

.dash__periodo-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dash__periodo-btn:hover {
  color: var(--text);
}

.dash__periodo-btn.is-ativo {
  background: var(--panel-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.dash__periodo-btn:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.dash__atualizado {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ══ KPIs ════════════════════════════════════════════════════════════
   grid-auto-rows: 1fr nivela todos os cards da grade sem height fixa.
   Em grade auto-height, 1fr resolve para a maior linha, igualando todas. */

.dash__kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}

/* Stat card estilo MyndDrive: chip do ícone colorido, número grande,
   rótulo discreto e tendência em pílula. */
.dash__kpi {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.dash__kpi:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dash__kpi-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash__kpi-icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-size: 18px;
  line-height: 1;
}
/* tom por métrica — fundo e ícone derivados das variáveis de série do tema.
   As cores de chip (--serie-*) estão definidas abaixo e foram validadas pelo
   dataviz skill (6 checks) contra a superfície #17171c em modo escuro.
   --accent-soft / --no-condicao já são tokens do sistema e reutilizados aqui. */
.dash__kpi--azul     .dash__kpi-icone { background: rgba(59, 130, 246, 0.15); color: var(--serie-azul); }
.dash__kpi--verde    .dash__kpi-icone { background: rgba(34, 197, 94, 0.15); color: var(--serie-verde); }
.dash__kpi--roxo     .dash__kpi-icone { background: rgba(168, 85, 247, 0.15); color: var(--serie-roxo); }
.dash__kpi--ambar    .dash__kpi-icone { background: rgba(245, 158, 11, 0.15); color: var(--serie-ambar); }
.dash__kpi--laranja  .dash__kpi-icone { background: var(--aviso-soft); color: var(--aviso); }
.dash__kpi--vermelho .dash__kpi-icone { background: var(--accent-soft); color: var(--accent); }

.dash__kpi-valor {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.dash__kpi-rotulo {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.dash__kpi-var {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.dash__kpi-var.is-alta   { color: var(--sucesso); background: rgba(34, 197, 94, 0.15); }
.dash__kpi-var.is-baixa  { color: var(--aviso); background: rgba(245, 158, 11, 0.15); }
.dash__kpi-var.is-neutra { color: var(--text-muted); background: var(--bg-tertiary); }

/* Sparkline: margin-top auto âncora ao rodapé do card nivelado */
.dash__kpi-spark {
  display: block;
  /* Largura cheia e colada na base do cartão: assim ela lê como o "chão" do
     número, e não como um rabisco solto ao lado dele. A margem negativa cancela
     o padding do cartão para a área encostar nas bordas. */
  /* -18px/-16px cancelam exatamente o padding de .dash__kpi (16px 18px), e o
     raio acompanha o do cartão (16px) — se não bater, sobra um canto quadrado
     escapando por baixo da borda arredondada. */
  width: calc(100% + 36px);
  margin: auto -18px -16px;
  height: 34px;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  overflow: hidden;
}

/* ══ Grid de cards ═══════════════════════════════════════════════════ */

.dash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.dash__card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash__card--largo {
  grid-column: 1 / -1;
}

.dash__card-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 0;
}

.dash__card-titulo {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.dash__card-acao {
  font: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.dash__card-acao:hover {
  background: var(--panel-bg-hover);
  color: var(--text);
}

.dash__card-acao:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.dash__card-corpo {
  padding: 14px 18px 18px;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
}

/* ══ Gráfico de linha / área ══════════════════════════════════════════
   JS não define width/height no <svg>, apenas viewBox="0 0 560 160".
   aspect-ratio: 7/2 espelha essa proporção: o SVG preenche o container
   exatamente sem precisar de preserveAspectRatio="none" no markup.    */

.dash__chart {
  display: block;
  width: 100%;
  /* Menor (item 7): viewBox achatado para 560x120 no JS; o aspect-ratio
     acompanha, então o gráfico ocupa menos altura sem distorcer. */
  aspect-ratio: 14 / 3;
  overflow: visible;
}

.dash__chart text {
  font-family: var(--font-body);
}

/* ══ Barras ══════════════════════════════════════════════════════════ */

.dash__barras {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash__barra {
  display: grid;
  grid-template-columns: 100px 1fr 52px;
  align-items: center;
  gap: 10px;
}

.dash__barra-rotulo {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__barra-trilho {
  background: rgba(7, 24, 39, .62);
  border: 1px solid rgba(166, 193, 211, .08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.dash__barra-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  min-width: 2px;
  box-shadow: 0 0 14px -7px rgba(246, 196, 0, .8);
  transition: width 0.35s ease;
}

.dash__barra-valor {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ══ Donut SVG (placeholder — Panel B ainda não gerou) ═══════════════ */

.dash__donut {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

/* ══ Tabela div-based (top campanhas / contas) ════════════════════════
   Estrutura gerada pelo B:
   div.dash__tabela
     div.dash__tabela-linha.dash__tabela-linha--cabecalho
       span.dash__tabela-celula
     div.dash__tabela-linha
       span.dash__tabela-celula.dash__tabela-celula--nome
       span.dash__tabela-celula …                                       */

.dash__tabela {
  width: 100%;
  font-size: 13px;
}

.dash__tabela-linha {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.dash__tabela-linha:last-child {
  border-bottom: none;
}

.dash__tabela-linha--cabecalho {
  padding-bottom: 7px;
}

.dash__tabela-linha--cabecalho .dash__tabela-celula {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash__tabela-linha:not(.dash__tabela-linha--cabecalho):hover {
  background: var(--panel-bg-hover);
  border-radius: 6px;
  margin: 0 -6px;
  padding-left: 6px;
  padding-right: 6px;
}

/* Foco para linhas tornadasa clicáveis via tabindex/role no B */
.dash__tabela-linha:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: -2px;
  border-radius: 6px;
}

.dash__tabela-celula {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash__tabela-celula--nome {
  flex: 2;
}

/* ══ Feed de atividade ════════════════════════════════════════════════ */

.dash__feed {
  display: flex;
  flex-direction: column;
}

.dash__feed-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 10px 14px;
  border-left: 3px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.dash__feed-item:last-child {
  border-bottom: none;
}

/* Paleta de dados §3 — única fonte de hex permitida */
.dash__feed-item.is-ok     { border-left-color: var(--sucesso); }
.dash__feed-item.is-alerta { border-left-color: var(--aviso); }
.dash__feed-item.is-erro   { border-left-color: var(--accent); }

.dash__feed-titulo {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dash__feed-detalhe {
  font-size: 12px;
  color: var(--text-muted);
}

.dash__feed-quando {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ══ Estados: carregando / vazio / erro ══════════════════════════════
   Diferenciação visual dos três estados:
   • is-carregando → skeleton animado (zero texto na tela)
   • is-vazio      → símbolo "—" via ::before + mensagem em --text-muted
   • is-erro       → mensagem em --accent (vermelho) + botão retry      */

.dash__estado {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 32px 24px;
  text-align: center;
}

/* ── Carregando: skeleton pulsado, sem texto ────────────────────── */

@keyframes dash-skeleton-pulse {
  0%, 100% { opacity: 1;    }
  50%       { opacity: 0.45; }
}

.dash__skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Panel B gera exatamente 6 blocos; nth-child define formas variadas */
.dash__skeleton-bloco {
  display: block;
  background: var(--panel-bg-hover);
  border-radius: 8px;
  height: 20px;
  animation: dash-skeleton-pulse 1.4s ease-in-out infinite;
}

.dash__skeleton-bloco:first-child  { width: 40%; height: 14px; }
.dash__skeleton-bloco:nth-child(2) { width: 100%; height: 32px; }
.dash__skeleton-bloco:nth-child(3) { width: 80%; }
.dash__skeleton-bloco:nth-child(4) { width: 60%; }
.dash__skeleton-bloco:nth-child(5) { width: 90%; }
.dash__skeleton-bloco:nth-child(6) { width: 70%; }

/* Variantes auxiliares (B não gera ainda; mantidas para uso futuro) */
.dash__skeleton--titulo { height: 18px; width: 130px; }
.dash__skeleton--valor  { height: 32px; width: 70px;  }
.dash__skeleton--barra  { height: 8px;  width: 100%;  }
.dash__skeleton--linha  { height: 14px; width: 65%;   }

/* ── Mensagem de texto (vazio e erro) ──────────────────────────── */

.dash__estado-msg {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  max-width: 280px;
}

/* Vazio: ícone tipográfico suave + texto muted */
.dash__estado.is-vazio::before {
  content: "—";
  display: block;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--border-strong);
}

.dash__estado.is-vazio .dash__estado-msg {
  color: var(--text-muted);
}

/* Erro: texto vermelho (--accent) + botão */
.dash__estado.is-erro .dash__estado-msg {
  color: var(--accent);
}

/* ── Botão "tentar de novo" ─────────────────────────────────────── */

.dash__btn-retry {
  padding: 8px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--panel-bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dash__btn-retry:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent);
}

.dash__btn-retry:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

/* ══ Redução de movimento ════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .dash__skeleton-bloco            { animation: none; }
  .dash__barra-fill,
  .dash__periodo-btn,
  .dash__card-acao,
  .dash__btn-retry                 { transition: none; }
}

/* ══ Compatibilidade — classes do JS anterior ════════════════════════
   Remover após o Painel B migrar o render para os nomes do contrato.  */

.dash__secao {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.dash__secao-titulo {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

.dash__carregando { color: var(--text-muted); font-size: 13px; }

.dash__vazio {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* Usuário novo: mantém o dashboard visível e explicitamente zerado. */
.dash__inicio-vazio {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-bg);
}

.dash__inicio-zero {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 700;
}

.dash__inicio-texto {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dash__inicio-titulo {
  color: var(--text);
  font-size: 14px;
}

.dash__inicio-descricao {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.dash--sem-dados .dash__kpi {
  box-shadow: none;
}

.dash--sem-dados .dash__kpi-valor {
  color: var(--text);
}

@media (max-width: 640px) {
  .dash__inicio-vazio {
    align-items: flex-start;
  }
}

/* ══ Polish profissional + animações (MyndDrive) ═════════════════════════
   Easing estilo Apple, entrada em fade+slide-up (só na 1ª carga via
   .dash--entrada), e hover com leve elevação. */
:root { --ease-suave: cubic-bezier(.4, 0, .2, 1); }

@keyframes dashEntrar {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* KPIs: elevação suave no hover (o chip colorido já dá o destaque) */
.dash__kpi {
  transition: transform .22s var(--ease-suave), box-shadow .22s var(--ease-suave), border-color .22s var(--ease-suave);
}
.dash__kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.10);
  border-color: var(--border-strong);
}

/* Cards do grid: mesma elevação suave no hover */
.dash__card {
  transition: transform .22s var(--ease-suave), box-shadow .22s var(--ease-suave), border-color .22s var(--ease-suave);
}
.dash__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* Entrada escalonada — só quando .dash--entrada está no container */
.dash--entrada .dash__kpi,
.dash--entrada .dash__card { animation: dashEntrar .5s var(--ease-suave) both; }
.dash--entrada .dash__kpi:nth-child(1)  { animation-delay: .02s; }
.dash--entrada .dash__kpi:nth-child(2)  { animation-delay: .05s; }
.dash--entrada .dash__kpi:nth-child(3)  { animation-delay: .08s; }
.dash--entrada .dash__kpi:nth-child(4)  { animation-delay: .11s; }
.dash--entrada .dash__kpi:nth-child(5)  { animation-delay: .14s; }
.dash--entrada .dash__kpi:nth-child(6)  { animation-delay: .17s; }
.dash--entrada .dash__kpi:nth-child(n+7) { animation-delay: .20s; }
.dash--entrada .dash__card:nth-child(1) { animation-delay: .18s; }
.dash--entrada .dash__card:nth-child(2) { animation-delay: .24s; }
.dash--entrada .dash__card:nth-child(n+3) { animation-delay: .30s; }

@media (prefers-reduced-motion: reduce) {
  .dash--entrada .dash__kpi,
  .dash--entrada .dash__card { animation: none; }
  .dash__kpi, .dash__card { transition: none; }
}

/* ══ Cabeçalho de seção (ex: "Métricas do dia") ════════════════════════ */
.dash__secao {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 26px 0 2px;
  letter-spacing: -0.01em;
}

/* ══ Monitor de disparo ao vivo ═════════════════════════════════════ */
.dash__monitor {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.05);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: dashEntrar .5s var(--ease-suave) both;
}
.dash__monitor.is-rodando { border-top: 3px solid var(--sucesso); }

.dash__monitor-topo { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dash__monitor-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dash__monitor-icone {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px; font-size: 20px;
  background: rgba(15, 122, 77, 0.12);
}
.dash__monitor-nome { display: block; font-size: 16px; font-weight: 700; color: var(--text); }
.dash__monitor-sub { font-size: 12.5px; color: var(--text-muted); }
.dash__anel { flex-shrink: 0; color: var(--text); }

.dash__monitor-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.dash__monitor-box {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px;
  border-radius: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.dash__monitor-box-ic { font-size: 15px; font-weight: 700; }
.dash__monitor-box-val { font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash__monitor-box-rot { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); }
.dash__monitor-box--verde    .dash__monitor-box-ic, .dash__monitor-box--verde    .dash__monitor-box-val { color: var(--sucesso); }
.dash__monitor-box--vermelho .dash__monitor-box-ic, .dash__monitor-box--vermelho .dash__monitor-box-val { color: var(--accent); }
.dash__monitor-box--azul     .dash__monitor-box-ic, .dash__monitor-box--azul     .dash__monitor-box-val { color: var(--info); }
.dash__monitor-box--ambar    .dash__monitor-box-ic, .dash__monitor-box--ambar    .dash__monitor-box-val { color: var(--aviso); }
.dash__monitor-acoes { display: flex; justify-content: flex-end; }

/* ══ Ações rápidas ═════════════════════════════════════════════════ */
.dash__acoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.dash__acao {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  cursor: pointer;
  font: inherit;
  transition: transform .2s var(--ease-suave), box-shadow .2s var(--ease-suave), border-color .2s var(--ease-suave);
}
.dash__acao:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16, 24, 40, 0.10); border-color: var(--border-strong); }
.dash__acao-ic {
  width: 46px; height: 46px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px; font-size: 22px;
  background: var(--accent-soft);
}
.dash__acao-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash__acao-tit { font-size: 14.5px; font-weight: 700; color: var(--text); }
.dash__acao-sub { font-size: 12.5px; color: var(--text-muted); }
/* card em destaque: vermelho de marca, sessão principal de ação */
.dash__acao--destaque {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}
.dash__acao--destaque .dash__acao-tit,
.dash__acao--destaque .dash__acao-sub { color: var(--sobre-cor); }
.dash__acao--destaque .dash__acao-sub { opacity: 0.9; }
.dash__acao--destaque .dash__acao-ic { background: rgba(255, 255, 255, 0.2); }

/* ── Barra de progresso da entrega ─────────────────────────────────── */
/* Especificação de marca da skill dataviz: respiro de 2px entre segmentos
   (a cor do fundo separando, não uma borda), pontas arredondadas em 4px e
   grade/eixos recessivos. */
.dash__pipe-barra {
  display: flex;
  height: 30px;
  padding: 3px;
  box-sizing: border-box;
  border: 1px solid rgba(166, 193, 211, .09);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7, 24, 39, .58);
  gap: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .22);
}
.dash__pipe-seg {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-width: 3px;
  border-radius: 7px;
  transition: filter .15s, transform .15s;
}
.dash__pipe-seg:hover { filter: brightness(1.08); transform: translateY(-1px); }
.dash__pipe-seg-num {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(7, 24, 39, .72);
  color: #f8f4e8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.dash__pipe-vazia { flex: 1; }

.dash__pipe-legenda {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 4px 14px;
  margin-top: 12px;
}
.dash__pipe-leg-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.dash__pipe-leg-item.is-zero { opacity: .45; }
.dash__pipe-leg-cor {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 2px rgba(246, 196, 0, .05);
}
.dash__pipe-leg-rot { flex: 1; color: var(--text-muted); }
.dash__pipe-leg-val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Falha fica FORA da barra: não é etapa da progressão, é saída dela. */
.dash__pipe-falha {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(208, 59, 59, 0.30);
  background: rgba(208, 59, 59, 0.07);
  font-size: 12.5px;
}
.dash__pipe-falha.is-zero { opacity: .5; border-color: var(--border); background: transparent; }
.dash__pipe-falha-icone { color: var(--perigo); font-weight: 700; }
.dash__pipe-falha-rot { flex: 1; color: var(--text-muted); }
.dash__pipe-falha-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.dash__pipe-falha-pct { color: var(--text-muted); font-size: 11.5px; }

/* Etapa do funil sem ninguém recua, para o olho achar onde os leads estão. */
.dash__barra.is-zero { opacity: .4; }

/* ── Hierarquia dos indicadores ────────────────────────────────────── */
/* Quatro números respondem "a operação está funcionando?" e ficam grandes;
   os outros sete viram apoio compacto. Onze cartões idênticos não davam
   hierarquia nenhuma. */
.dash__kpis--apoio {
  /* 128px é o menor cartão que ainda cabe o número: com 150px sobrava um órfão
     sozinho na segunda linha em telas de ~1180px úteis. */
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.dash__kpi--destaque .dash__kpi-valor { font-size: 34px; line-height: 1.05; }

.dash__kpi--apoio {
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "rotulo rotulo" "valor variacao";
  align-items: center;
  gap: 2px 8px;
}
.dash__kpi--apoio .dash__kpi-topo { display: contents; }
/* Sem ícone no cartão de apoio: com ele, o rótulo era cortado em "Taxa d…" e
   "Camp…", e um ícone ao lado de um rótulo legível não acrescenta nada. */
.dash__kpi--apoio .dash__kpi-icone { display: none; }
.dash__kpi--apoio .dash__kpi-rotulo {
  grid-area: rotulo; font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash__kpi--apoio .dash__kpi-valor { grid-area: valor; font-size: 20px; line-height: 1.15; }
.dash__kpi--apoio [class*="dash__kpi-var"] { grid-area: variacao; justify-self: end; }

/* ── Ícones em SVG (sem emoji) ─────────────────────────────────────── */
.dash__kpi-icone svg { width: 18px; height: 18px; display: block; }
.dash__kpi--destaque .dash__kpi-icone svg { width: 19px; height: 19px; }

/* ── Por que as mensagens falharam ─────────────────────────────────── */
.dash__motivos { display: flex; flex-direction: column; gap: 12px; }
.dash__motivo-topo {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 5px;
}
.dash__motivo-texto { font-size: 12.5px; line-height: 1.35; color: var(--text); }
.dash__motivo-valor { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.dash__motivo-trilho {
  height: 6px; border-radius: 3px;
  background: var(--panel-bg-hover);
  overflow: hidden;
}
.dash__motivo-fill { height: 100%; border-radius: 3px; background: var(--perigo); }
.dash__motivo-codigo {
  display: inline-block; margin-top: 4px;
  font-size: 11px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Respeita quem pediu menos movimento no sistema. */
@media (prefers-reduced-motion: reduce) {
  .dash__pipe-seg, .dash__kpi { transition: none; }
}

/* ── Histórico de campanhas ────────────────────────────────────────── */
.dash__hist { display: flex; flex-direction: column; gap: 10px; }
.dash__hist-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-bg);
}
.dash__hist-item--concluida { border-left-color: var(--sucesso); }
.dash__hist-item--rodando   { border-left-color: var(--info); }
.dash__hist-item--pausada   { border-left-color: var(--aviso); }
.dash__hist-item--falhou    { border-left-color: var(--perigo); }

.dash__hist-topo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 2px;
}
.dash__hist-nome { font-weight: 700; font-size: 14px; }
.dash__hist-status {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel-bg-hover); color: var(--text-muted);
}
.dash__hist-status--concluida { background: rgba(21,128,61,.10);  color: var(--sucesso); }
.dash__hist-status--rodando   { background: rgba(42,120,214,.12); color: var(--info); }
.dash__hist-status--pausada   { background: rgba(217,119,6,.12);  color: var(--aviso); }
.dash__hist-status--falhou    { background: rgba(208,59,59,.12);  color: var(--perigo); }

.dash__hist-conta {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 9px;
}
.dash__hist-grade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px 14px;
}
.dash__hist-dado { display: flex; flex-direction: column; gap: 1px; }
.dash__hist-dado-rot { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.dash__hist-dado-val { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash__hist-dado.is-ok    .dash__hist-dado-val { color: var(--sucesso); }
.dash__hist-dado.is-erro  .dash__hist-dado-val { color: var(--perigo); }
.dash__hist-dado.is-espera .dash__hist-dado-val { color: var(--aviso); }
