/* Modo de atendimento dedicado: trilho lateral fino + kanban (F12g) */

.modo-foco .lateral-foco {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 0 18px;
  overflow-y: auto;
}
.lateral-foco .lateral-marca { padding: 0; justify-content: center; }
.lateral-foco .simbolo-chatisp { display: block !important; width: 34px; }
.lateral-foco .simbolo-chatisp img { width: 34px; height: auto; }
.foco-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.foco-aba { width: 42px; height: 42px; border-radius: 12px; position: relative; }
.foco-aba svg { width: 20px; height: 20px; }
.foco-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--d2-bg-elevated);
}
.foco-badge[hidden] { display: none; }
.foco-aba.ativo {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(16, 185, 129, .35);
}

/* separacoes das conversas no trilho (estilo ChatMIX): aplicam o filtro da
   lista e levam a visao chat. Ativo usa so tinta + anel; o gradiente cheio e
   exclusivo das abas de visao. */
.foco-filtros {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--d2-border);
}
.foco-filtro { width: 38px; height: 38px; border-radius: 11px; position: relative; }
.foco-filtro svg { width: 17px; height: 17px; }
.foco-filtro.ativo {
  color: var(--d2-brand);
  background: var(--ci-brand-tinta);
  box-shadow: inset 0 0 0 1px var(--ci-brand-borda);
}
.foco-filtro .lateral-badge { top: -4px; right: -4px; }
.foco-filtro .lateral-badge:not([hidden]) { display: flex; }
/* na visao kanban o filtro nao age em nada visivel; a marcacao ativa se recolhe */
.foco-em-kanban .foco-filtro.ativo {
  color: var(--d2-text-muted);
  background: transparent;
  box-shadow: none;
}
.foco-rodape {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* conteudo do modo foco ocupa tudo */
.modo-foco .conteudo { padding: 18px 20px; max-width: none; display: flex; flex-direction: column; min-height: 0; }
.modo-foco .principal { height: 100dvh; }
.foco-visao { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.foco-visao[hidden] { display: none; }

/* a area de chat reusa .atendimento; dentro do modo foco ela estica */
.foco-visao > .atendimento { flex: 1; min-height: 0; }
.modo-foco .principal:has(.atendimento) { height: 100dvh; }

/* -------- topo do painel -------- */

.painel-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.painel-titulo { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.painel-titulo h1 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.painel-data { font-size: 12.5px; color: var(--d2-text-muted); white-space: nowrap; }
.painel-ferramentas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.painel-busca { width: 200px; }
.painel-filtro { max-width: 165px; }
.painel-usuario {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 5px;
  background: var(--d2-bg-elevated);
  border: 1px solid var(--d2-border);
  border-radius: 999px;
}
.painel-usuario span { font-size: 13px; font-weight: 650; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.painel-usuario .usuario-avatar { width: 30px; height: 30px; font-size: 13px; }

/* -------- resumos -------- */

.painel-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.resumo-cartao {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--d2-bg-elevated);
  border: 1px solid var(--d2-border);
  border-radius: 13px;
  box-shadow: var(--ci-sombra-1);
  padding: 13px 16px;
}
.resumo-icone {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
}
.resumo-icone svg { width: 19px; height: 19px; }
.resumo-icone.ok { background: linear-gradient(135deg, #10b981, #059669); }
.resumo-icone.alerta { background: linear-gradient(135deg, #f59e0b, #b45309); }
.resumo-icone.info { background: linear-gradient(135deg, #38bdf8, #0369a1); }
.resumo-icone.ia { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.resumo-icone.neutro { background: linear-gradient(135deg, #64748b, #475569); }
.resumo-textos { display: flex; flex-direction: column; min-width: 0; }
.resumo-textos b { font-size: 21px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.resumo-textos span { font-size: 12px; color: var(--d2-text-muted); font-weight: 600; }
.resumo-textos small { font-size: 11px; color: #b45309; font-weight: 650; margin-top: 1px; }
html[data-theme="dark"] .resumo-textos small { color: #fcd34d; }

.kanban-previa-midia { display: inline-flex; align-items: center; gap: 5px; }
.kanban-previa-midia svg { width: 13px; height: 13px; }

/* -------- kanban -------- */

.kanban {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 14px;
  align-items: stretch;
  overflow-x: auto;
}
.kanban-coluna {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--d2-bg-subtle);
  border: 1px solid var(--d2-border);
  border-radius: 14px;
  padding: 12px;
}
.kanban-cabecalho {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--d2-text-muted);
  padding: 2px 4px 12px;
}
.kanban-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--d2-text-faint); }
.kanban-ponto.ok { background: #10b981; }
.kanban-ponto.alerta { background: #f59e0b; }
.kanban-ponto.info { background: #38bdf8; }
.kanban-contagem {
  margin-left: auto;
  background: var(--d2-bg-elevated);
  border: 1px solid var(--d2-border);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11.5px;
}
.kanban-cartoes {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px;
}
.kanban-vazio { color: var(--d2-text-faint); font-size: 12.5px; text-align: center; padding: 26px 8px; }

.kanban-cartao {
  background: var(--d2-bg-elevated);
  border: 1px solid var(--d2-border);
  border-radius: 12px;
  box-shadow: var(--ci-sombra-1);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.kanban-cartao:hover { border-color: var(--d2-border-strong); box-shadow: var(--ci-sombra-2); transform: translateY(-1px); }
.kanban-cartao:focus-visible { outline: 2px solid var(--d2-brand); outline-offset: 2px; }
.kanban-cartao-topo { display: flex; align-items: center; gap: 10px; }
.kanban-cartao-nome { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.kanban-cartao-nome b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-cartao-hora { font-size: 11px; color: var(--d2-text-faint); }
.kanban-cartao-previa {
  margin-top: 8px;
  font-size: 12px;
  color: var(--d2-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-cartao-rodape { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(5, minmax(220px, 260px)); }
}
