/* Assistente do Gabinete -- widget flutuante, sem IA.
   Carregado uma única vez via admin/_footer.php (não copiado em cada página). */

#assistenteBotao {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--tinta, #1c2b4a);
    color: #fff;
    border: none;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}
#assistenteBotao:hover { filter: brightness(1.1); }

#assistentePainel {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: 'Inter', system-ui, sans-serif;
}
#assistentePainel[hidden] { display: none; }

#assistentePainel .assistente-cabecalho {
    background: var(--tinta, #1c2b4a);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
}
#assistentePainel .assistente-cabecalho strong { font-size: 14px; }
#assistentePainel .assistente-cabecalho > div { display: flex; align-items: center; gap: 8px; }
#assistentePainel .assistente-cabecalho button {
    background: none; border: none; color: #fff; cursor: pointer; font-size: 16px; opacity: .85;
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
#assistentePainel .assistente-cabecalho button:hover { opacity: 1; background: rgba(255,255,255,.12); }
#assistenteAjuda { font-size: 13px !important; font-weight: 700; border: 1px solid rgba(255,255,255,.5) !important; }

.assistente-status { font-size: 10.5px; opacity: .8; font-weight: 400; }
.assistente-status.consultando { opacity: 1; font-style: italic; }

#assistenteMensagens {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f6f5f1;
    font-size: 13.5px;
}

.assistente-msg { max-width: 88%; padding: 8px 11px; border-radius: 10px; white-space: pre-wrap; line-height: 1.4; }
.assistente-msg.assistente { background: #fff; border: 1px solid #e4e1d8; align-self: flex-start; }
.assistente-msg.usuario { background: var(--selo, #1f7a5c); color: #fff; align-self: flex-end; }

.assistente-cards { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.assistente-card {
    background: #fff; border: 1px solid #e4e1d8; border-radius: 8px; padding: 10px 14px; min-width: 100px; text-align: center;
}
.assistente-card .assistente-card-titulo { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #777; }
.assistente-card .assistente-card-valor { font-size: 20px; font-weight: 700; color: var(--tinta, #1c2b4a); }
.assistente-card .assistente-card-rodape { font-size: 11px; color: #999; }

.assistente-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.assistente-sugestao {
    background: #fff; border: 1px solid var(--selo, #1f7a5c); color: var(--selo, #1f7a5c);
    border-radius: 16px; padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.assistente-sugestao:hover { background: var(--selo, #1f7a5c); color: #fff; }

.assistente-guiado { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-self: stretch; }
.assistente-guiado button {
    background: #fff; border: 1px solid #e4e1d8; border-radius: 8px; padding: 10px; font-size: 13px; cursor: pointer; text-align: left;
}
.assistente-guiado button:hover { border-color: var(--selo, #1f7a5c); }

/* Grade inicial de atalhos (item 3 do pedido) -- compacta, sem poluir a janela. */
.assistente-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-self: stretch; }
.assistente-grade button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: #fff; border: 1px solid #e4e1d8; border-radius: 8px; padding: 9px 4px;
    font-size: 11px; line-height: 1.2; cursor: pointer; color: var(--tinta, #1c2b4a); text-align: center;
}
.assistente-grade button:hover { border-color: var(--selo, #1f7a5c); background: #f6f5f1; }
.assistente-grade-ico { font-size: 18px; }

/* Links reais para outro módulo -- visualmente distintos das sugestões
   (que reenviam pergunta): navegam, não conversam (item 27). */
.assistente-links { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.assistente-link-botao {
    display: inline-block; background: var(--tinta, #1c2b4a); color: #fff !important; text-decoration: none;
    border-radius: 16px; padding: 5px 12px; font-size: 12px;
}
.assistente-link-botao:hover { filter: brightness(1.15); }

#assistenteRodape { flex: none; border-top: 1px solid #e4e1d8; padding: 10px; position: relative; }
#assistenteAutocomplete {
    position: absolute; bottom: 100%; left: 10px; right: 10px; background: #fff; border: 1px solid #e4e1d8;
    border-radius: 8px; box-shadow: 0 -4px 14px rgba(0,0,0,.08); max-height: 160px; overflow-y: auto;
}
#assistenteAutocomplete[hidden] { display: none; }
#assistenteAutocomplete div { padding: 8px 12px; font-size: 13px; cursor: pointer; }
#assistenteAutocomplete div:hover { background: #f6f5f1; }

#assistenteForm { display: flex; gap: 8px; }
#assistenteInput { flex: 1; border: 1px solid #ddd; border-radius: 20px; padding: 9px 14px; font-size: 13.5px; }
#assistenteForm button { background: var(--selo, #1f7a5c); color: #fff; border: none; border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 16px; flex: none; }

@media (max-width: 480px) {
    #assistentePainel { right: 6px; left: 6px; top: 6px; width: auto; bottom: 76px; height: auto; max-height: none; }
    #assistenteBotao { right: 12px; bottom: 12px; }
}
