/* ─────────────────────────────────────────────────────────────────────────────
   Indicador de agentes online na topbar.
   Botão de ícone + badge numérico com count de agentes conectados.
   Click abre dropdown com a lista completa de agentes (online primeiro).
───────────────────────────────────────────────────────────────────────────── */

.wt-presence-wrap { position: relative; display: inline-flex; }
.wt-presence-btn {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--wt-r-md);
    background: transparent; color: var(--wt-fg-muted);
    border: 1px solid transparent;
    cursor: pointer;
}
.wt-presence-btn:hover { background: var(--wt-surface-2); }
.wt-presence-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 9999px;
    background: oklch(0.72 0.16 150); color: white;
    font-size: 10px; line-height: 16px; font-weight: 600;
    text-align: center;
}
.wt-presence-backdrop { position: fixed; inset: 0; z-index: 40; }
.wt-presence-popup {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;
    width: 280px; max-height: 420px; overflow: auto;
    background: var(--wt-card); border: 1px solid var(--wt-border);
    border-radius: var(--wt-r-md); box-shadow: var(--wt-shadow-lg);
    padding: 8px;
}
.wt-presence-head { padding: 4px 8px 8px; border-bottom: 1px solid var(--wt-border); }
.wt-presence-head-title { display: block; font-weight: 600; font-size: 13px; color: var(--wt-fg); }
.wt-presence-head-sub { display: block; font-size: 11px; color: var(--wt-fg-muted); margin-top: 2px; }
.wt-presence-list { list-style: none; padding: 4px 0; margin: 0; }
.wt-presence-row {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; background: transparent; border: none; cursor: pointer;
    border-radius: var(--wt-r-sm); text-align: left; font-size: 13px; color: var(--wt-fg);
}
.wt-presence-row:hover { background: var(--wt-surface-2); }
.wt-presence-row-dot { width: 8px; height: 8px; border-radius: 9999px; flex: 0 0 auto; }
.wt-presence-row-dot.is-ok { background: oklch(0.72 0.16 150); }
.wt-presence-row-dot.is-off { background: oklch(0.65 0 0); opacity: 0.5; }
.wt-presence-row-name { flex: 1; }
.wt-presence-row-state { font-size: 11px; color: var(--wt-fg-muted); }
.wt-presence-foot { padding: 4px 8px; border-top: 1px solid var(--wt-border); margin-top: 4px; }
.wt-presence-foot a { font-size: 12px; color: oklch(0.72 0.16 150); text-decoration: none; }
.wt-presence-foot a:hover { text-decoration: underline; }

/* ── Red dot overlay no botão quando há mensagens não-lidas ───────────── */
.wt-presence-btn { position: relative; }

.wt-presence-btn.is-unread::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wt-danger);
    border: 2px solid var(--wt-card);
    box-sizing: content-box;
    pointer-events: none;
}
