/* ════════════════════════════════════════════════════════════════════════
   COMPONENTES · BEM-ish (block__element--modifier)
   Lei: docs/03_DESIGN_SYSTEM.md §2 · touch target mínimo 44px (04)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Botão ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  color: var(--primary-text);
  background: var(--primary);
  border-color: var(--primary);
}
.btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--bg-muted); box-shadow: none; }

.btn--danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.btn--danger:hover:not(:disabled) { background: var(--danger); color: var(--neutral-0); }

.btn--sm    { min-height: 36px; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.btn--lg    { min-height: 52px; padding: var(--space-4) var(--space-6); font-size: var(--text-lg); }
.btn--block { width: 100%; }

.btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.btn--loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--radius-full);
  color: var(--primary-text);
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card ───────────────────────────────────────────────────────────── */

.card {
  padding: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card--locked { opacity: 0.6; pointer-events: none; }
.card--selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }

.card__title  { margin-bottom: var(--space-1); font-size: var(--text-lg); font-weight: var(--fw-semibold); }
.card__desc   { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.card__footer { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }

/* ── Campo de formulário ────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field__label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
}
.field__label span { color: var(--text-muted); font-weight: var(--fw-regular); }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease);
}
.field__input::placeholder { color: var(--text-subtle); }
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.field__textarea { min-height: 96px; resize: vertical; }

/* Confirmação de ação destrutiva (18): o número a copiar e o campo que o recebe.
   São quatro dígitos — campo de largura inteira faria a pessoa procurar onde
   digitar. Tabular para os dois casarem à vista. */
.codigo-perigo {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  color: var(--text);
}
.campo-codigo {
  max-width: 9ch;
  text-align: center;
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.24em;
  text-indent: 0.24em;      /* compensa o espaço que o tracking joga à direita */
}

.field__help  { font-size: var(--text-sm); color: var(--text-muted); }
.field__error { font-size: var(--text-sm); color: var(--danger); }
.field--erro .field__input { border-color: var(--danger); }

/* Opção clicável (rádio / checkbox grande — bom no celular) */
.opcao {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.opcao:hover { background: var(--bg-subtle); }
.opcao--marcada { border-color: var(--primary); background: var(--primary-subtle); }
.opcao input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ── Topbar ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-h);
  padding-inline: var(--space-4);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__logo  { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.topbar__spacer { flex: 1; }

/* O logo virou link — mas continua parecendo título, não link. */
a.topbar__logo { color: inherit; text-decoration: none; }
a.topbar__logo:hover { text-decoration: none; }

/* ── Navegação no computador ────────────────────────────────────────
   A barra de baixo some acima de 768px; esta assume no mesmo ponto. Sem ela
   havia um buraco: em tela grande o app não tinha navegação nenhuma, e quem
   entrava em Conversas só saa clicando em Sair. */
.topbar__nav { display: none; }
@media (min-width: 768px) {
  .topbar__nav {
    display: flex;
    gap: var(--space-1);
  }
}
.topbar__nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.topbar__nav__item:hover {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}
.topbar__nav__item--ativo {
  color: var(--primary);
  background: var(--primary-subtle);
  font-weight: var(--fw-medium);
}

/* Selo de versão: legível quando se procura, invisível quando não se procura.
   Tem contraste AA nos dois temas — é informação, não decoração. */
.topbar__versao {
  font-size: var(--text-xs);
  font-weight: var(--fw-regular);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px var(--space-2);
}

/* ── Bottom nav (mobile) ────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-dropdown);
  display: flex;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.bottom-nav__item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.bottom-nav__item:hover { text-decoration: none; }
.bottom-nav__item--ativo { color: var(--primary); font-weight: var(--fw-medium); }
@media (min-width: 768px) { .bottom-nav { display: none; } }

/* ── Cabeçalho de seção ─────────────────────────────────────────────── */

.section-header { margin-bottom: var(--space-5); }
.section-header__title { font-size: var(--text-2xl); }
.section-header__sub   { margin: var(--space-1) 0 0; color: var(--text-secondary); }

/* ── Status e badge ─────────────────────────────────────────────────── */

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--text-subtle);
  border-radius: var(--radius-full);
}
.status-dot--online  { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-dot--atencao { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.status-dot--erro    { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-bg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.badge--success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.badge--info    { color: var(--info);    background: var(--info-bg);    border-color: var(--info-border); }
.badge--warning { color: var(--accent-amber-700); background: var(--warning-bg); border-color: var(--warning-border); }
.badge--danger  { color: var(--danger);  background: var(--danger-bg);  border-color: var(--danger-border); }

/* ── Skeleton ───────────────────────────────────────────────────────── */

.skeleton {
  height: 1em;
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-subtle) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton 1.4s var(--ease) infinite;
}
@keyframes skeleton { to { background-position: -200% 0; } }
.skeleton--title { width: 60%; height: 1.5em; }
.skeleton--card  { height: 96px; border-radius: var(--radius-lg); }

/* ── Modal (substitui alert/confirm/prompt — proibidos) ─────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(0,0,0,0.45);
  animation: fade var(--duration-fast) var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.modal__box {
  width: 100%;
  max-width: 420px;
  padding: var(--space-6);
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  animation: rise var(--duration) var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.modal__title   { margin-bottom: var(--space-2); font-size: var(--text-xl); }
.modal__body    { color: var(--text-secondary); }
.modal__actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.modal__actions .btn { flex: 1; }

/* ── Toast ──────────────────────────────────────────────────────────── */

.toast-area {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--space-4));
  left: var(--space-4); right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
@media (min-width: 768px) {
  .toast-area { bottom: var(--space-6); left: auto; right: var(--space-6); width: 380px; }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: rise var(--duration) var(--ease-out);
}
.toast--success { border-left-color: var(--success); }
.toast--erro    { border-left-color: var(--danger); }
.toast--aviso   { border-left-color: var(--warning); }
.toast__texto   { flex: 1; font-size: var(--text-sm); }
.toast__acao    { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--primary); background: none; border: 0; cursor: pointer; }
.toast--saindo  { opacity: 0; transform: translateY(8px); transition: all var(--duration) var(--ease); }

