/* Assistente do corretor (botão central do app). Usa as variáveis do index.php (--gold, --dark-*). */

/* Botão central da barra inferior */
.nav-assistente { position: relative; }
.nav-assistente-botao {
    width: 54px; height: 54px; margin-top: -26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #e3c25a, var(--gold) 55%, var(--gold-dark));
    color: #111; font-size: 1.5rem;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35), 0 0 0 4px rgba(14, 14, 14, 0.96);
    transition: transform 0.15s;
}
.nav-assistente-botao i { margin: 0 !important; color: #111 !important; transform: none !important; }
.nav-assistente:active .nav-assistente-botao { transform: scale(0.92); }
.nav-assistente span.nav-assistente-rotulo { margin-top: 1px; color: var(--gold); }

/* Tela cheia */
.ast {
    position: fixed; inset: 0; z-index: 1045;
    height: 100vh; height: 100dvh;
    background: var(--dark-bg);
    display: flex; flex-direction: column;
    animation: astEntrar 0.2s ease-out;
}
.ast[hidden] { display: none; }
@keyframes astEntrar { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.ast-topo {
    flex: 0 0 auto;
    padding: calc(10px + var(--safe-top)) 12px 10px;
    display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(12, 12, 12, 0.98);
}
.ast-topo h1 { flex: 1; margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.ast-topo .icon-btn { flex: 0 0 auto; }
.ast-topo .ast-nova { width: auto; padding: 0 12px; border-radius: 19px; font-size: 0.8rem; font-weight: 700; gap: 6px; }

.ast-msgs {
    flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 14px 12px 8px;
    display: flex; flex-direction: column; gap: 10px;
}

.ast-bolha {
    max-width: 86%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 0.95rem; line-height: 1.4;
    word-wrap: break-word; white-space: normal;
    user-select: text;
}
.ast-bolha p { margin: 0 0 6px; }
.ast-bolha p:last-child { margin-bottom: 0; }
.ast-bolha ul { margin: 4px 0; padding-left: 18px; }
.ast-eu { align-self: flex-end; background: rgba(212, 175, 55, 0.18); border: 1px solid rgba(212, 175, 55, 0.4); border-bottom-right-radius: 4px; }
.ast-ia { align-self: flex-start; background: var(--dark-card); border: 1px solid rgba(255, 255, 255, 0.1); border-bottom-left-radius: 4px; }
.ast-erro { align-self: center; max-width: 92%; background: rgba(230, 57, 70, 0.12); border: 1px solid rgba(230, 57, 70, 0.45); color: #ffb3b9; font-size: 0.85rem; text-align: center; }
.ast-erro button { margin-top: 6px; }
.ast-nota { align-self: center; color: #94a3b8; font-size: 0.78rem; text-align: center; }

.ast-digitando { align-self: flex-start; display: flex; gap: 5px; padding: 12px 14px; }
.ast-digitando span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: 0.4; animation: astPonto 1.2s infinite; }
.ast-digitando span:nth-child(2) { animation-delay: 0.2s; }
.ast-digitando span:nth-child(3) { animation-delay: 0.4s; }
@keyframes astPonto { 0%, 60%, 100% { opacity: 0.25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Boas-vindas */
.ast-vazio { margin: auto 0; text-align: center; padding: 10px 8px 20px; color: #cbd5e1; }
.ast-vazio .ast-vazio-icone { font-size: 2.4rem; color: var(--gold); }
.ast-vazio h2 { font-size: 1.15rem; font-weight: 800; color: #fff; margin: 6px 0 4px; }
.ast-vazio p { font-size: 0.88rem; color: #94a3b8; margin: 0 0 14px; }
.ast-sugestoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ast-chip {
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(212, 175, 55, 0.4); color: #f3e5ab;
    border-radius: 18px; padding: 7px 13px; font-size: 0.83rem; font-weight: 600;
}
.ast-chip:active { background: rgba(212, 175, 55, 0.2); }

/* Cartões de imóveis */
.ast-imoveis { align-self: stretch; }
.ast-imoveis-rolagem { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.ast-imovel {
    flex: 0 0 210px; scroll-snap-align: start;
    background: var(--dark-card); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px; overflow: hidden;
    cursor: pointer;
}
.ast-imovel:active { border-color: var(--gold); }
.ast-imovel-foto { height: 118px; background: #222 center/cover no-repeat; position: relative; }
.ast-imovel-cod { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, 0.75); color: var(--gold); font-size: 0.7rem; font-weight: 800; padding: 2px 7px; border-radius: 8px; font-family: monospace; }
.ast-imovel-corpo { padding: 8px 10px 10px; }
.ast-imovel-tipo { font-size: 0.74rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ast-imovel-valor { font-size: 1rem; font-weight: 800; color: #fff; margin: 2px 0 4px; }
.ast-imovel-info { font-size: 0.74rem; color: #cbd5e1; display: flex; gap: 9px; flex-wrap: wrap; }
.ast-imoveis-mais { font-size: 0.76rem; color: #94a3b8; padding: 2px 4px 0; }

/* Ficha de captação */
.ast-ficha {
    align-self: stretch;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(22, 22, 22, 1) 60px);
    border: 1px solid rgba(212, 175, 55, 0.45); border-radius: 14px; padding: 12px;
}
.ast-ficha-topo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--gold); font-size: 0.92rem; }
.ast-ficha-topo .ast-ficha-situacao { margin-left: auto; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.ast-ficha-situacao.ok { background: rgba(46, 196, 182, 0.15); color: #5eead4; }
.ast-ficha-situacao.falta { background: rgba(230, 57, 70, 0.15); color: #ffb3b9; }
.ast-ficha-grupo { margin-top: 10px; }
.ast-ficha-grupo h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: #94a3b8; margin: 0 0 4px; font-weight: 700; }
.ast-ficha-item { display: flex; justify-content: space-between; gap: 10px; font-size: 0.84rem; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
/* Rótulo até ~45% da largura e quebra em linhas; o valor nunca fica espremido numa coluna de uma letra */
.ast-ficha-item > span:first-child { color: #94a3b8; flex: 0 1 auto; max-width: 45%; }
.ast-ficha-item > span:last-child { flex: 1 1 0; min-width: 50%; text-align: right; color: #fff; overflow-wrap: anywhere; user-select: text; }
.ast-ficha-item.padrao span:last-child { color: #94a3b8; font-style: italic; }
.ast-ficha-item .ast-tag { font-size: 0.66rem; color: var(--gold); margin-left: 4px; font-style: normal; }
.ast-ficha-faltam { margin-top: 10px; font-size: 0.8rem; }
.ast-ficha-faltam strong { color: #ffb3b9; }
.ast-ficha-faltam .rec { color: #94a3b8; }
.ast-ficha-acoes { margin-top: 12px; display: flex; gap: 8px; }
.ast-ficha-acoes .btn { flex: 1; font-weight: 800; border-radius: 22px; padding: 9px 12px; }
.ast-ficha.recolhida .ast-ficha-corpo { display: none; }
.ast-ficha.antiga { opacity: 0.55; }
.ast-ficha.antiga .ast-ficha-acoes { display: none; }
.ast-ficha-alternar { background: none; border: 0; color: #94a3b8; font-size: 0.78rem; padding: 0; margin-left: 6px; }

/* Lista de fichas salvas */
.ast-fichas { align-self: stretch; display: flex; flex-direction: column; gap: 6px; }
.ast-fichas-item { display: flex; align-items: center; gap: 10px; background: var(--dark-card); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 8px 10px; }
.ast-fichas-num { flex: 0 0 auto; font-family: monospace; font-weight: 800; color: var(--gold); font-size: 0.8rem; }
.ast-fichas-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ast-fichas-corpo strong { color: #fff; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ast-fichas-corpo small { color: #94a3b8; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ast-fichas-sit { flex: 0 0 auto; font-size: 0.66rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.ast-fichas-sit.assinada { background: rgba(46, 196, 182, 0.15); color: #5eead4; }
.ast-fichas-sit.aberta { background: rgba(212, 175, 55, 0.15); color: var(--gold); }

.ast-salva { align-self: stretch; background: rgba(46, 196, 182, 0.08); border: 1px solid rgba(46, 196, 182, 0.45); border-radius: 14px; padding: 12px; }
.ast-salva-titulo { font-weight: 800; color: #5eead4; margin-bottom: 8px; }
.ast-salva-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.ast-salva-acoes a, .ast-salva-acoes button { flex: 1 1 45%; border-radius: 20px; font-weight: 700; font-size: 0.82rem; }

/* Entrada */
.ast-entrada {
    flex: 0 0 auto;
    padding: 8px 10px calc(10px + var(--safe-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(12, 12, 12, 0.98);
}
.ast-status { min-height: 16px; font-size: 0.74rem; color: #f3e5ab; padding: 0 6px 4px; }
.ast-status.erro { color: #ffb3b9; }
.ast-linha { display: flex; align-items: flex-end; gap: 8px; }
.ast-linha textarea {
    flex: 1; resize: none; max-height: 120px; min-height: 44px;
    background: #111; color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 22px;
    padding: 10px 14px; font-size: 16px; line-height: 1.35;
}
.ast-linha textarea:focus { outline: none; border-color: var(--gold); }
.ast-mic, .ast-enviar {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.ast-mic { background: var(--gold); color: #111; }
.ast-mic.co-voz-gravando { background: #e63946 !important; color: #fff !important; animation: astPulso 1.2s infinite; }
.ast-mic.co-voz-enviando { opacity: 0.6; }
@keyframes astPulso { 0% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.6); } 70% { box-shadow: 0 0 0 12px rgba(230, 57, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); } }
.ast-enviar { background: rgba(255, 255, 255, 0.1); color: var(--gold); }
.ast-enviar:disabled { opacity: 0.4; }

/* Avisos de pendência, demanda e cobrança do dia */
.ast-aviso { color: #fbbf77; font-size: 0.72rem; margin-top: 3px; white-space: normal; }
.ast-fichas-corpo strong .ast-tag { font-size: 0.62rem; color: var(--gold); margin-left: 6px; font-weight: 600; }
.ast-demanda-titulo { color: #fff; font-weight: 700; font-size: 0.92rem; margin-top: 8px; }
.ast-demanda-desc { color: #cbd5e1; font-size: 0.84rem; margin-top: 4px; }
.ast-demanda.antiga .ast-ficha-acoes { display: none; }
.ast-cobranca { border-color: rgba(212, 175, 55, 0.55); }
.ast-sugestoes-esq { justify-content: flex-start; margin-top: 10px; }
.ast-nota-ok { color: #5eead4; }
/* Foto de ficha e Drive */
.ast-foto { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.1); color: var(--gold); font-size: 1.15rem; display: flex; align-items: center; justify-content: center; }
.ast-foto:active { background: rgba(212, 175, 55, 0.25); }
.ast-miniatura { display: block; max-width: 180px; max-height: 220px; border-radius: 10px; margin-bottom: 6px; }
.ast-foto-aviso { font-size: 0.75rem; opacity: 0.8; margin-bottom: 3px; }
.ast-drive a { font-weight: 700; }
/* Leads do Kenlo */
.ast-lead-itens { margin: 8px 0 0; padding-left: 18px; font-size: 0.86rem; }
.ast-lead-acao.antiga .ast-ficha-acoes { display: none; }
.ast-salva-erro { background: rgba(230, 57, 70, 0.08); border-color: rgba(230, 57, 70, 0.45); }
.ast-salva-erro .ast-salva-titulo { color: #ffb3b9; }
.ast-fichas-item .badge { flex: 0 0 auto; font-size: 0.66rem; }
/* Cartão digital, links e demandas vencidas */
.ast-cartao { max-width: 300px; }
.ast-cartao-img { display: block; width: 100%; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: #000; aspect-ratio: 1080 / 1350; }
.ast-cartao-acoes { display: flex; gap: 8px; margin-top: 8px; }
.ast-cartao-acoes .btn { flex: 1; font-weight: 700; border-radius: 20px; }
.ast-dem-acoes { display: flex; gap: 6px; margin-top: 6px; }
.ast-dem-acoes .btn { flex: 1; font-weight: 700; border-radius: 18px; font-size: 0.76rem; padding: 4px 8px; }
.ast-dem-todas { text-align: right; }
.ast-dem-todas .btn { border-radius: 18px; font-weight: 700; font-size: 0.78rem; }.ast-cartao-titulo { font-weight: 700; font-size: 0.86rem; margin-bottom: 6px; }
/* Artes de imóvel: tira horizontal */
.ast-arte { max-width: 100%; align-self: stretch; }
.ast-arte-tira { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.ast-arte-tira a { position: relative; flex: 0 0 auto; scroll-snap-align: start; }
.ast-arte-tira img { display: block; height: 260px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.12); background: #000; aspect-ratio: 1080 / 1350; }
.ast-arte-stories img { aspect-ratio: 1080 / 1920; height: 300px; }
.ast-arte-tira span { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.7rem; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.ast-arte-dica { color: #94a3b8; }