/* Balcão v4: componentes novos que valem para todos os temas (Claro, Escuro e Papel). Usa só os tokens. */

/* barra lateral: menu do usuário, botão Conectar canal e seções */
.lado-topo { display: flex; align-items: center; gap: 2px; }
.lado-topo .marca-topo { flex: 1; min-width: 0; }
.lado-topo .nav-recolher { flex: none; color: var(--texto-2); }
@media (min-width: 768px) { .nav-recolhida .lado-topo { flex-direction: column; gap: var(--e1); } .nav-recolhida .lado-topo .marca-topo { width: 100%; } }
@media (max-width: 1023px) { .lado-topo .nav-recolher { display: none !important; } }
.usuario { border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.usuario > .ic { flex: none; }
.usuario-wrap { min-width: 0; }
.menu-usuario { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); min-width: 220px; }
.menu-temas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 2px var(--e1) var(--e1); }
.menu-temas button { flex-direction: column; height: auto !important; padding: 6px 0 !important; gap: 4px; justify-content: center; align-items: center; font-size: 11.5px !important; border: 1px solid var(--borda) !important; }
.menu-temas button.ativo { border-color: var(--brand-ink) !important; color: var(--texto); background: var(--brand-suave) !important; }
.menu-sep { height: 1px; background: var(--sup-2); margin: var(--e1) calc(var(--e1) * -1); }
.menu a { width: 100%; display: flex; align-items: center; gap: var(--e2); height: 32px; padding: 0 var(--e2); border-radius: var(--r-2); font-size: var(--fs-13); color: var(--texto); text-decoration: none; }
.menu a:hover { background: var(--sup-2); text-decoration: none; }
.nav-conectar .btn { width: 100%; }
.nav-grupo { display: flex; flex-direction: column; gap: 1px; }
.nav-grupo + .nav-grupo { margin-top: var(--e3); }
.nav-grupo-tit { padding: 0 12px 4px; font-size: var(--fs-12); color: var(--texto-2); }