/* ── Estado vazio ───────────────────────────────────────────────────── */

.vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.vazio svg { color: var(--text-subtle); }

/* ── Selo de categoria (admin) ──────────────────────────────────────── */
/* Recebe a cor por `--cor` (token de categoria). Pouca tinta, muito sinal. */

.selo-cat {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px; height: 28px;
  color: var(--cor, var(--text-muted));
  background: color-mix(in srgb, var(--cor, var(--text-muted)) 12%, transparent);
  border-radius: var(--radius-md);
}

/* ── Abas ───────────────────────────────────────────────────────────── */

.abas {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.abas__item {
  position: relative;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease);
}
.abas__item:hover { color: var(--text); }
.abas__item--ativa { color: var(--text); }
.abas__item--ativa::after {
  content: '';
  position: absolute;
  left: var(--space-3); right: var(--space-3); bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ── Chips de anexo (modal de gerar workflow) ───────────────────────── */

.anexos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.anexos:empty { display: none; }

.anexo-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.anexo-chip--link { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.anexo-chip__x {
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  opacity: 0.6;
}
.anexo-chip__x:hover { opacity: 1; background: var(--bg); }

/* ── Menu suspenso ──────────────────────────────────────────────────── */

.menu-tema { position: relative; display: inline-flex; }

.menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  min-width: 232px;
  padding: var(--space-1);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: rise var(--duration-fast) var(--ease-out);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.menu__item:hover { background: var(--bg-muted); }
.menu__item--ativo { color: var(--primary); font-weight: var(--fw-medium); }
.menu__item small { font-weight: var(--fw-regular); }

/* ── Passos do wizard (29 §5.3 — progresso sempre visível) ──────────── */

.passos { display: flex; gap: var(--space-2); margin-bottom: var(--space-6); }
.passos__item {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background var(--duration) var(--ease);
}
.passos__item--feito { background: var(--primary); }
.passos__legenda { margin-bottom: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }

/* ── Estado de atendimento da equipe (29 §3) ───────────────────────────
   Uma linha responde a pergunta que importa na lista: "essa equipe está
   atendendo?". O ponto colorido dá a leitura em um relance; o texto ao lado
   diz o motivo, para não obrigar a caçar em três telas. */
.wf-estado {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}
.wf-ponto {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: var(--radius-full);
  opacity: .55;
}
.wf-estado--ok { color: var(--success); }
/* Pulsa só quando ESTÁ atendendo — é o estado "vivo", e o movimento carrega
   essa informação sem precisar de mais texto. */
.wf-estado--ok .wf-ponto { opacity: 1; animation: wf-pulso 2.4s ease-in-out infinite; }
.wf-estado--alerta { color: var(--danger); }
.wf-estado--alerta .wf-ponto { opacity: 1; }

@keyframes wf-pulso {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%      { box-shadow: 0 0 0 3px transparent; opacity: .6; }
}
/* Respeita quem pediu menos movimento (04 §acessibilidade). */
@media (prefers-reduced-motion: reduce) {
  .wf-estado--ok .wf-ponto { animation: none; }
}

/* ── Tabela de dados (painel admin) ──────────────────────────────────
   Rola dentro do próprio contêiner: uma tabela de sete colunas não cabe em
   360px, e deixar a PÁGINA rolar de lado quebra a leitura de tudo o mais. */
.tabela-rolo { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.tabela th,
.tabela td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.tabela th {
  position: sticky; top: 0;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  background: var(--bg);
  border-bottom-color: var(--border);
}
/* Números alinhados à direita e tabulares: é assim que se compara coluna. */
.tabela .n { text-align: right; font-variant-numeric: tabular-nums; }
.tabela tbody tr:hover { background: var(--bg-subtle); }

/* Conta que não atende fica apagada — presente na lista, fora do foco. */
.linha--parada { opacity: 0.6; }

/* ════════════════════════════════════════════════════════════════════════
   GRÁFICOS · sem biblioteca, com os tokens do tema
   Como tudo aqui usa `var(--…)`, o modo escuro sai de graça e sempre certo:
   não existe hex solto para esquecer de inverter.
   ════════════════════════════════════════════════════════════════════════ */

.grade-graficos {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;      /* celular: um embaixo do outro */
}
@media (min-width: 900px) {
  .grade-graficos { grid-template-columns: 1fr 1fr; }
}

/* ── Barras verticais ─────────────────────────────────────────────── */
.gr__plot {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: var(--gr-h, 160px);
  /* Linha de base discreta: separa dado de eixo sem virar moldura. */
  border-bottom: 1px solid var(--border);
}
.gr__col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: var(--space-1);
}
.gr__barra {
  width: 100%;
  max-width: 3rem;
  background: var(--primary-subtle);
  /* Cantos arredondados só em cima: embaixo a barra é ancorada na base, e
     arredondar ali descolaria o dado do eixo. */
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height var(--duration) var(--ease-out);
}
/* O mês corrente é o que se está lendo — ele ganha a cor cheia; os anteriores
   ficam de apoio. Sem isso, seis barras iguais não dizem onde olhar. */
.gr__barra--atual { background: var(--primary); }

.gr__num  { font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gr__eixo { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

/* ── Barras horizontais nomeadas ──────────────────────────────────── */
.grh { display: flex; flex-direction: column; gap: var(--space-4); }
.grh__topo { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.grh__nome  { font-size: var(--text-sm); font-weight: var(--fw-medium); }
.grh__valor { font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; }
.grh__trilho { height: 10px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.grh__barra  { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* ── Linha ────────────────────────────────────────────────────────── */
.grl svg { display: block; width: 100%; height: 140px; }
/* `non-scaling-stroke` no traço: sem ele o `preserveAspectRatio="none"`
   esticaria a espessura junto com a largura e a linha sairia deformada. */
.grl__traco { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grl__area  { fill: var(--primary-subtle); }
.grl__eixo {
  display: flex; justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--text-muted);
}

/* ── Funil ────────────────────────────────────────────────────────── */
.funil { display: flex; flex-direction: column; gap: var(--space-4); }
.funil__cabeca { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-sm); }
.funil__trilho { height: 12px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.funil__barra  { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
/* A perda é o dado do funil — vem com ícone e texto, nunca só cor (a11y). */
.funil__perda {
  display: inline-flex; align-items: center; gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--danger);
}

.u-alerta { color: var(--danger); font-weight: var(--fw-medium); }
.u-strong { font-weight: var(--fw-semibold); color: var(--text); }

/* ── Tiles de métrica ────────────────────────────────────────────────
   Estas classes já eram usadas pela aba Medição, mas NUNCA tiveram CSS: os
   números saíam empilhados como texto corrido. Não era escolha de design —
   era estilo que faltava, e é por isso que o painel parecia cru.

   `auto-fit` + `minmax`: quatro tiles em tela grande, dois no tablet, um no
   celular, sem uma única media query. */
.tiles {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.tile__rotulo {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
/* O número é o dado: grande, tabular (para alinhar entre tiles) e com
   tracking apertado, que é o que faz número grande parecer intencional. */
.tile__valor {
  font-size: var(--text-3xl, 30px);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tile__valor--alerta { color: var(--danger); }
.tile__apoio {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ── Faixa de estado (Início do cliente) ─────────────────────────────
   A pergunta "está atendendo?" merece uma faixa própria, não um tile no meio
   dos números: é sim ou não, e é o que ele abre o app para saber. */
.estado {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-lg);
}
.estado--ok     { border-left-color: var(--success); }
.estado--parado { border-left-color: var(--danger); }

/* Ponto + texto, nunca só cor: quem não distingue verde de vermelho lê
   "está atendendo" do mesmo jeito. */
.estado__ponto {
  flex: 0 0 auto;
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
}
.estado--ok .estado__ponto     { background: var(--success); }
.estado--parado .estado__ponto { background: var(--danger); }

.estado__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.estado__texto span { font-size: var(--text-sm); color: var(--text-secondary); }
