/* ============================================================================
   wa-mobile.css — Central de atendimento no CELULAR com cara de WhatsApp
   Ativo quando <body class="ct-mobile"> (tela até 767px, página da Central aberta)
   ============================================================================ */
:root { --wa-verde: #008069; --wa-verde2: #00a884; --wa-fundo: #efeae2; --wa-bolha: #d9fdd3; --wa-cinza: #f0f2f5; --wa-texto: #111b21; --wa-sub: #667781; }

/* ── troca rápida Sistema ⇄ Atendimento (topo) e botão flutuante do WhatsApp ── */
.va-troca { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px; margin-right: 12px; }
.va-troca button { border: none; background: none; color: rgba(255,255,255,.85); font-size: .82rem; font-weight: 600; padding: 5px 13px; border-radius: 999px; white-space: nowrap; position: relative; }
.va-troca button.on { background: #fff; color: #111827; }
.va-troca #vaBtnAt.on { background: #25d366; color: #fff; }
.va-badge { display: inline-block; min-width: 18px; margin-left: 6px; background: #ef4444; color: #fff; border-radius: 999px; font-size: .66rem; font-weight: 700; padding: 0 5px; line-height: 18px; text-align: center; }
.va-fab-at { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; border: none; background: #25d366; color: #fff; font-size: 1.6rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 1025; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.va-fab-at:hover { transform: scale(1.06); }
.va-fab-at .va-badge { position: absolute; top: -2px; right: -2px; margin: 0; }
body.va-na-central .va-fab-at { display: none; }
@media (max-width: 991.98px) { .va-troca { margin-right: 6px; } .va-troca button { padding: 5px 10px; font-size: .78rem; } }
@media (max-width: 420px) { .va-troca button span.txt { display: none; } }

/* ── aviso de nova versão ── */
#vaAtuBar { position: fixed; left: 50%; transform: translateX(-50%); top: 12px; z-index: 2100; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); width: 460px;
  background: #111827; color: #fff; border-radius: 14px; padding: 10px 12px 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .86rem; }
#vaAtuBar > i { font-size: 1.3rem; color: #25d366; }
#vaAtuBar .va-atu-notas { font-size: .74rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#vaAtuBar button { border: none; background: #25d366; color: #fff; font-weight: 700; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
#vaAtuBar a { color: #9ca3af; text-decoration: none; padding: 0 4px; }
body.ct-mobile #vaAtuBar { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); }

/* ── botões/elementos que só existem no celular ── */
.wi-mtop, .wi-fab, .wi-mmenu, .ct-bottom, .ct-mais { display: none; }

body.ct-mobile { background: #fff; overscroll-behavior-y: none; }
body.ct-mobile .navbar { display: none !important; }
body.ct-mobile #appContent > .container-fluid { padding: 0 !important; }
body.ct-mobile #ctRoot { margin: 0 !important; display: block; }
body.ct-mobile #ctRoot .ct-lado, body.ct-mobile #ctRoot .ct-topo { display: none !important; }
body.ct-mobile #ctConteudo { height: calc(100dvh - 58px - env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.ct-mobile #ctConteudo > .ct-pagina, body.ct-mobile #ctConteudo > .cfg-card, body.ct-mobile #ctConteudo > .row { border-radius: 0; margin: 0; }

/* barra inferior (como as abas do WhatsApp) */
body.ct-mobile .ct-bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid #e9edef; z-index: 1035; }
.ct-bottom button { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--wa-texto); font-size: .72rem; font-weight: 600; position: relative; }
.ct-bottom button i { font-size: 1.25rem; padding: 2px 18px; border-radius: 999px; }
.ct-bottom button.on i { background: #d8fdd2; color: #15603e; }
.ct-bottom .ct-bcnt { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--wa-verde2); color: #fff; border-radius: 999px; font-size: .62rem; padding: 0 6px; font-weight: 700; }
/* folha "Mais" */
body.ct-mobile .ct-mais.on { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(0,0,0,.35); }
.ct-mais .ct-mais-f { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 0 calc(12px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow-y: auto; }
.ct-mais .ct-mais-f a { display: flex; align-items: center; gap: 14px; padding: 13px 22px; color: var(--wa-texto); text-decoration: none; font-size: .95rem; }
.ct-mais .ct-mais-f a i { font-size: 1.15rem; color: var(--wa-sub); width: 22px; text-align: center; }
.ct-mais .ct-alca { width: 38px; height: 4px; border-radius: 4px; background: #d1d7db; margin: 4px auto 8px; }

/* ── LISTA DE CONVERSAS ── */
body.ct-mobile #inbox-root .wi-wrap { height: calc(100dvh - 58px - env(safe-area-inset-bottom)); border: none; border-radius: 0; }
body.ct-mobile #inbox-root .wi-lista { border-right: none; }
body.ct-mobile .wi-mtop { display: flex; align-items: center; gap: 4px; background: #fff; color: var(--wa-verde); padding: 12px 8px 6px 16px; }
body.ct-mobile .wi-mtop b { font-size: 1.45rem; font-weight: 700; letter-spacing: -.2px; }
body.ct-mobile .wi-mtop button { border: none; background: none; color: var(--wa-texto); font-size: 1.25rem; width: 42px; height: 42px; border-radius: 50%; }
body.ct-mobile .wi-mtop button:active { background: var(--wa-cinza); }
body.ct-mobile .wi-mtop .wi-disp { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; width: auto; height: auto; }
body.ct-mobile #inbox-root .wi-busca { border: none !important; padding: 2px 12px 4px !important; }
body.ct-mobile #inbox-root .wi-busca #wiBusca { background: var(--wa-cinza); border: none; border-radius: 999px; padding: 9px 16px; font-size: .95rem; }
body.ct-mobile #inbox-root .wi-busca #wiBusca + select { display: none; }
body.ct-mobile #inbox-root .wi-lista:not(.filtros-on) .wi-busca .wi-filtros,
body.ct-mobile #inbox-root .wi-lista:not(.filtros-on) .wi-busca .d-flex.gap-1.mt-2 { display: none !important; }
body.ct-mobile #inbox-root .wi-abas { border: none; gap: 8px; padding: 6px 12px 8px; overflow-x: auto; scrollbar-width: none; }
body.ct-mobile #inbox-root .wi-abas::-webkit-scrollbar { display: none; }
body.ct-mobile #inbox-root .wi-abas button { flex: 0 0 auto; border: none; border-radius: 999px; background: var(--wa-cinza); color: #54656f; text-transform: none; font-size: .85rem; font-weight: 600; padding: 6px 14px; }
body.ct-mobile #inbox-root .wi-abas button.on { background: #d8fdd2; color: #15603e; border: none; }
body.ct-mobile #inbox-root .wi-abas .cnt { background: var(--wa-verde2) !important; }
body.ct-mobile #inbox-root .wi-item { padding: 10px 16px; gap: 13px; border: none; align-items: center; }
body.ct-mobile #inbox-root .wi-item > div:last-child { border-bottom: 1px solid #f0f2f5; padding-bottom: 10px; }
body.ct-mobile #inbox-root .wi-item.sel { background: none; border: none; padding-left: 16px; }
body.ct-mobile #inbox-root .wi-item:active { background: var(--wa-cinza); }
body.ct-mobile #inbox-root .wi-av { width: 50px; height: 50px; flex-basis: 50px; font-size: 1.2rem; background: #dfe5e7; color: #fff; background: linear-gradient(135deg, #7fb8a8, #4f9a86); }
body.ct-mobile #inbox-root .wi-nome { font-size: 1.02rem; font-weight: 600; color: var(--wa-texto); }
body.ct-mobile #inbox-root .wi-prev { font-size: .9rem; color: var(--wa-sub); }
body.ct-mobile #inbox-root .wi-badge { background: var(--wa-verde2); min-width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
body.ct-mobile #inbox-root .wi-resp { font-size: .72rem; }
body.ct-mobile .wi-fab { display: flex; position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 16px; border: none;
  background: var(--wa-verde2); color: #fff; font-size: 1.45rem; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 1020; }
body.ct-mobile #inbox-root .wi-wrap.aberta ~ .wi-fab, body.ct-mobile #inbox-root .wi-wrap.aberta .wi-fab { display: none; }

/* ── CONVERSA ABERTA (tela cheia, por cima da barra inferior) ── */
body.ct-mobile #inbox-root .wi-wrap.aberta { position: fixed; inset: 0; z-index: 1036; height: 100dvh; background: var(--wa-fundo); }
body.ct-mobile #inbox-root .wi-wrap.aberta .wi-chat { padding-bottom: env(safe-area-inset-bottom); }
body.ct-mobile #inbox-root .wi-topo { background: var(--wa-verde); color: #fff; padding: 8px 4px 8px 2px; gap: 8px; flex-wrap: nowrap; border: none; min-height: 60px; }
body.ct-mobile #inbox-root .wi-topo > .btn-light { background: none; border: none; color: #fff; font-size: 1.2rem; padding: 4px 6px; }
body.ct-mobile #inbox-root .wi-topo .wi-av { width: 40px; height: 40px; flex-basis: 40px; font-size: 1rem; }
body.ct-mobile #inbox-root .wi-topo .fw-bold { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
body.ct-mobile #inbox-root .wi-topo .small.text-muted { color: rgba(255,255,255,.8) !important; font-size: .76rem; }
body.ct-mobile #inbox-root .wi-topo .wi-tag { display: none; }
body.ct-mobile #inbox-root .wi-topo .ms-auto > :not(.wi-mmenu) { display: none !important; }
body.ct-mobile #inbox-root .wi-mmenu { display: block; }
body.ct-mobile #inbox-root .wi-mmenu > button { background: none; border: none; color: #fff; font-size: 1.3rem; width: 42px; height: 42px; }
body.ct-mobile #inbox-root .wi-mmenu .dropdown-menu { font-size: .95rem; min-width: 220px; }
body.ct-mobile #inbox-root .wi-mmenu .dropdown-item { padding: 10px 16px; }
body.ct-mobile #inbox-root .wi-msgs { padding: 8px 10px; gap: 3px;
  background-color: var(--wa-fundo);
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px), radial-gradient(rgba(0,0,0,.025) 1px, transparent 1px);
  background-size: 22px 22px, 34px 34px; background-position: 0 0, 11px 17px; }
body.ct-mobile #inbox-root .wi-b { max-width: 82%; font-size: .95rem; line-height: 1.32; padding: 6px 8px 4px 9px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; color: var(--wa-texto); }
body.ct-mobile #inbox-root .wi-b.eq { background: var(--wa-bolha); border-top-right-radius: 0; margin-right: 8px; }
body.ct-mobile #inbox-root .wi-b.cli { background: #fff; border-top-left-radius: 0; margin-left: 8px; }
body.ct-mobile #inbox-root .wi-b.eq::after, body.ct-mobile #inbox-root .wi-b.cli::after { content: ''; position: absolute; top: 0; width: 0; height: 0; border-top: 0 solid transparent; }
body.ct-mobile #inbox-root .wi-b.eq::after { right: -8px; border-left: 8px solid var(--wa-bolha); border-bottom: 10px solid transparent; }
body.ct-mobile #inbox-root .wi-b.cli::after { left: -8px; border-right: 8px solid #fff; border-bottom: 10px solid transparent; }
body.ct-mobile #inbox-root .wi-meta { font-size: .68rem; color: var(--wa-sub); margin-top: 1px; }
body.ct-mobile #inbox-root .wi-dia { background: #fff; color: #54656f; font-size: .76rem; box-shadow: 0 1px .5px rgba(11,20,26,.13); border-radius: 8px; padding: 4px 12px; margin: 8px 0; text-transform: uppercase; }
body.ct-mobile #inbox-root .wi-ev { background: #fff7d6; color: #54656f; border-radius: 8px; padding: 3px 10px; font-weight: 500; font-size: .74rem; }
body.ct-mobile #inbox-root .wi-b.nota { background: #fff7d6; }
body.ct-mobile #inbox-root #wiJanela > div { font-size: .8rem; }
/* composer estilo WhatsApp */
body.ct-mobile #inbox-root .wi-modo { background: var(--wa-fundo); border: none !important; padding: 4px 10px 0 !important; }
body.ct-mobile #inbox-root .wi-modo .btn { font-size: .72rem !important; border-radius: 999px; padding: 1px 10px !important; }
body.ct-mobile #inbox-root .wi-env { background: var(--wa-fundo); border: none; padding: 6px 6px 8px; gap: 6px; align-items: flex-end; }
body.ct-mobile #inbox-root .wi-env > .btn-outline-secondary { order: 1; background: #fff; border: none; border-radius: 50%; width: 42px; height: 42px; color: var(--wa-sub); padding: 0; flex: 0 0 42px; }
body.ct-mobile #inbox-root .wi-env > .btn-outline-secondary:first-of-type { display: none; }
body.ct-mobile #inbox-root .wi-env textarea { order: 0; border: none; border-radius: 22px; padding: 11px 16px; font-size: 1rem; min-height: 46px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
body.ct-mobile #inbox-root .wi-env #wiBtnEnv { order: 2; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: var(--wa-verde2); border: none; color: #fff; font-size: 1.15rem; padding: 0; }
body.ct-mobile #inbox-root .wi-env.nota #wiBtnEnv { background: #d97706; }
body.ct-mobile #inbox-root .wi-rapidas { bottom: 60px; }
/* ficha do contato = tela cheia */
body.ct-mobile #inbox-root .wi-ficha { position: fixed; inset: 0; width: 100%; z-index: 1045; background: #fff; box-shadow: none; padding-bottom: env(safe-area-inset-bottom); }

/* ── FUNIL no celular: uma coluna por vez, deslizando ── */
body.ct-mobile .fn-top { padding: 10px 12px 0; }
body.ct-mobile .fn-board { height: calc(100dvh - 58px - 120px); scroll-snap-type: x mandatory; padding: 0 12px 8px; gap: 10px; }
body.ct-mobile .fn-col { flex: 0 0 86vw; scroll-snap-align: center; }
body.ct-mobile .fn-card { font-size: .9rem; padding: 11px 12px; }

/* ── CHAT DA EQUIPE no celular ── */
body.ct-mobile #chat-root .ch-wrap { height: calc(100dvh - 58px - env(safe-area-inset-bottom)) !important; border: none; border-radius: 0; }
body.ct-mobile #chat-root .ch-msgs { background: var(--wa-fundo); }

/* modais ocupando a tela do celular */
@media (max-width: 767.98px) {
  body.ct-mobile [id$="Ov"][style*="position:fixed"] { padding: 0 !important; align-items: flex-end !important; }
  body.ct-mobile [id$="Ov"][style*="position:fixed"] > div { border-radius: 18px 18px 0 0 !important; max-height: 92dvh !important; }
}
/* hora e ✓✓ dentro da bolha, no canto (como no WhatsApp) */
body.ct-mobile #inbox-root .wi-b .wi-meta { float: right; margin: 7px 0 -3px 12px; line-height: 1; }
body.ct-mobile #inbox-root .wi-b::before { content: none; }
