/* CRM — Conversas (caixa de entrada do WhatsApp não oficial) */

.view.view-inbox { padding: 0; max-width: none; height: 100vh; display: flex; }
.view.view-inbox > div { flex: 1; min-width: 0; display: flex; }
@media (max-width: 860px) { .view.view-inbox { height: calc(100vh - 51px); padding: 0; } }

.nav a .nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }

.ib { --ib-list-w: 340px; --ib-side-w: 320px; position: relative; flex: 1; min-width: 0; display: grid; grid-template-columns: var(--ib-list-w) minmax(0, 1fr); height: 100%; background: var(--surface); }
/* bordas arrastáveis (lista | conversa | painel da aluna) */
.ib-resize { position: absolute; top: 0; bottom: 0; width: 9px; margin-left: -4px; cursor: col-resize; z-index: 6; touch-action: none; }
.ib-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background .12s; }
.ib-resize:hover::after, .ib-resize.dragging::after { width: 3px; left: 3px; background: var(--accent); }
.ib-resize-list { left: var(--ib-list-w); }
.ib-resize-side { left: calc(100% - var(--ib-side-w)); display: none; }
.ib.side-open .ib-resize-side { display: block; }
body.ib-resizing { cursor: col-resize; user-select: none; }
body.ib-resizing iframe, body.ib-resizing video { pointer-events: none; }
.ib-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ib-list-head { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.ib-list-head h1 { font-size: 18px; margin: 0; }
/* abas de status: compactas, no máx. 2 linhas na largura padrão (25/11) */
.ib-tabs { display: flex; gap: 3px 0; flex-wrap: wrap; margin: 0 -3px; }
.ib-tabs button { border: 0; background: transparent; color: var(--text-2); padding: 3px 5px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ib-tabs button:hover { background: var(--surface-hover); color: var(--text); }
.ib-tabs button.active { background: var(--accent); color: #fff; }
.ib-tabs .n { color: var(--text-3); font-weight: 500; font-size: 11px; font-variant-numeric: tabular-nums; }
.ib-tabs button.zero .n { opacity: .55; }
.ib-tabs button.active .n { color: inherit; opacity: .85; }
/* barra de filtros: Caixas + Etiqueta (25/11) */
.ib-filters { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.ib-filters > .ib-fbtn, .ib-filters > .ib-fclear { flex: none; }
.ib-filters > .ib-fbtn[data-pop] { flex: 0 1 auto; }
.ib-fbtn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.ib-fbtn:hover { background: var(--surface-hover); color: var(--text); }
.ib-fbtn .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ib-fbtn .car { font-size: 10px; opacity: .6; transition: transform .15s; }
.ib-fbtn.open .car { transform: rotate(180deg); }
.ib-fbtn .svg-icon, .ib-fbtn svg { width: 14px; height: 14px; flex: none; }
.ib-fbtn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ib-fbtn.open { box-shadow: 0 0 0 3px var(--accent-soft); }
.ib-fclear { border: 0; background: transparent; color: var(--text-3); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 2px; }
.ib-fclear:hover { color: var(--text); }
.ib-fpop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow: auto; }
.ib-fpop-h { padding-right: 12px !important; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 4px 8px 6px; }
.ib-fpop-row { display: flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); padding: 2px 4px 2px 0; }
.ib-fpop-row:hover { background: var(--surface-hover); }
.ib-fpop-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 7px 4px 7px 8px; cursor: pointer; }
.ib-fpop-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.ib-fpop-row input:disabled { cursor: not-allowed; }
.ib-fpop-row .nm { min-width: 0; display: flex; flex-direction: column; font-size: 13px; color: var(--text); line-height: 1.3; overflow: hidden; }
.ib-fpop-row:not(.on) .nm { color: var(--text-2); }
.ib-fpop-row .nm b { font-weight: 400; display: flex; align-items: center; min-width: 0; }
.ib-fpop-row .nm small { font-size: 11.5px; color: var(--text-3); }
.ib-fpop-off { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--success); color: #fff; font-size: 9px; font-weight: 700; margin-right: 5px; vertical-align: 1px; }
.ib-fpop-row .ct { order: 2; padding-right: 4px; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ib-fpop-row .op, .ib-fpop-opt .op { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.ib-fpop-row .only { order: 1; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; opacity: 0; flex: none; }
.ib-fpop-row:hover .only, .ib-fpop-row .only:focus-visible { opacity: 1; }
.ib-fpop-row .only:hover { background: var(--accent-soft); }
@media (hover: none) { .ib-fpop-row .only { opacity: 1; } }
.ib-fpop-f { border-top: 1px solid var(--border); margin-top: 4px; padding: 6px 4px 2px; display: flex; justify-content: flex-end; }
.ib-fpop-f button { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.ib-fpop-f button:hover:not([disabled]) { background: var(--accent-soft); }
.ib-fpop-f button[disabled] { color: var(--text-3); cursor: default; }
.ib-fpop-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.ib-fpop-opt:hover { background: var(--surface-hover); }
.ib-fpop-opt.on { background: var(--accent-soft); }
.ib-items { flex: 1; overflow-y: auto; min-height: 0; }
.ib-item { display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.ib-item:hover { background: var(--surface-hover); text-decoration: none; }
.ib-item.active { background: var(--accent-soft); }
.ib-item-left { flex: 0 0 36px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ib-ai { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--text-3); line-height: 1; }
.ib-ai i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.ib-ai.on i { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.18); }
.ib-ai.wait i { background: var(--border); }
.ib-ai.off i { background: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,.18); }
/* 24/11 (Yan): laranja puxado pro âmbar — o #f97316 ficava parecido demais com o vermelho */
.ib-ai.reply i { background: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,.3); }
.ib-ai.attend i { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.2); }
.ib-av { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.ib-item-main { flex: 1; min-width: 0; }
.ib-item-inbox { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 14px; color: var(--text-3); margin-bottom: 1px; min-width: 0; }
.ib-item-inbox .svg-icon { width: 12px; height: 12px; flex: 0 0 12px; vertical-align: 0; }
.ib-item-inbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item-top { display: flex; align-items: baseline; gap: 6px; }
.ib-item-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ib-item-bot { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.ib-item-prev { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item.unread .ib-item-prev { color: var(--text); font-weight: 500; }
.ib-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--success); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.ib-item-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-more { padding: 10px; text-align: center; }
.ib-empty { padding: 40px 20px; text-align: center; color: var(--text-3); }

.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.ib-thread-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-3); padding: 20px; text-align: center; }
.ib-th-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ib-th-who { flex: 1; min-width: 160px; }
.ib-th-name { font-weight: 600; font-size: 15px; }
.ib-th-sub { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ib-th-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ib-th-actions select { width: auto; padding: 4px 8px; font-size: 13px; }
.ib-back { display: none; }

.ib-msgs { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.ib-day { align-self: center; font-size: 11px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1px 10px; margin: 10px 0 6px; }
.ib-msg { max-width: min(560px, 78%); align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px 4px; position: relative; word-wrap: break-word; overflow-wrap: anywhere; }
.ib-msg.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.ib-msg.failed { border-color: var(--danger); }
.ib-msg-text { white-space: pre-wrap; }
.ib-msg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ib-msg-foot .svg-icon { width: 13px; height: 13px; }
.ib-tick.read { color: var(--accent); }
.ib-msg-by { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.ib-quote { border-left: 3px solid var(--border-strong); background: rgba(127,127,127,.08); padding: 3px 8px; border-radius: 4px; font-size: 12px; color: var(--text-2); margin-bottom: 4px; white-space: pre-wrap; max-height: 60px; overflow: hidden; }
.ib-react { position: absolute; bottom: -10px; right: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; padding: 0 4px; line-height: 18px; }
.ib-msg.has-react { margin-bottom: 10px; }
.ib-err { font-size: 12px; color: var(--danger); margin-top: 2px; }
.ib-media { margin: 2px 0 4px; }
.ib-media img { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; cursor: zoom-in; }
.ib-media img.sticker { max-width: 140px; cursor: default; }
.ib-media video { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; }
.ib-media audio { display: block; width: 260px; max-width: 100%; }
.ib-media .btn { margin: 2px 0; }
.ib-media-off { font-size: 12px; color: var(--text-3); font-style: italic; }
.ib-older { align-self: center; margin-bottom: 8px; }

.ib-composer { background: var(--surface); border-top: 1px solid var(--border); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.ib-comp-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-comp-row textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; }
.ib-attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--surface-2); border-radius: 6px; padding: 3px 4px 3px 8px; align-self: flex-start; }
.ib-comp-note { font-size: 12px; color: var(--text-3); }
.ib-comp-warn { font-size: 13px; color: var(--warning); background: var(--warning-soft); padding: 8px 10px; border-radius: 6px; }

@media (max-width: 860px) {
  .ib { grid-template-columns: 1fr; }
  .ib-resize { display: none !important; }
  .ib.has-open .ib-list { display: none; }
  .ib:not(.has-open) .ib-thread { display: none; }
  .ib-back { display: inline-flex; }
  .ib-msgs { padding: 12px 10px; }
  .ib-msg { max-width: 88%; }
}

/* painel da aluna (Digital Members) */
.ib.side-open { grid-template-columns: var(--ib-list-w) minmax(0, 1fr) var(--ib-side-w); }
.ib-side { display: none; border-left: 1px solid var(--border); background: var(--surface); min-height: 0; flex-direction: column; }
.ib.side-open .ib-side { display: flex; }
.ib-side-head { display: flex; align-items: center; gap: 4px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--border); }
.ib-side-title { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ib-side-title .svg-icon { width: 16px; height: 16px; }
.ib-side-body { flex: 1; overflow-y: auto; padding: 12px 14px 20px; }
.ib-side-empty { color: var(--text-3); padding: 8px 0; }
.ib-side-empty .hint { margin-top: 6px; font-size: 12px; }
.ib-side-sum { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ib-side-acct + .ib-side-acct { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.ib-side-who { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.ib-side-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--warning); background: var(--warning-soft); padding: 6px 8px; border-radius: 6px; margin-top: 4px; }
.ib-side-warn .svg-icon { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 1px; }
.ib-side-brand { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 10px 0 6px; }
.ib-side-other { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ib-acc { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.ib-acc.inactive, .ib-acc.expired { opacity: .75; }
.ib-acc-top { display: flex; align-items: flex-start; gap: 8px; }
.ib-acc-name { flex: 1; min-width: 0; font-weight: 500; }
.ib-acc-prods { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.ib-acc-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
#ib-cust.active { background: var(--accent-soft); border-color: var(--accent); }
#ib-cust .badge { margin-left: 2px; }
@media (max-width: 1180px) and (min-width: 861px) {
  .ib { --ib-list-w: 280px; --ib-side-w: 300px; }
}
@media (max-width: 860px) {
  .ib.side-open { grid-template-columns: 1fr; }
  .ib.side-open .ib-side { position: fixed; inset: 0; z-index: 40; }
}

/* subabas por canal */
.ib-chans { display: flex; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.ib-chans button { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 6px; border: 0; background: var(--surface); color: var(--text-2); cursor: pointer; font-weight: 500; white-space: nowrap; font-size: 13px; }
.ib-chans button + button { border-left: 1px solid var(--border); }
.ib-chans button.active { background: var(--accent-soft); color: var(--accent); }
.ib-chans .svg-icon { width: 15px; height: 15px; }
.ib-item-subj { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.ib-th-subj { font-size: 13px; font-weight: 500; color: var(--text-2); }

/* e-mail na conversa: cartão largo, sem bolha de chat */
.ib-msg.ib-email { max-width: min(760px, 92%); width: 100%; padding: 10px 12px 6px; }
.ib-email .ib-msg-by { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.ib-full { margin-top: 6px; font-size: 12px; }
.ib-full summary { cursor: pointer; color: var(--text-3); }
.ib-full .ib-msg-text { margin-top: 6px; color: var(--text-2); border-left: 2px solid var(--border); padding-left: 8px; }
.ib-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ib-att { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; max-width: 100%; }
.ib-att .svg-icon { width: 13px; height: 13px; }
.ib-att.off { opacity: .6; cursor: default; }
.ib-email-ta { min-height: 96px !important; }
#ib-attach { display: flex; flex-wrap: wrap; gap: 6px; }

/* e-mail: lido × não lido (igual ao Gmail) */
.ib-item.email .ib-item-name { font-weight: 500; }
.ib-item.email.unread .ib-item-name, .ib-item.email.unread .ib-item-subj, .ib-item.email.unread .ib-item-time { font-weight: 700; color: var(--text); }
.ib-item.email.read { background: var(--surface-2); }
.ib-item.email.read .ib-item-name, .ib-item.email.read .ib-item-subj { color: var(--text-2); font-weight: 400; }
.ib-item.email.read .ib-item-prev, .ib-item.email.read .ib-item-time { color: var(--text-3); }
.ib-item.email.read .ib-av { opacity: .6; }
.ib-item.email.read:hover { background: var(--surface-hover); }
.ib-item.email.read.active, .ib-item.email.active { background: var(--accent-soft); }
.ib-item-count { font-weight: 400; color: var(--text-3); }

/* marcadores do Gmail (aba E-mail) */
.ib-labels { display: flex; gap: 4px; flex-wrap: wrap; }
.ib-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; line-height: 16px; padding: 0 6px; border-radius: 4px; margin-right: 4px; white-space: nowrap; border: 1px solid transparent; vertical-align: 1px; }
button.ib-label { cursor: pointer; font-size: 12px; line-height: 20px; padding: 0 8px; margin: 0; }
button.ib-label .n { opacity: .75; font-weight: 400; }
button.ib-label.active { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.lb-warn { background: var(--warning-soft); color: var(--warning); }
.lb-info, .lb-a { background: var(--accent-soft); color: var(--accent); }
.lb-ok, .lb-b { background: var(--success-soft); color: var(--success); }
.lb-danger { background: var(--danger-soft); color: var(--danger); }
.lb-c, .lb-d { background: var(--surface-2); color: var(--text-2); }
/* etiquetas do WhatsApp com a cor do Chatwoot (24/11/2026) */
.lb-custom { background: color-mix(in srgb, var(--lb) 16%, transparent); color: color-mix(in srgb, var(--lb) 75%, var(--text)); }
.ib-label svg { width: 11px; height: 11px; }
.ib-labels-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.ib-item-labels { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px; }
.ib-th-labels { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.ib-label-edit { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--border); background: transparent; color: var(--text-3); font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 4px; cursor: pointer; }
.ib-label-edit:hover { color: var(--text); border-color: var(--text-3); }
.ib-label-edit svg { width: 11px; height: 11px; }
.ib-lb-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.ib-lb-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ib-lb-new { display: flex; gap: 8px; }
.ib-lb-new input { flex: 1; }

/* modelo pela conversa (WhatsApp oficial, 24/11/2026) */
.ib-tpl-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.ib-tpl-tag svg { width: 11px; height: 11px; }
.ib-tpl-q { width: 100%; margin-bottom: 10px; }
.ib-tpl-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.ib-tpl-item { text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; }
.ib-tpl-item:hover { background: var(--surface-hover); border-color: var(--text-3); }
.ib-tpl-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ib-tpl-body { font-size: 12px; color: var(--text-2); white-space: pre-wrap; }
.ib-tpl-prev { margin-top: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; }
.ib-tpl-prev .ib-msg { max-width: 100%; align-self: flex-end; }
.ib-tpl-btn { margin-top: 6px; text-align: center; font-size: 13px; color: var(--accent); border-top: 1px solid var(--border); padding-top: 6px; }

/* botão direito na mensagem (WhatsApp) */
.ib-ctx { position: fixed; z-index: 1000; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; }
.ib-ctx > button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; text-align: left; }
.ib-ctx > button:hover:not([disabled]) { background: var(--surface-hover); }
.ib-ctx > button[disabled] { opacity: .45; cursor: default; }
.ib-ctx > button.danger { color: var(--danger); }
.ib-ctx-emojis { display: flex; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.ib-ctx-emojis button { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 5px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.ib-ctx-emojis button:hover { background: var(--surface-hover); transform: scale(1.15); }
.ib-ctx-emojis button.on { background: var(--accent-soft); }
.ib-ctx-note { font-size: 12px; color: var(--text-3); padding: 4px 10px 6px; }
.ib-msg.deleted > :not(.ib-deleted):not(.ib-msg-foot):not(.ib-msg-by) { opacity: .45; text-decoration: line-through; }
.ib-deleted { display: flex; align-items: center; gap: 4px; font-size: 12px; font-style: italic; color: var(--text-3); margin-bottom: 2px; }
.ib-deleted .svg-icon { width: 12px; height: 12px; }
.ib-quote[data-goto] { cursor: pointer; }
.ib-quote[data-goto]:hover { background: rgba(127,127,127,.16); }
.ib-msg.flash { animation: ib-flash 1.5s ease; }
@keyframes ib-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* respondendo a uma mensagem */
.ib-replybar { display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 6px; padding: 4px 4px 4px 10px; margin-bottom: 6px; }
.ib-replybar-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); }
.ib-replybar-txt b { color: var(--accent); font-weight: 600; }
.ib-replybar-txt div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ib-attach { display: flex; flex-wrap: wrap; gap: 6px; }
#ib-attach:not(:empty) { margin-bottom: 6px; }

/* arrastar arquivo pro chat */
.ib-thread { position: relative; }
.ib-drop { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent-soft) 85%, transparent); border: 2px dashed var(--accent); border-radius: var(--radius); pointer-events: none; }
.ib-drop div { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); font-size: 15px; }

/* urgente */
.ib-urgent { color: var(--danger); display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.ib-urgent .svg-icon { width: 14px; height: 14px; }
.ib-urgent-badge { cursor: pointer; font-size: 11px; vertical-align: 2px; }

/* barra de progresso do anexo */
.ib-attach-chip.ib-up { align-items: center; min-width: 240px; max-width: 100%; }
.ib-up-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ib-up-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-up-bar { display: block; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ib-up-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s; }
.ib-up-info { font-size: 11px; color: var(--text-3); }
.ib-up-bar.ib-indet { margin-top: 6px; width: 160px; }
.ib-up-bar.ib-indet i { width: 35%; animation: ib-indet 1.2s ease-in-out infinite; }
@keyframes ib-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }

/* outras conversas da mesma pessoa */
.ib-side-sec { margin-bottom: 14px; }
.ib-side-sec + .ib-side-sec { border-top: 1px solid var(--border); padding-top: 12px; }
.ib-side-sec-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.ib-side-sec-title .svg-icon { width: 15px; height: 15px; }
.ib-side-sec-title .muted { margin-left: auto; font-weight: 400; }
.ib-rel { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.ib-rel.recent { border-color: var(--warning); box-shadow: inset 3px 0 0 var(--warning); }
.ib-rel-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.ib-rel-top .svg-icon { width: 14px; height: 14px; flex: none; }
.ib-rel-where { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ib-rel-time { color: var(--text-3); flex: none; }
.ib-rel-title { font-weight: 600; font-size: 13px; margin-top: 3px; }
.ib-rel-prev { font-size: 12px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-rel-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ib-rel-acts { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.ib-rel-msgs { margin-top: 8px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 6px; padding: 8px; }
.ib-rel-m { max-width: 92%; align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 12px; }
.ib-rel-m.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.ib-rel-m.note { background: var(--warning-soft); border-color: transparent; }
.ib-rel-m-by { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.ib-rel-m-txt { white-space: pre-wrap; word-break: break-word; }
.ib-rel-who { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.ib-rel-who summary { cursor: pointer; }
.ib-rel-btn.recent { border-color: var(--warning); }

/* resposta da IA no WhatsApp não oficial */
.ib-msg.me.ai .ib-msg-by { color: var(--accent); font-weight: 600; }

/* velocidade do áudio (1x / 1.5x / 2x) */
.ib-audio { display: flex; align-items: center; gap: 6px; }
.ib-audio audio { min-width: 0; flex: 1; }
.ib-speed { flex: none; min-width: 42px; height: 26px; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 8px; }
.ib-speed:hover { background: var(--surface-hover); }
.ib-speed.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* caixa em observação (Fase 0 do Acne Zero, 24/11/2026): no lugar do compositor */
.ib-observe { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); font-size: 13px; }
.ib-observe > .svg-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent); }
.ib-observe > div { flex: 1; min-width: 0; }
.ib-observe .btn { white-space: nowrap; }

/* confirmação ancorada no botão (pausar/devolver IA, 24/11/2026) */
.ib-pop { position: fixed; z-index: 1100; width: 320px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; }
.ib-pop-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ib-pop-msg { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.ib-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Visualizador de imagem (lightbox) — 25/11/2026 */
.ib-lb { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); display: flex; flex-direction: column; }
.ib-lb-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 14px; }
.ib-lb-bar button, .ib-lb-bar a { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px; min-width: 34px; height: 34px; padding: 0 10px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.ib-lb-bar button:hover, .ib-lb-bar a:hover { background: rgba(255,255,255,.22); }
.ib-lb-pct { color: #fff; font-size: 13px; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.ib-lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; user-select: none; }
.ib-lb-stage img { max-width: 94vw; max-height: calc(100vh - 80px); object-fit: contain; transform-origin: center center; cursor: zoom-in; will-change: transform; }
.ib-lb-stage.zoomed img { cursor: grab; }
.ib-lb-stage.zoomed:active img { cursor: grabbing; }

/* Filtro composto + atalhos (25/11/2026) */
.ib-views { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-views:empty, .ib-advbar:empty { display: none; }
.ib-view { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 26px; padding: 0 10px; border: 1px dashed var(--border-strong); border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.ib-view span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-view svg { width: 12px; height: 12px; flex: none; color: var(--warning, #d97706); }
.ib-view:hover { background: var(--surface-hover); color: var(--text); }
.ib-view.active { border-style: solid; border-color: var(--accent); background: var(--accent); color: #fff; }
.ib-view.active svg { color: #fff; }
.ib-view .sh { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }
.ib-advbar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.ib-advbar-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ib-advbar-t svg { width: 14px; height: 14px; flex: none; }
.ib-advbar-t b { white-space: nowrap; font-weight: 600; }
.ib-advbar-t .d { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; }
.ib-advbar button { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 3px 6px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; }
.ib-advbar button:hover { background: rgba(0,0,0,.06); }
.ib-advbar button svg { width: 14px; height: 14px; }
.ib-adv-help { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }
.ib-adv-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.ib-adv-row { display: grid; grid-template-columns: 112px 186px minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.ib-adv-row select { width: 100%; min-width: 0; }
.ib-adv-and { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; padding-left: 4px; }
.ib-adv-or { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.ib-adv-or::before, .ib-adv-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ib-adv-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.ib-adv-add:hover { background: var(--accent-soft); }
.ib-adv-add svg { width: 13px; height: 13px; }
.ib-adv-add.or { margin-top: 8px; border: 1px dashed var(--border-strong); padding: 6px 10px; }
.ib-adv-save { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ib-adv-save > label:first-child { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.ib-adv-save input[type=text] { width: 100%; }
.ib-adv-err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 1em; }
.ib-adv-foot, .modal-foot .ib-adv-foot { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
@media (max-width: 560px) { .ib-adv-row { grid-template-columns: 1fr 80px 32px; } .ib-adv-row select[data-k=v], .ib-adv-row .ib-ms { grid-column: 1 / 3; } }
/* lista de marcar do filtro ("qualquer uma das" / "nenhuma das", 25/11) */
.ib-ms { position: relative; min-width: 0; }
.ib-ms-btn { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.ib-ms.open .ib-ms-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ib-ms-btn .s { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-ms-btn .ph, .ib-ms-list .ph { color: var(--text-3); }
.ib-ms-btn .more { flex: none; display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.ib-ms-btn .car { font-size: 10px; opacity: .6; flex: none; }
.ib-ms-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; max-height: 260px; overflow: auto; }
.ib-ms-list label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.ib-ms-list label:hover { background: var(--surface-hover); }
.ib-ms-list input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.ib-ms-f { position: sticky; bottom: -4px; display: flex; gap: 4px; padding: 6px 4px 2px; margin-top: 4px; border-top: 1px solid var(--border); background: var(--surface); }
.ib-ms-f button { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); }
.ib-ms-f button:hover { background: var(--accent-soft); }
.ib-ms-f .ok { margin-left: auto; background: var(--accent); color: #fff; }
.ib-ms-f .ok:hover { background: var(--accent); filter: brightness(1.08); }

/* "Sem automações" (25/11/2026): botão na barra de filtros, divisor da lista e mensagens automáticas recolhidas */
.ib-fauto { position: relative; }
.ib-fauto.on .sl { position: absolute; left: 50%; top: 50%; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transform: translate(-50%, -50%) rotate(-45deg); box-shadow: 0 0 0 1px var(--accent-soft); }
.ib-fauto.off { border-color: var(--warning); color: var(--warning); background: var(--warning-soft); }
.ib-sep-auto { display: flex; align-items: center; gap: 6px; padding: 10px 14px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); border-top: 1px solid var(--border); }
.ib-sep-auto svg { width: 13px; height: 13px; }
.ib-item-prev.auto { color: var(--text-3); font-style: italic; }
.ib-autofold { display: flex; align-items: center; gap: 8px; align-self: center; width: min(560px, 92%); margin: 4px auto; padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-3); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ib-autofold:hover { color: var(--text-2); background: var(--surface-hover); }
.ib-autofold svg { width: 14px; height: 14px; flex: none; }
.ib-autofold .tx { display: flex; gap: 8px; align-items: baseline; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.ib-autofold .tx b { font-weight: 600; color: var(--text-2); flex: none; }
.ib-autofold .tm { flex: none; font-variant-numeric: tabular-nums; }
.ib-autofold .pk { overflow: hidden; text-overflow: ellipsis; min-width: 0; opacity: .85; }
.ib-autofold .ac { flex: none; color: var(--accent); font-weight: 500; }
.ib-autofold.open { border-style: solid; }
.ib-more-load { font-size: 12.5px; color: var(--text-3); }

/* Avisos no meio da conversa (25/11/2026): mudança da IA, status, urgente e responsável */
.ib-evt { display: flex; align-items: center; gap: 7px; align-self: center; max-width: min(560px, 92%); margin: 6px auto; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12px; line-height: 1.35; width: fit-content; }
.ib-evt .d { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.ib-evt .tx { min-width: 0; }
.ib-evt .tm { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ib-evt[title] { cursor: help; }
.ib-evt.on .d, .ib-evt.done .d { background: var(--success); }
.ib-evt.off .d, .ib-evt.urgent .d { background: var(--danger); }
.ib-evt.reply .d { background: var(--warning); }
.ib-evt.attend .d { background: var(--accent); }
.ib-evt.auto { background: transparent; border-style: dashed; color: var(--text-3); }
.ib-evt.auto .d { opacity: .55; }

/* prévia no hover da lista (25/11): 4 últimas mensagens sem abrir a conversa */
.ib-peek { position: fixed; z-index: 60; width: 340px; max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); pointer-events: none; }
.ib-peek-m { max-width: 92%; align-self: flex-start; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.ib-peek-m.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.ib-peek-m.auto { opacity: .65; border-style: dashed; }
.ib-peek-by { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.ib-peek-txt { color: var(--text); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ib-peek-empty { font-size: 12px; color: var(--text-3); }
.ib-peek-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 18px; border-radius: 5px; color: var(--text-3); margin-left: 2px; }
.ib-peek-btn svg { width: 14px; height: 14px; }
.ib-peek-btn:hover { color: var(--accent); background: var(--accent-soft); }
