/* Atendimento Oficerto (CRM com WhatsApp). Usa as cores do sistema (variaveis do styles.css). */
.atd-root { --atd-navy: var(--text, #08192f); --atd-teal: var(--cyan, #20d6d2); --atd-verde: var(--green, #45df9b); --atd-amarelo: #f5b937; --atd-vermelho: var(--red, #ff5f86); --atd-linha: var(--line, rgba(9,24,49,.12)); --atd-mudo: var(--muted, #5f7185); --atd-fundo: var(--bg-2, #f6f9fc); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; max-width: 100%; }
.atd-corpo, .atd-funil-topo { min-width: 0; }
.atd-root * { box-sizing: border-box; }
.atd-root button { font: inherit; cursor: pointer; }
.atd-root button:disabled { cursor: not-allowed; opacity: .45; }
.atd-root input, .atd-root select, .atd-root textarea { font: inherit; color: var(--atd-navy); background: #fff; border: 1px solid var(--atd-linha); border-radius: 10px; padding: 8px 10px; width: 100%; min-width: 0; }
.atd-root textarea { resize: vertical; }
.atd-root svg { width: 16px; height: 16px; flex-shrink: 0; }

.atd-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.atd-titulo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atd-titulo h2 { margin: 0; font-size: 22px; color: var(--atd-navy); }
.atd-selo { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.atd-selo.ligado { background: rgba(69,223,155,.16); color: #0b6b43; }
.atd-selo.desligado { background: rgba(255,95,134,.12); color: #b3264b; }
.atd-abas { display: flex; gap: 4px; background: #fff; border: 1px solid var(--atd-linha); border-radius: 12px; padding: 3px; }
.atd-abas button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: 13px; color: var(--atd-mudo); }
.atd-abas button.ativa { background: var(--atd-navy); color: #fff; }
.atd-abas em { font-style: normal; background: var(--atd-teal); color: var(--atd-navy); border-radius: 999px; padding: 0 6px; font-size: 11px; }

.atd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--atd-linha); background: #fff; color: var(--atd-navy); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.atd-btn.primario { background: var(--atd-navy); color: #fff; border-color: var(--atd-navy); }
.atd-btn.fantasma { background: transparent; }
.atd-btn.alerta, .atd-btn-icone.alerta { border-color: var(--atd-vermelho); color: #b3264b; }
.atd-btn.mini { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.atd-btn-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--atd-linha); border-radius: 10px; background: #fff; color: var(--atd-navy); }
.atd-btn-icone.ativo { border-color: var(--atd-teal); color: #0a8f8c; }
.atd-link { border: 0; background: none; color: #1f6fe0; padding: 2px 0; font-size: 12px; font-weight: 700; text-align: left; }
.atd-mudo { color: var(--atd-mudo); font-size: 12px; }
.atd-aviso { border-radius: 12px; padding: 10px 14px; font-size: 13px; background: #fff; border: 1px solid var(--atd-linha); }
.atd-aviso.erro, .atd-vazio.erro, .erro { color: #b3264b; }
.atd-aviso.erro { border-color: rgba(255,95,134,.4); background: rgba(255,95,134,.06); }
.atd-aviso.ok { border-color: rgba(69,223,155,.5); background: rgba(69,223,155,.08); color: #0b6b43; }
.atd-carregando { padding: 30px; text-align: center; color: var(--atd-mudo); }
.atd-busca { display: flex; align-items: center; gap: 6px; border: 1px solid var(--atd-linha); border-radius: 10px; padding: 0 10px; background: #fff; flex: 1; min-width: 0; }
.atd-busca input { border: 0; padding: 9px 0; outline: none; }
.atd-busca.largo { margin: 10px 0 6px; }
.atd-check { display: inline-flex !important; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.atd-check input { width: auto; }
.atd-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.atd-rotulo { margin-top: 16px; margin-bottom: 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--atd-mudo); }

/* caixa de conversas */
.atd-caixa { display: grid; grid-template-columns: 340px minmax(0, 1fr) 290px; height: calc(100vh - 190px); min-height: 480px; border: 1px solid var(--atd-linha); border-radius: 16px; overflow: hidden; background: #fff; }
.atd-lista { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--atd-linha); }
.atd-lista-topo { display: flex; gap: 6px; padding: 10px 10px 6px; }
.atd-nova { display: grid; gap: 6px; padding: 0 10px 8px; }
.atd-filtros { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 10px 6px; }
.atd-filtros button { border: 0; background: transparent; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--atd-mudo); }
.atd-filtros button.ativo { background: var(--atd-navy); color: #fff; }
.atd-funil-filtro { margin: 0 10px 8px; width: calc(100% - 20px) !important; font-size: 12px !important; padding: 6px 8px !important; }
.atd-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% - 20px); margin: 0 10px 8px; border: 0; border-radius: 12px; background: var(--atd-navy); color: #fff; padding: 9px 12px; text-align: left; font-size: 13px; }
.atd-fila b { color: var(--atd-teal); }
.atd-fila em { font-style: normal; background: var(--atd-teal); color: var(--atd-navy); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.atd-livres { margin: 0 10px 8px; background: rgba(32,214,210,.1); border-radius: 12px; padding: 8px; }
.atd-livres-topo { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; color: var(--atd-navy); }
.atd-livre { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 10px; padding: 6px 8px; margin-top: 4px; }
.atd-livre-info { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; }
.atd-livre-info b, .atd-livre-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.atd-livre-info span { color: var(--atd-mudo); font-size: 11px; }
.atd-livre-tempo { font-size: 11px; font-weight: 800; color: #b3264b; white-space: nowrap; }
.atd-itens { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; border-top: 1px solid var(--atd-linha); }
.atd-vazio { padding: 26px; text-align: center; color: var(--atd-mudo); font-size: 13px; }
.atd-item { display: flex; gap: 10px; width: 100%; border: 0; border-bottom: 1px solid var(--atd-linha); background: #fff; padding: 10px 12px; text-align: left; }
.atd-item:hover { background: var(--atd-fundo); }
.atd-item.sel { background: rgba(32,214,210,.12); }
.atd-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--atd-navy); color: var(--atd-teal); font-weight: 800; font-size: 14px; flex-shrink: 0; }
.atd-avatar.ok { background: var(--atd-teal); color: var(--atd-navy); }
.atd-avatar.atencao { background: var(--atd-amarelo); color: var(--atd-navy); }
.atd-avatar.atrasado { background: var(--atd-vermelho); color: #fff; }
.atd-item-meio { flex: 1; min-width: 0; display: grid; gap: 2px; }
.atd-item-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.atd-item-linha b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--atd-navy); }
.atd-item-linha b.forte { font-weight: 800; }
.atd-item-linha small { color: var(--atd-mudo); font-size: 11px; white-space: nowrap; }
.atd-previa { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--atd-mudo); font-size: 13px; }
.atd-bolha { font-style: normal; background: var(--atd-teal); color: var(--atd-navy); border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 800; }
.atd-item-tags { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--atd-mudo); }
.atd-sem-dono { color: #b3264b; font-weight: 700; }
.atd-espera { font-weight: 800; }
.atd-espera.ok { color: #0a8f8c; } .atd-espera.atencao { color: #a86b00; } .atd-espera.atrasado { color: #b3264b; }
.atd-tag-cinza { background: var(--atd-fundo); border-radius: 4px; padding: 0 4px; font-weight: 700; }

.atd-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.atd-chat-vazio { display: grid; place-items: center; align-content: center; gap: 8px; flex: 1; color: var(--atd-mudo); text-align: center; padding: 30px; }
.atd-chat-vazio svg { width: 36px; height: 36px; opacity: .4; }
.atd-chat-topo { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--atd-linha); }
.atd-chat-nome { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.atd-chat-nome b { font-size: 15px; color: var(--atd-navy); }
.atd-chat-nome span { margin-left: 8px; color: var(--atd-mudo); font-size: 13px; }
.atd-janela { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.atd-janela.aberta { background: rgba(32,214,210,.18); color: var(--atd-navy); }
.atd-janela.fechada { background: rgba(255,95,134,.12); color: #b3264b; }
.atd-voltar { display: none; border: 0; background: none; color: var(--atd-mudo); align-items: center; gap: 4px; font-size: 12px; }
.atd-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; background: var(--atd-fundo); }
.atd-anteriores { display: block; margin: 0 auto 10px; border: 0; background: none; color: #1f6fe0; font-size: 12px; font-weight: 700; }
.atd-dia { text-align: center; margin: 12px 0 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--atd-mudo); }
.atd-msg { display: flex; margin-bottom: 6px; }
.atd-msg.env { justify-content: flex-end; }
.atd-balao { max-width: min(82%, 560px); border-radius: 16px; padding: 9px 12px; font-size: 15px; line-height: 1.4; box-shadow: 0 1px 2px rgba(9,24,49,.08); background: #fff; color: var(--atd-navy); border-bottom-left-radius: 4px; overflow-wrap: anywhere; }
.atd-msg.env .atd-balao { background: var(--atd-navy); color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.atd-msg.env .atd-balao a { color: var(--atd-teal); }
.atd-msg.falhou .atd-balao { outline: 2px solid var(--atd-vermelho); }
.atd-texto { white-space: pre-wrap; }
.atd-meta { margin-top: 3px; text-align: right; font-size: 11px; opacity: .65; }
.atd-st { margin-left: 4px; }
.atd-st.lida { color: var(--atd-teal); opacity: 1; font-weight: 800; }
.atd-st.falhou { color: var(--atd-vermelho); font-weight: 800; }
.atd-falhou { display: block; margin-top: 4px; color: #ffb3c5; font-size: 11px; }
.atd-msg.rec .atd-falhou { color: #b3264b; }
.atd-img { display: block; max-width: 100%; max-height: 300px; border-radius: 10px; margin-bottom: 4px; cursor: zoom-in; }
.atd-img.sticker { width: 120px; height: 120px; object-fit: contain; }
.atd-video { display: block; max-width: 100%; max-height: 300px; border-radius: 10px; margin-bottom: 4px; }
.atd-balao audio { display: block; width: 240px; max-width: 100%; margin-bottom: 4px; }
.atd-doc { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 8px 10px; background: rgba(9,24,49,.06); color: inherit; text-decoration: none; margin-bottom: 4px; font-size: 13px; }
.atd-msg.env .atd-doc { background: rgba(255,255,255,.12); }
.atd-tipo { opacity: .65; font-size: 12px; }
.atd-anuncio { display: block; overflow: hidden; border-radius: 12px; border: 1px solid var(--atd-linha); margin-bottom: 6px; text-decoration: none; color: inherit; background: rgba(9,24,49,.03); }
.atd-anuncio img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.atd-anuncio span { display: grid; gap: 2px; padding: 8px 10px; }
.atd-anuncio small { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #1f6fe0; }
.atd-anuncio em { font-style: normal; font-size: 12px; opacity: .8; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.atd-faixa { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 14px; border-top: 1px solid var(--atd-linha); font-size: 12px; background: var(--atd-fundo); color: var(--atd-navy); }
.atd-faixa.verde { background: rgba(32,214,210,.12); }
.atd-faixa.erro { background: rgba(255,95,134,.08); color: #b3264b; }
.atd-faixa.gravando { background: rgba(255,95,134,.1); color: #b3264b; font-weight: 700; }
.atd-faixa span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.atd-pulso { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--atd-vermelho); animation: atd-pulso 1s infinite; }
@keyframes atd-pulso { 50% { opacity: .3; } }
.atd-painel-extra { max-height: 220px; overflow-y: auto; border-top: 1px solid var(--atd-linha); padding: 8px 14px; background: #fff; }
.atd-painel-extra-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13px; }
.atd-painel-extra-topo span { display: flex; gap: 12px; }
.atd-modelo { display: grid; gap: 2px; width: 100%; border: 0; border-radius: 10px; background: none; padding: 7px 8px; text-align: left; font-size: 13px; }
.atd-modelo:hover { background: var(--atd-fundo); }
.atd-modelo span { color: var(--atd-mudo); font-size: 12px; white-space: pre-wrap; }
.atd-modelo small { color: var(--atd-mudo); }
.atd-compor { border-top: 1px solid var(--atd-linha); padding: 10px 12px; background: #fff; }
.atd-compor textarea { min-height: 64px; max-height: 220px; font-size: 16px; line-height: 1.4; padding: 10px 12px; }
.atd-compor textarea:disabled { background: var(--atd-fundo); }
.atd-compor-acoes { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.atd-dica { flex: 1; min-width: 0; font-size: 11px; color: var(--atd-mudo); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.atd-compor-acoes .atd-btn.primario { margin-left: auto; padding: 9px 20px; }

.atd-cliente { min-height: 0; overflow-y: auto; border-left: 1px solid var(--atd-linha); padding: 14px; font-size: 13px; }
.atd-cliente-nome input { border: 1px solid transparent; padding: 2px 4px; margin-left: -4px; font-size: 17px; font-weight: 800; background: transparent; }
.atd-cliente-nome input:hover, .atd-cliente-nome input:focus { border-color: var(--atd-linha); background: #fff; }
.atd-cliente select { font-size: 12px; padding: 6px 8px; }
.atd-cliente .atd-linha select { flex: 1; width: auto; }
.atd-fim { margin-top: 18px; }
.atd-fim select { width: auto; }
.atd-outros { margin-top: 8px; }
.atd-outros summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--atd-mudo); }
.atd-outros .atd-link { display: block; }
.atd-campos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
.atd-campos dt { font-size: 11px; color: var(--atd-mudo); margin-top: 6px; }
.atd-campos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* imagem ampliada */
.atd-lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; background: rgba(5,15,30,.86); cursor: zoom-out; }
.atd-lightbox img { max-width: 94vw; max-height: 80vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.atd-lightbox-acoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; cursor: default; }

/* funil (quadro) */
.atd-funil-topo { display: grid; gap: 10px; }
.atd-funis { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.atd-funis button { border: 1px solid var(--atd-linha); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 12px; white-space: nowrap; color: var(--atd-navy); }
.atd-funis button.ativo { background: var(--atd-navy); color: #fff; border-color: var(--atd-navy); }
.atd-funil-ferramentas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.atd-funil-ferramentas .atd-busca { max-width: 360px; }
.atd-quadro { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; min-height: 420px; }
.atd-coluna { flex: 0 0 272px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 300px; background: var(--atd-fundo); border-radius: 14px; border-top: 4px solid var(--atd-cor, var(--atd-teal)); }
.atd-coluna.tipo-ganho { border-top-color: var(--atd-verde); }
.atd-coluna.tipo-perdido { border-top-color: var(--atd-vermelho); }
.atd-coluna.alvo { outline: 2px dashed var(--atd-teal); }
.atd-coluna header { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; font-size: 12px; }
.atd-coluna header b { color: var(--atd-navy); }
.atd-coluna header span { color: var(--atd-mudo); white-space: nowrap; }
.atd-cards { display: grid; align-content: start; gap: 8px; padding: 4px 8px 10px; overflow-y: auto; }
.atd-card { background: #fff; border: 1px solid var(--atd-linha); border-radius: 12px; padding: 10px; font-size: 12px; cursor: pointer; }
.atd-card:hover { border-color: var(--atd-teal); }
.atd-card.arrastando { opacity: .5; }
.atd-card.esperando { border-left: 4px solid var(--atd-teal); }
.atd-card.esperando.atencao { border-left-color: var(--atd-amarelo); }
.atd-card.esperando.atrasado { border-left-color: var(--atd-vermelho); }
.atd-card-topo { display: flex; justify-content: space-between; gap: 6px; }
.atd-card-topo b { font-size: 14px; color: var(--atd-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-card-wa { position: relative; color: #b8c2cc; }
.atd-card-wa.aberta { color: #0a8f8c; }
.atd-card-wa em { position: absolute; top: -7px; right: -8px; font-style: normal; background: var(--atd-vermelho); color: #fff; border-radius: 999px; padding: 0 4px; font-size: 9px; font-weight: 800; }
.atd-card-sub, .atd-card-msg { color: var(--atd-mudo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.atd-card-msg { color: #3d4f63; }
.atd-card-rodape { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; color: var(--atd-mudo); font-size: 11px; }

/* gaveta do lead */
.atd-drawer-fundo { position: fixed; inset: 0; z-index: 80; background: rgba(5,15,30,.35); }
.atd-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(460px, 100vw); overflow-y: auto; background: #fff; box-shadow: -20px 0 50px rgba(9,24,49,.18); padding: 18px; }
.atd-lead header { display: flex; justify-content: space-between; gap: 10px; }
.atd-lead h3, .atd-form h3 { margin: 0 0 4px; font-size: 19px; color: var(--atd-navy); }
.atd-lead-acoes { margin: 12px 0 4px; }
.atd-lead label, .atd-form label { display: grid; gap: 4px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--atd-mudo); }
.atd-eventos { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.atd-eventos li { border-left: 2px solid var(--atd-linha); padding-left: 8px; }
.atd-eventos small { display: block; color: var(--atd-mudo); font-size: 11px; }
.atd-form .atd-linha { margin-top: 14px; }

/* configuracoes */
.atd-config { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); align-items: start; }
.atd-cartao { background: #fff; border: 1px solid var(--atd-linha); border-radius: 16px; padding: 16px; min-width: 0; }
.atd-cartao h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; color: var(--atd-navy); }
.atd-ok { color: #0b6b43; font-weight: 800; }
.atd-falta { color: #b3264b; font-weight: 800; }
.atd-webhook { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--atd-fundo); font-size: 12px; }
.atd-webhook span { display: block; color: var(--atd-mudo); font-weight: 700; }
.atd-webhook code { display: block; overflow-wrap: anywhere; font-size: 12px; user-select: all; }
.atd-tabela { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.atd-tabela th { text-align: left; font-size: 11px; color: var(--atd-mudo); padding: 4px; }
.atd-tabela td { padding: 4px; border-top: 1px solid var(--atd-linha); overflow-wrap: anywhere; }
.atd-usuarios { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.atd-usuarios li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--atd-fundo); }
.atd-usuarios small { color: var(--atd-mudo); }
.atd-log { max-height: 240px; overflow: auto; margin: 10px 0 0; padding: 10px; border-radius: 10px; background: var(--atd-fundo); font-size: 12px; white-space: pre-wrap; }
.atd-log:empty { display: none; }

/* celular: uma coluna por vez */
@media (max-width: 1100px) {
  .atd-caixa { grid-template-columns: 300px minmax(0, 1fr); }
  .atd-cliente { display: none; }
  .atd-caixa.painel-cliente { grid-template-columns: minmax(0, 1fr); }
  .atd-caixa.painel-cliente .atd-lista, .atd-caixa.painel-cliente .atd-chat { display: none; }
  .atd-caixa.painel-cliente .atd-cliente { display: block; border-left: 0; }
  .atd-voltar { display: inline-flex; }
  .atd-voltar[data-atd-painel="lista"] { display: none; }
}
@media (max-width: 760px) {
  .atd-caixa { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 150px); border-radius: 12px; }
  .atd-caixa.painel-lista .atd-chat, .atd-caixa.painel-chat .atd-lista { display: none; }
  .atd-caixa.painel-lista .atd-lista { border-right: 0; }
  .atd-voltar[data-atd-painel="lista"] { display: inline-flex; }
  .atd-dica, .atd-compor-acoes .atd-btn span { display: none; }
  .atd-compor-acoes .atd-btn.primario span { display: inline; }
  .atd-chat-nome span { display: none; }
  .atd-balao { max-width: 88%; }
  .atd-coluna { flex-basis: 84vw; }
  .atd-abas button { padding: 7px 9px; font-size: 12px; }
}
@media (min-width: 1101px) { .so-celular { display: none !important; } }
.atd-tabela .atd-link { white-space: nowrap; }
.atd-form label input, .atd-form label select, .atd-form label textarea, .atd-lead label input, .atd-lead label select, .atd-lead label textarea { font-weight: 500; }

/* ---------- Funil e ficha do lead no mesmo jeito da Nexa (24/09/2026) ---------- */
.atd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.atd-chips button { border: 1px solid var(--atd-linha); background: #fff; color: var(--atd-mudo); border-radius: 999px; padding: 5px 12px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.atd-chips button:hover { border-color: var(--atd-teal); }
.atd-chips button.ativo { background: var(--atd-navy); border-color: var(--atd-navy); color: #fff; }
.atd-quadro { gap: 14px; scroll-snap-type: x mandatory; }
.atd-coluna { flex: 0 0 264px; scroll-snap-align: start; background: transparent; border-radius: 0; border-top: 0; max-height: none; min-height: 0; }
.atd-coluna header { align-items: baseline; padding: 0 4px 8px; margin-bottom: 8px; border-bottom: 1px solid var(--atd-linha); font-size: 13px; }
.atd-coluna header b { font-weight: 700; }
.atd-coluna header span { font-size: 12px; }
.atd-coluna.tipo-ganho header { border-bottom-color: var(--atd-verde); }
.atd-coluna.tipo-perdido header { border-bottom-color: var(--atd-vermelho); }
.atd-coluna.alvo { outline-offset: 4px; border-radius: 12px; }
.atd-cards { padding: 0 4px 10px 0; gap: 8px; max-height: calc(100vh - 290px); }
.atd-col-vazia { padding: 6px 4px; }
.atd-card { border-radius: 14px; padding: 12px; font-size: 13px; transition: border-color .12s; }
.atd-card-topo { align-items: flex-start; }
.atd-card-nome { min-width: 0; display: grid; }
.atd-card-nome b { font-size: 15px; font-weight: 700; color: var(--atd-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-card-nome small { font-size: 12px; color: var(--atd-mudo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-card-msg { margin-top: 6px; font-size: 12px; }
.atd-card-rodape { align-items: center; font-size: 12px; }
.atd-card-quem { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-card-rodape > span:last-child, .atd-card-rodape > b:last-child { white-space: nowrap; }
.atd-card.livre { cursor: default; }
.atd-card.livre:hover { border-color: var(--atd-linha); }
.atd-card.livre.vez { border: 2px solid var(--atd-teal); }
.atd-na-fila { border-radius: 8px; background: var(--atd-fundo); padding: 4px 8px; font-weight: 700; color: var(--atd-mudo); }

.atd-ficha { display: grid; gap: 12px; min-width: 0; }
.atd-ficha-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.atd-ficha-etapa { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800; background: rgba(32,214,210,.18); color: var(--atd-navy); }
.atd-ficha-etapa.tipo-ganho { background: var(--atd-navy); color: #fff; }
.atd-ficha-etapa.tipo-perdido { background: var(--atd-fundo); color: var(--atd-mudo); }
.atd-ficha-grade { display: grid; gap: 12px; align-items: start; grid-template-columns: minmax(0, 1fr) 300px 300px; }
.atd-ficha-chat { height: calc(100vh - 175px); min-height: 520px; background: #fff; border: 1px solid var(--atd-linha); border-radius: 16px; overflow: hidden; position: sticky; top: 12px; }
.atd-ficha-chat .atd-voltar { display: none !important; }
.atd-ficha-col { display: grid; gap: 12px; min-width: 0; }
.atd-ficha-col .atd-cartao { padding: 14px; }
.atd-ficha-col .atd-cartao h3 { font-size: 15px; margin-bottom: 8px; }
.atd-ficha-col .atd-cartao h3 small { font-weight: 500; color: var(--atd-mudo); font-size: 13px; }
.atd-ficha-form { display: grid; gap: 8px; }
.atd-ficha-form label { display: grid; gap: 2px; font-size: 11px; font-weight: 600; color: var(--atd-mudo); }
.atd-ficha-form input, .atd-ficha-form select { font-size: 14px; font-weight: 500; }
.atd-btn.largo { width: 100%; }
.atd-ficha-form .atd-btn.primario { background: var(--atd-teal); border-color: var(--atd-teal); color: var(--atd-navy); }
.atd-ficha-col textarea { font-size: 14px; margin-bottom: 8px; }
.atd-info { display: grid; gap: 4px; margin: 12px 0 0; font-size: 12px; }
.atd-info div { display: flex; justify-content: space-between; gap: 10px; }
.atd-info dt { color: var(--atd-mudo); white-space: nowrap; }
.atd-info dd { margin: 0; font-weight: 700; color: var(--atd-navy); text-align: right; overflow-wrap: anywhere; }
.atd-fechar { margin-top: 10px; }
.atd-fechar summary { cursor: pointer; font-size: 12px; color: var(--atd-mudo); }
.atd-fechar .atd-linha { margin-top: 8px; }
.atd-btn.ganho { border-color: var(--atd-verde); color: #0b6b43; }
.atd-btn.perdido { border-color: var(--atd-vermelho); color: #b3264b; }
.atd-tempo { max-height: 320px; overflow-y: auto; margin: 0; }
@media (max-width: 1280px) {
  .atd-ficha-grade { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .atd-ficha-chat { grid-column: 1 / -1; position: static; height: 70vh; }
}
@media (max-width: 760px) {
  .atd-ficha-grade { grid-template-columns: minmax(0, 1fr); }
  .atd-ficha-chat { height: calc(100dvh - 170px); min-height: 420px; }
  .atd-coluna { flex-basis: 86vw; }
  .atd-cards { max-height: none; }
}

/* ---------- Funil: colunas com largura fixa (24/09/2026) ----------
   O texto longo de um card nao estica mais a coluna: o card corta com reticencias. */
.atd-coluna { min-width: 0; }
.atd-cards { grid-template-columns: minmax(0, 1fr); }
.atd-card { min-width: 0; overflow: hidden; }

/* ---------- Modo so assistir (observador do atendimento, 24/09/2026) ----------
   Ve funil, leads e conversas; nao escreve, nao move card e nao edita nada. */
.atd-somente-leitura .atd-compor-acoes,
.atd-somente-leitura [data-atd-nova-toggle],
.atd-somente-leitura [data-atd-novo-lead],
.atd-somente-leitura [data-atd-novo-lead-funil],
.atd-somente-leitura [data-atd-acao],
.atd-somente-leitura [data-atd-acao-cli],
.atd-somente-leitura [data-atd-transferir],
.atd-somente-leitura [data-atd-ficha-conversa],
.atd-somente-leitura [data-atd-salvar-notas],
.atd-somente-leitura [data-atd-ligar],
.atd-somente-leitura .atd-ficha-form button { display: none !important; }
.atd-somente-leitura [data-atd-nome],
.atd-somente-leitura [data-atd-notas],
.atd-somente-leitura [data-atd-ficha-notas],
.atd-somente-leitura [data-atd-etapa],
.atd-somente-leitura [data-atd-etiqueta],
.atd-somente-leitura [data-atd-lead-etapa],
.atd-somente-leitura [data-atd-lead-resp],
.atd-somente-leitura .atd-ficha-form { pointer-events: none; }
.atd-somente-leitura .atd-compor textarea { background: #f3f5f8; }

/* ---------- Funil de atendimento: respiro, colunas, trava e tarefas (25/09/2026) ----------
   Colunas: o card nao encolhe mais quando a coluna tem muitos atendimentos (a coluna rola). */
[data-view-panel="atendimento"] .atd-root { padding: 20px clamp(16px, 2.2vw, 28px) 28px; }
.atd-cards { grid-auto-rows: max-content; }
.atd-card { flex-shrink: 0; }
.atd-card.pendente { border-color: rgba(71, 193, 176, 0.85); box-shadow: 0 0 0 3px rgba(71, 193, 176, 0.18); }
.atd-card.bloqueado { opacity: 0.5; cursor: not-allowed; }
.atd-card.bloqueado:hover { border-color: var(--atd-linha); }
.atd-card-tarefa { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 9px; border-radius: 999px; background: #EEF1F8; color: #304EA9; font-size: 11.5px; font-weight: 600; }
.atd-card-tarefa svg { width: 13px; height: 13px; }
.atd-card-tarefa.vencida { background: #FDECEE; color: #B42335; }

.atd-pend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: #FFF6E5; border: 1px solid rgba(217, 154, 22, 0.35); }
.atd-pend.trava { background: #FDECEE; border-color: rgba(217, 75, 95, 0.35); }
.atd-pend-info { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.atd-pend-icone { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #D94B5F; color: #fff; flex: 0 0 auto; animation: atd-pulsar 1.6s ease-in-out infinite; }
.atd-pend:not(.trava) .atd-pend-icone { background: #D99A16; animation: none; }
.atd-pend-icone svg { width: 18px; height: 18px; }
.atd-pend-info b { display: block; color: #1A2444; font-size: 14px; }
.atd-pend-info small { color: #5A6178; font-size: 12.5px; }
.atd-pend-lista { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
.atd-root .atd-pend-lista button { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(26, 36, 68, 0.14); background: #fff; font-size: 12.5px; color: #1A2444; }
.atd-root .atd-pend-lista button:hover { border-color: #47C1B0; }
.atd-pend-lista button span { color: #B42335; font-weight: 600; font-size: 11.5px; }
.atd-pend-mais { align-self: center; font-size: 12px; color: #5A6178; font-weight: 600; }
.atd-pend > .atd-btn { margin-left: auto; }
.atd-prox { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: #EEF1F8; color: #304EA9; font-size: 13px; }
.atd-prox b { color: #1A2444; }
@keyframes atd-pulsar { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 75, 95, 0.45); } 50% { box-shadow: 0 0 0 7px rgba(217, 75, 95, 0); } }

.atd-barra-tarefa, .atd-barra-trava { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; font-size: 13px; color: #1A2444; }
.atd-barra-tarefa { background: #EEF1F8; border: 1px solid rgba(48, 78, 169, 0.3); }
.atd-barra-tarefa > svg { color: #304EA9; }
.atd-barra-trava { background: #FDECEE; border: 1px solid rgba(217, 75, 95, 0.3); }
.atd-barra-trava > svg { color: #D94B5F; }
.atd-barra-acoes { margin-left: auto; display: inline-flex; gap: 6px; }
.atd-barra-trava > .atd-btn { margin-left: auto; }
.atd-ficha-bloqueada .atd-ficha-col form, .atd-ficha-bloqueada .atd-ficha-col [data-atd-salvar-notas], .atd-ficha-bloqueada .atd-ficha-col [data-atd-fechar-etapa], .atd-ficha-bloqueada .atd-ficha-col [data-atd-t-ok], .atd-ficha-bloqueada .atd-ficha-col [data-atd-t-reag] { pointer-events: none; opacity: 0.5; }
.atd-faixa.aguardando { background: #FFF6E5; border-color: rgba(217, 154, 22, 0.35); }

.atd-tarefas h3 small { font-weight: 500; }
.atd-tarefas-lista { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.atd-tarefas-lista li { display: grid; gap: 8px; padding: 10px; border-radius: 12px; border: 1px solid var(--atd-linha); background: #fff; }
.atd-tarefas-lista li.atd-tarefa-vazia { border: 0; padding: 0; background: none; }
.atd-tarefas-lista li.vencida { border-color: rgba(217, 75, 95, 0.45); background: #FFF8F9; }
.atd-tarefas-lista li b { display: block; font-size: 13.5px; color: var(--atd-navy); }
.atd-tarefas-lista li small { display: inline-flex; align-items: center; gap: 5px; color: var(--atd-mudo); font-size: 12px; }
.atd-tarefas-lista li.vencida small { color: #B42335; font-weight: 600; }
.atd-tarefas-lista li small svg { width: 13px; height: 13px; }
.atd-tarefas-lista li > span { display: flex; gap: 6px; justify-content: flex-end; }
.atd-tarefa-quando { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.atd-tarefas-feitas { margin-top: 10px; font-size: 12.5px; color: var(--atd-mudo); }
.atd-tarefas-feitas summary { cursor: pointer; }
.atd-tarefas-feitas ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.atd-tarefas-feitas li { padding: 8px 10px; border-radius: 10px; background: var(--atd-fundo); }
.atd-tarefas-feitas li b { text-decoration: line-through; color: var(--atd-mudo); font-weight: 600; }

/* janela de aviso e de tarefa: fica fora do .atd-root, por isso tem estilo proprio */
.atd-modal-fundo { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; background: rgba(20, 28, 54, 0.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.atd-modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 30px 60px -20px rgba(4, 6, 6, 0.5); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: #1A2444; }
.atd-modal * { box-sizing: border-box; }
.atd-modal-cabeca { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.atd-modal-cabeca > svg { width: 22px; height: 22px; flex: 0 0 auto; padding: 9px; box-sizing: content-box; border-radius: 12px; background: #EEF1F8; color: #304EA9; }
.atd-modal-cabeca.aviso > svg { background: #FDECEE; color: #D94B5F; }
.atd-modal-cabeca.ok > svg { background: #47C1B0; color: #1A2444; }
.atd-modal-cabeca small { display: block; color: #5A6178; font-size: 12.5px; font-weight: 600; }
.atd-modal-cabeca h3 { margin: 2px 0 0; font-family: Archivo, Inter, sans-serif; font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; color: #1A2444; }
.atd-modal p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #3C4560; }
.atd-modal p.atd-mudo { color: #5A6178; font-size: 13px; }
.atd-modal .atd-modal-cliente { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #1A2444; }
.atd-modal-cliente svg { width: 16px; height: 16px; color: #5A6178; }
.atd-modal-lista { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.atd-modal-lista button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(26, 36, 68, 0.12); background: #fff; font: inherit; cursor: pointer; color: #1A2444; }
.atd-modal-lista button:hover { border-color: #47C1B0; }
.atd-modal-lista b { font-size: 14px; }
.atd-modal-lista span { grid-column: 1; color: #5A6178; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atd-modal-lista em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; color: #B42335; font-weight: 600; font-size: 12px; }
.atd-modal-acoes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.atd-modal .atd-btn, .atd-flutuante .atd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(26, 36, 68, 0.18); background: #fff; color: #1A2444; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.atd-modal .atd-btn:hover { background: #F8F8FA; }
.atd-modal .atd-btn.primario, .atd-flutuante .atd-btn { background: #47C1B0; border-color: #47C1B0; color: #1A2444; }
.atd-modal .atd-btn.primario:hover { filter: brightness(0.96); background: #47C1B0; }
.atd-modal .atd-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.atd-modal .atd-btn svg { width: 16px; height: 16px; }
.atd-modal-form { display: grid; gap: 10px; }
.atd-modal-form label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: #5A6178; }
.atd-modal-form label span { font-weight: 500; }
.atd-modal-form input, .atd-modal-form textarea { width: 100%; font: 500 14px Inter, system-ui, sans-serif; color: #1A2444; border: 1px solid rgba(26, 36, 68, 0.18); border-radius: 10px; padding: 9px 11px; background: #fff; }
.atd-modal-form input:focus, .atd-modal-form textarea:focus { outline: none; border-color: #47C1B0; box-shadow: 0 0 0 3px rgba(71, 193, 176, 0.22); }
.atd-modal-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.atd-modal .atd-modal-erro { color: #B42335; font-size: 13px; margin: 0; }
.atd-modal .atd-modal-erro:empty { display: none; }

.atd-flutuante { position: fixed; right: 20px; bottom: 20px; z-index: 1900; width: min(340px, calc(100vw - 32px)); background: #1A2444; color: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 24px 48px -16px rgba(4, 6, 6, 0.55); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; animation: atd-subir 0.25s ease-out; }
.atd-flutuante-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.atd-flutuante-topo svg { width: 18px; height: 18px; color: #47C1B0; }
.atd-flutuante-topo small { margin-left: auto; color: rgba(255, 255, 255, 0.65); font-size: 12.5px; }
.atd-flutuante p { margin: 0 0 12px; display: grid; gap: 2px; font-size: 14px; }
.atd-flutuante p span { color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.atd-flutuante .atd-btn { width: 100%; border: 0; }
@keyframes atd-subir { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.atd-somente-leitura [data-atd-form-tarefa], .atd-somente-leitura [data-atd-t-ok], .atd-somente-leitura [data-atd-t-reag], .atd-somente-leitura [data-atd-acao="respondido"] { display: none !important; }
@media (max-width: 720px) {
  .atd-pend > .atd-btn { width: 100%; margin-left: 0; }
  .atd-modal-duplo, .atd-tarefa-quando { grid-template-columns: 1fr; }
}