/* Papel: as peças novas seguem a voz editorial do tema */
:root[data-estilo="papel"] .nav-grupo-tit { font-family: var(--fonte-tit); font-style: italic; font-size: var(--fs-13); }
:root[data-estilo="papel"] .nav-conectar .btn .ic { display: none; }
:root[data-estilo="papel"] .usuario { display: flex; align-items: center; gap: var(--e2); padding: var(--e2) var(--e1) 0 var(--e2); }
:root[data-estilo="papel"] .usuario > .ic { display: none; }
@media (min-width: 768px) {
  :root[data-estilo="papel"] .nav-recolhida .nav-grupo-tit { display: none; }
  :root[data-estilo="papel"] .nav-recolhida .nav-conectar .btn > span { display: none; }
  :root[data-estilo="papel"] .nav-recolhida .nav-conectar .btn .ic { display: block; }
  :root[data-estilo="papel"] .nav-recolhida .nav-conectar .btn { padding: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  :root[data-estilo="papel"] .nav-grupo-tit, :root[data-estilo="papel"] .nav-conectar .btn > span { display: none; }
  :root[data-estilo="papel"] .nav-conectar .btn .ic { display: block; }
  :root[data-estilo="papel"] .nav-conectar .btn { padding: 0; }
  :root[data-estilo="papel"] .menu-usuario { right: auto; width: 240px; }
}
:root[data-estilo="papel"] .compor-barra { display: flex; align-items: center; gap: 2px; }
:root[data-estilo="papel"] .compor-ferr { display: flex; align-items: center; gap: 2px; position: relative; }
:root[data-estilo="papel"] .compor-caixa { flex-wrap: wrap; }
:root[data-estilo="papel"] .compor-caixa textarea { flex: 1 1 100%; }
:root[data-estilo="papel"] .compor-barra { flex: 1; justify-content: space-between; }
:root[data-estilo="papel"] .emojis { position: absolute; left: 0; bottom: calc(100% + 8px); display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px; background: var(--fundo); border: 1px solid var(--borda-forte); border-radius: var(--r-3); box-shadow: var(--sombra-3); z-index: 6; }
:root[data-estilo="papel"] .emojis button { width: 32px; height: 32px; border: 0; border-radius: var(--r-2); background: transparent; font-size: 18px; cursor: pointer; }
:root[data-estilo="papel"] .emojis button:hover { background: var(--sup); }

/* primeiros passos (caixa de entrada) */
.onboarding { display: flex; gap: var(--e3); align-items: flex-start; margin: var(--e1) 0 var(--e3); padding: var(--e3); border: 1px solid var(--borda); border-radius: var(--r-3); background: var(--papel); }
.onboarding b { font-size: var(--fs-13); font-weight: 600; }
.onboarding p { margin: 2px 0 var(--e2); line-height: 1.45; }
.onboarding-logo { width: 32px; height: 32px; flex: none; border-radius: var(--r-2); display: flex; align-items: center; justify-content: center; background: var(--sup-2); border: 1px solid var(--borda); }
.onboarding .btn-p { gap: 4px; }

/* conexões */
.pagina-conexoes { max-width: 1040px; }
.cfg-topo { display: flex; align-items: center; gap: var(--e3); margin-bottom: var(--e4); }
.cfg-topo p { margin-top: 2px; }
.canal-escolhas { display: flex; flex-direction: column; gap: var(--e2); }
.canal-escolha { display: flex; align-items: center; gap: var(--e3); width: 100%; padding: var(--e3) var(--e4); border: 1px solid var(--borda); border-radius: var(--r-3); background: var(--papel); color: var(--texto); text-align: left; cursor: pointer; font: inherit;
  transition: border-color var(--dur), background var(--dur); }
.canal-escolha:hover { border-color: var(--brand-borda); background: var(--brand-suave); }
.canal-escolha:focus-visible { box-shadow: var(--foco); }
.canal-escolha-logo { width: 40px; height: 40px; flex: none; border-radius: var(--r-3); display: flex; align-items: center; justify-content: center; background: var(--sup-2); border: 1px solid var(--borda); color: var(--texto-2); }
.canal-escolha-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.canal-escolha-txt b { font-weight: 600; font-size: var(--fs-14); }
.canal-passo { display: flex; gap: var(--e4); align-items: flex-start; }
.canal-passo p { font-size: var(--fs-14); line-height: 1.55; }

/* aparência */
.temas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e3); }
@media (max-width: 900px) { .temas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tema-op { display: flex; flex-direction: column; gap: var(--e2); padding: var(--e2); border: 1px solid var(--borda); border-radius: var(--r-3); background: var(--papel); color: var(--texto); text-align: left; cursor: pointer; font: inherit; transition: border-color var(--dur), box-shadow var(--dur); }
.tema-op:hover { border-color: var(--borda-forte); }
.tema-op.ativo { border-color: var(--brand-ink); box-shadow: 0 0 0 1px var(--brand-ink); }
.tema-op-txt { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 2px; }
.tema-op-txt b { font-weight: 600; font-size: var(--fs-13); }
.tema-previa { display: grid; grid-template-columns: 28% 1fr; height: 76px; border-radius: var(--r-2); overflow: hidden; border: 1px solid var(--tp-borda); background: var(--tp-fundo); }
.tp-lado { background: var(--tp-sup); border-right: 1px solid var(--tp-borda); padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; }
.tp-lado i { display: block; height: 5px; border-radius: 3px; background: var(--tp-linha); }
.tp-lado i:first-child { background: var(--tp-acento); width: 70%; }
.tp-corpo { padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.tp-b { display: block; height: 12px; width: 62%; border-radius: 6px; background: var(--tp-in); }
.tp-out { align-self: flex-end; background: var(--tp-out); width: 54%; }
.tp-curta { width: 38%; }
.tp-claro { --tp-fundo: #ffffff; --tp-sup: #fafafa; --tp-borda: #e8e8ec; --tp-linha: #e4e4e8; --tp-in: #f0f0f2; --tp-out: #e6ecfd; --tp-acento: #2f5bea; }
.tp-escuro { --tp-fundo: #0f0f11; --tp-sup: #17171a; --tp-borda: #26262b; --tp-linha: #2c2c32; --tp-in: #222226; --tp-out: #1f2a4a; --tp-acento: #8aa6ff; }
.tp-papel { --tp-fundo: #f8f6f1; --tp-sup: #efece4; --tp-borda: #dcd7c9; --tp-linha: #ddd7c8; --tp-in: transparent; --tp-out: transparent; --tp-acento: #c86d51; }
.tp-papel .tp-b { height: 10px; border-radius: 0; border-left: 2px solid #c9c1ae; background: repeating-linear-gradient(#d8d1c1 0 2px, transparent 2px 5px); }
.tp-papel .tp-out { border-left-color: #c86d51; }
.tp-sistema { background: linear-gradient(105deg, #ffffff 50%, #0f0f11 50%); --tp-sup: transparent; --tp-borda: #c9c9d0; --tp-linha: #b8b8c0; --tp-in: #9a9aa4; --tp-out: #7f97e8; --tp-acento: #2f5bea; }
.densidades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e3); max-width: 560px; }
.densidades .opcao-card { background: var(--papel); color: var(--texto); font: inherit; text-align: left; }
.densidades .opcao-card > .ic { color: var(--texto-2); margin-top: 1px; }
.acentos { display: flex; flex-wrap: wrap; gap: var(--e3); }
.acento-op { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 88px; text-align: center; padding: var(--e2) 0; border: 0; border-radius: var(--r-3); background: transparent; color: var(--texto); cursor: pointer; font: inherit; }
.acento-op:hover:not(:disabled) { background: var(--hover); }
.acento-op:disabled { opacity: 0.45; cursor: not-allowed; }
.acento-cor { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.acento-op.ativo .acento-cor { box-shadow: 0 0 0 2px var(--fundo), 0 0 0 4px var(--texto); }
@media (max-width: 640px) { .canal-passo { flex-direction: column; } .cfg-topo { flex-wrap: wrap; } }

img.avatar-foto { object-fit: cover; border-radius: 50%; background: var(--sup-2); }
.bolha-audio { display: block; width: min(280px, 100%); height: 36px; }

/* Caixa por número: Todas + uma ficha por conexão (nome, telefone, abertas e não lidas). */
.cx-caixas { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.cx-caixa { flex: 1 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 92px; max-width: 168px; padding: 5px 9px; border: 1px solid var(--borda); border-radius: 10px; background: var(--fundo); color: var(--texto-2); cursor: pointer; text-align: left; font: inherit; }
.cx-caixa:hover { border-color: var(--borda-forte, var(--borda)); color: var(--texto); }
.cx-caixa.ativo { border-color: var(--brand); color: var(--texto); box-shadow: inset 0 0 0 1px var(--brand); }
.cx-caixa:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.cx-caixa-l1 { display: flex; align-items: center; gap: 6px; max-width: 100%; font-size: var(--fs-13); font-weight: 600; }
.cx-caixa-l1 .corta { min-width: 0; }
.cx-caixa-l2 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; color: var(--texto-2); white-space: nowrap; }
.pagina .cx-caixas { margin: 0 0 12px; }
.cx-numero { display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 118px; padding: 0 6px; border: 1px solid var(--borda); border-radius: 999px; color: var(--texto-2); font-size: 11px; white-space: nowrap; }
.cx-numero-cab { color: var(--texto-2); }
.cx-numero-cab > img, .cx-numero-cab > .logo-qr { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.cx-item-l3 .cx-quem { white-space: nowrap; flex: none; }
.aviso-mini { display: block; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--sup-2, var(--fundo)); color: var(--texto-2); text-align: left; }
.logo-qr { position: relative; display: inline-block; flex: none; }
.logo-qr .logo-marca { width: 100%; height: 100%; }
.logo-qr b { position: absolute; right: -4px; bottom: -3px; padding: 0 2px; border-radius: 3px; background: var(--texto); color: var(--fundo); font-size: 7px; line-height: 9px; font-weight: 700; letter-spacing: 0.02em; }

/* Tipos de mensagem do WhatsApp (QR e oficial) */
.bolha-sistema { display: flex; justify-content: center; margin: 6px 0; }
.bolha-sistema > span { display: inline-flex; align-items: center; gap: 6px; max-width: 92%; padding: 2px 10px; border: 1px solid var(--borda); border-radius: 999px; background: var(--sup-2, var(--fundo)); color: var(--texto-2); font-size: 12px; }
.bolha-apagada { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--texto-2); font-style: italic; }
.bolha-apagada-orig { flex-basis: 100%; font-style: normal; text-decoration: line-through; color: var(--texto-2); opacity: 0.75; }
.bolha-desconhecida { color: var(--texto-2); font-style: italic; }
.bolha-desconhecida > .ic { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.bolha-encaminhada { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; font-style: italic; }
.bolha-audio-linha { display: flex; align-items: center; gap: 8px; color: var(--texto-2); }
.bolha-fig { max-width: 140px; background: transparent; }
.bolha-img-link { display: block; }
.bolha-doc { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 320px; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--fundo); color: var(--texto); text-decoration: none; }
.bolha-doc b { display: block; font-weight: 600; font-size: var(--fs-13); }
.bolha-doc:hover { border-color: var(--brand); }
.bolha-midia-off { opacity: 0.7; }
.bolha-contatos { display: flex; flex-direction: column; gap: 6px; }
.bolha-contato { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--borda); border-radius: 10px; background: var(--fundo); min-width: 200px; }
.bolha-enquete { margin: 6px 0 4px; padding-left: 18px; }
.bolha-enquete li { margin: 2px 0; }
.bolha-link { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--texto-2); }
.bloco { display: block; }
