/* AF CRM — programar mensagem de WhatsApp (24/09/2026) */
.afa-bt {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: .6rem; border: 1px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.afa-bt:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.afa-bt.afa-tem { color: #c2410c; border-color: #fdba74; }
.afa-bt.afa-erro { color: #b91c1c; border-color: #fca5a5; }
.afa-bt.afa-sem { opacity: .45; }
.afa-cont {
  position: absolute; top: -6px; right: -6px; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem;
  border-radius: 999px; background: #ea580c; color: #fff; font-size: .62rem; font-weight: 700;
  line-height: 1.05rem; text-align: center; box-sizing: border-box;
}
.afa-cont:empty { display: none; }
.afa-bt.afa-erro .afa-cont { background: #dc2626; }

.afa-pop {
  position: absolute; right: .5rem; bottom: calc(100% + .5rem); z-index: 60;
  width: min(420px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; box-sizing: border-box;
  padding: .85rem; border-radius: .9rem; border: 1px solid hsl(var(--border));
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .18); font-size: .8125rem; pointer-events: auto;
}
.afa-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; }
.afa-cab strong { font-size: .9rem; }
.afa-x { border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: hsl(var(--muted-foreground)); }
.afa-texto, .afa-quando {
  width: 100%; box-sizing: border-box; border: 1px solid hsl(var(--border)); border-radius: .55rem;
  background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: .85rem;
}
.afa-texto { padding: .5rem .6rem; resize: vertical; min-height: 5rem; }
.afa-quando { height: 2.3rem; padding: 0 .55rem; margin-top: .25rem; }
.afa-texto:focus, .afa-quando:focus { outline: none; border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, .18); }
.afa-linha { margin-top: .6rem; }
.afa-rot { display: block; font-size: .72rem; font-weight: 600; color: hsl(var(--muted-foreground)); }
.afa-atalhos { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.afa-chip {
  border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--foreground));
  border-radius: 999px; padding: .2rem .6rem; font: inherit; font-size: .72rem; cursor: pointer;
}
.afa-chip:hover { background: hsl(var(--muted)); }
.afa-rodape { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }
.afa-msg { flex: 1 1 auto; font-size: .75rem; }
.afa-ok { color: #15803d; }
.afa-ruim { color: #b91c1c; }
:is(.dark *) .afa-ok { color: #86efac; }
:is(.dark *) .afa-ruim { color: #fca5a5; }
.afa-ir {
  border: 0; border-radius: .55rem; background: #ea580c; color: #fff; font: inherit; font-weight: 600;
  font-size: .8rem; padding: .5rem .9rem; cursor: pointer;
}
.afa-ir:hover { background: #c2410c; }
.afa-ir:disabled { opacity: .6; cursor: default; }
.afa-aviso { padding: .4rem 0; color: hsl(var(--muted-foreground)); }
.afa-lista:not(:empty) { margin-top: .8rem; border-top: 1px solid hsl(var(--border)); padding-top: .6rem; }
.afa-sub { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-bottom: .35rem; }
.afa-item { padding: .45rem .5rem; border-radius: .55rem; background: hsl(var(--muted) / .5); margin-bottom: .35rem; }
.afa-item-erro { background: rgba(220, 38, 38, .08); }
.afa-item-topo { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.afa-item-q { font-weight: 600; font-size: .75rem; }
.afa-item-acoes { display: inline-flex; gap: .6rem; }
.afa-link { border: 0; background: none; padding: 0; font: inherit; font-size: .72rem; cursor: pointer; color: hsl(var(--primary)); }
.afa-link-ruim { color: #b91c1c; }
.afa-item-tx { margin-top: .2rem; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.afa-item-err { margin-top: .2rem; font-size: .7rem; color: #b91c1c; overflow-wrap: anywhere; }
@media (max-width: 640px) { .afa-pop { right: 0; left: 0; width: auto; } }

/* ver mensagem inteira + edição (25/09/2026) */
.afa-item-tx.afa-aberto { display: block; -webkit-line-clamp: unset; overflow: visible; max-height: 40vh; overflow-y: auto; }
.afa-ver { display: inline-block; margin-top: .25rem; }
.afa-item-ed { outline: 2px solid #ea580c; outline-offset: -2px; }
.afa-item-edtx { margin-top: .25rem; font-size: .7rem; font-weight: 600; color: #c2410c; }
:is(.dark *) .afa-item-edtx { color: #fdba74; }
.afa-rodape .afa-link { white-space: nowrap; }
