/* Ajustes para as telas reais (o estilo.css é o mesmo do protótipo aprovado). */
a.item, a.btn { text-decoration: none; }
a.btn { color: var(--ink); }
.side-foot form, .bottom form { margin: 0; }
.espaco { margin-bottom: 18px; }
.estreito { max-width: 520px; }
.linha { display: flex; gap: 6px; margin: 0; }
.linha input { min-width: 130px; padding: 6px 10px; }
td form { margin: 0; }
.recado { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.recado.ok { background: var(--green-soft); color: var(--green); }
.recado.erro { background: var(--red-soft); color: var(--red); }
.aviso { font-size: 12px; margin-top: 24px; text-align: center; }
.aviso a { color: var(--green); }
.botoes { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.qr { display: block; width: min(280px, 100%); background: #fff; padding: 10px; border-radius: 14px; }

/* Aviso de cobrança, filtros e destaque do vencimento */
.recado.atencao { background: var(--amber-soft); color: var(--amber); }
.aviso-pag { display: block; text-decoration: none; }
.topo { margin-top: 18px; }
.filtros { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filtros > div { flex: 1; min-width: 160px; }
.filtros label { margin-top: 0; }
.proxima { display: flex; flex-direction: column; border-left: 6px solid var(--amber); }
.proxima.vencida { border-left-color: var(--red); }
.proxima b { font-size: 28px; }
.proxima span { color: var(--muted); font-weight: 600; }
td .linha { flex-wrap: wrap; }
textarea { resize: vertical; }

/* Página inicial do gestor */
.secao { margin: 22px 0 12px; }
.banner { margin-bottom: 16px; }
.banner img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 18px; }
.planos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.plano { display: flex; flex-direction: column; align-items: flex-start; }
.plano img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; margin: 8px 0; }
.plano h3 { margin: 8px 0 0; }
.plano p { white-space: pre-line; }
.preco s { display: block; color: var(--muted); font-size: 13px; }
.preco b { font-size: 30px; }
.plano ul { list-style: none; padding: 0; margin: 4px 0 14px; }
.plano li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.plano .btn.wide { margin-top: auto; }
.novidade { padding: 12px 0; border-bottom: 1px solid var(--line); }
.novidade:last-child { border-bottom: 0; }
.novidade h4 { margin: 6px 0 2px; font-size: 15px; }
.novidade p { margin: 0 0 6px; white-space: pre-line; }
.novidade img { display: block; max-width: min(420px, 100%); border-radius: 12px; margin-bottom: 6px; }
.novidade a { color: var(--green); }
.previa { display: block; max-width: 100%; max-height: 360px; border-radius: 14px; margin-bottom: 12px; }
.previa.mini { max-height: 120px; margin-top: 8px; }

/* Tela de entrada: arte à esquerda, login à direita */
.entrada { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); min-height: 100vh; min-height: 100dvh; }
.entrada-arte { position: relative; background: #06180f; overflow: hidden; }
.entrada-arte a { display: contents; }
.entrada-arte img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.entrada-lado { display: grid; place-items: center; padding: 28px 24px; background: var(--card); }
.entrada-form { width: min(400px, 100%); }
.entrada-form h2 { margin: 26px 0 4px; }
.com-botao { display: flex; gap: 8px; }
.com-botao input { flex: 1; min-width: 0; }
.entrada-form label.check { margin-top: 14px; }
.assinatura { text-align: center; margin-top: 28px; font-size: 12px; }

@media (max-width: 860px) {
	.entrada { grid-template-columns: minmax(0, 1fr); }
	.entrada-arte { display: none; }
}
@media (max-width: 760px) {
	.bottom { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(68px, 1fr); overflow-x: auto; }
	.bottom .item { min-width: 0; font-size: 10px; padding: 6px 0; }
	.bottom .item span.lbl { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}

/* Setores e imagem de fundo */
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 6px; padding: 8px 14px; }
legend { font-weight: 600; padding: 0 6px; }
.opcoes { display: flex; flex-wrap: wrap; gap: 0 18px; }
.opcoes label.check { margin: 6px 0; }
.previa-zap { background: var(--chat); border-radius: 14px; padding: 14px; }
.previa-zap .msg { display: inline-block; }
.fundo img { display: block; width: 100%; border-radius: 20px; }
.cols.duas-um { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.duas-um .linha input { flex: 1; }
@media (max-width: 1100px) { .cols.duas-um { grid-template-columns: minmax(0, 1fr); } }

/* Atendimentos */
#view.cheia { display: flex; flex-direction: column; overflow: hidden; }
#view.cheia > .recado { margin: 8px 12px; }
#view.cheia .desk { flex: 1; min-height: 0; height: auto; }
.chat .pe { flex: none; }
.chat-head .acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.composer textarea { flex: 1; border-radius: 18px; max-height: 120px; resize: none; }
.msg.falhou { outline: 2px solid var(--red); }
.msg .anexo { display: block; font-size: 12px; opacity: .75; }
.msgs > * { flex: none; }

.desk .search input { min-width: 0; }
.desk.is-dash .info { display: none; }
.chat-head .iconbtn.finalizar:hover { color: var(--red); border-color: var(--red); }
.row[role=button]:focus-visible { outline: 2px solid var(--green); }
.picklist .note { align-items: center; }
.chipsel label { font-weight: 600; }
/* Janela solta: só a conversa */
body.janela .side, body.janela .top, body.janela .bottom, body.janela .desk .list, body.janela .desk .info, body.janela .desk .rail, body.janela .aviso-pag { display: none !important; }
body.janela .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.janela .desk { grid-template-columns: minmax(0, 1fr) !important; }
body.janela .desk .chat { display: flex; }
body.janela .chat-head .opt, body.janela .chat-head .back { display: none; }

/* Barra do topo */
.top-right .pill.zap { text-decoration: none; color: var(--ink); white-space: nowrap; }
.pill.zap.fora i { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.top-right button.avatar.eu { border: 0; cursor: pointer; }
.pop { max-height: min(70vh, 520px); overflow: auto; }
.pop a.note { text-decoration: none; color: var(--ink); }
.pop .vazio { padding: 0 8px 8px; }
.pop.conta { width: 250px; }
.pop.conta .quem { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop.conta .quem small { display: block; }
.pop form { margin: 0; }
.pop .note { align-items: center; }
.modal-box a.note { text-decoration: none; color: var(--ink); }
@media (max-width: 1100px) { .top-right .support { display: none; } }
@media (max-width: 760px) {
	.top-right .pill.zap { padding: 6px 9px; }
	.top-right .pill.zap span { display: none; }
	.top-right { gap: 6px; }
	.top .title { min-width: 0; }
	.pop { position: fixed; right: 8px; top: 56px; }
}

/* Fotos e arquivos */
.avatar.com-foto { overflow: hidden; }
.avatar.com-foto img { width: 100%; height: 100%; object-fit: cover; }
.midia { display: block; max-width: min(320px, 100%); border-radius: 10px; margin-bottom: 4px; }
video.midia { max-height: 320px; }
.msg a.file, .info a.file { text-decoration: none; color: inherit; }
.file .anexo { display: block; font-size: 12px; opacity: .75; }
.audio .wave { cursor: pointer; min-width: 150px; }
.wave i.tocada { opacity: .9; background: var(--green); }
.audio small { font-size: 11.5px; opacity: .75; }
.previa-envio { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin: 0 auto 8px; }

/* Visualizador de foto, vídeo e PDF */
button.midia, button.file { border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.midia { background: none; }
button.file { padding: 9px 12px; background: rgba(127, 127, 127, .12); width: 100%; }
.visor-caixa { display: flex; flex-direction: column; width: min(1100px, 100%); height: min(92vh, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.visor-topo { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.visor-topo strong { flex: 1; min-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.visor-topo a.btn { text-decoration: none; }
.visor-corpo { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--chat); }
.visor-corpo img, .visor-corpo video { max-width: 100%; max-height: 100%; min-height: 0; }
.visor-corpo { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.visor-corpo iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Foto sempre no mesmo tamanho na conversa; ampliada no visualizador */
button.midia.foto { width: min(260px, 100%); cursor: zoom-in; }
button.midia.foto img { display: block; width: 100%; height: 260px; object-fit: cover; border-radius: 10px; }
button.midia.figurinha img { display: block; width: 130px; height: 130px; object-fit: contain; }
.visor-corpo img.ampliada { cursor: zoom-out; width: 100%; height: 100%; object-fit: contain; }
.msgs { overflow-x: hidden; }
.msg:has(.midia) { max-width: min(320px, 85%); }
.opcoes-aviso { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px; }
.opcoes-aviso label.check { margin: 4px 0 8px; }

/* Horário de atendimento */
table.horas td { padding: 6px 8px; }
table.horas input[type=time] { padding: 6px 8px; min-width: 96px; }
table.horas label.check { margin: 0; white-space: nowrap; }

/* Contatos e retornos */
td .quem { display: flex; gap: 10px; align-items: center; }
.ret-done { opacity: .55; }
.main > .alerts { flex: none; }
.comment .btn { margin-top: 6px; }
body.janela .alerts { display: none; }

/* Formulários que abrem em cascata */
details.abre > summary { cursor: pointer; font-weight: 700; font-size: 16px; color: var(--green); list-style: none; display: flex; align-items: center; }
details.abre > summary::-webkit-details-marker { display: none; }
details.abre > summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); }
details.abre[open] > summary::after { content: "\25B4"; }
details.abre[open] > summary { margin-bottom: 8px; }
td.resposta { white-space: pre-line; max-width: 480px; }
.picklist .note small { display: block; white-space: pre-line; max-height: 3.2em; overflow: hidden; }
.picklist .note .ic { color: var(--green); }
.modal-box a.btn { text-decoration: none; color: var(--ink); }
