/* =========================================================
   Componente: Badge, Chip, Avatar, Status dot
   ========================================================= */

.badge-cf2 {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}
.badge-cf2.presente    { color: var(--presente);    background: var(--presente-soft); }
.badge-cf2.falta       { color: var(--falta);       background: var(--falta-soft); }
.badge-cf2.justificada { color: var(--justificada); background: var(--justificada-soft); }
.badge-cf2.atrasado    { color: var(--atrasado);    background: var(--atrasado-soft); }
.badge-cf2.info        { color: var(--info);        background: var(--info-soft); }
.badge-cf2.neutral     { color: var(--text-secondary); background: var(--bg-muted); }
.badge-cf2.brand       { color: var(--pitch-700);  background: var(--pitch-50); }

/* dot de status (para tabelas/listas) */
.dot-cf { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-cf.presente { background: var(--presente); }
.dot-cf.falta { background: var(--falta); }
.dot-cf.justificada { background: var(--justificada); }
.dot-cf.atrasado { background: var(--atrasado); }

/* Chip (filtro removivel / selecao) — e a faixa de chips com contagem da
   leva "layout premium" (components/filterChips.js). */
.chips-cf {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chips-cf::-webkit-scrollbar { display: none; }
.chip-cf {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
  min-height: 36px;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.chip-cf:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip-cf.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}
/* A contagem e uma pilula dentro da pilula: tinta suave no chip desligado,
   translucida sobre o verde no ligado. */
.chip-cf__n {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-secondary);
  text-align: center;
}
.chip-cf.active .chip-cf__n { background: rgba(255, 255, 255, 0.22); color: inherit; }
:root[data-theme='dark'] .chip-cf.active .chip-cf__n { background: rgba(0, 0, 0, 0.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chip-cf.active .chip-cf__n { background: rgba(0, 0, 0, 0.18); }
}
@media (hover: none) and (pointer: coarse), (max-width: 991.98px) {
  .chip-cf { min-height: 44px; }
}
/* Faixa de chips do CrudPage: acima da lista, com o mesmo respiro da tira. */
.crud-chips-cf { margin-bottom: var(--space-4); min-width: 0; }
.crud-chips-cf__grupo + .crud-chips-cf__grupo { margin-top: var(--space-2); }
.chip-cf .chip-x { opacity: 0.6; }
.chip-cf .chip-x:hover { opacity: 1; }

/* Avatar */
.avatar2-cf {
  --size: 40px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-semibold);
  font-size: calc(var(--size) * 0.4);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-group-cf { display: inline-flex; }
.avatar-group-cf .avatar2-cf { border: 2px solid var(--bg-surface); margin-left: -10px; }
.avatar-group-cf .avatar2-cf:first-child { margin-left: 0; }
